Fixed problem with leveling validation canceling
Fixed 'connections succeeded' color
This commit is contained in:
parent
25303bbc74
commit
4ee02584c4
2 changed files with 21 additions and 12 deletions
|
|
@ -59,12 +59,11 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
|
|||
private bool waitingToCompleteNextSample;
|
||||
private bool haveSeenM190;
|
||||
private bool haveSeenG28;
|
||||
private bool validationCanceled;
|
||||
|
||||
public ValidatePrintLevelingStream(PrinterConfig printer, GCodeStream internalStream)
|
||||
public ValidatePrintLevelingStream(PrinterConfig printer, GCodeStream internalStream)
|
||||
: base(printer, internalStream)
|
||||
{
|
||||
printer.Connection.CanceleRequested += Connection_PrintCanceled;
|
||||
|
||||
if (!printer.Settings.GetValue<bool>(SettingsKey.has_heated_bed)
|
||||
|| printer.Settings.Helpers.ActiveBedTemperature == 0)
|
||||
{
|
||||
|
|
@ -74,23 +73,19 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
|
|||
}
|
||||
}
|
||||
|
||||
private void Connection_PrintCanceled(object sender, EventArgs e)
|
||||
{
|
||||
CancelValidation();
|
||||
}
|
||||
|
||||
public override string DebugInfo => "";
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
CancelValidation();
|
||||
printer.Connection.CanceleRequested -= Connection_PrintCanceled;
|
||||
|
||||
base.Dispose();
|
||||
}
|
||||
|
||||
private void CancelValidation()
|
||||
{
|
||||
validationCanceled = true;
|
||||
|
||||
if (validationRunning)
|
||||
{
|
||||
validationRunning = false;
|
||||
|
|
@ -126,6 +121,11 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
|
|||
}
|
||||
}
|
||||
|
||||
public void Cancel()
|
||||
{
|
||||
CancelValidation();
|
||||
}
|
||||
|
||||
public override string ReadLine()
|
||||
{
|
||||
if (queuedCommands.Count > 0)
|
||||
|
|
@ -133,6 +133,12 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
|
|||
return queuedCommands.Dequeue();
|
||||
}
|
||||
|
||||
if (validationRunning
|
||||
&& printer.Connection.PrintWasCanceled)
|
||||
{
|
||||
CancelValidation();
|
||||
}
|
||||
|
||||
if (validationRunning
|
||||
&& !validationHasBeenRun)
|
||||
{
|
||||
|
|
@ -169,7 +175,8 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
|
|||
&& haveSeenM190
|
||||
&& !validationRunning
|
||||
&& !validationHasBeenRun
|
||||
&& printer.Connection.Printing)
|
||||
&& printer.Connection.Printing
|
||||
&& !validationCanceled)
|
||||
{
|
||||
SetupForValidation();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2466,7 +2466,7 @@ Make sure that your printer is turned on. Some printers will appear to be connec
|
|||
&& doValidateLeveling)
|
||||
{
|
||||
// make sure we don't validate the leveling while recovering a print
|
||||
accumulatedStream = new ValidatePrintLevelingStream(Printer, accumulatedStream);
|
||||
accumulatedStream = validatePrintLevelingStream = new ValidatePrintLevelingStream(Printer, accumulatedStream);
|
||||
}
|
||||
|
||||
accumulatedStream = printLevelingStream = new PrintLevelingStream(Printer, accumulatedStream);
|
||||
|
|
@ -3141,6 +3141,7 @@ Make sure that your printer is turned on. Some printers will appear to be connec
|
|||
maxLengthStream?.Cancel();
|
||||
waitForTempStream?.Cancel();
|
||||
queuedCommandStream?.Cancel();
|
||||
validatePrintLevelingStream?.Cancel();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
|
@ -3154,8 +3155,9 @@ Make sure that your printer is turned on. Some printers will appear to be connec
|
|||
private int noOkResendCount;
|
||||
private ProcessWriteRegexStream processWriteRegexStream;
|
||||
private bool cancelPrintNextWriteLine;
|
||||
private ValidatePrintLevelingStream validatePrintLevelingStream;
|
||||
|
||||
public class ReadThread
|
||||
public class ReadThread
|
||||
{
|
||||
private readonly int creationIndex;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue