diff --git a/PrinterCommunication/Io/PrintLevelingStream.cs b/PrinterCommunication/Io/PrintLevelingStream.cs index fa3b87e4b..1a8e03f94 100644 --- a/PrinterCommunication/Io/PrintLevelingStream.cs +++ b/PrinterCommunication/Io/PrintLevelingStream.cs @@ -49,11 +49,15 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io } public PrinterMove LastDestination { get { return lastDestination; } } + + public static bool Enabled { get; set; } + public override string ReadLine() { string lineFromChild = base.ReadLine(); if (lineFromChild != null + && PrintLevelingStream.Enabled && PrinterConnectionAndCommunication.Instance.ActivePrinter.GetValue(SettingsKey.print_leveling_enabled)) { if (LineIsMovement(lineFromChild)) diff --git a/PrinterCommunication/Io/PrintRecoveryStream.cs b/PrinterCommunication/Io/PrintRecoveryStream.cs index 8c73e2961..e55f81079 100644 --- a/PrinterCommunication/Io/PrintRecoveryStream.cs +++ b/PrinterCommunication/Io/PrintRecoveryStream.cs @@ -100,6 +100,8 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io // remove it from the part case RecoveryState.Raising: + // We don't know where the printer is for sure (it make have been turned off). Disable leveling until we know where it is. + PrintLevelingStream.Enabled = false; queuedCommands.Add("M114 ; get current position"); queuedCommands.Add("G91 ; move relative"); queuedCommands.Add("G1 Z10 F{0}".FormatWith(MovementControls.ZSpeed)); @@ -125,6 +127,8 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io // home z queuedCommands.Add("G28 Z0"); } + // We now know where the printer is re-enable print leveling + PrintLevelingStream.Enabled = true; recoveryState = RecoveryState.FindingRecoveryLayer; return "";