this->accepted_by_module = true;
}
-// strip off X Y Z I J parameters if G0/1/2/3
+// strip off X Y Z I J K parameters if G0/1/2/3
void Gcode::strip_parameters()
{
- if(has_g && g <= 4){
+ if(has_g && g < 4){
// strip the command of the XYZIJK parameters
string newcmd;
char *cn= command;
char *eos;
strtof(pch+1, &eos);
cn= eos; // point to end of last parameter
- pch= strpbrk(cn, "XYZIJ"); // find next parameter
+ pch= strpbrk(cn, "XYZIJK"); // find next parameter
}
// append anything left on the line
newcmd.append(cn);
- // strip whitespace to save even more
- newcmd.erase(std::remove_if(newcmd.begin(), newcmd.end(), ::isspace), newcmd.end());
+
+ // strip whitespace to save even more, this causes problems so don't do it
+ //newcmd.erase(std::remove_if(newcmd.begin(), newcmd.end(), ::isspace), newcmd.end());
// release the old one
free(command);
void Block::append_gcode(Gcode* gcode)
{
Gcode new_gcode = *gcode;
- new_gcode.strip_parameters(); // optimization to save memory we strip off the XYZIJ parameters from the saved command
+ new_gcode.strip_parameters(); // optimization to save memory we strip off the XYZIJK parameters from the saved command
gcodes.push_back(new_gcode);
}