diff options
author | Tiago Conceição <Tiago_caza@hotmail.com> | 2021-05-13 05:24:36 +0300 |
---|---|---|
committer | Tiago Conceição <Tiago_caza@hotmail.com> | 2021-05-13 05:24:36 +0300 |
commit | edd9984a31a90791edf3bcf594855d08507428b5 (patch) | |
tree | be296b13d7587d6d14811ddc2bff1821fa59e324 /UVtools.Core | |
parent | 3cd46728f1ca599d1f2211d9ff07273135d670af (diff) |
v2.11.2v2.11.2
- (Improvement) Applied some refactorings on code
- (Fix) MDLP, GR1 and CXDLP: Bad enconde of display width, display height and layer height properties
Diffstat (limited to 'UVtools.Core')
-rw-r--r-- | UVtools.Core/Enumerations.cs | 10 | ||||
-rw-r--r-- | UVtools.Core/FileFormats/CXDLPFile.cs | 24 | ||||
-rw-r--r-- | UVtools.Core/FileFormats/FileFormat.cs | 61 | ||||
-rw-r--r-- | UVtools.Core/FileFormats/GR1File.cs | 25 | ||||
-rw-r--r-- | UVtools.Core/FileFormats/MDLPFile.cs | 25 | ||||
-rw-r--r-- | UVtools.Core/Objects/RangeObservableCollection.cs | 6 | ||||
-rw-r--r-- | UVtools.Core/Operations/Operation.cs | 4 | ||||
-rw-r--r-- | UVtools.Core/Operations/OperationCalibrateExposureFinder.cs | 3 | ||||
-rw-r--r-- | UVtools.Core/Operations/OperationMask.cs | 6 | ||||
-rw-r--r-- | UVtools.Core/UVtools.Core.csproj | 2 |
10 files changed, 85 insertions, 81 deletions
diff --git a/UVtools.Core/Enumerations.cs b/UVtools.Core/Enumerations.cs index 13f3f7a..468b389 100644 --- a/UVtools.Core/Enumerations.cs +++ b/UVtools.Core/Enumerations.cs @@ -1,7 +1,11 @@ -using System; -using System.Collections.Generic; +/* + * GNU AFFERO GENERAL PUBLIC LICENSE + * Version 3, 19 November 2007 + * Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ using System.ComponentModel; -using System.Text; namespace UVtools.Core { diff --git a/UVtools.Core/FileFormats/CXDLPFile.cs b/UVtools.Core/FileFormats/CXDLPFile.cs index bd44c26..0c4129e 100644 --- a/UVtools.Core/FileFormats/CXDLPFile.cs +++ b/UVtools.Core/FileFormats/CXDLPFile.cs @@ -97,7 +97,7 @@ namespace UVtools.Core.FileFormats [FieldOrder(1)] [FieldLength(nameof(DisplayWidthDataSize))] - public byte[] DisplayWidth { get; set; } + public byte[] DisplayWidthBytes { get; set; } [FieldOrder(2)] [FieldEndianness(Endianness.Big)] @@ -105,7 +105,7 @@ namespace UVtools.Core.FileFormats [FieldOrder(3)] [FieldLength(nameof(DisplayHeightDataSize))] - public byte[] DisplayHeight { get; set; } + public byte[] DisplayHeightBytes { get; set; } [FieldOrder(4)] [FieldEndianness(Endianness.Big)] @@ -113,7 +113,7 @@ namespace UVtools.Core.FileFormats [FieldOrder(5)] [FieldLength(nameof(LayerHeightDataSize))] - public byte[] LayerHeight { get; set; } + public byte[] LayerHeightBytes { get; set; } [FieldOrder(6)] [FieldEndianness(Endianness.Big)] @@ -328,7 +328,7 @@ namespace UVtools.Core.FileFormats public override float DisplayWidth { - get => float.Parse(SlicerInfoSettings.DisplayWidth.Where(b => b != 0).Aggregate(string.Empty, (current, b) => current + System.Convert.ToChar(b))); + get => float.Parse(Encoding.ASCII.GetString(SlicerInfoSettings.DisplayWidthBytes.Where(b => b != 0).ToArray())); set { string str = Math.Round(value, 2).ToString(CultureInfo.InvariantCulture); @@ -336,17 +336,17 @@ namespace UVtools.Core.FileFormats var data = new byte[SlicerInfoSettings.DisplayWidthDataSize]; for (var i = 0; i < str.Length; i++) { - data[i * 2] = System.Convert.ToByte(str[i]); + data[i * 2 + 1] = System.Convert.ToByte(str[i]); } - SlicerInfoSettings.DisplayWidth = data; + SlicerInfoSettings.DisplayWidthBytes = data; RaisePropertyChanged(); } } public override float DisplayHeight { - get => float.Parse(SlicerInfoSettings.DisplayHeight.Where(b => b != 0).Aggregate(string.Empty, (current, b) => current + System.Convert.ToChar(b))); + get => float.Parse(Encoding.ASCII.GetString(SlicerInfoSettings.DisplayHeightBytes.Where(b => b != 0).ToArray())); set { string str = Math.Round(value, 2).ToString(CultureInfo.InvariantCulture); @@ -354,10 +354,10 @@ namespace UVtools.Core.FileFormats var data = new byte[SlicerInfoSettings.DisplayHeightDataSize]; for (var i = 0; i < str.Length; i++) { - data[i * 2] = System.Convert.ToByte(str[i]); + data[i * 2 + 1] = System.Convert.ToByte(str[i]); } - SlicerInfoSettings.DisplayHeight = data; + SlicerInfoSettings.DisplayHeightBytes = data; RaisePropertyChanged(); } } @@ -370,7 +370,7 @@ namespace UVtools.Core.FileFormats public override float LayerHeight { - get => float.Parse(SlicerInfoSettings.LayerHeight.Where(b => b != 0).Aggregate(string.Empty, (current, b) => current + System.Convert.ToChar(b))); + get => float.Parse(Encoding.ASCII.GetString(SlicerInfoSettings.LayerHeightBytes.Where(b => b != 0).ToArray())); set { string str = Layer.RoundHeight(value).ToString(CultureInfo.InvariantCulture); @@ -378,10 +378,10 @@ namespace UVtools.Core.FileFormats var data = new byte[SlicerInfoSettings.LayerHeightDataSize]; for (var i = 0; i < str.Length; i++) { - data[i * 2] = System.Convert.ToByte(str[i]); + data[i * 2 + 1] = System.Convert.ToByte(str[i]); } - SlicerInfoSettings.LayerHeight = data; + SlicerInfoSettings.LayerHeightBytes = data; RaisePropertyChanged(); } } diff --git a/UVtools.Core/FileFormats/FileFormat.cs b/UVtools.Core/FileFormats/FileFormat.cs index 8b4e801..0f0ade7 100644 --- a/UVtools.Core/FileFormats/FileFormat.cs +++ b/UVtools.Core/FileFormats/FileFormat.cs @@ -1271,7 +1271,7 @@ namespace UVtools.Core.FileFormats public bool Equals(FileFormat other) { - if (ReferenceEquals(null, other)) return false; + if (other is null) return false; if (ReferenceEquals(this, other)) return true; return FileFullPath == other.FileFullPath; } @@ -1283,6 +1283,7 @@ namespace UVtools.Core.FileFormats public void Dispose() { + GC.SuppressFinalize(this); Clear(); } @@ -1614,40 +1615,38 @@ namespace UVtools.Core.FileFormats { if (LayerCount > 0) { - using (TextWriter tw = new StreamWriter(Path.Combine(path, "Layers.ini"))) + using TextWriter tw = new StreamWriter(Path.Combine(path, "Layers.ini")); + for (int layerIndex = 0; layerIndex < LayerCount; layerIndex++) { - for (int layerIndex = 0; layerIndex < LayerCount; layerIndex++) + var layer = this[layerIndex]; + tw.WriteLine($"[{layerIndex}]"); + tw.WriteLine($"{nameof(layer.NonZeroPixelCount)}: {layer.NonZeroPixelCount}"); + tw.WriteLine($"{nameof(layer.BoundingRectangle)}: {layer.BoundingRectangle}"); + tw.WriteLine($"{nameof(layer.IsBottomLayer)}: {layer.IsBottomLayer}"); + tw.WriteLine($"{nameof(layer.LayerHeight)}: {layer.LayerHeight}"); + tw.WriteLine($"{nameof(layer.PositionZ)}: {layer.PositionZ}"); + tw.WriteLine($"{nameof(layer.ExposureTime)}: {layer.ExposureTime}"); + + if (HavePrintParameterPerLayerModifier(PrintParameterModifier.LightOffDelay)) + tw.WriteLine($"{nameof(layer.LightOffDelay)}: {layer.LightOffDelay}"); + if (HavePrintParameterPerLayerModifier(PrintParameterModifier.LiftHeight)) + tw.WriteLine($"{nameof(layer.LiftHeight)}: {layer.LiftHeight}"); + if (HavePrintParameterPerLayerModifier(PrintParameterModifier.LiftSpeed)) + tw.WriteLine($"{nameof(layer.LiftSpeed)}: {layer.LiftSpeed}"); + if (HavePrintParameterPerLayerModifier(PrintParameterModifier.RetractSpeed)) + tw.WriteLine($"{nameof(layer.RetractSpeed)}: {layer.RetractSpeed}"); + if (HavePrintParameterPerLayerModifier(PrintParameterModifier.LightPWM)) + tw.WriteLine($"{nameof(layer.LightPWM)}: {layer.LightPWM}"); + + var materialMillilitersPercent = layer.MaterialMillilitersPercent; + if (!float.IsNaN(materialMillilitersPercent)) { - var layer = this[layerIndex]; - tw.WriteLine($"[{layerIndex}]"); - tw.WriteLine($"{nameof(layer.NonZeroPixelCount)}: {layer.NonZeroPixelCount}"); - tw.WriteLine($"{nameof(layer.BoundingRectangle)}: {layer.BoundingRectangle}"); - tw.WriteLine($"{nameof(layer.IsBottomLayer)}: {layer.IsBottomLayer}"); - tw.WriteLine($"{nameof(layer.LayerHeight)}: {layer.LayerHeight}"); - tw.WriteLine($"{nameof(layer.PositionZ)}: {layer.PositionZ}"); - tw.WriteLine($"{nameof(layer.ExposureTime)}: {layer.ExposureTime}"); - - if (HavePrintParameterPerLayerModifier(PrintParameterModifier.LightOffDelay)) - tw.WriteLine($"{nameof(layer.LightOffDelay)}: {layer.LightOffDelay}"); - if (HavePrintParameterPerLayerModifier(PrintParameterModifier.LiftHeight)) - tw.WriteLine($"{nameof(layer.LiftHeight)}: {layer.LiftHeight}"); - if (HavePrintParameterPerLayerModifier(PrintParameterModifier.LiftSpeed)) - tw.WriteLine($"{nameof(layer.LiftSpeed)}: {layer.LiftSpeed}"); - if (HavePrintParameterPerLayerModifier(PrintParameterModifier.RetractSpeed)) - tw.WriteLine($"{nameof(layer.RetractSpeed)}: {layer.RetractSpeed}"); - if (HavePrintParameterPerLayerModifier(PrintParameterModifier.LightPWM)) - tw.WriteLine($"{nameof(layer.LightPWM)}: {layer.LightPWM}"); - - var materialMillilitersPercent = layer.MaterialMillilitersPercent; - if (!float.IsNaN(materialMillilitersPercent)) - { - tw.WriteLine($"{nameof(layer.MaterialMilliliters)}: {layer.MaterialMilliliters}ml ({materialMillilitersPercent:F2}%)"); - } - - tw.WriteLine(); + tw.WriteLine($"{nameof(layer.MaterialMilliliters)}: {layer.MaterialMilliliters}ml ({materialMillilitersPercent:F2}%)"); } - tw.Close(); + + tw.WriteLine(); } + tw.Close(); } } diff --git a/UVtools.Core/FileFormats/GR1File.cs b/UVtools.Core/FileFormats/GR1File.cs index 74b4019..4374b38 100644 --- a/UVtools.Core/FileFormats/GR1File.cs +++ b/UVtools.Core/FileFormats/GR1File.cs @@ -15,6 +15,7 @@ using System.Drawing; using System.Globalization; using System.IO; using System.Linq; +using System.Text; using System.Threading.Tasks; using BinarySerialization; using Emgu.CV; @@ -65,12 +66,12 @@ namespace UVtools.Core.FileFormats [FieldOrder(1)] [FieldEndianness(Endianness.Big)] public ushort ResolutionX { get; set; } [FieldOrder(2)] [FieldEndianness(Endianness.Big)] public ushort ResolutionY { get; set; } [FieldOrder(3)] [FieldEndianness(Endianness.Big)] public uint DisplayWidthDataSize { get; set; } = 6; - [FieldOrder(4)] [FieldLength(nameof(DisplayWidthDataSize))] public byte[] DisplayWidth { get; set; } + [FieldOrder(4)] [FieldLength(nameof(DisplayWidthDataSize))] public byte[] DisplayWidthBytes { get; set; } [FieldOrder(5)] [FieldEndianness(Endianness.Big)] public uint DisplayHeightDataSize { get; set; } = 6; - [FieldOrder(6)] [FieldLength(nameof(DisplayHeightDataSize))] public byte[] DisplayHeight { get; set; } + [FieldOrder(6)] [FieldLength(nameof(DisplayHeightDataSize))] public byte[] DisplayHeightBytes { get; set; } [FieldOrder(7)] [FieldEndianness(Endianness.Big)] public uint LayerHeightDataSize { get; set; } = 6; - [FieldOrder(8)] [FieldLength(nameof(LayerHeightDataSize))] public byte[] LayerHeight { get; set; } + [FieldOrder(8)] [FieldLength(nameof(LayerHeightDataSize))] public byte[] LayerHeightBytes { get; set; } [FieldOrder(9)] [FieldEndianness(Endianness.Big)] public ushort ExposureTime { get; set; } [FieldOrder(10)] [FieldEndianness(Endianness.Big)] public ushort LightOffDelay { get; set; } [FieldOrder(11)] [FieldEndianness(Endianness.Big)] public ushort BottomExposureTime { get; set; } @@ -185,7 +186,7 @@ namespace UVtools.Core.FileFormats public override float DisplayWidth { - get => float.Parse(SlicerInfoSettings.DisplayWidth.Where(b => b != 0).Aggregate(string.Empty, (current, b) => current + System.Convert.ToChar(b))); + get => float.Parse(Encoding.ASCII.GetString(SlicerInfoSettings.DisplayWidthBytes.Where(b => b != 0).ToArray())); set { string str = Math.Round(value, 2).ToString(CultureInfo.InvariantCulture); @@ -193,17 +194,17 @@ namespace UVtools.Core.FileFormats var data = new byte[SlicerInfoSettings.DisplayWidthDataSize]; for (var i = 0; i < str.Length; i++) { - data[i * 2] = System.Convert.ToByte(str[i]); + data[i * 2 + 1] = System.Convert.ToByte(str[i]); } - SlicerInfoSettings.DisplayWidth = data; + SlicerInfoSettings.DisplayWidthBytes = data; RaisePropertyChanged(); } } public override float DisplayHeight { - get => float.Parse(SlicerInfoSettings.DisplayHeight.Where(b => b != 0).Aggregate(string.Empty, (current, b) => current + System.Convert.ToChar(b))); + get => float.Parse(Encoding.ASCII.GetString(SlicerInfoSettings.DisplayHeightBytes.Where(b => b != 0).ToArray())); set { string str = Math.Round(value, 2).ToString(CultureInfo.InvariantCulture); @@ -211,10 +212,10 @@ namespace UVtools.Core.FileFormats var data = new byte[SlicerInfoSettings.DisplayHeightDataSize]; for (var i = 0; i < str.Length; i++) { - data[i * 2] = System.Convert.ToByte(str[i]); + data[i * 2 + 1] = System.Convert.ToByte(str[i]); } - SlicerInfoSettings.DisplayHeight = data; + SlicerInfoSettings.DisplayHeightBytes = data; RaisePropertyChanged(); } } @@ -229,7 +230,7 @@ namespace UVtools.Core.FileFormats public override float LayerHeight { - get => float.Parse(SlicerInfoSettings.LayerHeight.Where(b => b != 0).Aggregate(string.Empty, (current, b) => current + System.Convert.ToChar(b))); + get => float.Parse(Encoding.ASCII.GetString(SlicerInfoSettings.LayerHeightBytes.Where(b => b != 0).ToArray())); set { string str = Layer.RoundHeight(value).ToString(CultureInfo.InvariantCulture); @@ -237,10 +238,10 @@ namespace UVtools.Core.FileFormats var data = new byte[SlicerInfoSettings.LayerHeightDataSize]; for (var i = 0; i < str.Length; i++) { - data[i * 2] = System.Convert.ToByte(str[i]); + data[i * 2 + 1] = System.Convert.ToByte(str[i]); } - SlicerInfoSettings.LayerHeight = data; + SlicerInfoSettings.LayerHeightBytes = data; RaisePropertyChanged(); } } diff --git a/UVtools.Core/FileFormats/MDLPFile.cs b/UVtools.Core/FileFormats/MDLPFile.cs index 475150f..7530199 100644 --- a/UVtools.Core/FileFormats/MDLPFile.cs +++ b/UVtools.Core/FileFormats/MDLPFile.cs @@ -15,6 +15,7 @@ using System.Drawing; using System.Globalization; using System.IO; using System.Linq; +using System.Text; using System.Threading.Tasks; using BinarySerialization; using Emgu.CV; @@ -70,12 +71,12 @@ namespace UVtools.Core.FileFormats [FieldOrder(1)] [FieldEndianness(Endianness.Big)] public ushort ResolutionX { get; set; } [FieldOrder(2)] [FieldEndianness(Endianness.Big)] public ushort ResolutionY { get; set; } [FieldOrder(3)] [FieldEndianness(Endianness.Big)] public uint DisplayWidthDataSize { get; set; } = 6; - [FieldOrder(4)] [FieldLength(nameof(DisplayWidthDataSize))] public byte[] DisplayWidth { get; set; } + [FieldOrder(4)] [FieldLength(nameof(DisplayWidthDataSize))] public byte[] DisplayWidthBytes { get; set; } [FieldOrder(5)] [FieldEndianness(Endianness.Big)] public uint DisplayHeightDataSize { get; set; } = 6; - [FieldOrder(6)] [FieldLength(nameof(DisplayHeightDataSize))] public byte[] DisplayHeight { get; set; } + [FieldOrder(6)] [FieldLength(nameof(DisplayHeightDataSize))] public byte[] DisplayHeightBytes { get; set; } [FieldOrder(7)] [FieldEndianness(Endianness.Big)] public uint LayerHeightDataSize { get; set; } = 6; - [FieldOrder(8)] [FieldLength(nameof(LayerHeightDataSize))] public byte[] LayerHeight { get; set; } + [FieldOrder(8)] [FieldLength(nameof(LayerHeightDataSize))] public byte[] LayerHeightBytes { get; set; } [FieldOrder(9)] [FieldEndianness(Endianness.Big)] public ushort ExposureTime { get; set; } [FieldOrder(10)] [FieldEndianness(Endianness.Big)] public ushort LightOffDelay { get; set; } [FieldOrder(11)] [FieldEndianness(Endianness.Big)] public ushort BottomExposureTime { get; set; } @@ -189,7 +190,7 @@ namespace UVtools.Core.FileFormats public override float DisplayWidth { - get => float.Parse(SlicerInfoSettings.DisplayWidth.Where(b => b != 0).Aggregate(string.Empty, (current, b) => current + System.Convert.ToChar(b))); + get => float.Parse(Encoding.ASCII.GetString(SlicerInfoSettings.DisplayWidthBytes.Where(b => b != 0).ToArray())); set { string str = Math.Round(value, 2).ToString(CultureInfo.InvariantCulture); @@ -197,17 +198,17 @@ namespace UVtools.Core.FileFormats var data = new byte[SlicerInfoSettings.DisplayWidthDataSize]; for (var i = 0; i < str.Length; i++) { - data[i * 2] = System.Convert.ToByte(str[i]); + data[i * 2 + 1] = System.Convert.ToByte(str[i]); } - SlicerInfoSettings.DisplayWidth = data; + SlicerInfoSettings.DisplayWidthBytes = data; RaisePropertyChanged(); } } public override float DisplayHeight { - get => float.Parse(SlicerInfoSettings.DisplayHeight.Where(b => b != 0).Aggregate(string.Empty, (current, b) => current + System.Convert.ToChar(b))); + get => float.Parse(Encoding.ASCII.GetString(SlicerInfoSettings.DisplayHeightBytes.Where(b => b != 0).ToArray())); set { string str = Math.Round(value, 2).ToString(CultureInfo.InvariantCulture); @@ -215,10 +216,10 @@ namespace UVtools.Core.FileFormats var data = new byte[SlicerInfoSettings.DisplayHeightDataSize]; for (var i = 0; i < str.Length; i++) { - data[i * 2] = System.Convert.ToByte(str[i]); + data[i * 2 + 1] = System.Convert.ToByte(str[i]); } - SlicerInfoSettings.DisplayHeight = data; + SlicerInfoSettings.DisplayHeightBytes = data; RaisePropertyChanged(); } } @@ -233,7 +234,7 @@ namespace UVtools.Core.FileFormats public override float LayerHeight { - get => float.Parse(SlicerInfoSettings.LayerHeight.Where(b => b != 0).Aggregate(string.Empty, (current, b) => current + System.Convert.ToChar(b))); + get => float.Parse(Encoding.ASCII.GetString(SlicerInfoSettings.LayerHeightBytes.Where(b => b != 0).ToArray())); set { string str = Layer.RoundHeight(value).ToString(CultureInfo.InvariantCulture); @@ -241,10 +242,10 @@ namespace UVtools.Core.FileFormats var data = new byte[SlicerInfoSettings.LayerHeightDataSize]; for (var i = 0; i < str.Length; i++) { - data[i * 2] = System.Convert.ToByte(str[i]); + data[i * 2 + 1] = System.Convert.ToByte(str[i]); } - SlicerInfoSettings.LayerHeight = data; + SlicerInfoSettings.LayerHeightBytes = data; RaisePropertyChanged(); } } diff --git a/UVtools.Core/Objects/RangeObservableCollection.cs b/UVtools.Core/Objects/RangeObservableCollection.cs index 2c52e67..9e529d8 100644 --- a/UVtools.Core/Objects/RangeObservableCollection.cs +++ b/UVtools.Core/Objects/RangeObservableCollection.cs @@ -696,8 +696,8 @@ /// </remarks> internal static class EventArgsCache { - internal static readonly PropertyChangedEventArgs CountPropertyChanged = new PropertyChangedEventArgs("Count"); - internal static readonly PropertyChangedEventArgs IndexerPropertyChanged = new PropertyChangedEventArgs("Item[]"); - internal static readonly NotifyCollectionChangedEventArgs ResetCollectionChanged = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset); + internal static readonly PropertyChangedEventArgs CountPropertyChanged = new("Count"); + internal static readonly PropertyChangedEventArgs IndexerPropertyChanged = new("Item[]"); + internal static readonly NotifyCollectionChangedEventArgs ResetCollectionChanged = new(NotifyCollectionChangedAction.Reset); } }
\ No newline at end of file diff --git a/UVtools.Core/Operations/Operation.cs b/UVtools.Core/Operations/Operation.cs index 166446d..b7f7955 100644 --- a/UVtools.Core/Operations/Operation.cs +++ b/UVtools.Core/Operations/Operation.cs @@ -354,7 +354,7 @@ namespace UVtools.Core.Operations SelectLastLayer(); break; default: - throw new ArgumentOutOfRangeException(); + throw new NotImplementedException(); } } @@ -507,7 +507,7 @@ namespace UVtools.Core.Operations return result; } - public virtual void Dispose() { } + public virtual void Dispose() { GC.SuppressFinalize(this); } #endregion #region Static Methods diff --git a/UVtools.Core/Operations/OperationCalibrateExposureFinder.cs b/UVtools.Core/Operations/OperationCalibrateExposureFinder.cs index 8f79702..9109e29 100644 --- a/UVtools.Core/Operations/OperationCalibrateExposureFinder.cs +++ b/UVtools.Core/Operations/OperationCalibrateExposureFinder.cs @@ -787,9 +787,8 @@ namespace UVtools.Core.Operations { get { - List<decimal> layerHeights = new List<decimal>(); + List<decimal> layerHeights = new(); var endLayerHeight = _multipleLayerHeight ? _multipleLayerHeightMaximum : _layerHeight; - List<ExposureItem> list = new(); for (decimal layerHeight = _layerHeight; layerHeight <= endLayerHeight; layerHeight += _multipleLayerHeightStep) { layerHeights.Add(Layer.RoundHeight(layerHeight)); diff --git a/UVtools.Core/Operations/OperationMask.cs b/UVtools.Core/Operations/OperationMask.cs index f3571fb..c310ae5 100644 --- a/UVtools.Core/Operations/OperationMask.cs +++ b/UVtools.Core/Operations/OperationMask.cs @@ -41,7 +41,7 @@ namespace UVtools.Core.Operations public override string ValidateInternally() { var sb = new StringBuilder(); - if (Mask is null) + if (!HaveInputMask) { sb.AppendLine("The mask can not be empty."); } @@ -54,7 +54,7 @@ namespace UVtools.Core.Operations [XmlIgnore] public Mat Mask { get; set; } - public bool HaveMask => !(Mask is null); + public bool HaveInputMask => Mask is not null; #endregion #region Constructor @@ -69,7 +69,7 @@ namespace UVtools.Core.Operations public void InvertMask() { - if (!HaveMask) return; + if (!HaveInputMask) return; CvInvoke.BitwiseNot(Mask, Mask); } diff --git a/UVtools.Core/UVtools.Core.csproj b/UVtools.Core/UVtools.Core.csproj index b0630af..d3eac6a 100644 --- a/UVtools.Core/UVtools.Core.csproj +++ b/UVtools.Core/UVtools.Core.csproj @@ -10,7 +10,7 @@ <RepositoryUrl>https://github.com/sn4k3/UVtools</RepositoryUrl> <PackageProjectUrl>https://github.com/sn4k3/UVtools</PackageProjectUrl> <Description>MSLA/DLP, file analysis, calibration, repair, conversion and manipulation</Description> - <Version>2.11.1</Version> + <Version>2.11.2</Version> <Copyright>Copyright © 2020 PTRTECH</Copyright> <PackageIcon>UVtools.png</PackageIcon> <Platforms>AnyCPU;x64</Platforms> |