From ec51decbeee4bd5487e91b6d58ff223fcc12ff23 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Tue, 19 Apr 2016 15:14:22 -0700 Subject: [PATCH] Better end of lie trimming. Make the extrusion setting correct on resume. --- PrinterCommunication/Io/ResumePrintingStream.cs | 5 +++-- PrinterCommunication/PrinterConnectionAndCommunication.cs | 2 +- StaticData/Translations/Master.txt | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/PrinterCommunication/Io/ResumePrintingStream.cs b/PrinterCommunication/Io/ResumePrintingStream.cs index 9b18c1725..e88dbd2ae 100644 --- a/PrinterCommunication/Io/ResumePrintingStream.cs +++ b/PrinterCommunication/Io/ResumePrintingStream.cs @@ -119,7 +119,7 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io } resumeState = ResumeState.PrimingAndMovingToStart; - goto case ResumeState.PrimingAndMovingToStart; + return "G92 E{0}".FormatWith(lastDestination.extrusion); case ResumeState.PrimingAndMovingToStart: resumeState = ResumeState.PrintingSlow; @@ -134,7 +134,7 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io { PrinterMove currentMove = GetPosition(lineToSend, lastDestination); PrinterMove moveToSend = currentMove; - double feedRate = ActiveSliceSettings.Instance.GetActiveValueAsDouble("first_layer_speed", 10); + double feedRate = ActiveSliceSettings.Instance.GetActiveValueAsDouble("first_layer_speed", 10) * 60; moveToSend.feedRate = feedRate; lineToSend = CreateMovementLine(moveToSend, lastDestination); @@ -144,6 +144,7 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io return lineToSend; } + resumeState = ResumeState.PrintingToEnd; goto case ResumeState.PrintingToEnd; diff --git a/PrinterCommunication/PrinterConnectionAndCommunication.cs b/PrinterCommunication/PrinterConnectionAndCommunication.cs index d22729735..ead99b44e 100644 --- a/PrinterCommunication/PrinterConnectionAndCommunication.cs +++ b/PrinterCommunication/PrinterConnectionAndCommunication.cs @@ -2861,7 +2861,7 @@ namespace MatterHackers.MatterControl.PrinterCommunication StringEventArgs currentEvent = new StringEventArgs(lineToWrite); if (PrinterIsPrinting) { - string lineWidthoutCR = lineToWrite.Substring(0, lineToWrite.Length - 2); + string lineWidthoutCR = lineToWrite.TrimEnd(); CommunicationUnconditionalToPrinter.CallEvents(this, new StringEventArgs("{0} [{1:0.000}]\n".FormatWith(lineWidthoutCR, timeSinceStartedPrint.Elapsed.TotalSeconds))); } else diff --git a/StaticData/Translations/Master.txt b/StaticData/Translations/Master.txt index 3508fe3f5..bb795b5a0 100644 --- a/StaticData/Translations/Master.txt +++ b/StaticData/Translations/Master.txt @@ -4678,3 +4678,6 @@ Translated:Resume Last Print English:It appears your last print failed to complete.\n\nWould your like to attempt to resume from the last know position? Translated:It appears your last print failed to complete.\n\nWould your like to attempt to resume from the last know position? +English:Unable to Connect +Translated:Unable to Connect +