Make it more consistent

This commit is contained in:
Lars Brubaker 2020-10-28 09:17:32 -07:00
parent dff86bb5a6
commit c439ea2908
3 changed files with 4 additions and 22 deletions

View file

@ -49,10 +49,10 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
private Vector3 positionToSample;
private Vector3 positionToSampleWithProbeOffset;
private List<PrintLevelingWizard.ProbePosition> sampledPositions;
private bool validationHasBeenRun;
private bool validationRunning;
private bool waitingToCompleteNextSample;
private string moveAfterLevel;
public ValidatePrintLevelingStream(PrinterConfig printer, GCodeStream internalStream)
: base(printer, internalStream)
@ -82,11 +82,6 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
validationRunning = false;
validationHasBeenRun = true;
if (!string.IsNullOrEmpty(moveAfterLevel))
{
queuedCommands.Enqueue(moveAfterLevel);
}
printer.Connection.LineReceived -= GetZProbeHeight;
if (validationRunning || validationHasBeenRun)
@ -142,6 +137,7 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
if (lineToSend != null
&& !gcodeAlreadyLeveled
&& printer.Connection.IsConnected
&& printer.Connection.Printing
&& printer.Connection.CurrentlyPrintingLayer <= 0
&& !validationHasBeenRun
&& printer.Settings.GetValue<bool>(SettingsKey.validate_leveling))
@ -153,20 +149,6 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
// still set the bed temp and wait
return lineToSend;
}
if (LineIsMovement(lineToSend))
{
var destination = GetPosition(lineToSend, PrinterMove.Unknown);
// double startProbeHeight = printer.Settings.GetValue<double>(SettingsKey.print_leveling_probe_start);
if (destination.position.Z < printer.Settings.GetValue<double>(SettingsKey.print_leveling_probe_start))
{
SetupForValidation();
// remember the move
moveAfterLevel = lineToSend;
// and send nothing until leveling done
return "";
}
}
}
return lineToSend;