Change SettingsValid to ValidateSettings extension method
This commit is contained in:
parent
b304519061
commit
d6bcb515ce
6 changed files with 10 additions and 10 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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<ValidationError> SettingsValid(PrinterConfig printer)
|
||||
public static List<ValidationError> 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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue