Merge pull request #4892 from larsbrubaker/master

make validation have feedback
This commit is contained in:
Lars Brubaker 2020-10-28 20:28:01 -07:00 committed by GitHub
commit 33c3bd8dc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 3 deletions

View file

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

View file

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

@ -1 +1 @@
Subproject commit f5ccdb8dcb3a38d1d9dc33a92977c6936f1f0fbf
Subproject commit 65c4736b10b9b096c60a8dcda5dc916a4cc5f63b