+ safe height gcode parameter
This commit is contained in:
parent
2cd0ee4b33
commit
a45e84a2ff
@ -161,6 +161,11 @@ void TextWindow::ScreenChangeGCodeParameter(int link, uint32_t v) {
|
|||||||
buf += SS.MmToString(SS.gCode.depth, true);
|
buf += SS.MmToString(SS.gCode.depth, true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'h':
|
||||||
|
SS.TW.edit.meaning = Edit::G_CODE_SAFE_HEIGHT;
|
||||||
|
buf += SS.MmToString(SS.gCode.safeHeight, true);
|
||||||
|
break;
|
||||||
|
|
||||||
case 's':
|
case 's':
|
||||||
SS.TW.edit.meaning = Edit::G_CODE_PASSES;
|
SS.TW.edit.meaning = Edit::G_CODE_PASSES;
|
||||||
buf += std::to_string(SS.gCode.passes);
|
buf += std::to_string(SS.gCode.passes);
|
||||||
@ -492,6 +497,11 @@ bool TextWindow::EditControlDoneForConfiguration(const std::string &s) {
|
|||||||
if(e) SS.gCode.depth = (float)SS.ExprToMm(e);
|
if(e) SS.gCode.depth = (float)SS.ExprToMm(e);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case Edit::G_CODE_SAFE_HEIGHT: {
|
||||||
|
Expr *e = Expr::From(s, /*popUpError=*/true);
|
||||||
|
if(e) SS.gCode.safeHeight = (float)SS.ExprToMm(e);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case Edit::G_CODE_PASSES: {
|
case Edit::G_CODE_PASSES: {
|
||||||
Expr *e = Expr::From(s, /*popUpError=*/true);
|
Expr *e = Expr::From(s, /*popUpError=*/true);
|
||||||
if(e) SS.gCode.passes = (int)(e->Eval());
|
if(e) SS.gCode.passes = (int)(e->Eval());
|
||||||
|
@ -1308,9 +1308,9 @@ void GCodeFileWriter::FinishAndCloseFile() {
|
|||||||
SS.MmToString(pt->p.x).c_str(), SS.MmToString(pt->p.y).c_str(),
|
SS.MmToString(pt->p.x).c_str(), SS.MmToString(pt->p.y).c_str(),
|
||||||
SS.MmToString(SS.gCode.feed).c_str());
|
SS.MmToString(SS.gCode.feed).c_str());
|
||||||
}
|
}
|
||||||
// Move up to a clearance plane 5mm above the work.
|
// Move up to a clearance plane above the work.
|
||||||
fprintf(f, "G00 Z%s\r\n",
|
fprintf(f, "G00 Z%s\r\n",
|
||||||
SS.MmToString(SS.gCode.depth < 0 ? +5 : -5).c_str());
|
SS.MmToString(SS.gCode.safeHeight).c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,6 +105,7 @@ void SolveSpaceUI::Init() {
|
|||||||
exportCanvas.dy = settings->ThawFloat("ExportCanvas_Dy", 5.0);
|
exportCanvas.dy = settings->ThawFloat("ExportCanvas_Dy", 5.0);
|
||||||
// Extra parameters when exporting G code
|
// Extra parameters when exporting G code
|
||||||
gCode.depth = settings->ThawFloat("GCode_Depth", 10.0);
|
gCode.depth = settings->ThawFloat("GCode_Depth", 10.0);
|
||||||
|
gCode.safeHeight = settings->ThawFloat("GCode_SafeHeight", 5.0);
|
||||||
gCode.passes = settings->ThawInt("GCode_Passes", 1);
|
gCode.passes = settings->ThawInt("GCode_Passes", 1);
|
||||||
gCode.feed = settings->ThawFloat("GCode_Feed", 10.0);
|
gCode.feed = settings->ThawFloat("GCode_Feed", 10.0);
|
||||||
gCode.plungeFeed = settings->ThawFloat("GCode_PlungeFeed", 10.0);
|
gCode.plungeFeed = settings->ThawFloat("GCode_PlungeFeed", 10.0);
|
||||||
|
@ -598,6 +598,7 @@ public:
|
|||||||
} exportCanvas;
|
} exportCanvas;
|
||||||
struct {
|
struct {
|
||||||
double depth;
|
double depth;
|
||||||
|
double safeHeight;
|
||||||
int passes;
|
int passes;
|
||||||
double feed;
|
double feed;
|
||||||
double plungeFeed;
|
double plungeFeed;
|
||||||
|
15
src/ui.h
15
src/ui.h
@ -314,13 +314,14 @@ public:
|
|||||||
EXPORT_OFFSET = 110,
|
EXPORT_OFFSET = 110,
|
||||||
CANVAS_SIZE = 111,
|
CANVAS_SIZE = 111,
|
||||||
G_CODE_DEPTH = 112,
|
G_CODE_DEPTH = 112,
|
||||||
G_CODE_PASSES = 113,
|
G_CODE_SAFE_HEIGHT = 113,
|
||||||
G_CODE_FEED = 114,
|
G_CODE_PASSES = 114,
|
||||||
G_CODE_PLUNGE_FEED = 115,
|
G_CODE_FEED = 115,
|
||||||
AUTOSAVE_INTERVAL = 116,
|
G_CODE_PLUNGE_FEED = 116,
|
||||||
LIGHT_AMBIENT = 117,
|
AUTOSAVE_INTERVAL = 117,
|
||||||
FIND_CONSTRAINT_TIMEOUT = 118,
|
LIGHT_AMBIENT = 118,
|
||||||
EXPLODE_DISTANCE = 119,
|
FIND_CONSTRAINT_TIMEOUT = 119,
|
||||||
|
EXPLODE_DISTANCE = 120,
|
||||||
// For TTF text
|
// For TTF text
|
||||||
TTF_TEXT = 300,
|
TTF_TEXT = 300,
|
||||||
// For the step dimension screen
|
// For the step dimension screen
|
||||||
|
Loading…
Reference in New Issue
Block a user