Merge pull request #3565 from lordofhyphens/makerbot-m109

Pair of fixes for temperature standby on MB-derived FW
This commit is contained in:
Alessandro Ranellucci 2016-11-22 18:24:04 +01:00 committed by GitHub
commit 092bec103a
2 changed files with 6 additions and 5 deletions

View File

@ -98,7 +98,7 @@ OozePrevention::pre_toolchange(GCode &gcodegen)
if (gcodegen.config.standby_temperature_delta.value != 0) {
// we assume that heating is always slower than cooling, so no need to block
gcode += gcodegen.writer.set_temperature
(this->_get_temp(gcodegen) + gcodegen.config.standby_temperature_delta.value, false);
(this->_get_temp(gcodegen) + gcodegen.config.standby_temperature_delta.value, false, gcodegen.writer.extruder()->id);
}
return gcode;
@ -110,7 +110,7 @@ OozePrevention::post_toolchange(GCode &gcodegen)
std::string gcode;
if (gcodegen.config.standby_temperature_delta.value != 0) {
gcode += gcodegen.writer.set_temperature(this->_get_temp(gcodegen), true);
gcode += gcodegen.writer.set_temperature(this->_get_temp(gcodegen), true, gcodegen.writer.extruder()->id);
}
return gcode;

View File

@ -78,11 +78,9 @@ GCodeWriter::postamble() const
std::string
GCodeWriter::set_temperature(unsigned int temperature, bool wait, int tool) const
{
if (wait && (FLAVOR_IS(gcfMakerWare) || FLAVOR_IS(gcfSailfish)))
return "";
std::string code, comment;
if (wait && FLAVOR_IS_NOT(gcfTeacup)) {
if (wait && FLAVOR_IS_NOT(gcfTeacup) && FLAVOR_IS_NOT(gcfMakerWare) && FLAVOR_IS_NOT(gcfSailfish)) {
code = "M109";
comment = "set temperature and wait for it to be reached";
} else {
@ -106,6 +104,9 @@ GCodeWriter::set_temperature(unsigned int temperature, bool wait, int tool) cons
if (FLAVOR_IS(gcfTeacup) && wait)
gcode << "M116 ; wait for temperature to be reached\n";
if (wait && tool !=-1 && (FLAVOR_IS(gcfMakerWare) || FLAVOR_IS(gcfSailfish)))
gcode << "M6 T" << tool << " ; wait for temperature to be reached\n";
return gcode.str();
}