コード例 #1
0
        private static LevelWizardBase CreateAndShowWizard(LevelWizardBase.RuningState runningState)
        {
            PrintLevelingData levelingData = PrintLevelingData.GetForPrinter(ActivePrinterProfile.Instance.ActivePrinter);

            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);
        }
コード例 #2
0
        public override void PageIsBecomingActive()
        {
            // This data is currently the offset from the probe to the extruder tip. We need to translate them
            // into bed offsets and store them.

            PrintLevelingData levelingData = PrintLevelingData.GetForPrinter(ActivePrinterProfile.Instance.ActivePrinter);
            // The first point is the user assisted offset to the bed
            Vector3 userBedSample0 = probePositions[0].position;
            // The first point sample offset at the limit switch
            Vector3 probeOffset0 = probePositions[1].position; // this z should be 0

            // right side of printer
            Vector3 userBedSample1 = probePositions[2].position;
            Vector3 probeOffset1   = probePositions[3].position;

            // auto back probe
            Vector3 probeOffset2 = probePositions[4].position;

            levelingData.sampledPosition0 = userBedSample0 - paperWidth;
            levelingData.sampledPosition1 = userBedSample1 - paperWidth;
            levelingData.sampledPosition2 = probeOffset2 - probeOffset0 + userBedSample0 - paperWidth;

            levelingData.probeOffset0 = probeOffset0 - paperWidth;
            levelingData.probeOffset1 = probeOffset1 - paperWidth;

            ActivePrinterProfile.Instance.DoPrintLeveling = true;
            base.PageIsBecomingActive();
        }
コード例 #3
0
        public override Vector2 GetPrintLevelPositionToSample(int index, double radius)
        {
            Printer           activePrinter = PrinterConnectionAndCommunication.Instance.ActivePrinter;
            PrintLevelingData levelingData  = PrintLevelingData.GetForPrinter(activePrinter);

            return(GetLevelingFunctions(numberOfRadialSamples, levelingData, ActiveSliceSettings.Instance.BedCenter)
                   .GetPrintLevelPositionToSample(index, radius));
        }
コード例 #4
0
        public override void PageIsBecomingActive()
        {
            PrintLevelingData levelingData = PrintLevelingData.GetForPrinter(ActivePrinterProfile.Instance.ActivePrinter);

            levelingData.sampledPosition0 = probePositions[0].position - paperWidth;
            levelingData.sampledPosition1 = probePositions[1].position - paperWidth;
            levelingData.sampledPosition2 = probePositions[2].position - paperWidth;

            ActivePrinterProfile.Instance.DoPrintLeveling = true;
            base.PageIsBecomingActive();
        }
コード例 #5
0
        private static void SetEquations()
        {
            PrintLevelingData levelingData = PrintLevelingData.GetForPrinter(ActivePrinterProfile.Instance.ActivePrinter);

            // position 0 does not change as it is the distance from the switch trigger to the extruder tip.
            //levelingData.sampledPosition0 = levelingData.sampledPosition0;
            levelingData.sampledPosition1 = levelingData.sampledPosition0 + probeRead1;
            levelingData.sampledPosition2 = levelingData.sampledPosition0 + probeRead2;

            ActivePrinterProfile.Instance.DoPrintLeveling = true;
        }
コード例 #6
0
        public override void PageIsBecomingActive()
        {
            PrintLevelingData levelingData = PrintLevelingData.GetForPrinter(ActivePrinterProfile.Instance.ActivePrinter);
            Vector3           paperWidth   = new Vector3(0, 0, ActiveSliceSettings.Instance.ProbePaperWidth);

            levelingData.SampledPosition0 = probePositions[0].position - paperWidth;
            levelingData.SampledPosition1 = probePositions[1].position - paperWidth;
            levelingData.SampledPosition2 = probePositions[2].position - paperWidth;

            ActivePrinterProfile.Instance.DoPrintLeveling = true;
            base.PageIsBecomingActive();
        }
コード例 #7
0
        public static string ApplyLeveling(string lineBeingSent, Vector3 currentDestination, PrinterMachineInstruction.MovementTypes movementMode)
        {
            Printer activePrinter = PrinterConnectionAndCommunication.Instance.ActivePrinter;

            if (activePrinter != null &&
                activePrinter.DoPrintLeveling &&
                (lineBeingSent.StartsWith("G0 ") || lineBeingSent.StartsWith("G1 ")) &&
                lineBeingSent.Length > 2 &&
                lineBeingSent[2] == ' ')
            {
                PrintLevelingData levelingData = PrintLevelingData.GetForPrinter(activePrinter);
                return(GetLevelingFunctions(numberOfRadialSamples, levelingData, ActiveSliceSettings.Instance.BedCenter)
                       .DoApplyLeveling(lineBeingSent, currentDestination, movementMode));
            }

            return(lineBeingSent);
        }
コード例 #8
0
        public override void PageIsBecomingActive()
        {
            PrintLevelingData levelingData = PrintLevelingData.GetForPrinter(ActivePrinterProfile.Instance.ActivePrinter);

            levelingData.SampledPositions.Clear();
            Vector3 paperWidth = new Vector3(0, 0, ActiveSliceSettings.Instance.ProbePaperWidth);

            for (int i = 0; i < probePositions.Length; i++)
            {
                levelingData.SampledPositions.Add(probePositions[i].position - paperWidth);
            }

            levelingData.Commit();


            ActivePrinterProfile.Instance.DoPrintLeveling = true;
            base.PageIsBecomingActive();
        }