Merge pull request #1743 from larsbrubaker/1.6

Make sure we turn off print leveling as we are recovering.
This commit is contained in:
Lars Brubaker 2016-12-20 17:43:04 -08:00 committed by GitHub
commit aa0127cc71
2 changed files with 8 additions and 0 deletions

View file

@ -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<bool>(SettingsKey.print_leveling_enabled))
{
if (LineIsMovement(lineFromChild))

View file

@ -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 "";