Made a Loading... overlay when changing printers

Took out the filament selection in leveling
Made our load and unload scripts work correctly with repetier firmware

issue: MatterHackers/MCCentral#4315
Need Loading overlay when adding or switching to a printer
This commit is contained in:
Lars Brubaker 2018-10-30 13:40:13 -07:00
parent b76162cd04
commit e49397b0b5
4 changed files with 29 additions and 17 deletions

View file

@ -71,7 +71,6 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
"The next few screens will walk your through calibrating your printer.".Localize()));
}
// To make sure the bed is at the correct temp, put in a filament selection page.
bool hasHeatedBed = printer.Settings.GetValue<bool>(SettingsKey.has_heated_bed);
bool useZProbe = printer.Settings.Helpers.UseZProbe();
int zProbeSamples = printer.Settings.GetValue<int>(SettingsKey.z_probe_samples);
@ -86,15 +85,6 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
"Print Leveling Overview".Localize(),
levelingStrings.WelcomeText(levelingPlan.ProbeCount, (int)Math.Round(secondsToCompleteWizard / 60.0)));
// If we need to heat the bed or the extruder, select the current material
if (hasHeatedBed || !useZProbe)
{
yield return new SelectMaterialPage(
this,
"Select Material".Localize(),
"Please select the material you will be printing with, so we can accurately calibrate the printer.".Localize());
}
yield return new HomePrinterPage(
this,
"Homing The Printer".Localize(),

View file

@ -45,6 +45,7 @@ using System;
using System.Diagnostics;
using System.IO;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
namespace MatterHackers.MatterControl.Library.Widgets.HardwarePage
@ -258,13 +259,34 @@ namespace MatterHackers.MatterControl.Library.Widgets.HardwarePage
}
else
{
ProfileManager.Instance.LastProfileID = printerID;
ProfileManager.Instance.LoadPrinter().ContinueWith(task =>
var theme = ApplicationController.Instance.Theme;
var reloadingOverlay = new GuiWidget
{
var printer = task.Result;
HAnchor = HAnchor.Stretch,
VAnchor = VAnchor.Stretch,
BackgroundColor = theme.DarkShade
};
// TODO: Alternatively we could hold and restore the Scene from the prior printer
printer.Bed.LoadPlateFromHistory().ConfigureAwait(false);
reloadingOverlay.AddChild(new TextWidget("Reloading".Localize() + "...", textColor: Color.White, pointSize: theme.DefaultFontSize * 1.5)
{
HAnchor = HAnchor.Center,
VAnchor = VAnchor.Center
});
AppContext.RootSystemWindow.AddChild(reloadingOverlay);
ProfileManager.Instance.LastProfileID = printerID;
Task.Run(() =>
{
ProfileManager.Instance.LoadPrinter().ContinueWith(task =>
{
var printer = task.Result;
// TODO: Alternatively we could hold and restore the Scene from the prior printer
printer.Bed.LoadPlateFromHistory().ConfigureAwait(false);
AppContext.RootSystemWindow.RemoveChild(reloadingOverlay);
});
});
}
}