From d6bcb515ce063ae363785da0ab7eccbaeb3af8bc Mon Sep 17 00:00:00 2001 From: John Lewin Date: Fri, 4 Jan 2019 18:25:33 -0800 Subject: [PATCH] Change SettingsValid to ValidateSettings extension method --- MatterControlLib/ApplicationView/ApplicationController.cs | 2 +- MatterControlLib/ApplicationView/SettingsValidation.cs | 6 +++--- MatterControlLib/DesignTools/Operations/CurveObject3D.cs | 6 +++--- MatterControlLib/Library/Export/GCodeExport.cs | 2 +- MatterControlLib/PartPreviewWindow/PrinterTabPage.cs | 2 +- .../PartPreviewWindow/View3D/PrinterBar/SliceButton.cs | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/MatterControlLib/ApplicationView/ApplicationController.cs b/MatterControlLib/ApplicationView/ApplicationController.cs index a0a3c16fc..d853bf8c6 100644 --- a/MatterControlLib/ApplicationView/ApplicationController.cs +++ b/MatterControlLib/ApplicationView/ApplicationController.cs @@ -2251,7 +2251,7 @@ namespace MatterHackers.MatterControl printer.Connection.PrintingItemName = printItemName; - var errors = SettingsValidation.SettingsValid(printer); + var errors = printer.ValidateSettings(); if(errors.Count > 0) { this.ShowValidationErrors("Export Error".Localize(), errors); diff --git a/MatterControlLib/ApplicationView/SettingsValidation.cs b/MatterControlLib/ApplicationView/SettingsValidation.cs index 393ca4805..9ca2deabf 100644 --- a/MatterControlLib/ApplicationView/SettingsValidation.cs +++ b/MatterControlLib/ApplicationView/SettingsValidation.cs @@ -1,5 +1,5 @@ /* -Copyright (c) 2018, Lars Brubaker +Copyright (c) 2019, Lars Brubaker, John Lewin All rights reserved. Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ namespace MatterHackers.MatterControl { public static class SettingsValidation { - public static List SettingsValid(PrinterConfig printer) + public static List ValidateSettings(this PrinterConfig printer) { var settings = printer.Settings; @@ -289,7 +289,7 @@ namespace MatterHackers.MatterControl }); } - // marlin firmware can only take a max of 128 bytes in a single instrection, make sure no lines are longer than that + // marlin firmware can only take a max of 128 bytes in a single instruction, make sure no lines are longer than that ValidateGCodeLinesShortEnough(SettingsKey.cancel_gcode, printer, errors); ValidateGCodeLinesShortEnough(SettingsKey.connect_gcode, printer, errors); ValidateGCodeLinesShortEnough(SettingsKey.end_gcode, printer, errors); diff --git a/MatterControlLib/DesignTools/Operations/CurveObject3D.cs b/MatterControlLib/DesignTools/Operations/CurveObject3D.cs index 9bca64934..dabc20270 100644 --- a/MatterControlLib/DesignTools/Operations/CurveObject3D.cs +++ b/MatterControlLib/DesignTools/Operations/CurveObject3D.cs @@ -117,10 +117,10 @@ namespace MatterHackers.MatterControl.DesignTools [Range(3, 360, ErrorMessage = "Value for {0} must be between {1} and {2}.")] [Description("Ensurs the rotated part has a minimum number of sides per complete rotation")] public double MinSidesPerRotation { get; set; } = 3; - + // holds where we rotate the object Vector2 rotationCenter; - + public CurveObject3D() { Name = "Curve".Localize(); @@ -267,7 +267,7 @@ namespace MatterHackers.MatterControl.DesignTools && layer.Scene.SelectedItem != null && layer.Scene.SelectedItem.DescendantsAndSelf().Where((i) => i == this).Any()) { - // we want to measure the + // we want to measure the var currentMatrixInv = Matrix.Inverted; var aabb = this.GetAxisAlignedBoundingBox(currentMatrixInv); diff --git a/MatterControlLib/Library/Export/GCodeExport.cs b/MatterControlLib/Library/Export/GCodeExport.cs index a62fce913..27b0774c2 100644 --- a/MatterControlLib/Library/Export/GCodeExport.cs +++ b/MatterControlLib/Library/Export/GCodeExport.cs @@ -217,7 +217,7 @@ namespace MatterHackers.MatterControl.Library.Export printer.Settings.SetValue(SettingsKey.spiral_vase, "1"); } - var errors = SettingsValidation.SettingsValid(printer); + var errors = printer.ValidateSettings(); if(errors.Count > 0) { diff --git a/MatterControlLib/PartPreviewWindow/PrinterTabPage.cs b/MatterControlLib/PartPreviewWindow/PrinterTabPage.cs index f0d92f14d..d9ef9d035 100644 --- a/MatterControlLib/PartPreviewWindow/PrinterTabPage.cs +++ b/MatterControlLib/PartPreviewWindow/PrinterTabPage.cs @@ -543,7 +543,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow bool doSlicing = !activelySlicing && printer.Bed.EditContext.SourceItem != null; if (doSlicing) { - var errors = SettingsValidation.SettingsValid(printer); + var errors = printer.ValidateSettings(); if(errors.Count > 0) { doSlicing = false; diff --git a/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/SliceButton.cs b/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/SliceButton.cs index 9e74c071b..d3f7129f2 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/SliceButton.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/PrinterBar/SliceButton.cs @@ -102,7 +102,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow bool doSlicing = !activelySlicing && printer.Bed.EditContext.SourceItem != null; if (doSlicing) { - var errors = SettingsValidation.SettingsValid(printer); + var errors = printer.ValidateSettings(); if (errors.Count > 0) { doSlicing = false;