diff options
author | Tiago Conceição <Tiago_caza@hotmail.com> | 2021-08-29 21:38:56 +0300 |
---|---|---|
committer | Tiago Conceição <Tiago_caza@hotmail.com> | 2021-08-29 21:38:56 +0300 |
commit | 1fd53c9d3c34ef2e4027eb2ceb8e79d9e6cdb7e3 (patch) | |
tree | 4643d7b036de541a058d2abb9d614d90a74bbea3 | |
parent | 14f0cd4ce5a7dbab26b4bb2b105a35be5da8ff33 (diff) |
v2.20.4v2.20.4
- (Fix) On some tools, calibration tests and even files when recalculating the Z layer position for the whole set, it will use the bottom setting for all layers
-rw-r--r-- | CHANGELOG.md | 4 | ||||
-rw-r--r-- | UVtools.Core/FileFormats/FileFormat.cs | 2 | ||||
-rw-r--r-- | UVtools.Core/Layer/Layer.cs | 10 | ||||
-rw-r--r-- | UVtools.Core/Layer/LayerManager.cs | 22 | ||||
-rw-r--r-- | UVtools.Core/UVtools.Core.csproj | 2 | ||||
-rw-r--r-- | UVtools.WPF/UVtools.WPF.csproj | 2 |
6 files changed, 24 insertions, 18 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index a5bd8f6..bc150fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 29/08/2021 - v2.20.4 + +- (Fix) On some tools, calibration tests and even files when recalculating the Z layer position for the whole set, it will use the bottom setting for all layers + ## 28/08/2021 - v2.20.3 - **Tool - Dynamic Layer Height:** diff --git a/UVtools.Core/FileFormats/FileFormat.cs b/UVtools.Core/FileFormats/FileFormat.cs index 7ff9433..04a8a3d 100644 --- a/UVtools.Core/FileFormats/FileFormat.cs +++ b/UVtools.Core/FileFormats/FileFormat.cs @@ -905,7 +905,7 @@ namespace UVtools.Core.FileFormats // Recalculate changes PrintHeight = PrintHeight; PrintTime = PrintTimeComputed; - MaterialMilliliters = 0; + MaterialMilliliters = -1; if (oldLayerManager is null) return; // Init diff --git a/UVtools.Core/Layer/Layer.cs b/UVtools.Core/Layer/Layer.cs index 5d83c02..77bd7ec 100644 --- a/UVtools.Core/Layer/Layer.cs +++ b/UVtools.Core/Layer/Layer.cs @@ -75,7 +75,7 @@ namespace UVtools.Core { if(!RaiseAndSetIfChanged(ref _nonZeroPixelCount, value)) return; RaisePropertyChanged(nameof(ExposureMillimeters)); - MaterialMilliliters = 0; // Recalculate + MaterialMilliliters = -1; // Recalculate } } @@ -154,7 +154,7 @@ namespace UVtools.Core { if (!RaiseAndSetIfChanged(ref _positionZ, RoundHeight(value))) return; RaisePropertyChanged(nameof(LayerHeight)); - //MaterialMilliliters = 0; // Recalculate + //MaterialMilliliters = -1; // Recalculate } } @@ -414,18 +414,18 @@ namespace UVtools.Core public float MaterialMilliliters { get => _materialMilliliters; - internal set + set { if (SlicerFile is null) return; //var globalMilliliters = SlicerFile.MaterialMilliliters - _materialMilliliters; - if (value <= 0) + if (value < 0) { value = (float) Math.Round(SlicerFile.PixelArea * LayerHeight * NonZeroPixelCount / 1000f, 4); } if(!RaiseAndSetIfChanged(ref _materialMilliliters, value)) return; - SlicerFile.MaterialMilliliters = 0; // Recalculate global RaisePropertyChanged(nameof(MaterialMillilitersPercent)); + SlicerFile.MaterialMilliliters = -1; // Recalculate global //ParentLayerManager.MaterialMillilitersTimer.Stop(); //if(!ParentLayerManager.MaterialMillilitersTimer.Enabled) // ParentLayerManager.MaterialMillilitersTimer.Start(); diff --git a/UVtools.Core/Layer/LayerManager.cs b/UVtools.Core/Layer/LayerManager.cs index 965ed40..34a2603 100644 --- a/UVtools.Core/Layer/LayerManager.cs +++ b/UVtools.Core/Layer/LayerManager.cs @@ -81,11 +81,13 @@ namespace UVtools.Core RebuildLayersProperties(); rebuildProperties = true; } - - SlicerFile.MaterialMilliliters = 0; } - if (!rebuildProperties) SlicerFile.RebuildGCode(); + if (!rebuildProperties) + { + SlicerFile.MaterialMilliliters = -1; + SlicerFile.RebuildGCode(); + } RaisePropertyChanged(); } @@ -500,7 +502,12 @@ namespace UVtools.Core var layer = this[layerIndex]; layer.Index = layerIndex; layer.ParentLayerManager = this; - + + if (recalculateZPos) + { + layer.PositionZ = SlicerFile.GetHeightFromLayer(layerIndex); + } + if (property != string.Empty) { if (property is null or nameof(SlicerFile.BottomLayerCount)) @@ -571,12 +578,7 @@ namespace UVtools.Core } } - if (recalculateZPos) - { - layer.PositionZ = SlicerFile.GetHeightFromLayer(layerIndex); - } - - layer.MaterialMilliliters = 0; // Recalculate this value to be sure + layer.MaterialMilliliters = -1; // Recalculate this value to be sure } SlicerFile?.RebuildGCode(); diff --git a/UVtools.Core/UVtools.Core.csproj b/UVtools.Core/UVtools.Core.csproj index f388343..a8558b4 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.20.3</Version> + <Version>2.20.4</Version> <Copyright>Copyright © 2020 PTRTECH</Copyright> <PackageIcon>UVtools.png</PackageIcon> <Platforms>AnyCPU;x64</Platforms> diff --git a/UVtools.WPF/UVtools.WPF.csproj b/UVtools.WPF/UVtools.WPF.csproj index e848ffb..1b1922b 100644 --- a/UVtools.WPF/UVtools.WPF.csproj +++ b/UVtools.WPF/UVtools.WPF.csproj @@ -12,7 +12,7 @@ <PackageLicenseFile>LICENSE</PackageLicenseFile> <RepositoryUrl>https://github.com/sn4k3/UVtools</RepositoryUrl> <RepositoryType>Git</RepositoryType> - <Version>2.20.3</Version> + <Version>2.20.4</Version> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> |