Ejemplo n.º 1
0
        private static LevelWizardBase CreateAndShowWizard(LevelWizardBase.RuningState runningState)
        {
            PrintLevelingData levelingData = ActiveSliceSettings.Instance.Helpers.GetPrintLevelingData();

            LevelWizardBase printLevelWizardWindow;

            switch (levelingData.CurrentPrinterLevelingSystem)
            {
            case PrintLevelingData.LevelingSystem.Probe2Points:
                printLevelWizardWindow = new LevelWizard2Point(runningState);
                break;

            case PrintLevelingData.LevelingSystem.Probe3Points:
                printLevelWizardWindow = new LevelWizard3Point(runningState);
                break;

            case PrintLevelingData.LevelingSystem.Probe7PointRadial:
                printLevelWizardWindow = new LevelWizard7PointRadial(runningState);
                break;

            case PrintLevelingData.LevelingSystem.Probe13PointRadial:
                printLevelWizardWindow = new LevelWizard13PointRadial(runningState);
                break;

            default:
                throw new NotImplementedException();
            }

            printLevelWizardWindow.ShowAsSystemWindow();
            return(printLevelWizardWindow);
        }
Ejemplo n.º 2
0
        private static LevelWizardBase CreateAndShowWizard(LevelWizardBase.RuningState runningState)
        {
            // turn off print leveling
            ActiveSliceSettings.Instance.Helpers.DoPrintLeveling(false);
            // clear any data that we are going to be acquiring (sampled positions, after z home offset)
            PrintLevelingData levelingData = ActiveSliceSettings.Instance.Helpers.GetPrintLevelingData();

            levelingData.SampledPositions.Clear();
            ActiveSliceSettings.Instance.SetValue(SettingsKey.baby_step_z_offset, "0");

            ApplicationController.Instance.ReloadAdvancedControlsPanel();

            LevelWizardBase printLevelWizardWindow;

            switch (levelingData.CurrentPrinterLevelingSystem)
            {
            case PrintLevelingData.LevelingSystem.Probe3Points:
                printLevelWizardWindow = new LevelWizard3Point(runningState);
                break;

            case PrintLevelingData.LevelingSystem.Probe7PointRadial:
                printLevelWizardWindow = new LevelWizard7PointRadial(runningState);
                break;

            case PrintLevelingData.LevelingSystem.Probe13PointRadial:
                printLevelWizardWindow = new LevelWizard13PointRadial(runningState);
                break;

            default:
                throw new NotImplementedException();
            }

            printLevelWizardWindow.ShowAsSystemWindow();
            return(printLevelWizardWindow);
        }
