Include bed heating to recover consideration

This commit is contained in:
Lars Brubaker 2016-12-29 14:51:32 -08:00
parent a1b474756d
commit 84c0032b05

View file

@ -93,8 +93,24 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
queuedCommands.Add("G90; use absolute coordinates");
queuedCommands.Add("G92 E0; reset the expected extruder position");
queuedCommands.Add("M82; use absolute distance for extrusion");
bool hasHeatedBed = ActiveSliceSettings.Instance.GetValue<bool>(SettingsKey.has_heated_bed);
double bedTemp = ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.bed_temperature);
if (hasHeatedBed && bedTemp > 0)
{
// start heating the bed
queuedCommands.Add($"M140 S{bedTemp}");
}
// heat up the extruder
queuedCommands.Add("M109 S{0}".FormatWith(ActiveSliceSettings.Instance.Helpers.ExtruderTemperature(0)));
if (hasHeatedBed && bedTemp > 0)
{
// finish heating the bed
queuedCommands.Add($"M190 S{bedTemp}");
}
recoveryState = RecoveryState.Raising;
return "";
@ -179,12 +195,14 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
}
// check if the line is something we want to send to the printer (like a temp)
if (line.StartsWith("M109")
|| line.StartsWith("M104")
|| line.StartsWith("T")
|| line.StartsWith("M106")
|| line.StartsWith("M107")
|| line.StartsWith("G92"))
if (line.StartsWith("M109") // heat and wait extruder
|| line.StartsWith("M104") // heat extruder
|| line.StartsWith("M190") // heat and wait bed
|| line.StartsWith("M140") // heat bed
|| line.StartsWith("T") // switch extruder
|| line.StartsWith("M106") // fan on
|| line.StartsWith("M107") // fan off
|| line.StartsWith("G92")) // set position
{
return line;
}