Added waiting to pause so the pause resume button work better

This commit is contained in:
Lars Brubaker 2021-08-13 16:49:23 -07:00
parent ab96018191
commit 86ee3b4b9c
4 changed files with 11 additions and 1 deletions

View file

@ -2012,7 +2012,7 @@ namespace MatterHackers.MatterControl
}),
IsPaused = () =>
{
return printer.Connection.Paused;
return printer.Connection.Paused || printer.Connection.WaitingToPause;
},
PauseToolTip = "Pause Print".Localize(),
PauseText = "Pause".Localize(),

View file

@ -127,6 +127,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
pauseButton.Visible = true;
resumeButton.Visible = false;
}
if (this.HasBeenClosed)
{
UiThread.ClearInterval(runningInterval);

View file

@ -159,6 +159,8 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
public PrinterMove LastDestination { get { return lastDestination; } }
public bool WaitingToPause { get; private set; }
public void Add(string line)
{
// lock queue
@ -191,6 +193,9 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
// Add the pause_gcode to the loadedGCode.GCodeCommandQueue
string pauseGCode = printer.Settings.GetValue(SettingsKey.pause_gcode);
// set the state that we are waiting to pause
WaitingToPause = true;
// put in the gcode for pausing (if any)
InjectPauseGCode(pauseGCode);
@ -283,6 +288,9 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
printer.Connection.CommunicationState = CommunicationStates.Paused;
}
// remember that we are no longer waiting
WaitingToPause = false;
lineToSend = "";
}
else if (readOutOfFilament)

View file

@ -2857,6 +2857,7 @@ Make sure that your printer is turned on. Some printers will appear to be connec
public ExtrusionMultiplierStream ExtrusionMultiplierStream { get; private set; }
public FeedRateMultiplierStream FeedRateMultiplierStream { get; private set; }
public bool WaitingToPause => pauseHandlingStream?.WaitingToPause == true;
public void TurnOffPartCoolingFan()
{