Brought in the changes to set temp before leveling.
This commit is contained in:
parent
a541a8eac0
commit
7c5f5a2775
13 changed files with 153 additions and 26 deletions
|
|
@ -62,7 +62,11 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
|
|||
|
||||
printLevelWizard.AddPage(new FirstPageInstructions(levelingStrings.OverviewText, levelingStrings.WelcomeText(3, 3)));
|
||||
|
||||
// To make sure the bed is at the correct temp, put in a filament selection page.
|
||||
string filamentSelectionPage = "{0}\n\n{1}".FormatWith(levelingStrings.materialPageInstructions1, levelingStrings.materialPageInstructions2);
|
||||
printLevelWizard.AddPage(new SelectMaterialPage(levelingStrings.materialStepText, filamentSelectionPage));
|
||||
printLevelWizard.AddPage(new HomePrinterPage(levelingStrings.homingPageStepText, levelingStrings.homingPageInstructions));
|
||||
printLevelWizard.AddPage(new WaitForTempPage(levelingStrings.waitingForTempPageStepText, levelingStrings.waitingForTempPageInstructions));
|
||||
|
||||
string positionLabel = "Position".Localize();
|
||||
string autoCalibrateLabel = "Auto Calibrate".Localize();
|
||||
|
|
|
|||
|
|
@ -118,7 +118,11 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
|
|||
|
||||
printLevelWizard.AddPage(new FirstPageInstructions(levelingStrings.OverviewText, levelingStrings.WelcomeText(numberOfRadialSamples + 1, 5)));
|
||||
|
||||
// To make sure the bed is at the correct temp, put in a filament selection page.
|
||||
string filamentSelectionPage = "{0}\n\n{1}".FormatWith(levelingStrings.materialPageInstructions1, levelingStrings.materialPageInstructions2);
|
||||
printLevelWizard.AddPage(new SelectMaterialPage(levelingStrings.materialStepText, filamentSelectionPage));
|
||||
printLevelWizard.AddPage(new HomePrinterPage(levelingStrings.homingPageStepText, levelingStrings.homingPageInstructions));
|
||||
printLevelWizard.AddPage(new WaitForTempPage(levelingStrings.waitingForTempPageStepText, levelingStrings.waitingForTempPageInstructions));
|
||||
|
||||
string positionLabel = "Position".Localize();
|
||||
string autoCalibrateLabel = "Auto Calibrate".Localize();
|
||||
|
|
|
|||
|
|
@ -176,7 +176,11 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
|
|||
|
||||
printLevelWizard.AddPage(new FirstPageInstructions(levelingStrings.OverviewText, levelingStrings.WelcomeText(probeCount, 5)));
|
||||
|
||||
// To make sure the bed is at the correct temp, put in a filament selection page.
|
||||
string filamentSelectionPage = "{0}\n\n{1}".FormatWith(levelingStrings.materialPageInstructions1, levelingStrings.materialPageInstructions2);
|
||||
printLevelWizard.AddPage(new SelectMaterialPage(levelingStrings.materialStepText, filamentSelectionPage));
|
||||
printLevelWizard.AddPage(new HomePrinterPage(levelingStrings.homingPageStepText, levelingStrings.homingPageInstructions));
|
||||
printLevelWizard.AddPage(new WaitForTempPage(levelingStrings.waitingForTempPageStepText, levelingStrings.waitingForTempPageInstructions));
|
||||
|
||||
string positionLabel = "Position".Localize();
|
||||
string autoCalibrateLabel = "Auto Calibrate".Localize();
|
||||
|
|
|
|||
|
|
@ -36,9 +36,13 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
|
|||
public class LevelingStrings
|
||||
{
|
||||
public string homingPageStepText = "Homing The Printer".Localize();
|
||||
public string waitingForTempPageStepText = "Waiting For Bed To Heat".Localize();
|
||||
public string initialPrinterSetupStepText = "Initial Printer Setup".Localize();
|
||||
public string materialStepText = "Select Material".Localize();
|
||||
public string requiredPageInstructions1 = "Congratulations on connecting to your new printer. Before starting your first print we need to run a simple calibration procedure.";
|
||||
public string requiredPageInstructions2 = "The next few screens will walk your through the print leveling wizard.";
|
||||
public string materialPageInstructions1 = "The temperature of the bed can have a significant effect on the quality of leveling.";
|
||||
public string materialPageInstructions2 = "Please select the material you will be printing, so we can adjust the temperature before calibrating.";
|
||||
public string stepTextBeg = "Step".Localize();
|
||||
public string stepTextEnd = "of".Localize();
|
||||
private string doneLine1 = "Congratulations!";
|
||||
|
|
@ -46,19 +50,21 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
|
|||
private string doneLine2 = "Remove the paper".Localize();
|
||||
private string doneLine3 = "To re-calibrate the printer, or to turn off Auto Print Leveling, the print leveling controls can be found under 'Options'->'Calibration'.";
|
||||
private string doneLine3b = "Click 'Done' to close this window.".Localize();
|
||||
private string homingLine1 = "The printer should now be 'homing'. Once it is finished homing we will move it to the first point to sample.";
|
||||
private string homingLine1 = "The printer should now be 'homing'. Once it is finished homing we will heat the bed.";
|
||||
private string homingLine1b = "To complete the next few steps you will need".Localize();
|
||||
private string homingLine2 = "A standard sheet of paper".Localize();
|
||||
private string homingLine3 = "We will use this paper to measure the distance between the extruder and the bed.";
|
||||
private string homingLine3b = "Click 'Next' to continue.".Localize();
|
||||
private int stepNumber = 1;
|
||||
private string welcomeLine1 = "Welcome to the print leveling wizard. Here is a quick overview on what we are going to do.".Localize();
|
||||
private string welcomeLine2 = "Home the printer".Localize();
|
||||
private string welcomeLine3 = "Sample the bed at {0} points".Localize();
|
||||
private string welcomeLine4 = "Turn auto leveling on".Localize();
|
||||
private string welcomeLine5 = "We should be done in less than {0} minutes.".Localize();
|
||||
private string welcomeLine6 = "Note: Be sure the tip of the extruder is clean and the bed is clear.".Localize();
|
||||
private string welcomeLine7 = "Click 'Next' to continue.".Localize();
|
||||
private string welcomeLine2 = "Select the material you are printing".Localize();
|
||||
private string welcomeLine3 = "Home the printer".Localize();
|
||||
private string welcomeLine4 = "Heat the bed".Localize();
|
||||
private string welcomeLine5 = "Sample the bed at {0} points".Localize();
|
||||
private string welcomeLine6 = "Turn auto leveling on".Localize();
|
||||
private string welcomeLine7 = "We should be done in less than {0} minutes.".Localize();
|
||||
private string welcomeLine8 = "Note: Be sure the tip of the extruder is clean and the bed is clear.".Localize();
|
||||
private string welcomeLine9 = "Click 'Next' to continue.".Localize();
|
||||
|
||||
public string DoneInstructions
|
||||
{
|
||||
|
|
@ -75,6 +81,14 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
|
|||
}
|
||||
}
|
||||
|
||||
public string waitingForTempPageInstructions
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Waiting for the bed to heat up.\nThis will improve the accuracy of print leveling.\n\nClick 'Next' when the bed reaches temp.";
|
||||
}
|
||||
}
|
||||
|
||||
public string homingPageInstructions
|
||||
{
|
||||
get
|
||||
|
|
@ -104,24 +118,26 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
|
|||
numberOfMinutes = 2;
|
||||
}
|
||||
|
||||
return "{0}\n\n\t• {1}\n\t• {2}\n\t• {3}\n\n{4}\n\n{5}\n\n{6}".FormatWith(
|
||||
return "{0}\n\n\t• {1}\n\t• {2}\n\t• {3}\n\t• {4}\n\t• {5}\n\n{6}\n\n{7}\n\n{8}".FormatWith(
|
||||
this.welcomeLine1,
|
||||
this.welcomeLine2,
|
||||
this.WelcomeLine3(numberOfSteps),
|
||||
this.welcomeLine3,
|
||||
this.welcomeLine4,
|
||||
this.WelcomeLine5(numberOfMinutes),
|
||||
this.WelcomeLine5(numberOfSteps),
|
||||
this.welcomeLine6,
|
||||
this.welcomeLine7);
|
||||
this.WelcomeLine7(numberOfMinutes),
|
||||
this.welcomeLine8,
|
||||
this.welcomeLine9);
|
||||
}
|
||||
|
||||
private string WelcomeLine3(int numberOfPoints)
|
||||
private string WelcomeLine5(int numberOfPoints)
|
||||
{
|
||||
return welcomeLine3.FormatWith(numberOfPoints);
|
||||
return welcomeLine5.FormatWith(numberOfPoints);
|
||||
}
|
||||
|
||||
private string WelcomeLine5(int numberOfMinutes)
|
||||
private string WelcomeLine7(int numberOfMinutes)
|
||||
{
|
||||
return welcomeLine5.FormatWith(numberOfMinutes);
|
||||
return welcomeLine7.FormatWith(numberOfMinutes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -48,6 +48,81 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
|
|||
}
|
||||
}
|
||||
|
||||
public class SelectMaterialPage : InstructionsPage
|
||||
{
|
||||
public SelectMaterialPage(string pageDescription, string instructionsText)
|
||||
: base(pageDescription, instructionsText)
|
||||
{
|
||||
int extruderIndex = 0;
|
||||
var materialSelector = new PresetSelectorWidget(string.Format($"{"Material".Localize()} {extruderIndex + 1}"), RGBA_Bytes.Transparent, NamedSettingsLayers.Material, extruderIndex);
|
||||
materialSelector.BackgroundColor = RGBA_Bytes.Transparent;
|
||||
materialSelector.Margin = new BorderDouble(0, 0, 0, 15);
|
||||
topToBottomControls.AddChild(materialSelector);
|
||||
}
|
||||
}
|
||||
|
||||
public class WaitForTempPage : InstructionsPage
|
||||
{
|
||||
private ProgressBar progressBar;
|
||||
private TextWidget progressBarText;
|
||||
double startingTemp;
|
||||
|
||||
public WaitForTempPage(string pageDescription, string instructionsText)
|
||||
: base(pageDescription, instructionsText)
|
||||
{
|
||||
var holder = new FlowLayoutWidget();
|
||||
progressBar = new ProgressBar((int)(150 * GuiWidget.DeviceScale), (int)(15 * GuiWidget.DeviceScale))
|
||||
{
|
||||
FillColor = ActiveTheme.Instance.PrimaryAccentColor,
|
||||
BorderColor = ActiveTheme.Instance.PrimaryTextColor,
|
||||
BackgroundColor = RGBA_Bytes.White,
|
||||
Margin = new BorderDouble(3, 0, 0, 10),
|
||||
};
|
||||
progressBarText = new TextWidget("", pointSize: 10, textColor: ActiveTheme.Instance.PrimaryTextColor)
|
||||
{
|
||||
AutoExpandBoundsToText = true,
|
||||
Margin = new BorderDouble(5, 0, 0, 0),
|
||||
};
|
||||
holder.AddChild(progressBar);
|
||||
holder.AddChild(progressBarText);
|
||||
topToBottomControls.AddChild(holder);
|
||||
}
|
||||
|
||||
public override void PageIsBecomingActive()
|
||||
{
|
||||
startingTemp = PrinterConnection.Instance.GetActualExtruderTemperature(0);
|
||||
UiThread.RunOnIdle(ShowTempChangeProgress);
|
||||
|
||||
// start heating the bed and show our progress
|
||||
PrinterConnection.Instance.TargetBedTemperature = ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.bed_temperature);
|
||||
|
||||
// hook our parent so we can turn off the extruder when we are done with leveling
|
||||
Parent.Closed += (s, e) =>
|
||||
{
|
||||
// Make sure when the wizard closes we turn off the bed heating
|
||||
PrinterConnection.Instance.TargetBedTemperature = 0;
|
||||
};
|
||||
|
||||
base.PageIsBecomingActive();
|
||||
}
|
||||
|
||||
private void ShowTempChangeProgress()
|
||||
{
|
||||
progressBar.Visible = true;
|
||||
double targetTemp = PrinterConnection.Instance.TargetBedTemperature;
|
||||
double actualTemp = PrinterConnection.Instance.ActualBedTemperature;
|
||||
double totalDelta = targetTemp - startingTemp;
|
||||
double currentDelta = actualTemp - startingTemp;
|
||||
double ratioDone = totalDelta != 0 ? (currentDelta / totalDelta) : 1;
|
||||
progressBar.RatioComplete = Math.Min(Math.Max(0, ratioDone), 1);
|
||||
progressBarText.Text = $"Temperature: {actualTemp:0} / {targetTemp:0}";
|
||||
if (!HasBeenClosed)
|
||||
{
|
||||
UiThread.RunOnIdle(ShowTempChangeProgress, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class LastPagelInstructions : InstructionsPage
|
||||
{
|
||||
protected WizardControl container;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue