Leave heaters on for prints less than 10 minutes

This commit is contained in:
jlewin 2019-03-06 14:55:00 -08:00
parent 7a893817a7
commit e5bd83d6ff
2 changed files with 27 additions and 15 deletions

View file

@ -381,24 +381,27 @@ namespace MatterControl.Printing
public (int toolIndex, double time) NextToolChange(int instructionIndex, int currentToolIndex = -1, int toolToLookFor = -1)
{
int nextToolChange = -1;
// find the first tool change that we are less than
for (int i = 0; i < toolChanges.Count; i++)
if (GCodeCommandQueue.Count > 0)
{
if (instructionIndex < toolChanges[i]
&& GCodeCommandQueue[toolChanges[i]].ToolIndex != currentToolIndex
&& (toolToLookFor == -1 || GCodeCommandQueue[toolChanges[i]].ToolIndex == toolToLookFor))
int nextToolChange = -1;
// find the first tool change that we are less than
for (int i = 0; i < toolChanges.Count; i++)
{
nextToolChange = i;
break;
if (instructionIndex < toolChanges[i]
&& GCodeCommandQueue[toolChanges[i]].ToolIndex != currentToolIndex
&& (toolToLookFor == -1 || GCodeCommandQueue[toolChanges[i]].ToolIndex == toolToLookFor))
{
nextToolChange = i;
break;
}
}
}
if (nextToolChange >= 0)
{
var toolIndex = GCodeCommandQueue[toolChanges[nextToolChange]].ToolIndex;
var time = GCodeCommandQueue[instructionIndex].SecondsToEndFromHere - GCodeCommandQueue[toolChanges[nextToolChange]].SecondsToEndFromHere;
return (toolIndex, time);
if (nextToolChange >= 0)
{
var toolIndex = GCodeCommandQueue[toolChanges[nextToolChange]].ToolIndex;
var time = GCodeCommandQueue[instructionIndex].SecondsToEndFromHere - GCodeCommandQueue[toolChanges[nextToolChange]].SecondsToEndFromHere;
return (toolIndex, time);
}
}
// there are no more tool changes

View file

@ -2440,7 +2440,16 @@ 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();
TurnOffBedAndExtruders(TurnOff.Now);
if (SecondsPrinted < 60 * 10)
{
// The user may still be sitting at the machine, leave it heated for a period of time
TurnOffBedAndExtruders(TurnOff.AfterDelay);
}
else
{
// Turn off the heaters on long prints as the user is less likely to be around and interacting
TurnOffBedAndExtruders(TurnOff.Now);
}
}
}
}