Skip to content
Snippets Groups Projects
Commit 1b6a2a10 authored by Thomas Oster's avatar Thomas Oster
Browse files

Merge pull request #28 from quillford/smoothieboard

added travel feedrate setting
parents 31c2beac 1f9cde71
No related branches found
No related tags found
No related merge requests found
...@@ -53,6 +53,7 @@ public class GenericGcodeDriver extends LaserCutter { ...@@ -53,6 +53,7 @@ public class GenericGcodeDriver extends LaserCutter {
protected static final String SETTING_HTTP_UPLOAD_URL = "HTTP Upload URL"; protected static final String SETTING_HTTP_UPLOAD_URL = "HTTP Upload URL";
protected static final String SETTING_LINEEND = "Lineend (CR,LF,CRLF)"; protected static final String SETTING_LINEEND = "Lineend (CR,LF,CRLF)";
protected static final String SETTING_MAX_SPEED = "Max speed (in mm/min)"; protected static final String SETTING_MAX_SPEED = "Max speed (in mm/min)";
protected static final String SETTING_TRAVEL_SPEED = "Travel (non laser moves) speed (in mm/min)";
protected static final String SETTING_PRE_JOB_GCODE = "Pre-Job GCode (comma separated)"; protected static final String SETTING_PRE_JOB_GCODE = "Pre-Job GCode (comma separated)";
protected static final String SETTING_POST_JOB_GCODE = "Post-Job GCode (comma separated)"; protected static final String SETTING_POST_JOB_GCODE = "Post-Job GCode (comma separated)";
protected static final String SETTING_RESOLUTIONS = "Supported DPI (comma separated)"; protected static final String SETTING_RESOLUTIONS = "Supported DPI (comma separated)";
...@@ -240,6 +241,18 @@ public class GenericGcodeDriver extends LaserCutter { ...@@ -240,6 +241,18 @@ public class GenericGcodeDriver extends LaserCutter {
this.max_speed = max_speed; this.max_speed = max_speed;
} }
protected double travel_speed = 60*60;
public double getTravel_speed()
{
return travel_speed;
}
public void setTravel_speed(double travel_speed)
{
this.travel_speed = travel_speed;
}
@Override @Override
/** /**
* We do not support Frequency atm, so we return power,speed and focus * We do not support Frequency atm, so we return power,speed and focus
...@@ -305,7 +318,8 @@ public class GenericGcodeDriver extends LaserCutter { ...@@ -305,7 +318,8 @@ public class GenericGcodeDriver extends LaserCutter {
} }
protected void move(PrintStream out, int x, int y, double resolution) throws IOException { protected void move(PrintStream out, int x, int y, double resolution) throws IOException {
sendLine("G0 X%f Y%f", Util.px2mm(x, resolution), Util.px2mm(y, resolution)); currentSpeed = getTravel_speed();
sendLine("G0 X%f Y%f F%d", Util.px2mm(x, resolution), Util.px2mm(y, resolution), (int) (travel_speed));
} }
protected void line(PrintStream out, int x, int y, double resolution) throws IOException { protected void line(PrintStream out, int x, int y, double resolution) throws IOException {
...@@ -672,6 +686,7 @@ public class GenericGcodeDriver extends LaserCutter { ...@@ -672,6 +686,7 @@ public class GenericGcodeDriver extends LaserCutter {
SETTING_INIT_DELAY, SETTING_INIT_DELAY,
SETTING_LINEEND, SETTING_LINEEND,
SETTING_MAX_SPEED, SETTING_MAX_SPEED,
SETTING_TRAVEL_SPEED,
SETTING_PRE_JOB_GCODE, SETTING_PRE_JOB_GCODE,
SETTING_POST_JOB_GCODE, SETTING_POST_JOB_GCODE,
SETTING_RESOLUTIONS, SETTING_RESOLUTIONS,
...@@ -708,6 +723,8 @@ public class GenericGcodeDriver extends LaserCutter { ...@@ -708,6 +723,8 @@ public class GenericGcodeDriver extends LaserCutter {
return this.getLineend(); return this.getLineend();
} else if (SETTING_MAX_SPEED.equals(attribute)) { } else if (SETTING_MAX_SPEED.equals(attribute)) {
return this.getMax_speed(); return this.getMax_speed();
} else if (SETTING_TRAVEL_SPEED.equals(attribute)) {
return this.getTravel_speed();
} else if (SETTING_PRE_JOB_GCODE.equals(attribute)) { } else if (SETTING_PRE_JOB_GCODE.equals(attribute)) {
return this.getPreJobGcode(); return this.getPreJobGcode();
} else if (SETTING_POST_JOB_GCODE.equals(attribute)) { } else if (SETTING_POST_JOB_GCODE.equals(attribute)) {
...@@ -747,6 +764,8 @@ public class GenericGcodeDriver extends LaserCutter { ...@@ -747,6 +764,8 @@ public class GenericGcodeDriver extends LaserCutter {
this.setLineend((String) value); this.setLineend((String) value);
} else if (SETTING_MAX_SPEED.equals(attribute)) { } else if (SETTING_MAX_SPEED.equals(attribute)) {
this.setMax_speed((Double) value); this.setMax_speed((Double) value);
} else if (SETTING_TRAVEL_SPEED.equals(attribute)) {
this.setTravel_speed((Double) value);
} else if (SETTING_PRE_JOB_GCODE.equals(attribute)) { } else if (SETTING_PRE_JOB_GCODE.equals(attribute)) {
this.setPreJobGcode((String) value); this.setPreJobGcode((String) value);
} else if (SETTING_POST_JOB_GCODE.equals(attribute)) { } else if (SETTING_POST_JOB_GCODE.equals(attribute)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment