Add fix for Bed Leveling Temp validation, add support for disable

This commit is contained in:
jlewin 2019-03-08 16:59:04 -08:00
parent 13f13cf983
commit c6fcdb4615
2 changed files with 10 additions and 9 deletions

View file

@ -34,6 +34,7 @@ using System.Threading;
using MatterHackers.Agg;
using MatterHackers.Agg.UI;
using MatterHackers.Localizations;
using MatterHackers.MatterControl.ConfigurationPage.PrintLeveling;
using MatterHackers.MatterControl.DesignTools;
using MatterHackers.MatterControl.SlicerConfiguration;
@ -208,16 +209,15 @@ namespace MatterHackers.MatterControl
ErrorLevel = ValidationErrorLevel.Warning,
FixAction = new NamedAction()
{
Title = "Dismiss",
Title = "Recalibrate",
Action = () =>
{
// Get active leveling - ensure we pull the leveling data at the moment of dismiss invoke
PrintLevelingData leveling = printer.Settings.Helpers.GetPrintLevelingData();
leveling.IssuedLevelingTempWarning = true;
// Store leveling data with IssuedLevelingTempWarning set
printer.Settings.Helpers.SetPrintLevelingData(leveling);
}
UiThread.RunOnIdle(() =>
{
DialogWindow.Show(new PrintLevelingWizard(printer));
});
},
IsEnabled =() => printer.Connection.IsConnected
}
});
}

View file

@ -88,7 +88,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
var button = new LinkLabel(action.Title, theme, pointSize: theme.FontSize10)
{
VAnchor = VAnchor.Center,
Margin = new BorderDouble(right: 8)
Margin = new BorderDouble(right: 8),
Enabled = action.IsEnabled == null || action.IsEnabled()
};
if (!string.IsNullOrEmpty(action.ID))