diff --git a/ActionBar/PrintActionRow.cs b/ActionBar/PrintActionRow.cs
index 420e27248..d19e99c89 100644
--- a/ActionBar/PrintActionRow.cs
+++ b/ActionBar/PrintActionRow.cs
@@ -238,9 +238,7 @@ namespace MatterHackers.MatterControl.ActionBar
&& ActivePrinterProfile.Instance.GetPrintLevelingMeasuredPosition(1).z == 0
&& ActivePrinterProfile.Instance.GetPrintLevelingMeasuredPosition(2).z == 0)
{
- PrintLevelWizardWindow printLevelWizardWindow = new PrintLevelWizardWindow(true);
- printLevelWizardWindow.ShowAsSystemWindow();
-
+ LevelWizardBase.CreateAndShowWizard(LevelWizardBase.RuningState.InitialStartupCalibration);
return;
}
diff --git a/ApplicationView/WidescreenPanel.cs b/ApplicationView/WidescreenPanel.cs
index bb0b1730f..95b025f84 100644
--- a/ApplicationView/WidescreenPanel.cs
+++ b/ApplicationView/WidescreenPanel.cs
@@ -243,7 +243,7 @@ namespace MatterHackers.MatterControl
ColumnTwo.RemoveAllChildren();
double buildHeight = ActiveSliceSettings.Instance.BuildHeight;
- part3DView = new View3DTransformPart(PrinterCommunication.Instance.ActivePrintItem, new Vector3(ActiveSliceSettings.Instance.BedSize, buildHeight), ActiveSliceSettings.Instance.BedShape, false);
+ part3DView = new View3DTransformPart(PrinterCommunication.Instance.ActivePrintItem, new Vector3(ActiveSliceSettings.Instance.BedSize, buildHeight), ActiveSliceSettings.Instance.BedShape, View3DTransformPart.WindowType.Embeded, View3DTransformPart.AutoRotate.Enabled);
part3DView.Margin = new BorderDouble(bottom: 4);
part3DView.AnchorAll();
diff --git a/ConfigurationPage/ConfigurationPage.cs b/ConfigurationPage/ConfigurationPage.cs
index 21eeeeb5e..64001eeef 100644
--- a/ConfigurationPage/ConfigurationPage.cs
+++ b/ConfigurationPage/ConfigurationPage.cs
@@ -395,7 +395,7 @@ namespace MatterHackers.MatterControl
return topLine;
}
- PrintLevelWizardWindow printLevelWizardWindow;
+ SystemWindow printLevelWizardWindow;
public override void OnClosed(EventArgs e)
{
@@ -451,7 +451,10 @@ namespace MatterHackers.MatterControl
Button runPrintLevelingButton = textImageButtonFactory.Generate("Configure".Localize().ToUpper());
runPrintLevelingButton.Margin = new BorderDouble(left:6);
runPrintLevelingButton.VAnchor = VAnchor.ParentCenter;
- runPrintLevelingButton.Click += new ButtonBase.ButtonEventHandler(runPrintLeveling_Click);
+ runPrintLevelingButton.Click += (sender, e) =>
+ {
+ OpenPrintLevelWizard();
+ };
Agg.Image.ImageBuffer levelingImage = new Agg.Image.ImageBuffer();
ImageIO.LoadImageData(Path.Combine(ApplicationDataStorage.Instance.ApplicationStaticDataPath,"Icons", "PrintStatusControls", "leveling-24x24.png"), levelingImage);
@@ -514,11 +517,12 @@ namespace MatterHackers.MatterControl
{
if (printLevelWizardWindow == null)
{
- printLevelWizardWindow = new PrintLevelWizardWindow(false);
+ LevelWizardBase.CreateAndShowWizard(LevelWizardBase.RuningState.UserRequestedCalibration);
printLevelWizardWindow.Closed += (sender, e) =>
{
printLevelWizardWindow = null;
};
+
printLevelWizardWindow.ShowAsSystemWindow();
}
else
@@ -653,10 +657,5 @@ namespace MatterHackers.MatterControl
{
base.OnClosing(out CancelClose);
}
-
- void runPrintLeveling_Click(object sender, MouseEventArgs mouseEvent)
- {
- OpenPrintLevelWizard();
- }
}
}
diff --git a/ConfigurationPage/PrintLeveling/InstructionsPage.cs b/ConfigurationPage/PrintLeveling/InstructionsPage.cs
new file mode 100644
index 000000000..abd8064d9
--- /dev/null
+++ b/ConfigurationPage/PrintLeveling/InstructionsPage.cs
@@ -0,0 +1,89 @@
+/*
+Copyright (c) 2014, Lars Brubaker
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The views and conclusions contained in the software and documentation are those
+of the authors and should not be interpreted as representing official policies,
+either expressed or implied, of the FreeBSD Project.
+*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Diagnostics;
+
+using MatterHackers.Agg;
+using MatterHackers.Agg.UI;
+using MatterHackers.VectorMath;
+using MatterHackers.Agg.Font;
+using MatterHackers.Localizations;
+using MatterHackers.MatterControl.SlicerConfiguration;
+
+namespace MatterHackers.MatterControl
+{
+ public class InstructionsPage : WizardPage
+ {
+ protected FlowLayoutWidget topToBottomControls;
+
+ public InstructionsPage(string pageDescription, string instructionsText)
+ : base(pageDescription)
+ {
+ topToBottomControls = new FlowLayoutWidget(FlowDirection.TopToBottom);
+ topToBottomControls.Padding = new BorderDouble(3);
+ topToBottomControls.HAnchor |= Agg.UI.HAnchor.ParentLeft;
+ topToBottomControls.VAnchor |= Agg.UI.VAnchor.ParentTop;
+
+ AddTextField(instructionsText, 10);
+
+ AddChild(topToBottomControls);
+
+ AnchorAll();
+ }
+
+ protected double ZMovementSpeed()
+ {
+ double zSpeed = 315;
+ string savedSettings = ActivePrinterProfile.Instance.ActivePrinter.ManualMovementSpeeds;
+ if (savedSettings != null && savedSettings != "")
+ {
+ zSpeed = double.Parse(savedSettings.Split(',')[5]);
+ }
+
+ return zSpeed;
+ }
+
+ public void AddTextField(string instructionsText, int pixelsFromLast)
+ {
+ GuiWidget spacer = new GuiWidget(10, pixelsFromLast);
+ topToBottomControls.AddChild(spacer);
+
+ EnglishTextWrapping wrapper = new EnglishTextWrapping(12);
+ string wrappedInstructions = wrapper.InsertCRs(instructionsText, 400);
+ string wrappedInstructionsTabsToSpaces = wrappedInstructions.Replace("\t", " ");
+ TextWidget instructionsWidget = new TextWidget(wrappedInstructionsTabsToSpaces, textColor: ActiveTheme.Instance.PrimaryTextColor);
+ instructionsWidget.HAnchor = Agg.UI.HAnchor.ParentLeft;
+ topToBottomControls.AddChild(instructionsWidget);
+ }
+ }
+}
diff --git a/ConfigurationPage/PrintLeveling/LevelWizard2Point.cs b/ConfigurationPage/PrintLeveling/LevelWizard2Point.cs
new file mode 100644
index 000000000..2a81b4c1b
--- /dev/null
+++ b/ConfigurationPage/PrintLeveling/LevelWizard2Point.cs
@@ -0,0 +1,107 @@
+/*
+Copyright (c) 2014, Lars Brubaker
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The views and conclusions contained in the software and documentation are those
+of the authors and should not be interpreted as representing official policies,
+either expressed or implied, of the FreeBSD Project.
+*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Diagnostics;
+
+using MatterHackers.Agg;
+using MatterHackers.Agg.UI;
+using MatterHackers.VectorMath;
+using MatterHackers.Agg.Font;
+using MatterHackers.Localizations;
+using MatterHackers.MatterControl.SlicerConfiguration;
+
+namespace MatterHackers.MatterControl
+{
+ public class LevelWizard2Point : LevelWizardBase
+ {
+ Vector2 position0 = new Vector2(0, 0);
+ Vector2 position1 = new Vector2(220, 0);
+
+ string pageOneStepText = "Print Leveling Overview".Localize();
+ string pageOneInstructionsTextOne = LocalizedString.Get("Welcome to the print leveling wizard. Here is a quick overview on what we are going to do.");
+ string pageOneInstructionsTextTwo = LocalizedString.Get("'Home' the printer");
+ string pageOneInstructionsTextThree = LocalizedString.Get("Sample the bed at two points");
+ string pageOneInstructionsTextFour = LocalizedString.Get("Turn auto leveling on");
+ string pageOneInstructionsText5 = LocalizedString.Get("You should be done in about 2 minutes.");
+ string pageOneInstructionsText6 = LocalizedString.Get("Note: Be sure the tip of the extrude is clean.");
+ string pageOneInstructionsText7 = LocalizedString.Get("Click 'Next' to continue.");
+
+ public LevelWizard2Point(RuningState runningState)
+ : base(500, 370, 6)
+ {
+ string printLevelWizardTitle = LocalizedString.Get("MatterControl");
+ string printLevelWizardTitleFull = LocalizedString.Get("Print Leveling Wizard");
+ Title = string.Format("{0} - {1}", printLevelWizardTitle, printLevelWizardTitleFull);
+ ProbePosition[] probePositions = new ProbePosition[3];
+ probePositions[0] = new ProbePosition();
+ probePositions[1] = new ProbePosition();
+ probePositions[2] = new ProbePosition();
+
+ printLevelWizard = new WizardControl();
+ AddChild(printLevelWizard);
+
+ if (runningState == RuningState.InitialStartupCalibration)
+ {
+ string requiredPageInstructions = "{0}\n\n{1}".FormatWith(requiredPageInstructions1, requiredPageInstructions2);
+ printLevelWizard.AddPage(new FirstPageInstructions(initialPrinterSetupStepText, requiredPageInstructions));
+ }
+
+ string pageOneInstructions = string.Format("{0}\n\n\t• {1}\n\t• {2}\n\t• {3}\n\n{4}\n\n{5}\n\n{6}", pageOneInstructionsTextOne, pageOneInstructionsTextTwo, pageOneInstructionsTextThree, pageOneInstructionsTextFour, pageOneInstructionsText5, pageOneInstructionsText6, pageOneInstructionsText7);
+ printLevelWizard.AddPage(new FirstPageInstructions(pageOneStepText, pageOneInstructions));
+
+ string homingPageInstructions = string.Format("{0}:\n\n\t• {1}\n\n{2}", homingPageInstructionsTextOne, homingPageInstructionsTextTwo, homingPageInstructionsTextThree);
+ printLevelWizard.AddPage(new HomePrinterPage(homingPageStepText, homingPageInstructions));
+
+ Vector2 probeFrontLeft = position0;
+ string positionLabelTwo = LocalizedString.Get("Position");
+ string lowPrecisionTwoLabel = LocalizedString.Get("Low Precision");
+ string medPrecisionTwoLabel = LocalizedString.Get("Medium Precision");
+ string highPrecisionTwoLabel = LocalizedString.Get("High Precision");
+ printLevelWizard.AddPage(new GetCoarseBedHeightProbeFirst(printLevelWizard, new Vector3(probeFrontLeft, 10), string.Format("{0} {1} 2 - {2}", GetStepString(), positionLabelTwo, lowPrecisionTwoLabel), probePositions[1]));
+ printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} {1} 2 - {2}", GetStepString(), positionLabelTwo, medPrecisionTwoLabel), probePositions[1]));
+ printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} {1} 2 - {2}", GetStepString(), positionLabelTwo, highPrecisionTwoLabel), probePositions[1]));
+
+ Vector2 probeFrontRight = position1;
+ string positionLabelThree = LocalizedString.Get("Position");
+ string lowPrecisionLabelThree = LocalizedString.Get("Low Precision");
+ string medPrecisionLabelThree = LocalizedString.Get("Medium Precision");
+ string highPrecisionLabelThree = LocalizedString.Get("High Precision");
+ printLevelWizard.AddPage(new GetCoarseBedHeightProbeFirst(printLevelWizard, new Vector3(probeFrontRight, 10), string.Format("{0} {1} 3 - {2}", GetStepString(), positionLabelThree, lowPrecisionLabelThree), probePositions[2]));
+ printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} {1} 3 - {2}", GetStepString(), positionLabelThree, medPrecisionLabelThree), probePositions[2]));
+ printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} {1} 3 - {2}", GetStepString(), positionLabelThree, highPrecisionLabelThree), probePositions[2]));
+
+ string doneInstructions = string.Format("{0}\n\n\t• {1}\n\n{2}", doneInstructionsText, doneInstructionsTextTwo, doneInstructionsTextThree);
+ printLevelWizard.AddPage(new LastPageInstructions("Done", doneInstructions, probePositions));
+ }
+ }
+}
diff --git a/ConfigurationPage/PrintLeveling/LevelWizard3Point.cs b/ConfigurationPage/PrintLeveling/LevelWizard3Point.cs
new file mode 100644
index 000000000..929cfcfbf
--- /dev/null
+++ b/ConfigurationPage/PrintLeveling/LevelWizard3Point.cs
@@ -0,0 +1,120 @@
+/*
+Copyright (c) 2014, Lars Brubaker
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The views and conclusions contained in the software and documentation are those
+of the authors and should not be interpreted as representing official policies,
+either expressed or implied, of the FreeBSD Project.
+*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Diagnostics;
+
+using MatterHackers.Agg;
+using MatterHackers.Agg.UI;
+using MatterHackers.VectorMath;
+using MatterHackers.Agg.Font;
+using MatterHackers.Localizations;
+using MatterHackers.MatterControl.SlicerConfiguration;
+
+namespace MatterHackers.MatterControl
+{
+ public class LevelWizard3Point : LevelWizardBase
+ {
+ string pageOneStepText = "Print Leveling Overview".Localize();
+ string pageOneInstructionsTextOne = LocalizedString.Get("Welcome to the print leveling wizard. Here is a quick overview on what we are going to do.");
+ string pageOneInstructionsTextTwo = LocalizedString.Get("'Home' the printer");
+ string pageOneInstructionsTextThree = LocalizedString.Get("Sample the bed at three points");
+ string pageOneInstructionsTextFour = LocalizedString.Get("Turn auto leveling on");
+ string pageOneInstructionsText5 = LocalizedString.Get("You should be done in about 3 minutes.");
+ string pageOneInstructionsText6 = LocalizedString.Get("Note: Be sure the tip of the extrude is clean.");
+ string pageOneInstructionsText7 = LocalizedString.Get("Click 'Next' to continue.");
+
+ public LevelWizard3Point(RuningState runningState)
+ : base(500, 370, 9)
+ {
+ string printLevelWizardTitle = LocalizedString.Get("MatterControl");
+ string printLevelWizardTitleFull = LocalizedString.Get("Print Leveling Wizard");
+ Title = string.Format("{0} - {1}", printLevelWizardTitle, printLevelWizardTitleFull);
+ ProbePosition[] probePositions = new ProbePosition[3];
+ probePositions[0] = new ProbePosition();
+ probePositions[1] = new ProbePosition();
+ probePositions[2] = new ProbePosition();
+
+ printLevelWizard = new WizardControl();
+ AddChild(printLevelWizard);
+
+ if (runningState == RuningState.InitialStartupCalibration)
+ {
+ string requiredPageInstructions = "{0}\n\n{1}".FormatWith(requiredPageInstructions1, requiredPageInstructions2);
+ printLevelWizard.AddPage(new FirstPageInstructions(initialPrinterSetupStepText, requiredPageInstructions));
+ }
+
+ string pageOneInstructions = string.Format("{0}\n\n\t• {1}\n\t• {2}\n\t• {3}\n\n{4}\n\n{5}\n\n{6}", pageOneInstructionsTextOne, pageOneInstructionsTextTwo, pageOneInstructionsTextThree, pageOneInstructionsTextFour, pageOneInstructionsText5, pageOneInstructionsText6, pageOneInstructionsText7);
+ printLevelWizard.AddPage(new FirstPageInstructions(pageOneStepText, pageOneInstructions));
+
+ string homingPageInstructions = string.Format("{0}:\n\n\t• {1}\n\n{2}", homingPageInstructionsTextOne, homingPageInstructionsTextTwo, homingPageInstructionsTextThree);
+ printLevelWizard.AddPage(new HomePrinterPage(homingPageStepText, homingPageInstructions));
+
+ Vector2 probeBackCenter = ActiveSliceSettings.Instance.GetPrintLevelPositionToSample(0);
+
+ string lowPrecisionPositionLabel = LocalizedString.Get("Position");
+ string lowPrecisionLabel = LocalizedString.Get("Low Precision");
+ GetCoarseBedHeight getCourseBedHeight = new GetCoarseBedHeight(printLevelWizard,
+ new Vector3(probeBackCenter, 10),
+ string.Format("{0} {1} 1 - {2}", GetStepString(), lowPrecisionPositionLabel, lowPrecisionLabel),
+ probePositions[0]);
+
+ printLevelWizard.AddPage(getCourseBedHeight);
+ string precisionPositionLabel = LocalizedString.Get("Position");
+ string medPrecisionLabel = LocalizedString.Get("Medium Precision");
+ printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} {1} 1 - {2}", GetStepString(), precisionPositionLabel, medPrecisionLabel), probePositions[0]));
+ string highPrecisionLabel = LocalizedString.Get("High Precision");
+ printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} {1} 1 - {2}", GetStepString(), precisionPositionLabel, highPrecisionLabel), probePositions[0]));
+
+ Vector2 probeFrontLeft = ActiveSliceSettings.Instance.GetPrintLevelPositionToSample(1);
+ string positionLabelTwo = LocalizedString.Get("Position");
+ string lowPrecisionTwoLabel = LocalizedString.Get("Low Precision");
+ string medPrecisionTwoLabel = LocalizedString.Get("Medium Precision");
+ string highPrecisionTwoLabel = LocalizedString.Get("High Precision");
+ printLevelWizard.AddPage(new GetCoarseBedHeight(printLevelWizard, new Vector3(probeFrontLeft, 10), string.Format("{0} {1} 2 - {2}", GetStepString(), positionLabelTwo, lowPrecisionTwoLabel), probePositions[1]));
+ printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} {1} 2 - {2}", GetStepString(), positionLabelTwo, medPrecisionTwoLabel), probePositions[1]));
+ printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} {1} 2 - {2}", GetStepString(), positionLabelTwo, highPrecisionTwoLabel), probePositions[1]));
+
+ Vector2 probeFrontRight = ActiveSliceSettings.Instance.GetPrintLevelPositionToSample(2);
+ string positionLabelThree = LocalizedString.Get("Position");
+ string lowPrecisionLabelThree = LocalizedString.Get("Low Precision");
+ string medPrecisionLabelThree = LocalizedString.Get("Medium Precision");
+ string highPrecisionLabelThree = LocalizedString.Get("High Precision");
+ printLevelWizard.AddPage(new GetCoarseBedHeight(printLevelWizard, new Vector3(probeFrontRight, 10), string.Format("{0} {1} 3 - {2}", GetStepString(), positionLabelThree, lowPrecisionLabelThree), probePositions[2]));
+ printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} {1} 3 - {2}", GetStepString(), positionLabelThree, medPrecisionLabelThree), probePositions[2]));
+ printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} {1} 3 - {2}", GetStepString(), positionLabelThree, highPrecisionLabelThree), probePositions[2]));
+
+ string doneInstructions = string.Format("{0}\n\n\t• {1}\n\n{2}", doneInstructionsText, doneInstructionsTextTwo, doneInstructionsTextThree);
+ printLevelWizard.AddPage(new LastPageInstructions("Done", doneInstructions, probePositions));
+ }
+ }
+}
diff --git a/ConfigurationPage/PrintLeveling/LevelWizardBase.cs b/ConfigurationPage/PrintLeveling/LevelWizardBase.cs
new file mode 100644
index 000000000..ffdf08c6e
--- /dev/null
+++ b/ConfigurationPage/PrintLeveling/LevelWizardBase.cs
@@ -0,0 +1,101 @@
+/*
+Copyright (c) 2014, Lars Brubaker
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The views and conclusions contained in the software and documentation are those
+of the authors and should not be interpreted as representing official policies,
+either expressed or implied, of the FreeBSD Project.
+*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Diagnostics;
+
+using MatterHackers.Agg;
+using MatterHackers.Agg.UI;
+using MatterHackers.VectorMath;
+using MatterHackers.Agg.Font;
+using MatterHackers.Localizations;
+using MatterHackers.MatterControl.SlicerConfiguration;
+
+namespace MatterHackers.MatterControl
+{
+ // this class is so that it is not passed by value
+ public class ProbePosition
+ {
+ public Vector3 position;
+ }
+
+ public class LevelWizardBase : SystemWindow
+ {
+ protected static readonly string initialPrinterSetupStepText = "Initial Printer Setup".Localize();
+ protected static readonly string requiredPageInstructions1 = "Congratulations on setting up your new printer. Before starting your first print we need to run a simple calibration procedure.";
+ protected static readonly string requiredPageInstructions2 = "The next few screens will walk your through the print leveling wizard.";
+
+ protected static readonly string homingPageStepText = "Homing The Printer".Localize();
+ protected static readonly string homingPageInstructionsTextOne = LocalizedString.Get("The printer should now be 'homing'. Once it is finished homing we will move it to the first point to sample.\n\nTo complete the next few steps you will need");
+ protected static readonly string homingPageInstructionsTextTwo = LocalizedString.Get("A standard sheet of paper");
+ protected static readonly string homingPageInstructionsTextThree = LocalizedString.Get("We will use this paper to measure the distance between the extruder and the bed.\n\nClick 'Next' to continue.");
+
+ protected static readonly string doneInstructionsText = LocalizedString.Get("Congratulations!\n\nAuto Print Leveling is now configured and enabled.");
+ protected static readonly string doneInstructionsTextTwo = LocalizedString.Get("Remove the paper");
+ protected static readonly string doneInstructionsTextThree = LocalizedString.Get("If in the future you need to re-calibrate your printer, or you wish to turn Auto Print Leveling off, you can find the print leveling controls in 'Advanced Settings'->'Configuration'.\n\nClick 'Done' to close this window.");
+ protected static readonly string stepTextBeg = LocalizedString.Get("Step");
+ protected static readonly string stepTextEnd = LocalizedString.Get("of");
+
+ protected WizardControl printLevelWizard;
+
+ int totalSteps;
+ protected int stepNumber = 1;
+
+ protected string GetStepString()
+ {
+ return string.Format("{0} {1} {2} {3}:", stepTextBeg, stepNumber++, stepTextEnd, totalSteps);
+ }
+
+ public LevelWizardBase(int width, int height, int totalSteps)
+ : base(width, height)
+ {
+ this.totalSteps = totalSteps;
+ }
+
+ public enum RuningState { InitialStartupCalibration, UserRequestedCalibration }
+ public static void CreateAndShowWizard(RuningState runningState)
+ {
+ LevelWizardBase printLevelWizardWindow;
+ if (ActivePrinterProfile.Instance.ActivePrinter.PrintLevelingType != null
+ && ActivePrinterProfile.Instance.ActivePrinter.PrintLevelingType != ""
+ && ActivePrinterProfile.Instance.ActivePrinter.PrintLevelingType != "2Point")
+ {
+ printLevelWizardWindow = new LevelWizard2Point(runningState);
+ }
+ else
+ {
+ printLevelWizardWindow = new LevelWizard3Point(runningState);
+ }
+ printLevelWizardWindow.ShowAsSystemWindow();
+ }
+ }
+}
diff --git a/ConfigurationPage/PrintLevelWizard.cs b/ConfigurationPage/PrintLeveling/PrintLevelPages.cs
similarity index 56%
rename from ConfigurationPage/PrintLevelWizard.cs
rename to ConfigurationPage/PrintLeveling/PrintLevelPages.cs
index 554516322..61d89ba9a 100644
--- a/ConfigurationPage/PrintLevelWizard.cs
+++ b/ConfigurationPage/PrintLeveling/PrintLevelPages.cs
@@ -42,44 +42,6 @@ using MatterHackers.MatterControl.SlicerConfiguration;
namespace MatterHackers.MatterControl
{
- public class ProbePosition
- {
- public Vector3 position;
- }
-
- public class InstructionsPage : WizardPage
- {
- protected FlowLayoutWidget topToBottomControls;
-
- public InstructionsPage(string pageDescription, string instructionsText)
- : base(pageDescription)
- {
- topToBottomControls = new FlowLayoutWidget(FlowDirection.TopToBottom);
- topToBottomControls.Padding = new BorderDouble(3);
- topToBottomControls.HAnchor |= Agg.UI.HAnchor.ParentLeft;
- topToBottomControls.VAnchor |= Agg.UI.VAnchor.ParentTop;
-
- AddTextField(instructionsText, 10);
-
- AddChild(topToBottomControls);
-
- AnchorAll();
- }
-
- public void AddTextField(string instructionsText, int pixelsFromLast)
- {
- GuiWidget spacer = new GuiWidget(10, pixelsFromLast);
- topToBottomControls.AddChild(spacer);
-
- EnglishTextWrapping wrapper = new EnglishTextWrapping(12);
- string wrappedInstructions = wrapper.InsertCRs(instructionsText, 400);
- string wrappedInstructionsTabsToSpaces = wrappedInstructions.Replace("\t", " ");
- TextWidget instructionsWidget = new TextWidget(wrappedInstructionsTabsToSpaces, textColor: ActiveTheme.Instance.PrimaryTextColor);
- instructionsWidget.HAnchor = Agg.UI.HAnchor.ParentLeft;
- topToBottomControls.AddChild(instructionsWidget);
- }
- }
-
public class FirstPageInstructions : InstructionsPage
{
public FirstPageInstructions(string pageDescription, string instructionsText)
@@ -195,18 +157,6 @@ namespace MatterHackers.MatterControl
return zButtons;
}
- internal double ZMovementSpeed()
- {
- double zSpeed = 315;
- string savedSettings = ActivePrinterProfile.Instance.ActivePrinter.ManualMovementSpeeds;
- if (savedSettings != null && savedSettings != "")
- {
- zSpeed = double.Parse(savedSettings.Split(',')[5]);
- }
-
- return zSpeed;
- }
-
static string zIsTooLowMessage = "You cannot move any lower. This position on your bed is too low for the extruder to reach. You need to raise your bed, or adjust your limits to allow the extruder to go lower.".Localize();
static string zTooLowTitle = "Waring Moving Too Low".Localize();
void zMinusControl_Click(object sender, MouseEventArgs mouseEvent)
@@ -242,8 +192,8 @@ namespace MatterHackers.MatterControl
static string setZHeightCourseInstructTextFive = LocalizedString.Get("Finally click 'Next' to continue.");
static string setZHeightCoarseInstruction2 = string.Format("\t• {0}\n\t• {1}\n\t• {2}\n\t• {3}\n\n{4}", setZHeightCourseInstructTextOne, setZHeightCourseInstructTextTwo, setZHeightCourseInstructTextThree,setZHeightCourseInstructTextFour, setZHeightCourseInstructTextFive);
- Vector3 probeStartPosition;
- WizardControl container;
+ protected Vector3 probeStartPosition;
+ protected WizardControl container;
public GetCoarseBedHeight(WizardControl container, Vector3 probeStartPosition, string pageDescription, ProbePosition whereToWriteProbePosition)
: base(pageDescription, setZHeightCoarseInstruction1, setZHeightCoarseInstruction2, 1, whereToWriteProbePosition)
@@ -266,7 +216,7 @@ namespace MatterHackers.MatterControl
zMinusControl.Click += new ButtonBase.ButtonEventHandler(zControl_Click);
}
- void zControl_Click(object sender, MouseEventArgs mouseEvent)
+ protected void zControl_Click(object sender, MouseEventArgs mouseEvent)
{
container.nextButton.Enabled = true;
}
@@ -277,6 +227,57 @@ namespace MatterHackers.MatterControl
}
}
+ public class GetCoarseBedHeightProbeFirst : GetCoarseBedHeight
+ {
+ double feedRate = 4000;
+ event EventHandler unregisterEvents;
+
+ public GetCoarseBedHeightProbeFirst(WizardControl container, Vector3 probeStartPosition, string pageDescription, ProbePosition whereToWriteProbePosition)
+ : base(container, probeStartPosition, pageDescription, whereToWriteProbePosition)
+ {
+ }
+
+ public override void PageIsBecomingActive()
+ {
+ PrinterCommunication.Instance.MoveAbsolute(PrinterCommunication.Axis.Z, probeStartPosition.z, feedRate);
+ PrinterCommunication.Instance.MoveAbsolute(probeStartPosition, feedRate);
+ PrinterCommunication.Instance.SendLineToPrinterNow("G30");
+ PrinterCommunication.Instance.ReadLine.RegisterEvent(FinishedProbe, ref unregisterEvents);
+
+ base.PageIsBecomingActive();
+
+ container.nextButton.Enabled = false;
+
+ zPlusControl.Click += new ButtonBase.ButtonEventHandler(zControl_Click);
+ zMinusControl.Click += new ButtonBase.ButtonEventHandler(zControl_Click);
+ }
+
+ void FinishedProbe(object sender, EventArgs e)
+ {
+ StringEventArgs currentEvent = e as StringEventArgs;
+ if (currentEvent != null)
+ {
+ if (currentEvent.Data.Contains("endstops hit"))
+ {
+ PrinterCommunication.Instance.ReadLine.UnregisterEvent(FinishedProbe, ref unregisterEvents);
+ int zStringPos = currentEvent.Data.LastIndexOf("Z:");
+ string zProbeHeight = currentEvent.Data.Substring(zStringPos + 2);
+ PrinterCommunication.Instance.MoveAbsolute(probeStartPosition, feedRate);
+ PrinterCommunication.Instance.ReadPosition();
+ }
+ }
+ }
+
+ public override void OnClosed(EventArgs e)
+ {
+ if (unregisterEvents != null)
+ {
+ unregisterEvents(this, null);
+ }
+ base.OnClosed(e);
+ }
+ }
+
public class GetFineBedHeight : FindBedHeight
{
static string setZHeightFineInstruction1 = LocalizedString.Get("We will now refine our measurement of the extruder height at this position.");
@@ -314,112 +315,9 @@ namespace MatterHackers.MatterControl
{
if (haveDrawn)
{
- PrinterCommunication.Instance.MoveRelative(PrinterCommunication.Axis.Z, 1, ZMovementSpeed());
+ PrinterCommunication.Instance.MoveRelative(PrinterCommunication.Axis.Z, 2, ZMovementSpeed());
}
base.PageIsBecomingInactive();
}
}
-
- // disabled style
- // check box control
-
- public class PrintLevelWizardWindow : SystemWindow
- {
- string initialPrinterSetupStepText = "Initial Printer Setup".Localize();
- string requiredPageInstructions1 = "Congratulations on setting up your new printer. Before starting your first print we need to run a simple calibration procedure.";
- string requiredPageInstructions2 = "The next few screens will walk your through the print leveling wizard.";
-
- string pageOneStepText = "Print Leveling Overview".Localize();
- string pageOneInstructionsTextOne = LocalizedString.Get("Welcome to the print leveling wizard. Here is a quick overview on what we are going to do.");
- string pageOneInstructionsTextTwo = LocalizedString.Get("'Home' the printer");
- string pageOneInstructionsTextThree = LocalizedString.Get("Sample the bed at three points");
- string pageOneInstructionsTextFour = LocalizedString.Get("Turn auto leveling on");
- string pageOneInstructionsText5 = LocalizedString.Get("You should be done in about 3 minutes.");
- string pageOneInstructionsText6 = LocalizedString.Get("Note: Be sure the tip of the extrude is clean.");
- string pageOneInstructionsText7 = LocalizedString.Get("Click 'Next' to continue.");
-
- string homingPageStepText = "Homing The Printer".Localize();
- string homingPageInstructionsTextOne = LocalizedString.Get("The printer should now be 'homing'. Once it is finished homing we will move it to the first point to sample.\n\nTo complete the next few steps you will need");
- string homingPageInstructionsTextTwo = LocalizedString.Get("A standard sheet of paper");
- string homingPageInstructionsTextThree = LocalizedString.Get("We will use this paper to measure the distance between the extruder and the bed.\n\nClick 'Next' to continue.");
-
- string doneInstructionsText = LocalizedString.Get("Congratulations!\n\nAuto Print Leveling is now configured and enabled.");
- string doneInstructionsTextTwo = LocalizedString.Get("Remove the paper");
- string doneInstructionsTextThree = LocalizedString.Get("If in the future you need to re-calibrate your printer, or you wish to turn Auto Print Leveling off, you can find the print leveling controls in 'Advanced Settings'->'Configuration'.\n\nClick 'Done' to close this window.");
- string stepTextBeg = LocalizedString.Get("Step");
- string stepTextEnd = LocalizedString.Get("of");
-
- WizardControl printLevelWizard;
-
- int stepNumber = 1;
-
- string GetStepString()
- {
- return string.Format("{0} {1} {2} 9:", stepTextBeg, stepNumber++, stepTextEnd);
- }
-
- public PrintLevelWizardWindow(bool requiredForPrinter)
- : base(500, 370)
- {
- string printLevelWizardTitle = LocalizedString.Get("MatterControl");
- string printLevelWizardTitleFull = LocalizedString.Get ("Print Leveling Wizard");
- Title = string.Format("{0} - {1}",printLevelWizardTitle, printLevelWizardTitleFull);
- ProbePosition[] probePositions = new ProbePosition[3];
- probePositions[0] = new ProbePosition();
- probePositions[1] = new ProbePosition();
- probePositions[2] = new ProbePosition();
-
- printLevelWizard = new WizardControl();
- AddChild(printLevelWizard);
-
- if(requiredForPrinter)
- {
- string requiredPageInstructions = "{0}\n\n{1}".FormatWith(requiredPageInstructions1, requiredPageInstructions2);
- printLevelWizard.AddPage(new FirstPageInstructions(initialPrinterSetupStepText, requiredPageInstructions));
- }
-
- string pageOneInstructions = string.Format("{0}\n\n\t• {1}\n\t• {2}\n\t• {3}\n\n{4}\n\n{5}\n\n{6}", pageOneInstructionsTextOne, pageOneInstructionsTextTwo, pageOneInstructionsTextThree, pageOneInstructionsTextFour, pageOneInstructionsText5, pageOneInstructionsText6, pageOneInstructionsText7);
- printLevelWizard.AddPage(new FirstPageInstructions(pageOneStepText, pageOneInstructions));
-
- string homingPageInstructions = string.Format("{0}:\n\n\t• {1}\n\n{2}", homingPageInstructionsTextOne, homingPageInstructionsTextTwo, homingPageInstructionsTextThree);
- printLevelWizard.AddPage(new HomePrinterPage(homingPageStepText, homingPageInstructions));
-
- Vector2 probeBackCenter = ActiveSliceSettings.Instance.GetPrintLevelPositionToSample(0);
-
- string lowPrecisionPositionLabel = LocalizedString.Get ("Position");
- string lowPrecisionLabel = LocalizedString.Get ("Low Precision");
- GetCoarseBedHeight getCourseBedHeight = new GetCoarseBedHeight (printLevelWizard,
- new Vector3 (probeBackCenter, 10),
- string.Format ("{0} {1} 1 - {2}", GetStepString(), lowPrecisionPositionLabel, lowPrecisionLabel),
- probePositions [0]);
-
- printLevelWizard.AddPage(getCourseBedHeight);
- string precisionPositionLabel = LocalizedString.Get("Position");
- string medPrecisionLabel = LocalizedString.Get("Medium Precision");
- printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} {1} 1 - {2}", GetStepString(), precisionPositionLabel, medPrecisionLabel), probePositions[0]));
- string highPrecisionLabel = LocalizedString.Get("High Precision");
- printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} {1} 1 - {2}", GetStepString(), precisionPositionLabel, highPrecisionLabel), probePositions[0]));
-
- Vector2 probeFrontLeft = ActiveSliceSettings.Instance.GetPrintLevelPositionToSample(1);
- string positionLabelTwo = LocalizedString.Get("Position");
- string lowPrecisionTwoLabel = LocalizedString.Get("Low Precision");
- string medPrecisionTwoLabel = LocalizedString.Get("Medium Precision");
- string highPrecisionTwoLabel = LocalizedString.Get("High Precision");
- printLevelWizard.AddPage(new GetCoarseBedHeight(printLevelWizard, new Vector3(probeFrontLeft, 10), string.Format("{0} {1} 2 - {2}", GetStepString(), positionLabelTwo, lowPrecisionTwoLabel ), probePositions[1]));
- printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} {1} 2 - {2}", GetStepString(), positionLabelTwo,medPrecisionTwoLabel), probePositions[1]));
- printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} {1} 2 - {2}", GetStepString(), positionLabelTwo,highPrecisionTwoLabel), probePositions[1]));
-
- Vector2 probeFrontRight = ActiveSliceSettings.Instance.GetPrintLevelPositionToSample(2);
- string positionLabelThree = LocalizedString.Get("Position");
- string lowPrecisionLabelThree = LocalizedString.Get("Low Precision");
- string medPrecisionLabelThree = LocalizedString.Get("Medium Precision");
- string highPrecisionLabelThree = LocalizedString.Get("High Precision");
- printLevelWizard.AddPage(new GetCoarseBedHeight(printLevelWizard, new Vector3(probeFrontRight, 10), string.Format("{0} {1} 3 - {2}", GetStepString(), positionLabelThree, lowPrecisionLabelThree), probePositions[2]));
- printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} {1} 3 - {2}", GetStepString(),positionLabelThree, medPrecisionLabelThree ), probePositions[2]));
- printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} {1} 3 - {2}", GetStepString(), positionLabelThree, highPrecisionLabelThree ), probePositions[2]));
-
- string doneInstructions = string.Format("{0}\n\n\t• {1}\n\n{2}",doneInstructionsText, doneInstructionsTextTwo, doneInstructionsTextThree);
- printLevelWizard.AddPage(new LastPageInstructions("Done", doneInstructions, probePositions));
- }
- }
}
diff --git a/CustomWidgets/PartThumbnailWidget.cs b/CustomWidgets/PartThumbnailWidget.cs
index 89e4a1a58..a91f91a0e 100644
--- a/CustomWidgets/PartThumbnailWidget.cs
+++ b/CustomWidgets/PartThumbnailWidget.cs
@@ -317,7 +317,15 @@ namespace MatterHackers.MatterControl
string pathAndFile = printItem.FileLocation;
if (File.Exists(pathAndFile))
{
- new PartPreviewMainWindow(printItem);
+ bool shiftKeyDown = Keyboard.IsKeyDown(Keys.ShiftKey);
+ if (shiftKeyDown)
+ {
+ new PartPreviewMainWindow(printItem, View3DTransformPart.AutoRotate.Disabled);
+ }
+ else
+ {
+ new PartPreviewMainWindow(printItem, View3DTransformPart.AutoRotate.Enabled);
+ }
}
else
{
diff --git a/DataStorage/Models.cs b/DataStorage/Models.cs
index 0c022ef3d..8d936bab3 100644
--- a/DataStorage/Models.cs
+++ b/DataStorage/Models.cs
@@ -376,6 +376,7 @@ namespace MatterHackers.MatterControl.DataStorage
public bool AutoConnectFlag { get; set; } //Auto connect to printer (if available)
public bool DoPrintLeveling { get; set; }
public bool NeedsPrintLeveling { get; set; }
+ public string PrintLevelingType { get; set; }
// features
public string _features { get; set; }
diff --git a/MatterControl.csproj b/MatterControl.csproj
index 711ee2076..d46ef9018 100644
--- a/MatterControl.csproj
+++ b/MatterControl.csproj
@@ -97,6 +97,10 @@
+
+
+
+
@@ -145,7 +149,7 @@
-
+
ExportPrintItemWindow.cs
diff --git a/MatterControlApplication.cs b/MatterControlApplication.cs
index 596dcfadb..7de7d4a54 100644
--- a/MatterControlApplication.cs
+++ b/MatterControlApplication.cs
@@ -281,7 +281,7 @@ namespace MatterHackers.MatterControl
{
if (Path.GetExtension(arg).ToUpper() == ".STL")
{
- new PartPreviewMainWindow(new PrintItemWrapper(new DataStorage.PrintItem(Path.GetFileName(arg), Path.GetFullPath(arg))));
+ new PartPreviewMainWindow(new PrintItemWrapper(new DataStorage.PrintItem(Path.GetFileName(arg), Path.GetFullPath(arg))), View3DTransformPart.AutoRotate.Enabled);
}
}
}
diff --git a/PartPreviewWindow/PartPreviewMainWindow.cs b/PartPreviewWindow/PartPreviewMainWindow.cs
index 01df77466..083f02b1e 100644
--- a/PartPreviewWindow/PartPreviewMainWindow.cs
+++ b/PartPreviewWindow/PartPreviewMainWindow.cs
@@ -46,7 +46,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
View3DTransformPart view3DTransformPart;
ViewGcodeBasic viewGcodeBasic;
- public PartPreviewMainWindow(PrintItemWrapper printItem)
+ public PartPreviewMainWindow(PrintItemWrapper printItem, View3DTransformPart.AutoRotate autoRotate3DView)
: base(690, 340)
{
string partPreviewTitle = LocalizedString.Get("MatterControl");
@@ -64,7 +64,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
string part3DViewLabelFull = string.Format("{0} {1} ", "3D", "View".Localize());
- view3DTransformPart = new View3DTransformPart(printItem, new Vector3(ActiveSliceSettings.Instance.BedSize, buildHeight), ActiveSliceSettings.Instance.BedShape, true);
+ view3DTransformPart = new View3DTransformPart(printItem, new Vector3(ActiveSliceSettings.Instance.BedSize, buildHeight), ActiveSliceSettings.Instance.BedShape, View3DTransformPart.WindowType.StandAlone, autoRotate3DView);
TabPage partPreview3DView = new TabPage(view3DTransformPart, part3DViewLabelFull);
tabControl.AddTab(new SimpleTextTabWidget(partPreview3DView, 16,
ActiveTheme.Instance.TabLabelSelected, new RGBA_Bytes(), ActiveTheme.Instance.TabLabelUnselected, new RGBA_Bytes()));
diff --git a/PartPreviewWindow/View3DTransfromPart.cs b/PartPreviewWindow/View3DTransfromPart.cs
index 1a244eec0..2108fd7fc 100644
--- a/PartPreviewWindow/View3DTransfromPart.cs
+++ b/PartPreviewWindow/View3DTransfromPart.cs
@@ -246,8 +246,12 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
base.OnClosed(e);
}
- public View3DTransformPart(PrintItemWrapper printItemWrapper, Vector3 viewerVolume, MeshViewerWidget.BedShape bedShape, bool standAloneWindow)
+ public enum WindowType { Embeded, StandAlone };
+ public enum AutoRotate { Enabled, Disabled };
+
+ public View3DTransformPart(PrintItemWrapper printItemWrapper, Vector3 viewerVolume, MeshViewerWidget.BedShape bedShape, WindowType windowType, AutoRotate autoRotate)
{
+ autoRotateEnabled = (autoRotate == AutoRotate.Enabled);
MeshExtraData = new List();
MeshExtraData.Add(new PlatingMeshData());
@@ -260,7 +264,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
FlowLayoutWidget centerPartPreviewAndControls = new FlowLayoutWidget(FlowDirection.LeftToRight);
centerPartPreviewAndControls.AnchorAll();
- if (!standAloneWindow)
+ if (windowType == WindowType.Embeded)
{
PrinterCommunication.Instance.CommunicationStateChanged.RegisterEvent(SetEditControlsBasedOnPrinterState, ref unregisterEvents);
}
@@ -417,7 +421,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
leftRightSpacer.HAnchor = HAnchor.ParentLeftRight;
buttonBottomPanel.AddChild(leftRightSpacer);
- if (standAloneWindow)
+ if (windowType == WindowType.StandAlone)
{
Button closeButton = textImageButtonFactory.Generate(LocalizedString.Get("Close"));
buttonBottomPanel.AddChild(closeButton);
@@ -447,7 +451,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
UiThread.RunOnIdle(AutoSpin);
- if (printItemWrapper == null && !standAloneWindow)
+ if (printItemWrapper == null && windowType == WindowType.Embeded)
{
enterEditButtonsContainer.Visible = false;
}
diff --git a/PrintLibrary/LibraryRowItem.cs b/PrintLibrary/LibraryRowItem.cs
index 08a1fcfd1..7aa462562 100644
--- a/PrintLibrary/LibraryRowItem.cs
+++ b/PrintLibrary/LibraryRowItem.cs
@@ -277,7 +277,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
{
if (viewWindowIsOpen == false)
{
- viewingWindow = new PartPreviewMainWindow(this.printItemWrapper);
+ viewingWindow = new PartPreviewMainWindow(this.printItemWrapper, View3DTransformPart.AutoRotate.Enabled);
this.viewWindowIsOpen = true;
viewingWindow.Closed += new EventHandler(PartPreviewMainWindow_Closed);
}
diff --git a/PrintQueue/QueueRowItem.cs b/PrintQueue/QueueRowItem.cs
index 23afa61f0..38aa67964 100644
--- a/PrintQueue/QueueRowItem.cs
+++ b/PrintQueue/QueueRowItem.cs
@@ -166,7 +166,7 @@ namespace MatterHackers.MatterControl.PrintQueue
{
if (viewWindowIsOpen == false)
{
- viewingWindow = new PartPreviewMainWindow(PrintItemWrapper);
+ viewingWindow = new PartPreviewMainWindow(PrintItemWrapper, View3DTransformPart.AutoRotate.Enabled);
this.viewWindowIsOpen = true;
viewingWindow.Closed += new EventHandler(PartPreviewWindow_Closed);
}
diff --git a/PrinterControls/PrinterConnections/SetupStepMakeModelName.cs b/PrinterControls/PrinterConnections/SetupStepMakeModelName.cs
index 595b30add..1a25524b1 100644
--- a/PrinterControls/PrinterConnections/SetupStepMakeModelName.cs
+++ b/PrinterControls/PrinterConnections/SetupStepMakeModelName.cs
@@ -209,6 +209,12 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
ActivePrinter.NeedsPrintLeveling = true;
}
+ string printLevelingType;
+ if (settingsDict.TryGetValue("print_leveling_type", out printLevelingType))
+ {
+ ActivePrinter.PrintLevelingType = printLevelingType;
+ }
+
string defaultSliceEngine;
if (settingsDict.TryGetValue("default_slice_engine", out defaultSliceEngine))
{
diff --git a/StaticData/PrinterSettings/RoBo 3D/R1/setup.ini b/StaticData/PrinterSettings/RoBo 3D/R1/setup.ini
index 4aba24a00..d94cb129b 100644
--- a/StaticData/PrinterSettings/RoBo 3D/R1/setup.ini
+++ b/StaticData/PrinterSettings/RoBo 3D/R1/setup.ini
@@ -3,4 +3,5 @@ default_slice_engine = Slic3r
windows_driver = CDM20824_Setup.exe
default_material_presets = PLA
default_quality_preset = Medium
-needs_print_leveling = 1
\ No newline at end of file
+needs_print_leveling = 1
+print_leveling_type = 2Point
\ No newline at end of file