Beispiel #1
0
        public void SetPrintLevelingData(PrintLevelingData data, bool clearUserZOffset)
        {
            if (clearUserZOffset)
            {
                printerSettings.SetValue(SettingsKey.baby_step_z_offset, "0");
            }

            printerSettings.SetValue(SettingsKey.print_leveling_data, JsonConvert.SerializeObject(data));
        }
        public void UpdateLevelSettings()
        {
            PrintLevelingData levelingData = ActiveSliceSettings.Instance.Helpers.GetPrintLevelingData();

            if (levelingData.SampledPositions.Count > 2)
            {
                PrintLevelingPlane.Instance.SetPrintLevelingEquation(
                    levelingData.SampledPositions[0],
                    levelingData.SampledPositions[1],
                    levelingData.SampledPositions[2],
                    ActiveSliceSettings.Instance.GetValue <Vector2>(SettingsKey.print_center));
            }
        }
Beispiel #3
0
        public PrintLevelingData GetPrintLevelingData()
        {
            PrintLevelingData printLevelingData = null;
            var jsonData = printerSettings.GetValue(SettingsKey.print_leveling_data);

            if (!string.IsNullOrEmpty(jsonData))
            {
                printLevelingData = JsonConvert.DeserializeObject <PrintLevelingData>(jsonData);
            }

            // if it is still null
            if (printLevelingData == null)
            {
                printLevelingData = new PrintLevelingData();
            }

            return(printLevelingData);
        }
Beispiel #4
0
        public PrintLevelingData GetPrintLevelingData()
        {
            if (printLevelingData == null)
            {
                printLevelingData = PrintLevelingData.Create(
                    ActiveSliceSettings.Instance,
                    layeredProfile.GetValue("MatterControl.PrintLevelingData"),
                    layeredProfile.GetValue("MatterControl.PrintLevelingProbePositions"));

                PrintLevelingPlane.Instance.SetPrintLevelingEquation(
                    printLevelingData.SampledPosition0,
                    printLevelingData.SampledPosition1,
                    printLevelingData.SampledPosition2,
                    ActiveSliceSettings.Instance.PrintCenter());
            }

            return(printLevelingData);
        }
        public PrintLevelingData GetPrintLevelingData()
        {
            if (printLevelingData == null)
            {
                printLevelingData = PrintLevelingData.Create(
                    ActiveSliceSettings.Instance,
                    printerSettings.GetValue("print_leveling_data"),
                    printerSettings.GetValue("MatterControl.PrintLevelingProbePositions"));

                PrintLevelingPlane.Instance.SetPrintLevelingEquation(
                    printLevelingData.SampledPosition0,
                    printLevelingData.SampledPosition1,
                    printLevelingData.SampledPosition2,
                    ActiveSliceSettings.Instance.GetValue <Vector2>(SettingsKey.print_center));
            }

            return(printLevelingData);
        }
        public PrintLevelingData GetPrintLevelingData()
        {
            if (printLevelingData == null)
            {
                printLevelingData = PrintLevelingData.Create(
                    ActiveSliceSettings.Instance,
                    printerSettings.GetValue(SettingsKey.print_leveling_data));

                if (printLevelingData.SampledPositions.Count == 3)
                {
                    PrintLevelingPlane.Instance.SetPrintLevelingEquation(
                        printLevelingData.SampledPositions[0],
                        printLevelingData.SampledPositions[1],
                        printLevelingData.SampledPositions[2],
                        ActiveSliceSettings.Instance.GetValue <Vector2>(SettingsKey.print_center));
                }
            }

            return(printLevelingData);
        }
Beispiel #7
0
        public void DoPrintLeveling(bool doLeveling)
        {
            // Early exit if already set
            if (doLeveling == this.DoPrintLeveling())
            {
                return;
            }

            layeredProfile.SetActiveValue("MatterControl.PrintLevelingEnabled", doLeveling ? "1" : "0");

            DoPrintLevelingChanged.CallEvents(this, null);

            if (doLeveling)
            {
                PrintLevelingData levelingData = ActiveSliceSettings.Instance.GetPrintLevelingData();
                PrintLevelingPlane.Instance.SetPrintLevelingEquation(
                    levelingData.SampledPosition0,
                    levelingData.SampledPosition1,
                    levelingData.SampledPosition2,
                    ActiveSliceSettings.Instance.PrintCenter());
            }
        }
        public void DoPrintLeveling(bool doLeveling)
        {
            // Early exit if already set
            if (doLeveling == printerSettings.GetValue <bool>("print_leveling_enabled"))
            {
                return;
            }

            printerSettings.SetValue("print_leveling_enabled", doLeveling ? "1" : "0");

            PrinterSettings.PrintLevelingEnabledChanged?.CallEvents(this, null);

            if (doLeveling)
            {
                PrintLevelingData levelingData = ActiveSliceSettings.Instance.Helpers.GetPrintLevelingData();
                PrintLevelingPlane.Instance.SetPrintLevelingEquation(
                    levelingData.SampledPosition0,
                    levelingData.SampledPosition1,
                    levelingData.SampledPosition2,
                    ActiveSliceSettings.Instance.GetValue <Vector2>(SettingsKey.print_center));
            }
        }
        public void LoadAllSettings()
        {
            this.activeSettingsLayers = new List <SettingsLayer>();
            globalInstance.LoadSettingsForPrinter();

            //Ordering matters - Material presets trump Quality
            globalInstance.LoadSettingsForQuality();
            globalInstance.LoadSettingsForMaterial(1);

            if (ActivePrinterProfile.Instance.ActivePrinter != null)
            {
                PrintLevelingData levelingData = PrintLevelingData.GetForPrinter(ActivePrinterProfile.Instance.ActivePrinter);

                PrintLevelingPlane.Instance.SetPrintLevelingEquation(
                    levelingData.SampledPosition0,
                    levelingData.SampledPosition1,
                    levelingData.SampledPosition2,
                    ActiveSliceSettings.Instance.PrintCenter);
            }
            OnSettingsChanged();

            this.HasUncommittedChanges = false;
        }
Beispiel #10
0
 public void SetPrintLevelingData(PrintLevelingData data)
 {
     printLevelingData = data;
     layeredProfile.SetActiveValue("MatterControl.PrintLevelingData", JsonConvert.SerializeObject(data));
 }
 public void SetPrintLevelingData(PrintLevelingData data)
 {
     printLevelingData = data;
     printerSettings.SetValue("print_leveling_data", JsonConvert.SerializeObject(data));
 }
 public void SetPrintLevelingData(PrintLevelingData data)
 {
     printLevelingData = data;
     layeredProfile.SetValue("print_leveling_data", JsonConvert.SerializeObject(data));
 }