Fix of previous commit, tooltip update

This commit is contained in:
Lukas Matena 2019-09-09 16:02:39 +02:00
parent 499fdeddd1
commit 822bc7a91c
2 changed files with 12 additions and 13 deletions

View file

@ -65,17 +65,16 @@ static bool custom_gcode_changes_tool(const std::string& custom_gcode, const std
// only whitespace is allowed before the command // only whitespace is allowed before the command
while (--pos < custom_gcode.size() && custom_gcode[pos] != '\n') { while (--pos < custom_gcode.size() && custom_gcode[pos] != '\n') {
if (! std::isspace(custom_gcode[pos])) if (! std::isspace(custom_gcode[pos]))
continue; goto NEXT;
} }
{
// we should also check that the extruder changes to what was expected // we should also check that the extruder changes to what was expected
std::istringstream ss(custom_gcode.substr(from_pos, std::string::npos)); std::istringstream ss(custom_gcode.substr(from_pos, std::string::npos));
unsigned num = 0; unsigned num = 0;
if (ss >> num) { if (ss >> num)
if (num == next_extruder) ok = (num == next_extruder);
ok = true;
else
ok = false;
} }
NEXT: ;
} }
return ok; return ok;
} }

View file

@ -2054,10 +2054,10 @@ void PrintConfigDef::init_fff_params()
def = this->add("toolchange_gcode", coString); def = this->add("toolchange_gcode", coString);
def->label = L("Tool change G-code"); def->label = L("Tool change G-code");
def->tooltip = L("This custom code is inserted before every toolchange. You can use placeholder variables for all Slic3r settings " def->tooltip = L("This custom code is inserted before every toolchange. You can use placeholder variables for all PrusaSlicer settings "
"as well as {previous_extruder} and {next_extruder}. If you explicitely include tool-changing command (such as T{next_extruder}), " "as well as {previous_extruder} and {next_extruder}. Explicitely including a tool-changing command (such as T{next_extruder}), "
"which changes to the correct extruder, no other such command will be emitted. This allows you to do custom stuff " "which changes to the correct extruder, no other such command will be emitted. It is therefore possible to script custom "
"both before and after the toolchange."); "behaviour both before and after the toolchange.");
def->multiline = true; def->multiline = true;
def->full_width = true; def->full_width = true;
def->height = 5; def->height = 5;