diff --git a/ConfigurationPage/PrintLeveling/PrintLevelingData.cs b/ConfigurationPage/PrintLeveling/PrintLevelingData.cs index 49ded76c8..d6d39cf89 100644 --- a/ConfigurationPage/PrintLeveling/PrintLevelingData.cs +++ b/ConfigurationPage/PrintLeveling/PrintLevelingData.cs @@ -9,6 +9,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling { public class PrintLevelingData { + public List SampledPositions = new List(); private static bool activelyLoading = false; private static Printer activePrinter = null; @@ -28,11 +29,9 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling [JsonConverter(typeof(StringEnumConverter))] public enum LevelingSystem { Probe3Points, Probe2Points, Probe7PointRadial, Probe13PointRadial } - public List SampledPositions = new List(); - public LevelingSystem CurrentPrinterLevelingSystem { - get + get { switch (ActiveSliceSettings.Instance.GetActiveValue("print_leveling_solution")) { @@ -135,6 +134,20 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling return instance; } + public void Commit() + { + if (!activelyLoading) + { + string newLevelingInfo = Newtonsoft.Json.JsonConvert.SerializeObject(this); + + // clear the legacy value + activePrinter.PrintLevelingProbePositions = ""; + // set the new value + activePrinter.PrintLevelingJsonData = newLevelingInfo; + activePrinter.Commit(); + } + } + private static void CreateFromJsonOrLegacy(string jsonData, string depricatedPositionsCsv3ByXYZ) { if (jsonData != null) @@ -154,20 +167,6 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling } } - public void Commit() - { - if (!activelyLoading) - { - string newLevelingInfo = Newtonsoft.Json.JsonConvert.SerializeObject(this); - - // clear the legacy value - activePrinter.PrintLevelingProbePositions = ""; - // set the new value - activePrinter.PrintLevelingJsonData = newLevelingInfo; - activePrinter.Commit(); - } - } - /// /// Gets the 9 {3 * (x, y, z)} positions that were probed during the print leveling setup. ///