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
while (--pos < custom_gcode.size() && custom_gcode[pos] != '\n') {
if (! std::isspace(custom_gcode[pos]))
continue;
goto NEXT;
}
// we should also check that the extruder changes to what was expected
std::istringstream ss(custom_gcode.substr(from_pos, std::string::npos));
unsigned num = 0;
if (ss >> num) {
if (num == next_extruder)
ok = true;
else
ok = false;
{
// we should also check that the extruder changes to what was expected
std::istringstream ss(custom_gcode.substr(from_pos, std::string::npos));
unsigned num = 0;
if (ss >> num)
ok = (num == next_extruder);
}
NEXT: ;
}
return ok;
}

View file

@ -2054,10 +2054,10 @@ void PrintConfigDef::init_fff_params()
def = this->add("toolchange_gcode", coString);
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 "
"as well as {previous_extruder} and {next_extruder}. If you explicitely include 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 "
"both before and after the toolchange.");
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}. Explicitely including a tool-changing command (such as T{next_extruder}), "
"which changes to the correct extruder, no other such command will be emitted. It is therefore possible to script custom "
"behaviour both before and after the toolchange.");
def->multiline = true;
def->full_width = true;
def->height = 5;