From cebc48ba3bf281af64b4aed5e8a432bfcebf5970 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Thu, 14 Sep 2017 14:11:49 -0700 Subject: [PATCH] Use consistent format for SliceSetting -> PresentationName - Enforce with test --- StaticData/SliceSettings/Properties.json | 8 ++++---- .../MatterControl/SettingsParseTests.cs | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/StaticData/SliceSettings/Properties.json b/StaticData/SliceSettings/Properties.json index f7b0663ba..d55901dc2 100644 --- a/StaticData/SliceSettings/Properties.json +++ b/StaticData/SliceSettings/Properties.json @@ -34,7 +34,7 @@ }, { "SlicerConfigName": "bottom_solid_layers", - "PresentationName": "Bottom Solid Layers:", + "PresentationName": "Bottom Solid Layers", "HelpText": "The number of layers or the distance in millimeters to solid fill on the bottom surface(s) of the object. Add mm to the end of the number to specify distance in millimeters.", "DataEditType": "INT_OR_MM", "ExtraSettings": "count or mm", @@ -42,7 +42,7 @@ }, { "SlicerConfigName": "layer_to_pause", - "PresentationName": "Layer(s) To Pause:", + "PresentationName": "Layer(s) To Pause", "HelpText": "The layer(s) at which the print will pause, allowing for a change in filament. Leave blank to disable. To pause on multiple layers, separate the layer numbers with semicolons. For example: \"16; 37\".", "DataEditType": "STRING", "ResetAtEndOfPrint": true, @@ -214,7 +214,7 @@ }, { "SlicerConfigName": "extra_perimeters", - "PresentationName": "Generate Extra Perimeters When Needed:", + "PresentationName": "Generate Extra Perimeters When Needed", "HelpText": "Allow slicer to generate extra perimeters when needed for sloping walls.", "DataEditType": "CHECK_BOX", "DefaultValue": "1" @@ -1659,7 +1659,7 @@ }, { "SlicerConfigName": "top_solid_layers", - "PresentationName": "Top Solid Layers:", + "PresentationName": "Top Solid Layers", "HelpText": "The number of layers, or the distance in millimeters, to solid fill on the top surface(s) of the object. Add mm to the end of the number to specify distance in millimeters.", "DataEditType": "INT_OR_MM", "ExtraSettings": "count or mm", diff --git a/Tests/MatterControl.Tests/MatterControl/SettingsParseTests.cs b/Tests/MatterControl.Tests/MatterControl/SettingsParseTests.cs index 640ebdd9a..fa99704a7 100644 --- a/Tests/MatterControl.Tests/MatterControl/SettingsParseTests.cs +++ b/Tests/MatterControl.Tests/MatterControl/SettingsParseTests.cs @@ -239,6 +239,22 @@ namespace MatterControl.Tests.MatterControl } } + [Test] + public void PresentationNamesLackColon() + { + AggContext.StaticData = new FileSystemStaticData(TestContext.CurrentContext.ResolveProjectPath(4, "StaticData")); + MatterControlUtilities.OverrideAppDataLocation(TestContext.CurrentContext.ResolveProjectPath(4)); + + string propertiesFileContents = AggContext.StaticData.ReadAllText(Path.Combine("SliceSettings", "Properties.json")); + var allSettings = JsonConvert.DeserializeObject>(propertiesFileContents); + + foreach (var setting in allSettings) + { + // TargetSetting source field must be defined/known + Assert.IsFalse(setting.PresentationName.Trim().EndsWith(":"), $"Presentation name should not end with trailing colon: '{setting.PresentationName}'"); + } + } + PrinterSettings GetProfile(string[] settings) { Dictionary dictionary = new Dictionary();