From 7af4ff557165b7d1e10dbc79579c6ebfe4eb237a Mon Sep 17 00:00:00 2001 From: LarsBrubaker Date: Wed, 28 Oct 2020 19:44:02 -0700 Subject: [PATCH 1/2] make validation have feedback issue: MatterHackers/MCCentral#6126 Add leveling feedback to printing dialog (like heating) --- .../Io/ValidatePrintLevelingStream.cs | 41 +++++++++++++++++++ Submodules/agg-sharp | 2 +- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/MatterControlLib/PrinterCommunication/Io/ValidatePrintLevelingStream.cs b/MatterControlLib/PrinterCommunication/Io/ValidatePrintLevelingStream.cs index 0f455f553..ab40cb1fa 100644 --- a/MatterControlLib/PrinterCommunication/Io/ValidatePrintLevelingStream.cs +++ b/MatterControlLib/PrinterCommunication/Io/ValidatePrintLevelingStream.cs @@ -30,7 +30,11 @@ either expressed or implied, of the FreeBSD Project. using System; using System.Collections.Generic; using System.Linq; +using System.Threading; +using System.Threading.Tasks; using MatterControl.Printing; +using MatterHackers.Agg; +using MatterHackers.Localizations; using MatterHackers.MatterControl.ConfigurationPage.PrintLeveling; using MatterHackers.MatterControl.SlicerConfiguration; using MatterHackers.VectorMath; @@ -373,6 +377,41 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io } positionsToSample = levelingPlan.GetPrintLevelPositionToSample().ToList(); + + StartReporting(); + } + + private void StartReporting() + { + ApplicationController.Instance.Tasks.Execute( + "Leveling".Localize(), + printer, + (reporter, cancellationToken) => + { + var progressStatus = new ProgressStatus(); + + while (validationRunning) + { + if (activeProbeIndex == 0) + { + progressStatus.Status = "Validating"; + } + else + { + progressStatus.Status = $"Probing point {activeProbeIndex} of {sampledPositions.Count}"; + } + + progressStatus.Progress0To1 = (activeProbeIndex + 1) / (double)sampledPositions.Count; + reporter.Report(progressStatus); + Thread.Sleep(100); + } + + return Task.CompletedTask; + }, + new RunningTaskOptions() + { + ReadOnlyReporting = true + }); } private void SampleNextPoint() @@ -388,6 +427,8 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io queuedCommands.Enqueue($"M280 P0 S{servoDeployCommand}"); } + Thread.Sleep(500); + positionToSampleWithProbeOffset = positionToSample; // subtract out the probe offset diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index f5ccdb8dc..65c4736b1 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit f5ccdb8dcb3a38d1d9dc33a92977c6936f1f0fbf +Subproject commit 65c4736b10b9b096c60a8dcda5dc916a4cc5f63b From 14f8f45e56267ee350ec17a4c6d4dfe11c8ca6b4 Mon Sep 17 00:00:00 2001 From: LarsBrubaker Date: Wed, 28 Oct 2020 19:54:21 -0700 Subject: [PATCH 2/2] fixing bad close button placement issue: MatterHackers/MCCentral#6129 presets editor has close button under edit icon --- MatterControlLib/CustomWidgets/InlineStringEdit.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MatterControlLib/CustomWidgets/InlineStringEdit.cs b/MatterControlLib/CustomWidgets/InlineStringEdit.cs index 1acabd9cf..9720f0f71 100644 --- a/MatterControlLib/CustomWidgets/InlineStringEdit.cs +++ b/MatterControlLib/CustomWidgets/InlineStringEdit.cs @@ -55,7 +55,7 @@ namespace MatterHackers.MatterControl.CustomWidgets bool boldFont = false, bool editable = true, string emptyText = null) - : base(theme.TabbarPadding, theme.CreateSmallResetButton()) + : base(theme.TabbarPadding) { this.Padding = theme.ToolbarPadding; this.HAnchor = HAnchor.Stretch; @@ -171,7 +171,7 @@ namespace MatterHackers.MatterControl.CustomWidgets public void SetVisibility(bool showEditPanel) { editButton.Visible = !showEditPanel; - titleText.Visible = !showEditPanel; + titleText.Visible = !showEditPanel; saveButton.Visible = showEditPanel; textEditWithInlineCancel.Visible = showEditPanel;