diff --git a/CHANGELOG.md b/CHANGELOG.md index c84aa05..66ef747 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 22/01/2021 - v2.3.2 + +* (Add) Settings - Automations: Change only light-off delay if value is zero (Enabled by default) +* (Fix) Calibrators: Some file formats will crash when calibration test output more layers than the dummy file +* (Fix) Undo/redo don't unlock the save function + ## 19/01/2021 - v2.3.1 * (Add) Calibrator - Stress Tower: Generates a stress tower to test the printer capabilities diff --git a/CREDITS.md b/CREDITS.md index 2d9d6c9..6cd8b3c 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -42,4 +42,5 @@ * Timothy Gray * David Gordon * Claus Pfeilschifter -* Chris Taatgen \ No newline at end of file +* Chris Taatgen +* Andrew Griffiths \ No newline at end of file diff --git a/UVtools.Core/Layer/LayerManager.cs b/UVtools.Core/Layer/LayerManager.cs index a9841ce..a5ec45d 100644 --- a/UVtools.Core/Layer/LayerManager.cs +++ b/UVtools.Core/Layer/LayerManager.cs @@ -43,6 +43,7 @@ namespace UVtools.Core _layers = value; BoundingRectangle = Rectangle.Empty; SlicerFile.LayerCount = Count; + SlicerFile.RequireFullEncode = true; if (value is null) return; SlicerFile.PrintTime = SlicerFile.PrintTimeComputed; } @@ -187,19 +188,64 @@ namespace UVtools.Core { var layer = this[layerIndex]; layer.Index = layerIndex; - - if(property is null || property == nameof(SlicerFile.BottomExposureTime) || property == nameof(SlicerFile.ExposureTime)) - layer.ExposureTime = SlicerFile.GetInitialLayerValueOrNormal(layerIndex, SlicerFile.BottomExposureTime, SlicerFile.ExposureTime); - if (property is null || property == nameof(SlicerFile.BottomLiftHeight) || property == nameof(SlicerFile.LiftHeight)) - layer.LiftHeight = SlicerFile.GetInitialLayerValueOrNormal(layerIndex, SlicerFile.BottomLiftHeight, SlicerFile.LiftHeight); - if (property is null || property == nameof(SlicerFile.BottomLiftSpeed) || property == nameof(SlicerFile.LiftSpeed)) - layer.LiftSpeed = SlicerFile.GetInitialLayerValueOrNormal(layerIndex, SlicerFile.BottomLiftSpeed, SlicerFile.LiftSpeed); - if (property is null || property == nameof(SlicerFile.RetractSpeed)) - layer.RetractSpeed = SlicerFile.RetractSpeed; - if (property is null || property == nameof(SlicerFile.BottomLightPWM) || property == nameof(SlicerFile.LightPWM)) - layer.LightPWM = SlicerFile.GetInitialLayerValueOrNormal(layerIndex, SlicerFile.BottomLightPWM, SlicerFile.LightPWM); - if (property is null || property == nameof(SlicerFile.BottomLightOffDelay) || property == nameof(SlicerFile.LightOffDelay)) + + if (property is null) + { + layer.ExposureTime = SlicerFile.GetInitialLayerValueOrNormal(layerIndex, SlicerFile.BottomExposureTime, SlicerFile.ExposureTime); + layer.LiftHeight = SlicerFile.GetInitialLayerValueOrNormal(layerIndex, SlicerFile.BottomLiftHeight, SlicerFile.LiftHeight); + layer.LiftSpeed = SlicerFile.GetInitialLayerValueOrNormal(layerIndex, SlicerFile.BottomLiftSpeed, SlicerFile.LiftSpeed); + layer.RetractSpeed = SlicerFile.RetractSpeed; + layer.LightPWM = SlicerFile.GetInitialLayerValueOrNormal(layerIndex, SlicerFile.BottomLightPWM, SlicerFile.LightPWM); layer.LightOffDelay = SlicerFile.GetInitialLayerValueOrNormal(layerIndex, SlicerFile.BottomLightOffDelay, SlicerFile.LightOffDelay); + } + else + { + if (layer.IsNormalLayer) + { + switch (property) + { + case nameof(SlicerFile.ExposureTime): + layer.ExposureTime = SlicerFile.ExposureTime; + break; + case nameof(SlicerFile.LiftHeight): + layer.LiftHeight = SlicerFile.LiftHeight; + break; + case nameof(SlicerFile.LiftSpeed): + layer.LiftSpeed = SlicerFile.LiftSpeed; + break; + case nameof(SlicerFile.LightOffDelay): + layer.LightOffDelay = SlicerFile.LightOffDelay; + break; + case nameof(SlicerFile.LightPWM): + layer.LightPWM = SlicerFile.LightPWM; + break; + } + } + else // Bottom layers + { + switch (property) + { + case nameof(SlicerFile.BottomExposureTime): + layer.ExposureTime = SlicerFile.BottomExposureTime; + break; + case nameof(SlicerFile.BottomLiftHeight): + layer.LiftHeight = SlicerFile.BottomLiftHeight; + break; + case nameof(SlicerFile.BottomLiftSpeed): + layer.LiftSpeed = SlicerFile.BottomLiftSpeed; + break; + case nameof(SlicerFile.RetractSpeed): + layer.RetractSpeed = SlicerFile.RetractSpeed; + break; + case nameof(SlicerFile.BottomLightOffDelay): + layer.LightOffDelay = SlicerFile.BottomLightOffDelay; + break; + case nameof(SlicerFile.BottomLightPWM): + layer.LightPWM = SlicerFile.BottomLightPWM; + break; + } + } + } if (recalculateZPos) { diff --git a/UVtools.Core/Operations/OperationLayerClone.cs b/UVtools.Core/Operations/OperationLayerClone.cs index 211cb7d..5ec7c28 100644 --- a/UVtools.Core/Operations/OperationLayerClone.cs +++ b/UVtools.Core/Operations/OperationLayerClone.cs @@ -108,7 +108,6 @@ namespace UVtools.Core.Operations } slicerFile.LayerManager.Layers = layers; - slicerFile.RequireFullEncode = true; progress.Token.ThrowIfCancellationRequested(); diff --git a/UVtools.Core/Operations/OperationLayerImport.cs b/UVtools.Core/Operations/OperationLayerImport.cs index 7e5b822..a540004 100644 --- a/UVtools.Core/Operations/OperationLayerImport.cs +++ b/UVtools.Core/Operations/OperationLayerImport.cs @@ -495,7 +495,6 @@ namespace UVtools.Core.Operations slicerFile.LayerManager.RebuildLayersProperties(); slicerFile.SuppressRebuildProperties = false; - slicerFile.RequireFullEncode = true; return true; } diff --git a/UVtools.Core/Operations/OperationLayerReHeight.cs b/UVtools.Core/Operations/OperationLayerReHeight.cs index fb04a34..bcd93d5 100644 --- a/UVtools.Core/Operations/OperationLayerReHeight.cs +++ b/UVtools.Core/Operations/OperationLayerReHeight.cs @@ -173,7 +173,6 @@ namespace UVtools.Core.Operations slicerFile.LayerManager.Layers = layers; slicerFile.LayerHeight = (float)Item.LayerHeight; - slicerFile.RequireFullEncode = true; return true; } diff --git a/UVtools.Core/Operations/OperationLayerRemove.cs b/UVtools.Core/Operations/OperationLayerRemove.cs index 45816dd..5fa1907 100644 --- a/UVtools.Core/Operations/OperationLayerRemove.cs +++ b/UVtools.Core/Operations/OperationLayerRemove.cs @@ -104,7 +104,6 @@ namespace UVtools.Core.Operations } slicerFile.LayerManager.Layers = layers; - slicerFile.RequireFullEncode = true; return true; } diff --git a/UVtools.Core/UVtools.Core.csproj b/UVtools.Core/UVtools.Core.csproj index 2131a03..9bfaefd 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, calibration, repair, conversion and manipulation - 2.3.1 + 2.3.2 Copyright © 2020 PTRTECH UVtools.png AnyCPU;x64 diff --git a/UVtools.WPF/MainWindow.Clipboard.cs b/UVtools.WPF/MainWindow.Clipboard.cs index 6ef670c..bf8435d 100644 --- a/UVtools.WPF/MainWindow.Clipboard.cs +++ b/UVtools.WPF/MainWindow.Clipboard.cs @@ -51,6 +51,7 @@ namespace UVtools.WPF public void ClipboardUndo() { + CanSave = true; if ((_globalModifiers & KeyModifiers.Shift) != 0) { ClipboardUndo(true); @@ -61,6 +62,7 @@ namespace UVtools.WPF public async void ClipboardUndo(bool rerun) { + CanSave = true; var clip = Clipboard.CurrentClip; Clipboard.Undo(); if (!rerun) @@ -72,9 +74,16 @@ namespace UVtools.WPF if (operation is null) { Clipboard.Redo(); + CanSave = false; } } + public void ClipboardRedo() + { + CanSave = true; + Clipboard.Redo(); + } + public async void ClipboardClear() { if (await this.MessageBoxQuestion("Are you sure you want to clear the clipboard?\n" + diff --git a/UVtools.WPF/MainWindow.axaml b/UVtools.WPF/MainWindow.axaml index 70439b9..f2dcee6 100644 --- a/UVtools.WPF/MainWindow.axaml +++ b/UVtools.WPF/MainWindow.axaml @@ -1451,7 +1451,7 @@