Ejemplo n.º 3
0
        public LevelWizard2Point(LevelWizardBase.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[5];
            probePositions[0] = new ProbePosition();
            probePositions[1] = new ProbePosition();
            probePositions[2] = new ProbePosition();
            probePositions[3] = new ProbePosition();
            probePositions[4] = new ProbePosition();

            printLevelWizard = new WizardControl();
            AddChild(printLevelWizard);

            if (runningState == LevelWizardBase.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));

            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, probeStartZHeight), string.Format("{0} {1} 2 - {2}", GetStepString(), positionLabelTwo, lowPrecisionTwoLabel), probePositions[0], probePositions[1], true));
            printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} {1} 2 - {2}", GetStepString(), positionLabelTwo, medPrecisionTwoLabel), probePositions[0], true));
            printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} {1} 2 - {2}", GetStepString(), positionLabelTwo, highPrecisionTwoLabel), probePositions[0], true));

            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, probeStartZHeight), string.Format("{0} {1} 3 - {2}", GetStepString(), positionLabelThree, lowPrecisionLabelThree), probePositions[2], probePositions[3], true));
            printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} {1} 3 - {2}", GetStepString(), positionLabelThree, medPrecisionLabelThree), probePositions[2], true));
            printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} {1} 3 - {2}", GetStepString(), positionLabelThree, highPrecisionLabelThree), probePositions[2], true));

            string retrievingFinalPosition = "Getting the third point.";

            printLevelWizard.AddPage(new GettingThirdPointFor2PointCalibration(printLevelWizard, "Collecting Data", new Vector3(probeBackLeft, probeStartZHeight), retrievingFinalPosition, probePositions[4]));

            string doneInstructions = string.Format("{0}\n\n\t• {1}\n\n{2}", doneInstructionsText, doneInstructionsTextTwo, doneInstructionsTextThree);

            printLevelWizard.AddPage(new LastPage2PointInstructions("Done".Localize(), doneInstructions, probePositions));
        }
        public LevelWizard3Point(LevelWizardBase.RuningState runningState)
            : base(500, 370, 9)
        {
            bool   allowLessThanZero         = ActiveSliceSettings.Instance.GetValue("z_can_be_negative") == "1";
            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 == LevelWizardBase.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));

            string positionLabel      = LocalizedString.Get("Position");
            string lowPrecisionLabel  = LocalizedString.Get("Low Precision");
            string medPrecisionLabel  = LocalizedString.Get("Medium Precision");
            string highPrecisionLabel = LocalizedString.Get("High Precision");

            Vector2 probeBackCenter = LevelWizardBase.GetPrintLevelPositionToSample(0);

            printLevelWizard.AddPage(new GetCoarseBedHeight(printLevelWizard, new Vector3(probeBackCenter, 10), string.Format("{0} {1} 1 - {2}", GetStepString(), positionLabel, lowPrecisionLabel), probePositions[0], allowLessThanZero));
            printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} {1} 1 - {2}", GetStepString(), positionLabel, medPrecisionLabel), probePositions[0], allowLessThanZero));
            printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} {1} 1 - {2}", GetStepString(), positionLabel, highPrecisionLabel), probePositions[0], allowLessThanZero));

            Vector2 probeFrontLeft = LevelWizardBase.GetPrintLevelPositionToSample(1);

            printLevelWizard.AddPage(new GetCoarseBedHeight(printLevelWizard, new Vector3(probeFrontLeft, 10), string.Format("{0} {1} 2 - {2}", GetStepString(), positionLabel, lowPrecisionLabel), probePositions[1], allowLessThanZero));
            printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} {1} 2 - {2}", GetStepString(), positionLabel, medPrecisionLabel), probePositions[1], allowLessThanZero));
            printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} {1} 2 - {2}", GetStepString(), positionLabel, highPrecisionLabel), probePositions[1], allowLessThanZero));

            Vector2 probeFrontRight = LevelWizardBase.GetPrintLevelPositionToSample(2);

            printLevelWizard.AddPage(new GetCoarseBedHeight(printLevelWizard, new Vector3(probeFrontRight, 10), string.Format("{0} {1} 3 - {2}", GetStepString(), positionLabel, lowPrecisionLabel), probePositions[2], allowLessThanZero));
            printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} {1} 3 - {2}", GetStepString(), positionLabel, medPrecisionLabel), probePositions[2], allowLessThanZero));
            printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} {1} 3 - {2}", GetStepString(), positionLabel, highPrecisionLabel), probePositions[2], allowLessThanZero));

            string doneInstructions = string.Format("{0}\n\n\t• {1}\n\n{2}", doneInstructionsText, doneInstructionsTextTwo, doneInstructionsTextThree);

            printLevelWizard.AddPage(new LastPage3PointInstructions("Done".Localize(), doneInstructions, probePositions));
        }
        public LevelWizardRadialBase(LevelWizardBase.RuningState runningState, int width, int height, int totalSteps, int numberOfRadialSamples)
            : base(width, height, totalSteps)
        {
            pageOneInstructionsTextThree = pageOneInstructionsTextThree.FormatWith(numberOfRadialSamples + 1);

            string printLevelWizardTitle     = "MatterControl";
            string printLevelWizardTitleFull = "Print Leveling Wizard".Localize();

            Title = string.Format("{0} - {1}", printLevelWizardTitle, printLevelWizardTitleFull);
            List <ProbePosition> probePositions = new List <ProbePosition>(numberOfRadialSamples + 1);

            for (int i = 0; i < numberOfRadialSamples + 1; i++)
            {
                probePositions.Add(new ProbePosition());
            }

            printLevelWizard = new WizardControl();
            AddChild(printLevelWizard);

            if (runningState == LevelWizardBase.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));

            string positionLabel      = "Position".Localize();
            string lowPrecisionLabel  = "Low Precision".Localize();
            string medPrecisionLabel  = "Medium Precision".Localize();
            string highPrecisionLabel = "High Precision".Localize();

            double bedRadius         = Math.Min(ActiveSliceSettings.Instance.GetValue <Vector2>(SettingsKey.bed_size).x, ActiveSliceSettings.Instance.GetValue <Vector2>(SettingsKey.bed_size).y) / 2;
            bool   allowLessThanZero = ActiveSliceSettings.Instance.GetValue <bool>(SettingsKey.z_can_be_negative);

            double startProbeHeight = ActiveSliceSettings.Instance.GetValue <double>(SettingsKey.print_leveling_probe_start);

            for (int i = 0; i < numberOfRadialSamples + 1; i++)
            {
                Vector2 probePosition = GetPrintLevelPositionToSample(i, bedRadius);
                printLevelWizard.AddPage(new GetCoarseBedHeight(printLevelWizard, new Vector3(probePosition, startProbeHeight), string.Format("{0} {1} {2} - {3}", GetStepString(), positionLabel, i + 1, lowPrecisionLabel), probePositions, i, allowLessThanZero));
                printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} {1} {2} - {3}", GetStepString(), positionLabel, i + 1, medPrecisionLabel), probePositions, i, allowLessThanZero));
                printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} {1} {2} - {3}", GetStepString(), positionLabel, i + 1, highPrecisionLabel), probePositions, i, allowLessThanZero));
            }

            string doneInstructions = string.Format("{0}\n\n\t• {1}\n\n{2}", doneInstructionsText, doneInstructionsTextTwo, doneInstructionsTextThree);

            printLevelWizard.AddPage(new LastPageRadialInstructions("Done".Localize(), doneInstructions, probePositions));
        }
