diff --git a/MatterControl.Printing/GCode/GCodeMemoryFile.cs b/MatterControl.Printing/GCode/GCodeMemoryFile.cs index 440410056..40b40c24c 100644 --- a/MatterControl.Printing/GCode/GCodeMemoryFile.cs +++ b/MatterControl.Printing/GCode/GCodeMemoryFile.cs @@ -51,6 +51,11 @@ namespace MatterControl.Printing private double parsingLastZ; private readonly List toolChanges = new List(); + /// + /// Gets total print time that will leave the heaters on at the conclusion of the print. + /// + public static int PrintTimeToLeaveHeatersOn => 60 * 10; + public GCodeMemoryFile(bool gcodeHasExplicitLayerChangeInfo = false) { this.gcodeHasExplicitLayerChangeInfo = gcodeHasExplicitLayerChangeInfo; @@ -441,9 +446,9 @@ namespace MatterControl.Printing { // don't turn of extruders if we will end the print within 10 minutes if (instructionIndex < gCodeCommandQueue.Count - && gCodeCommandQueue[instructionIndex].SecondsToEndFromHere < 60 * 10) + && gCodeCommandQueue[0].SecondsToEndFromHere < PrintTimeToLeaveHeatersOn) { - return (toolToLookFor, 60 * 10); + return (toolToLookFor, gCodeCommandQueue[instructionIndex].SecondsToEndFromHere); } } } diff --git a/MatterControlLib/PrinterCommunication/Io/ToolChangeStream.cs b/MatterControlLib/PrinterCommunication/Io/ToolChangeStream.cs index 54ca84f3d..9d631447e 100644 --- a/MatterControlLib/PrinterCommunication/Io/ToolChangeStream.cs +++ b/MatterControlLib/PrinterCommunication/Io/ToolChangeStream.cs @@ -280,7 +280,6 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io { // get the time to the next tool switch var timeToNextToolChange = NextToolChange().time; - var timeToReheat = printer.Settings.GetValue(SettingsKey.seconds_to_reheat); // if we do not switch again if (timeToNextToolChange == double.PositiveInfinity) diff --git a/MatterControlLib/PrinterCommunication/PrinterConnection.cs b/MatterControlLib/PrinterCommunication/PrinterConnection.cs index 51cfcdb5f..cc30a2524 100644 --- a/MatterControlLib/PrinterCommunication/PrinterConnection.cs +++ b/MatterControlLib/PrinterCommunication/PrinterConnection.cs @@ -2608,7 +2608,7 @@ You will then need to logout and log back in to the computer for the changes to // never leave the extruder and the bed hot ReleaseMotors(); - if (SecondsPrinted < 60 * 10) + if (SecondsPrinted < GCodeMemoryFile.PrintTimeToLeaveHeatersOn) { // The user may still be sitting at the machine, leave it heated for a period of time TurnOffBedAndExtruders(TurnOff.AfterDelay); @@ -2697,6 +2697,7 @@ You will then need to logout and log back in to the computer for the changes to public PrintTask ActivePrintTask { get; set; } + public void TurnOffBedAndExtruders(TurnOff turnOffTime) { if (turnOffTime == TurnOff.Now) diff --git a/Submodules/MatterSlice b/Submodules/MatterSlice index ffa0e8917..724c87220 160000 --- a/Submodules/MatterSlice +++ b/Submodules/MatterSlice @@ -1 +1 @@ -Subproject commit ffa0e8917960d7be3752de85e83fed78805abefa +Subproject commit 724c87220b2777bfbac7f8156c116404431d9dc6