From bf0feb805caac533dac58da6df2077b82225eafa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiago=20Concei=C3=A7=C3=A3o?= Date: Fri, 24 Jul 2020 04:38:44 +0100 Subject: [PATCH] v0.6.3.2 * (Add) Tool: Layer Re-Height - Allow change layer height * (Add) Setting: Gap closing default iterations * (Add) Setting: Noise removal default iterations * (Add) Setting: Repair layers and islands by default * (Add) Setting: Remove empty layers by default * (Add) Setting: Repair resin traps by default * (Change) Setting: "Reset to Defaults" changed to "Reset All Settings" * (Fix) CWS: Lack of ';' on GCode was preventing printer from printing --- CHANGELOG.md | 11 ++ UVtools.Core/FileFormats/CWSFile.cs | 9 +- UVtools.Core/FileFormats/ChituboxFile.cs | 6 +- UVtools.Core/FileFormats/ChituboxZipFile.cs | 7 +- UVtools.Core/FileFormats/FileFormat.cs | 2 +- UVtools.Core/FileFormats/IFileFormat.cs | 2 +- UVtools.Core/FileFormats/ImageFile.cs | 2 +- UVtools.Core/FileFormats/PHZFile.cs | 6 +- UVtools.Core/FileFormats/PWSFile.cs | 6 +- UVtools.Core/FileFormats/SL1File.cs | 6 +- UVtools.Core/FileFormats/UVJFile.cs | 6 +- UVtools.Core/FileFormats/ZCodexFile.cs | 7 +- UVtools.Core/Layer/Layer.cs | 10 +- UVtools.Core/Layer/LayerManager.cs | 59 ++++++++ .../Operations/OperationLayerReHeight.cs | 25 +++ UVtools.Core/UVtools.Core.csproj | 2 +- UVtools.GUI/App.config | 15 ++ UVtools.GUI/Forms/FrmInputBox.cs | 1 + UVtools.GUI/Forms/FrmRepairLayers.cs | 9 +- UVtools.GUI/Forms/FrmSettings.Designer.cs | 143 ++++++++++++++++-- UVtools.GUI/Forms/FrmSettings.cs | 12 ++ .../Forms/FrmToolLayerReHeight.Designer.cs | 20 +-- UVtools.GUI/Forms/FrmToolLayerReHeight.cs | 37 +++-- UVtools.GUI/Forms/FrmToolLayerReHeight.resx | 3 +- UVtools.GUI/FrmMain.Designer.cs | 1 - UVtools.GUI/FrmMain.cs | 44 +++++- UVtools.GUI/FrmMain.resx | 92 +++++------ UVtools.GUI/Properties/AssemblyInfo.cs | 4 +- UVtools.GUI/Properties/Settings.Designer.cs | 60 ++++++++ UVtools.GUI/Properties/Settings.settings | 15 ++ 30 files changed, 521 insertions(+), 101 deletions(-) create mode 100644 UVtools.Core/Operations/OperationLayerReHeight.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c5f0da9..b2039676 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 24/07/2020 - v0.6.3.2 + +* (Add) Tool: Layer Re-Height - Allow change layer height +* (Add) Setting: Gap closing default iterations +* (Add) Setting: Noise removal default iterations +* (Add) Setting: Repair layers and islands by default +* (Add) Setting: Remove empty layers by default +* (Add) Setting: Repair resin traps by default +* (Change) Setting: "Reset to Defaults" changed to "Reset All Settings" +* (Fix) CWS: Lack of ';' on GCode was preventing printer from printing + ## 20/07/2020 - v0.6.3.1 * (Add) Preview: Allow import images from disk and replace preview image diff --git a/UVtools.Core/FileFormats/CWSFile.cs b/UVtools.Core/FileFormats/CWSFile.cs index 940aaae7..7f4daebb 100644 --- a/UVtools.Core/FileFormats/CWSFile.cs +++ b/UVtools.Core/FileFormats/CWSFile.cs @@ -143,7 +143,11 @@ public class Slice public override uint ResolutionY => SliceSettings.Yres; public override byte AntiAliasing => (byte) OutputSettings.AntiAliasingValue; - public override float LayerHeight => SliceSettings.Thickness; + public override float LayerHeight + { + get => SliceSettings.Thickness; + set => OutputSettings.LayerThickness = SliceSettings.Thickness = value; + } public override uint LayerCount { @@ -151,6 +155,7 @@ public override uint LayerCount { OutputSettings.LayersNum = LayerCount; SliceSettings.LayersNum = LayerCount; + UpdateGCode(); } } @@ -581,7 +586,7 @@ private void UpdateGCode() string arch = Environment.Is64BitOperatingSystem ? "64-bits" : "32-bits"; GCode = new StringBuilder(); GCode.AppendLine($"; {About.Website} {About.Software} {Assembly.GetExecutingAssembly().GetName().Version} {arch} {DateTime.Now}"); - GCode.AppendLine("(****Build and Slicing Parameters * ***)"); + GCode.AppendLine(";(****Build and Slicing Parameters ****)"); foreach (var propertyInfo in OutputSettings.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) { diff --git a/UVtools.Core/FileFormats/ChituboxFile.cs b/UVtools.Core/FileFormats/ChituboxFile.cs index b3ca3c32..7a517027 100644 --- a/UVtools.Core/FileFormats/ChituboxFile.cs +++ b/UVtools.Core/FileFormats/ChituboxFile.cs @@ -944,7 +944,11 @@ public byte[] Read(byte[] input) public override uint ResolutionY => HeaderSettings.ResolutionY; public override byte AntiAliasing => (byte) (IsCbtFile ? SlicerInfoSettings.AntiAliasLevel : HeaderSettings.AntiAliasLevel); - public override float LayerHeight => HeaderSettings.LayerHeightMilimeter; + public override float LayerHeight + { + get => HeaderSettings.LayerHeightMilimeter; + set => HeaderSettings.LayerHeightMilimeter = value; + } public override uint LayerCount { diff --git a/UVtools.Core/FileFormats/ChituboxZipFile.cs b/UVtools.Core/FileFormats/ChituboxZipFile.cs index f7dc67e7..7c7eddaa 100644 --- a/UVtools.Core/FileFormats/ChituboxZipFile.cs +++ b/UVtools.Core/FileFormats/ChituboxZipFile.cs @@ -124,13 +124,18 @@ public class Header public override uint ResolutionY => HeaderSettings.ResolutionY; public override byte AntiAliasing => HeaderSettings.AntiAliasing; - public override float LayerHeight => HeaderSettings.LayerHeight; + public override float LayerHeight + { + get => HeaderSettings.LayerHeight; + set => HeaderSettings.LayerHeight = value; + } public override uint LayerCount { set { HeaderSettings.LayerCount = LayerCount; + UpdateGCode(); } } diff --git a/UVtools.Core/FileFormats/FileFormat.cs b/UVtools.Core/FileFormats/FileFormat.cs index 442f0e66..ea2cbd79 100644 --- a/UVtools.Core/FileFormats/FileFormat.cs +++ b/UVtools.Core/FileFormats/FileFormat.cs @@ -280,7 +280,7 @@ public bool RequireFullEncode public bool HaveAntiAliasing => AntiAliasing > 1; public abstract byte AntiAliasing { get; } - public abstract float LayerHeight { get; } + public abstract float LayerHeight { get; set; } public float TotalHeight => LayerCount == 0 ? 0 : this[LayerCount - 1].PositionZ; //(float)Math.Round(LayerCount * LayerHeight, 2); diff --git a/UVtools.Core/FileFormats/IFileFormat.cs b/UVtools.Core/FileFormats/IFileFormat.cs index 2db8d317..afeaf399 100644 --- a/UVtools.Core/FileFormats/IFileFormat.cs +++ b/UVtools.Core/FileFormats/IFileFormat.cs @@ -102,7 +102,7 @@ public interface IFileFormat /// /// Gets Layer Height in mm /// - float LayerHeight { get; } + float LayerHeight { get; set; } /// /// Gets Total Height in mm diff --git a/UVtools.Core/FileFormats/ImageFile.cs b/UVtools.Core/FileFormats/ImageFile.cs index dd0dacbd..661ef33c 100644 --- a/UVtools.Core/FileFormats/ImageFile.cs +++ b/UVtools.Core/FileFormats/ImageFile.cs @@ -28,7 +28,7 @@ public class ImageFile : FileFormat public override uint ResolutionX => (uint)ImageMat.Width; public override uint ResolutionY => (uint)ImageMat.Height; public override byte AntiAliasing { get; } = 1; - public override float LayerHeight { get; } = 0; + public override float LayerHeight { get; set; } = 0; public override ushort InitialLayerCount { get; } = 1; public override float InitialExposureTime { get; } = 0; public override float LayerExposureTime { get; } = 0; diff --git a/UVtools.Core/FileFormats/PHZFile.cs b/UVtools.Core/FileFormats/PHZFile.cs index 72c8b069..975971d1 100644 --- a/UVtools.Core/FileFormats/PHZFile.cs +++ b/UVtools.Core/FileFormats/PHZFile.cs @@ -716,7 +716,11 @@ public byte[] Read(byte[] input) public override uint ResolutionY => HeaderSettings.ResolutionY; public override byte AntiAliasing => (byte) HeaderSettings.AntiAliasLevelInfo; - public override float LayerHeight => HeaderSettings.LayerHeightMilimeter; + public override float LayerHeight + { + get => HeaderSettings.LayerHeightMilimeter; + set => HeaderSettings.LayerHeightMilimeter = value; + } public override uint LayerCount { diff --git a/UVtools.Core/FileFormats/PWSFile.cs b/UVtools.Core/FileFormats/PWSFile.cs index 33cd78f0..af871444 100644 --- a/UVtools.Core/FileFormats/PWSFile.cs +++ b/UVtools.Core/FileFormats/PWSFile.cs @@ -803,7 +803,11 @@ public void Validate() public override uint ResolutionY => HeaderSettings.ResolutionY; public override byte AntiAliasing => (byte) HeaderSettings.AntiAliasing; - public override float LayerHeight => HeaderSettings.LayerHeight; + public override float LayerHeight + { + get => HeaderSettings.LayerHeight; + set => HeaderSettings.LayerHeight = value; + } public override uint LayerCount { diff --git a/UVtools.Core/FileFormats/SL1File.cs b/UVtools.Core/FileFormats/SL1File.cs index 4b9261f8..16adcb6a 100644 --- a/UVtools.Core/FileFormats/SL1File.cs +++ b/UVtools.Core/FileFormats/SL1File.cs @@ -319,7 +319,11 @@ public override string ToString() public override uint ResolutionY => PrinterSettings.DisplayPixelsY; public override byte AntiAliasing => (byte) (PrinterSettings.GammaCorrection > 0 ? LookupCustomValue(Keyword_AntiAliasing, 4) : 1); - public override float LayerHeight => OutputConfigSettings.LayerHeight; + public override float LayerHeight + { + get => OutputConfigSettings.LayerHeight; + set => OutputConfigSettings.LayerHeight = value; + } public override uint LayerCount { diff --git a/UVtools.Core/FileFormats/UVJFile.cs b/UVtools.Core/FileFormats/UVJFile.cs index d8ebf37d..25aad40c 100644 --- a/UVtools.Core/FileFormats/UVJFile.cs +++ b/UVtools.Core/FileFormats/UVJFile.cs @@ -161,7 +161,11 @@ public override string ToString() public override uint ResolutionY => JsonSettings.Properties.Size.Y; public override byte AntiAliasing => JsonSettings.Properties.AntiAliasLevel; - public override float LayerHeight => JsonSettings.Properties.Size.LayerHeight; + public override float LayerHeight + { + get => JsonSettings.Properties.Size.LayerHeight; + set => JsonSettings.Properties.Size.LayerHeight = value; + } public override uint LayerCount { diff --git a/UVtools.Core/FileFormats/ZCodexFile.cs b/UVtools.Core/FileFormats/ZCodexFile.cs index 64e5ce5a..e6b6b965 100644 --- a/UVtools.Core/FileFormats/ZCodexFile.cs +++ b/UVtools.Core/FileFormats/ZCodexFile.cs @@ -172,7 +172,11 @@ public class LayerData public override uint ResolutionY => 2560; public override byte AntiAliasing => UserSettings.AntiAliasing; - public override float LayerHeight => ResinMetadataSettings.LayerThickness; + public override float LayerHeight + { + get => ResinMetadataSettings.LayerThickness; + set => ResinMetadataSettings.LayerThickness = value; + } public override uint LayerCount { @@ -180,6 +184,7 @@ public override uint LayerCount { UserSettings.MaxLayer = LayerCount - 1; ResinMetadataSettings.TotalLayersCount = LayerCount; + UpdateGCode(); } } diff --git a/UVtools.Core/Layer/Layer.cs b/UVtools.Core/Layer/Layer.cs index 015ae732..ed221c1d 100644 --- a/UVtools.Core/Layer/Layer.cs +++ b/UVtools.Core/Layer/Layer.cs @@ -40,7 +40,7 @@ public class Layer : IEquatable, IEquatable /// /// Gets the bounding rectangle for the image area /// - public Rectangle BoundingRectangle { get; private protected set; } = Rectangle.Empty; + public Rectangle BoundingRectangle { get; internal set; } = Rectangle.Empty; /// /// Gets the layer index @@ -781,7 +781,13 @@ public void ToolPattern(OperationPattern settings) public Layer Clone() { - return new Layer(Index, CompressedBytes, Filename, ParentLayerManager); + return new Layer(Index, CompressedBytes, Filename, ParentLayerManager) + { + PositionZ = PositionZ, + ExposureTime = ExposureTime, + BoundingRectangle = BoundingRectangle, + NonZeroPixelCount = NonZeroPixelCount, + }; } #endregion diff --git a/UVtools.Core/Layer/LayerManager.cs b/UVtools.Core/Layer/LayerManager.cs index 8c48dfd1..4cea92eb 100644 --- a/UVtools.Core/Layer/LayerManager.cs +++ b/UVtools.Core/Layer/LayerManager.cs @@ -1437,5 +1437,64 @@ public void RemoveLayer(List layersRemove) BoundingRectangle = Rectangle.Empty; SlicerFile.RequireFullEncode = true; } + + public void ReHeight(OperationLayerReHeight operation, OperationProgress progress = null) + { + if (ReferenceEquals(progress, null)) progress = new OperationProgress(); + progress.Reset("Re-Height", operation.LayerCount); + + var oldLayers = Layers; + + Layers = new Layer[operation.LayerCount]; + + uint newLayerIndex = 0; + for (uint layerIndex = 0; layerIndex < oldLayers.Length; layerIndex++) + { + var oldLayer = oldLayers[layerIndex]; + if (operation.IsDivision) + { + for (byte i = 0; i < operation.Modifier; i++) + { + Layers[newLayerIndex] = + new Layer(newLayerIndex, oldLayer.CompressedBytes, null, this) + { + PositionZ = (float) (operation.LayerHeight * (newLayerIndex + 1)), + ExposureTime = oldLayer.ExposureTime, + BoundingRectangle = oldLayer.BoundingRectangle, + }; + newLayerIndex++; + progress++; + } + } + else + { + using (var mat = oldLayers[layerIndex++].LayerMat) + { + for (byte i = 1; i < operation.Modifier; i++) + { + using (var nextMat = oldLayers[layerIndex++].LayerMat) + { + CvInvoke.Add(mat, nextMat, mat); + } + } + + Layers[newLayerIndex] = new Layer(newLayerIndex, mat, null, this) + { + PositionZ = (float)(operation.LayerHeight * (newLayerIndex + 1)), + ExposureTime = oldLayer.ExposureTime + }; + newLayerIndex++; + layerIndex--; + progress++; + } + } + } + + + SlicerFile.LayerHeight = (float) operation.LayerHeight; + SlicerFile.LayerCount = Count; + BoundingRectangle = Rectangle.Empty; + SlicerFile.RequireFullEncode = true; + } } } diff --git a/UVtools.Core/Operations/OperationLayerReHeight.cs b/UVtools.Core/Operations/OperationLayerReHeight.cs new file mode 100644 index 00000000..404f6462 --- /dev/null +++ b/UVtools.Core/Operations/OperationLayerReHeight.cs @@ -0,0 +1,25 @@ + +namespace UVtools.Core.Operations +{ + public sealed class OperationLayerReHeight + { + public bool IsMultiply { get; } + public bool IsDivision => !IsMultiply; + public byte Modifier { get; } + public decimal LayerHeight { get; } + public uint LayerCount { get; } + + public OperationLayerReHeight(bool isMultiply, byte modifier, decimal layerHeight, uint layerCount) + { + IsMultiply = isMultiply; + Modifier = modifier; + LayerHeight = layerHeight; + LayerCount = layerCount; + } + + public override string ToString() + { + return (IsMultiply ? 'x' : '÷') +$" {Modifier} → {LayerCount} layers at {LayerHeight}mm"; + } + } +} diff --git a/UVtools.Core/UVtools.Core.csproj b/UVtools.Core/UVtools.Core.csproj index 6bf1ebc1..d62a305f 100644 --- a/UVtools.Core/UVtools.Core.csproj +++ b/UVtools.Core/UVtools.Core.csproj @@ -10,7 +10,7 @@ https://github.com/sn4k3/UVtools https://github.com/sn4k3/UVtools MSLA/DLP, file analysis, repair, conversion and manipulation - 0.6.3.1 + 0.6.3.2 Copyright © 2020 PTRTECH UVtools.png AnyCPU;x64 diff --git a/UVtools.GUI/App.config b/UVtools.GUI/App.config index 0bc67657..9e184a84 100644 --- a/UVtools.GUI/App.config +++ b/UVtools.GUI/App.config @@ -174,6 +174,21 @@ True + + 2 + + + 1 + + + True + + + True + + + True + diff --git a/UVtools.GUI/Forms/FrmInputBox.cs b/UVtools.GUI/Forms/FrmInputBox.cs index 83328eda..4788900e 100644 --- a/UVtools.GUI/Forms/FrmInputBox.cs +++ b/UVtools.GUI/Forms/FrmInputBox.cs @@ -7,6 +7,7 @@ */ using System; +using System.Diagnostics; using System.Globalization; using System.Windows.Forms; using UVtools.Core; diff --git a/UVtools.GUI/Forms/FrmRepairLayers.cs b/UVtools.GUI/Forms/FrmRepairLayers.cs index 2351f539..b28d280a 100644 --- a/UVtools.GUI/Forms/FrmRepairLayers.cs +++ b/UVtools.GUI/Forms/FrmRepairLayers.cs @@ -59,14 +59,17 @@ public bool RepairResinTraps #endregion #region Constructors - public FrmRepairLayers(uint defaultClosingIterations = 1, uint defaultOpeningIterations = 1) + public FrmRepairLayers() { InitializeComponent(); DialogResult = DialogResult.Cancel; - ClosingIterations = defaultClosingIterations; - OpeningIterations = defaultOpeningIterations; + ClosingIterations = Properties.Settings.Default.LayerRepairDefaultClosingIterations; + OpeningIterations = Properties.Settings.Default.LayerRepairDefaultOpeningIterations; + RepairIslands = Properties.Settings.Default.LayerRepairLayersIslands; + RemoveEmptyLayers = Properties.Settings.Default.LayerRepairRemoveEmptyLayers; + RepairResinTraps = Properties.Settings.Default.LayerRepairResinTraps; numClosingIterations.Select(); nmLayerRangeEnd.Value = Program.SlicerFile.LayerCount-1; diff --git a/UVtools.GUI/Forms/FrmSettings.Designer.cs b/UVtools.GUI/Forms/FrmSettings.Designer.cs index 5b83b05d..ea5ee4be 100644 --- a/UVtools.GUI/Forms/FrmSettings.Designer.cs +++ b/UVtools.GUI/Forms/FrmSettings.Designer.cs @@ -119,6 +119,7 @@ private void InitializeComponent() this.tbFileSaveNamePreffix = new System.Windows.Forms.TextBox(); this.groupBox4 = new System.Windows.Forms.GroupBox(); this.tabPage2 = new System.Windows.Forms.TabPage(); + this.cbAutoZoomIssues = new System.Windows.Forms.CheckBox(); this.tabPage3 = new System.Windows.Forms.TabPage(); this.tabPage4 = new System.Windows.Forms.TabPage(); this.btnPixelEditorDrainHoleColor = new System.Windows.Forms.Button(); @@ -130,7 +131,14 @@ private void InitializeComponent() this.label23 = new System.Windows.Forms.Label(); this.btnPixelEditorAddPixelColor = new System.Windows.Forms.Button(); this.panel1 = new System.Windows.Forms.Panel(); - this.cbAutoZoomIssues = new System.Windows.Forms.CheckBox(); + this.tabPage5 = new System.Windows.Forms.TabPage(); + this.cbLayerRepairLayersIslands = new System.Windows.Forms.CheckBox(); + this.cbLayerRepairRemoveEmptyLayers = new System.Windows.Forms.CheckBox(); + this.cbLayerRepairResinTraps = new System.Windows.Forms.CheckBox(); + this.nmLayerRepairDefaultClosingIterations = new System.Windows.Forms.NumericUpDown(); + this.label33 = new System.Windows.Forms.Label(); + this.nmLayerRepairDefaultOpeningIterations = new System.Windows.Forms.NumericUpDown(); + this.label34 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.nmOutlineHollowAreasLineThickness)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nmOutlineLayerBoundsLineThickness)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nmOutlinePrintVolumeBoundsLineThickness)).BeginInit(); @@ -154,6 +162,9 @@ private void InitializeComponent() this.tabPage3.SuspendLayout(); this.tabPage4.SuspendLayout(); this.panel1.SuspendLayout(); + this.tabPage5.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nmLayerRepairDefaultClosingIterations)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nmLayerRepairDefaultOpeningIterations)).BeginInit(); this.SuspendLayout(); // // label1 @@ -619,7 +630,7 @@ private void InitializeComponent() this.btnReset.Name = "btnReset"; this.btnReset.Size = new System.Drawing.Size(158, 48); this.btnReset.TabIndex = 16; - this.btnReset.Text = "&Reset to defaults"; + this.btnReset.Text = "&Reset all settings"; this.btnReset.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.btnReset.UseVisualStyleBackColor = true; this.btnReset.Click += new System.EventHandler(this.EventClick); @@ -978,6 +989,7 @@ private void InitializeComponent() this.tabSettings.Controls.Add(this.tabPage2); this.tabSettings.Controls.Add(this.tabPage3); this.tabSettings.Controls.Add(this.tabPage4); + this.tabSettings.Controls.Add(this.tabPage5); this.tabSettings.Dock = System.Windows.Forms.DockStyle.Fill; this.tabSettings.Location = new System.Drawing.Point(0, 0); this.tabSettings.Name = "tabSettings"; @@ -1293,6 +1305,16 @@ private void InitializeComponent() this.tabPage2.Text = "Layer Preview"; this.tabPage2.UseVisualStyleBackColor = true; // + // cbAutoZoomIssues + // + this.cbAutoZoomIssues.AutoSize = true; + this.cbAutoZoomIssues.Location = new System.Drawing.Point(11, 305); + this.cbAutoZoomIssues.Name = "cbAutoZoomIssues"; + this.cbAutoZoomIssues.Size = new System.Drawing.Size(395, 22); + this.cbAutoZoomIssues.TabIndex = 35; + this.cbAutoZoomIssues.Text = "Auto zoom to issues and drawings portrait area (best fit)"; + this.cbAutoZoomIssues.UseVisualStyleBackColor = true; + // // tabPage3 // this.tabPage3.Controls.Add(this.groupBox3); @@ -1431,15 +1453,104 @@ private void InitializeComponent() this.panel1.Size = new System.Drawing.Size(624, 77); this.panel1.TabIndex = 19; // - // cbAutoZoomIssues + // tabPage5 + // + this.tabPage5.Controls.Add(this.nmLayerRepairDefaultOpeningIterations); + this.tabPage5.Controls.Add(this.label34); + this.tabPage5.Controls.Add(this.nmLayerRepairDefaultClosingIterations); + this.tabPage5.Controls.Add(this.label33); + this.tabPage5.Controls.Add(this.cbLayerRepairResinTraps); + this.tabPage5.Controls.Add(this.cbLayerRepairRemoveEmptyLayers); + this.tabPage5.Controls.Add(this.cbLayerRepairLayersIslands); + this.tabPage5.Location = new System.Drawing.Point(4, 27); + this.tabPage5.Name = "tabPage5"; + this.tabPage5.Padding = new System.Windows.Forms.Padding(3); + this.tabPage5.Size = new System.Drawing.Size(616, 498); + this.tabPage5.TabIndex = 4; + this.tabPage5.Text = "Layer Repair"; + this.tabPage5.UseVisualStyleBackColor = true; + // + // cbLayerRepairLayersIslands + // + this.cbLayerRepairLayersIslands.AutoSize = true; + this.cbLayerRepairLayersIslands.Location = new System.Drawing.Point(6, 66); + this.cbLayerRepairLayersIslands.Name = "cbLayerRepairLayersIslands"; + this.cbLayerRepairLayersIslands.Size = new System.Drawing.Size(257, 22); + this.cbLayerRepairLayersIslands.TabIndex = 15; + this.cbLayerRepairLayersIslands.Text = "Repair layers and islands by default"; + this.cbLayerRepairLayersIslands.UseVisualStyleBackColor = true; + // + // cbLayerRepairRemoveEmptyLayers + // + this.cbLayerRepairRemoveEmptyLayers.AutoSize = true; + this.cbLayerRepairRemoveEmptyLayers.Location = new System.Drawing.Point(6, 94); + this.cbLayerRepairRemoveEmptyLayers.Name = "cbLayerRepairRemoveEmptyLayers"; + this.cbLayerRepairRemoveEmptyLayers.Size = new System.Drawing.Size(236, 22); + this.cbLayerRepairRemoveEmptyLayers.TabIndex = 16; + this.cbLayerRepairRemoveEmptyLayers.Text = "Remove empty layers by default"; + this.cbLayerRepairRemoveEmptyLayers.UseVisualStyleBackColor = true; + // + // cbLayerRepairResinTraps + // + this.cbLayerRepairResinTraps.AutoSize = true; + this.cbLayerRepairResinTraps.Location = new System.Drawing.Point(6, 122); + this.cbLayerRepairResinTraps.Name = "cbLayerRepairResinTraps"; + this.cbLayerRepairResinTraps.Size = new System.Drawing.Size(209, 22); + this.cbLayerRepairResinTraps.TabIndex = 17; + this.cbLayerRepairResinTraps.Text = "Repair resin traps by default"; + this.cbLayerRepairResinTraps.UseVisualStyleBackColor = true; + // + // nmLayerRepairDefaultClosingIterations + // + this.nmLayerRepairDefaultClosingIterations.Location = new System.Drawing.Point(6, 6); + this.nmLayerRepairDefaultClosingIterations.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.nmLayerRepairDefaultClosingIterations.Name = "nmLayerRepairDefaultClosingIterations"; + this.nmLayerRepairDefaultClosingIterations.Size = new System.Drawing.Size(57, 24); + this.nmLayerRepairDefaultClosingIterations.TabIndex = 30; + this.nmLayerRepairDefaultClosingIterations.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); // - this.cbAutoZoomIssues.AutoSize = true; - this.cbAutoZoomIssues.Location = new System.Drawing.Point(11, 305); - this.cbAutoZoomIssues.Name = "cbAutoZoomIssues"; - this.cbAutoZoomIssues.Size = new System.Drawing.Size(395, 22); - this.cbAutoZoomIssues.TabIndex = 35; - this.cbAutoZoomIssues.Text = "Auto zoom to issues and drawings portrait area (best fit)"; - this.cbAutoZoomIssues.UseVisualStyleBackColor = true; + // label33 + // + this.label33.AutoSize = true; + this.label33.Location = new System.Drawing.Point(69, 9); + this.label33.Name = "label33"; + this.label33.Size = new System.Drawing.Size(198, 18); + this.label33.TabIndex = 31; + this.label33.Text = "Gap closing default iterations"; + // + // nmLayerRepairDefaultOpeningIterations + // + this.nmLayerRepairDefaultOpeningIterations.Location = new System.Drawing.Point(6, 36); + this.nmLayerRepairDefaultOpeningIterations.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.nmLayerRepairDefaultOpeningIterations.Name = "nmLayerRepairDefaultOpeningIterations"; + this.nmLayerRepairDefaultOpeningIterations.Size = new System.Drawing.Size(57, 24); + this.nmLayerRepairDefaultOpeningIterations.TabIndex = 32; + this.nmLayerRepairDefaultOpeningIterations.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + // + // label34 + // + this.label34.AutoSize = true; + this.label34.Location = new System.Drawing.Point(69, 39); + this.label34.Name = "label34"; + this.label34.Size = new System.Drawing.Size(215, 18); + this.label34.TabIndex = 33; + this.label34.Text = "Noise removal default iterations"; // // FrmSettings // @@ -1488,6 +1599,10 @@ private void InitializeComponent() this.tabPage4.ResumeLayout(false); this.tabPage4.PerformLayout(); this.panel1.ResumeLayout(false); + this.tabPage5.ResumeLayout(false); + this.tabPage5.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nmLayerRepairDefaultClosingIterations)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nmLayerRepairDefaultOpeningIterations)).EndInit(); this.ResumeLayout(false); } @@ -1596,5 +1711,13 @@ private void InitializeComponent() private System.Windows.Forms.Label label32; private System.Windows.Forms.TextBox tbFileExtractDefaultDirectory; private System.Windows.Forms.CheckBox cbAutoZoomIssues; + private System.Windows.Forms.TabPage tabPage5; + private System.Windows.Forms.CheckBox cbLayerRepairLayersIslands; + private System.Windows.Forms.CheckBox cbLayerRepairRemoveEmptyLayers; + private System.Windows.Forms.CheckBox cbLayerRepairResinTraps; + private System.Windows.Forms.NumericUpDown nmLayerRepairDefaultClosingIterations; + private System.Windows.Forms.Label label33; + private System.Windows.Forms.NumericUpDown nmLayerRepairDefaultOpeningIterations; + private System.Windows.Forms.Label label34; } } \ No newline at end of file diff --git a/UVtools.GUI/Forms/FrmSettings.cs b/UVtools.GUI/Forms/FrmSettings.cs index 71e72856..d6033f99 100644 --- a/UVtools.GUI/Forms/FrmSettings.cs +++ b/UVtools.GUI/Forms/FrmSettings.cs @@ -84,6 +84,12 @@ public void Init() btnPixelEditorRemovePixelColor.BackColor = Settings.Default.PixelEditorRemovePixelColor; btnPixelEditorSupportColor.BackColor = Settings.Default.PixelEditorSupportColor; btnPixelEditorDrainHoleColor.BackColor = Settings.Default.PixelEditorDrainHoleColor; + + nmLayerRepairDefaultClosingIterations.Value = Settings.Default.LayerRepairDefaultClosingIterations; + nmLayerRepairDefaultOpeningIterations.Value = Settings.Default.LayerRepairDefaultOpeningIterations; + cbLayerRepairLayersIslands.Checked = Settings.Default.LayerRepairLayersIslands; + cbLayerRepairRemoveEmptyLayers.Checked = Settings.Default.LayerRepairRemoveEmptyLayers; + cbLayerRepairResinTraps.Checked = Settings.Default.LayerRepairResinTraps; } catch (Exception ex) { @@ -228,6 +234,12 @@ private void EventClick(object sender, EventArgs e) Settings.Default.PixelEditorSupportColor = btnPixelEditorSupportColor.BackColor; Settings.Default.PixelEditorDrainHoleColor = btnPixelEditorDrainHoleColor.BackColor; + Settings.Default.LayerRepairDefaultClosingIterations = (byte) nmLayerRepairDefaultClosingIterations.Value; + Settings.Default.LayerRepairDefaultOpeningIterations = (byte) nmLayerRepairDefaultOpeningIterations.Value; + Settings.Default.LayerRepairLayersIslands = cbLayerRepairLayersIslands.Checked; + Settings.Default.LayerRepairRemoveEmptyLayers = cbLayerRepairRemoveEmptyLayers.Checked; + Settings.Default.LayerRepairResinTraps = cbLayerRepairResinTraps.Checked; + Settings.Default.Save(); DialogResult = DialogResult.OK; return; diff --git a/UVtools.GUI/Forms/FrmToolLayerReHeight.Designer.cs b/UVtools.GUI/Forms/FrmToolLayerReHeight.Designer.cs index 81a392d7..9c39680b 100644 --- a/UVtools.GUI/Forms/FrmToolLayerReHeight.Designer.cs +++ b/UVtools.GUI/Forms/FrmToolLayerReHeight.Designer.cs @@ -44,7 +44,7 @@ private void InitializeComponent() this.lbDescription.Location = new System.Drawing.Point(13, 14); this.lbDescription.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lbDescription.Name = "lbDescription"; - this.lbDescription.Size = new System.Drawing.Size(584, 95); + this.lbDescription.Size = new System.Drawing.Size(584, 118); this.lbDescription.TabIndex = 0; this.lbDescription.Text = resources.GetString("lbDescription.Text"); // @@ -54,7 +54,7 @@ private void InitializeComponent() this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnCancel.Image = global::UVtools.GUI.Properties.Resources.Cancel_24x24; this.btnCancel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.btnCancel.Location = new System.Drawing.Point(434, 324); + this.btnCancel.Location = new System.Drawing.Point(434, 202); this.btnCancel.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(150, 48); @@ -69,7 +69,7 @@ private void InitializeComponent() this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnOk.Image = global::UVtools.GUI.Properties.Resources.Ok_24x24; this.btnOk.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.btnOk.Location = new System.Drawing.Point(276, 324); + this.btnOk.Location = new System.Drawing.Point(276, 202); this.btnOk.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.btnOk.Name = "btnOk"; this.btnOk.Size = new System.Drawing.Size(150, 48); @@ -82,7 +82,7 @@ private void InitializeComponent() // lbCurrent // this.lbCurrent.AutoSize = true; - this.lbCurrent.Location = new System.Drawing.Point(13, 109); + this.lbCurrent.Location = new System.Drawing.Point(13, 132); this.lbCurrent.Name = "lbCurrent"; this.lbCurrent.Size = new System.Drawing.Size(234, 20); this.lbCurrent.TabIndex = 7; @@ -91,19 +91,19 @@ private void InitializeComponent() // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(13, 136); + this.label2.Location = new System.Drawing.Point(13, 159); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(75, 20); + this.label2.Size = new System.Drawing.Size(69, 20); this.label2.TabIndex = 8; - this.label2.Text = "Multiplier:"; + this.label2.Text = "Modifier:"; // // cbMultiplier // this.cbMultiplier.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbMultiplier.FormattingEnabled = true; - this.cbMultiplier.Location = new System.Drawing.Point(126, 132); + this.cbMultiplier.Location = new System.Drawing.Point(126, 155); this.cbMultiplier.Name = "cbMultiplier"; - this.cbMultiplier.Size = new System.Drawing.Size(121, 28); + this.cbMultiplier.Size = new System.Drawing.Size(458, 28); this.cbMultiplier.TabIndex = 9; // // FrmToolLayerReHeight @@ -111,7 +111,7 @@ private void InitializeComponent() this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.btnCancel; - this.ClientSize = new System.Drawing.Size(599, 386); + this.ClientSize = new System.Drawing.Size(599, 264); this.Controls.Add(this.cbMultiplier); this.Controls.Add(this.label2); this.Controls.Add(this.lbCurrent); diff --git a/UVtools.GUI/Forms/FrmToolLayerReHeight.cs b/UVtools.GUI/Forms/FrmToolLayerReHeight.cs index d7d0c862..9727ad9a 100644 --- a/UVtools.GUI/Forms/FrmToolLayerReHeight.cs +++ b/UVtools.GUI/Forms/FrmToolLayerReHeight.cs @@ -9,6 +9,7 @@ using System; using System.Globalization; using System.Windows.Forms; +using UVtools.Core.Operations; namespace UVtools.GUI.Forms @@ -18,6 +19,8 @@ public partial class FrmToolLayerReHeight : Form private uint LayerCount { get; } private decimal LayerHeight { get; } + public OperationLayerReHeight Operation => cbMultiplier.SelectedItem as OperationLayerReHeight; + #region Constructors public FrmToolLayerReHeight(uint layerCount, float layerHeight) { @@ -29,28 +32,42 @@ public FrmToolLayerReHeight(uint layerCount, float layerHeight) lbCurrent.Text = $"Current layers: {LayerCount} at {layerHeight}mm"; - for (byte i = 2; i < 255; i++) + for (byte i = 2; i < 255; i++) // Lower { - var countStr = (LayerCount / (decimal)i).ToString(); - if (countStr.IndexOf(".") >= 0) continue; // Cant multiply layers - countStr = (LayerHeight / i).ToString(); - int decimalCount = countStr.Substring(countStr.IndexOf(".")).Length; + if (LayerHeight / i < 0.01m) break; + var countStr = (LayerCount / (decimal)i).ToString(CultureInfo.InvariantCulture); + if (countStr.IndexOf(".", StringComparison.Ordinal) >= 0) continue; // Cant multiply layers + countStr = (LayerHeight / i).ToString(CultureInfo.InvariantCulture); + int decimalCount = countStr.Substring(countStr.IndexOf(".", StringComparison.Ordinal)).Length-1; if (decimalCount > 2) continue; // Cant multiply height - cbMultiplier.Items.Add($"/ {i}"); + OperationLayerReHeight operation = new OperationLayerReHeight(false, i, LayerHeight / i, LayerCount * i); + cbMultiplier.Items.Add(operation); } - for (byte i = 2; i < 255; i++) + for (byte i = 2; i < 255; i++) // Higher { + if (LayerHeight * i > 0.2m) break; var countStr = (LayerCount / (decimal)i).ToString(CultureInfo.InvariantCulture); if (countStr.IndexOf(".", StringComparison.Ordinal) >= 0) continue; // Cant multiply layers - if(LayerHeight * i > 0.2m) break; + countStr = (LayerHeight * i).ToString(CultureInfo.InvariantCulture); - int decimalCount = countStr.Substring(countStr.IndexOf(".", StringComparison.Ordinal)).Length; + int decimalCount = countStr.Substring(countStr.IndexOf(".", StringComparison.Ordinal)).Length-1; if (decimalCount > 2) continue; // Cant multiply height - cbMultiplier.Items.Add($"x {i}"); + OperationLayerReHeight operation = new OperationLayerReHeight(true, i, LayerHeight * i, LayerCount / i); + cbMultiplier.Items.Add(operation); + } + + if (cbMultiplier.Items.Count == 0) + { + MessageBox.Show("No valid configuration to be able to re-height, closing this tool now.", "Not possible to re-height", MessageBoxButtons.OK, MessageBoxIcon.Information); + Close(); + } + else + { + cbMultiplier.SelectedIndex = 0; } } #endregion diff --git a/UVtools.GUI/Forms/FrmToolLayerReHeight.resx b/UVtools.GUI/Forms/FrmToolLayerReHeight.resx index 1be15967..1424c182 100644 --- a/UVtools.GUI/Forms/FrmToolLayerReHeight.resx +++ b/UVtools.GUI/Forms/FrmToolLayerReHeight.resx @@ -120,7 +120,8 @@ Changes layer height. Going lower doesn't give you better XYZ accuracy but will reduce Z lines, layers will be cloned and repeated over Z for the effect. -Going higher will reduce detail, layers will sum times the multiplier for the effect. +Going higher will reduce detail, layers will sum times the modifier for the effect. +Note: Reslice with the new layer height is always preferable diff --git a/UVtools.GUI/FrmMain.Designer.cs b/UVtools.GUI/FrmMain.Designer.cs index d9f9a4f2..85c12c52 100644 --- a/UVtools.GUI/FrmMain.Designer.cs +++ b/UVtools.GUI/FrmMain.Designer.cs @@ -431,7 +431,6 @@ private void InitializeComponent() this.menuToolsLayerReHeight.Name = "menuToolsLayerReHeight"; this.menuToolsLayerReHeight.Size = new System.Drawing.Size(261, 22); this.menuToolsLayerReHeight.Text = "Layer Re-Height"; - this.menuToolsLayerReHeight.Visible = false; this.menuToolsLayerReHeight.Click += new System.EventHandler(this.EventClick); // // menuToolsLayerRemoval diff --git a/UVtools.GUI/FrmMain.cs b/UVtools.GUI/FrmMain.cs index f8349190..ab9cb376 100644 --- a/UVtools.GUI/FrmMain.cs +++ b/UVtools.GUI/FrmMain.cs @@ -697,7 +697,7 @@ private void EventClick(object sender, EventArgs e) bool repairIslands; bool removeEmptyLayers; bool repairResinTraps; - using (var frmRepairLayers = new FrmRepairLayers(2)) + using (var frmRepairLayers = new FrmRepairLayers()) { if (frmRepairLayers.ShowDialog() != DialogResult.OK) return; @@ -768,10 +768,48 @@ private void EventClick(object sender, EventArgs e) if (ReferenceEquals(sender, menuToolsLayerReHeight)) { + OperationLayerReHeight operation = null; using (var frm = new FrmToolLayerReHeight(SlicerFile.LayerCount, SlicerFile.LayerHeight)) { - if (frm.ShowDialog() != DialogResult.OK) return; + if (frm.IsDisposed || frm.ShowDialog() != DialogResult.OK) return; + operation = frm.Operation; } + + DisableGUI(); + FrmLoading.SetDescription($"Layer Re-Height from {SlicerFile.LayerHeight}mm to {operation.LayerHeight}mm"); + + var task = Task.Factory.StartNew(() => + { + try + { + SlicerFile.LayerManager.ReHeight(operation, FrmLoading.RestartProgress()); + } + catch (OperationCanceledException) + { + + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + finally + { + Invoke((MethodInvoker)delegate + { + // Running on the UI thread + EnableGUI(true); + }); + } + }); + + var loadingResult = FrmLoading.ShowDialog(); + + UpdateLayerLimits(); + RefreshInfo(); + ShowLayer(); + + menuFileSave.Enabled = + menuFileSaveAs.Enabled = true; } if (ReferenceEquals(sender, menuToolsLayerRemoval)) @@ -2157,7 +2195,7 @@ void ProcessFile(string fileName, uint actualLayer = 0) tsLayerResolution.Text = $"{{Width={SlicerFile.ResolutionX}, Height={SlicerFile.ResolutionY}}}"; UpdateLayerLimits(); - ShowLayer(actualLayer); + ShowLayer(Math.Min(actualLayer, SlicerFile.LayerCount-1)); diff --git a/UVtools.GUI/FrmMain.resx b/UVtools.GUI/FrmMain.resx index 0c326394..c2b5f07d 100644 --- a/UVtools.GUI/FrmMain.resx +++ b/UVtools.GUI/FrmMain.resx @@ -151,13 +151,13 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 - ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAq - EQAAAk1TRnQBSQFMAgEBBQEAARgBBgEYAQYBEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA - AwABIAMAAQEBAAEgBgABIC4AAxgBIgMwAUsDMAFMAzIBUOgAAyIBMQNWAbkDXQHiAQIBBQEAAf8BAgEF + ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAo + EQAAAk1TRnQBSQFMAgEBBQEAASABBgEgAQYBEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA + AwABIAMAAQEBAAEgBgABIC4AAxgBIgMwAUsDMAFMAzIBUOgAAyIBMQNWAbkDXQHiAQEBBAEAAf8BAQEE AQAB/wEqAS0BKAH+A1MBrANNAZUDAAEB2AADIQEwA1kB7AErAS4BKQH6A1EB9wNSAfQDUwHxA0gB9gNB - AfkBAgEFAQAB/wNPAZsDAAEB0AADHAEoA1kB6wEqAS0BKAH+A1YBtgNMAZI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eABBwEDAQABHwH/AYABAQHgAQcBAwEAAR8B/wGDAcEB4AEHAQMBwAIAAYABQQHgAQcBAwHAAgABiAER + AeABBwIAAR8B/wGBAREB4AEHAgABEAEBAYEBMQHgAQ8BwAEDAgABgQHxAeABHwHAAQMCAAGAAQEB4AE/ + AcABAwL/AYABAQL/AfwBPws= diff --git a/UVtools.GUI/Properties/AssemblyInfo.cs b/UVtools.GUI/Properties/AssemblyInfo.cs index 34f6dec4..6a871c4a 100644 --- a/UVtools.GUI/Properties/AssemblyInfo.cs +++ b/UVtools.GUI/Properties/AssemblyInfo.cs @@ -35,5 +35,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.6.3.1")] -[assembly: AssemblyFileVersion("0.6.3.1")] +[assembly: AssemblyVersion("0.6.3.2")] +[assembly: AssemblyFileVersion("0.6.3.2")] diff --git a/UVtools.GUI/Properties/Settings.Designer.cs b/UVtools.GUI/Properties/Settings.Designer.cs index 6d56b451..8f365ce3 100644 --- a/UVtools.GUI/Properties/Settings.Designer.cs +++ b/UVtools.GUI/Properties/Settings.Designer.cs @@ -598,5 +598,65 @@ public bool AutoZoomIssues { this["AutoZoomIssues"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("2")] + public byte LayerRepairDefaultClosingIterations { + get { + return ((byte)(this["LayerRepairDefaultClosingIterations"])); + } + set { + this["LayerRepairDefaultClosingIterations"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("1")] + public byte LayerRepairDefaultOpeningIterations { + get { + return ((byte)(this["LayerRepairDefaultOpeningIterations"])); + } + set { + this["LayerRepairDefaultOpeningIterations"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool LayerRepairLayersIslands { + get { + return ((bool)(this["LayerRepairLayersIslands"])); + } + set { + this["LayerRepairLayersIslands"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool LayerRepairResinTraps { + get { + return ((bool)(this["LayerRepairResinTraps"])); + } + set { + this["LayerRepairResinTraps"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool LayerRepairRemoveEmptyLayers { + get { + return ((bool)(this["LayerRepairRemoveEmptyLayers"])); + } + set { + this["LayerRepairRemoveEmptyLayers"] = value; + } + } } } diff --git a/UVtools.GUI/Properties/Settings.settings b/UVtools.GUI/Properties/Settings.settings index 09e2f7a2..8da8227d 100644 --- a/UVtools.GUI/Properties/Settings.settings +++ b/UVtools.GUI/Properties/Settings.settings @@ -146,5 +146,20 @@ True + + 2 + + + 1 + + + True + + + True + + + True + \ No newline at end of file