Ejemplo n.º 6
0
        public void RunLevelingWizard()
        {
            LevelWizardBase.RuningState runningState = LevelWizardBase.RuningState.UserRequestedCalibration;
            if (ActiveSliceSettings.Instance.LevelingRequiredToPrint)
            {
                // run in the first run state
                runningState = LevelWizardBase.RuningState.InitialStartupCalibration;
            }

            LevelWizardBase.ShowPrintLevelWizard(runningState);
        }
Ejemplo n.º 7
0
        public static void ShowPrintLevelWizard()
        {
            LevelWizardBase.RuningState runningState = LevelWizardBase.RuningState.UserRequestedCalibration;

            if (ActiveSliceSettings.Instance.GetValue <bool>("print_leveling_required_to_print"))
            {
                // run in the first run state
                runningState = LevelWizardBase.RuningState.InitialStartupCalibration;
            }

            ShowPrintLevelWizard(runningState);
        }
Ejemplo n.º 8
0
 public static void ShowPrintLevelWizard(LevelWizardBase.RuningState runningState)
 {
     if (printLevelWizardWindow == null)
     {
         printLevelWizardWindow         = LevelWizardBase.CreateAndShowWizard(runningState);
         printLevelWizardWindow.Closed += (sender, e) =>
         {
             printLevelWizardWindow = null;
         };
     }
     else
     {
         printLevelWizardWindow.BringToFront();
     }
 }
Ejemplo n.º 9
0
        private static LevelWizardBase CreateAndShowWizard(LevelWizardBase.RuningState runningState)
        {
            PrintLevelingData levelingData = PrintLevelingData.GetForPrinter(ActivePrinterProfile.Instance.ActivePrinter);

            LevelWizardBase printLevelWizardWindow;

            switch (levelingData.levelingSystem)
            {
            case PrintLevelingData.LevelingSystem.Probe2Points:
                printLevelWizardWindow = new LevelWizard2Point(runningState);
                break;

            case PrintLevelingData.LevelingSystem.Probe3Points:
                printLevelWizardWindow = new LevelWizard3Point(runningState);
                break;

            default:
                throw new NotImplementedException();
            }

            printLevelWizardWindow.ShowAsSystemWindow();
            return(printLevelWizardWindow);
        }
Ejemplo n.º 10
0
        private static LevelWizardBase CreateAndShowWizard(LevelWizardBase.RuningState runningState)
        {
            PrintLevelingData levelingData = ActiveSliceSettings.Instance.GetPrintLevelingData();

            LevelWizardBase printLevelWizardWindow;

            switch (levelingData.CurrentPrinterLevelingSystem)
            {
            case PrintLevelingData.LevelingSystem.Probe2Points:
                printLevelWizardWindow = new LevelWizard2Point(runningState);
                break;

            case PrintLevelingData.LevelingSystem.Probe3Points:
                printLevelWizardWindow = new LevelWizard3Point(runningState);
                break;

            case PrintLevelingData.LevelingSystem.Probe7PointRadial:
                printLevelWizardWindow = new LevelWizard7PointRadial(runningState);
                break;

            case PrintLevelingData.LevelingSystem.Probe13PointRadial:
                printLevelWizardWindow = new LevelWizard13PointRadial(runningState);
                break;

            default:
                throw new NotImplementedException();
            }

            printLevelWizardWindow.Closed += (sender, e) =>
            {
                ApplicationController.Instance.ReloadAll(null, null);
            };

            printLevelWizardWindow.ShowAsSystemWindow();
            return(printLevelWizardWindow);
        }
Ejemplo n.º 11
0
 public LevelWizard7PointRadial(LevelWizardBase.RuningState runningState)
     : base(runningState, 500, 370, 21, numberOfRadialSamples)
 {
 }