Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sn4k3/UVtools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Conceição <Tiago_caza@hotmail.com>2021-02-18 06:49:41 +0300
committerTiago Conceição <Tiago_caza@hotmail.com>2021-02-18 06:49:41 +0300
commit9c9540646c2ed8e3eac17cfddfc05aba209084a6 (patch)
treeaa1eb6bd662bb0585dbf6c40f9fe4411e3547bf8
parentf1dea71c601ccb6472cb32480d6bc57572d03809 (diff)
v2.4.8v2.4.8
* (Improvement) Cache per layer and global used material for faster calculations * (Improvement) Better internal PrintTime management * **(Improvement) GUI:** * Show per layer used material percentage compared to the rest model * Show total of millimeters cured per layer if available * Show bounds and ROI in millimeters if available * Show display width and height below resolution if available * Don't split (Actions / Refresh / Save) region when resize window and keep those fixed * **(Improvement) Calibrate - Grayscale:** * Add a option to convert brightness to exposure time on divisions text * Adjust text position to be better centered and near from the center within divisions * (Fix) Calculate the used material with global layer height instead of calculate height from layer difference which lead to wrong values in parallel computation * (Fix) Converting files were not setting the new file as parent for the layer manager, this affected auto convertions from SL1 and lead to crashes and bad calculations if file were not reloaded from the disk (#150, #151) * (Fix) PositionZ rounding error when removing layers
-rw-r--r--CHANGELOG.md17
-rw-r--r--UVtools.Core/Extensions/SizeExtensions.cs8
-rw-r--r--UVtools.Core/FileFormats/CWSFile.cs6
-rw-r--r--UVtools.Core/FileFormats/ChituboxFile.cs15
-rw-r--r--UVtools.Core/FileFormats/ChituboxZipFile.cs19
-rw-r--r--UVtools.Core/FileFormats/FDGFile.cs15
-rw-r--r--UVtools.Core/FileFormats/FileFormat.cs72
-rw-r--r--UVtools.Core/FileFormats/PHZFile.cs15
-rw-r--r--UVtools.Core/FileFormats/PhotonSFile.cs11
-rw-r--r--UVtools.Core/FileFormats/PhotonWorkshopFile.cs15
-rw-r--r--UVtools.Core/FileFormats/SL1File.cs19
-rw-r--r--UVtools.Core/FileFormats/ZCodexFile.cs17
-rw-r--r--UVtools.Core/Layer/Layer.cs64
-rw-r--r--UVtools.Core/Layer/LayerManager.cs38
-rw-r--r--UVtools.Core/Managers/ClipboardManager.cs1
-rw-r--r--UVtools.Core/Operations/OperationCalibrateGrayscale.cs17
-rw-r--r--UVtools.Core/Operations/OperationDynamicLayerHeight.cs4
-rw-r--r--UVtools.Core/Operations/OperationLayerRemove.cs2
-rw-r--r--UVtools.Core/UVtools.Core.csproj2
-rw-r--r--UVtools.WPF/Controls/Calibrators/CalibrateGrayscaleControl.axaml8
-rw-r--r--UVtools.WPF/Controls/WindowEx.cs4
-rw-r--r--UVtools.WPF/MainWindow.Information.cs2
-rw-r--r--UVtools.WPF/MainWindow.LayerPreview.cs74
-rw-r--r--UVtools.WPF/MainWindow.axaml28
-rw-r--r--UVtools.WPF/MainWindow.axaml.cs9
-rw-r--r--UVtools.WPF/UVtools.WPF.csproj2
26 files changed, 316 insertions, 168 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f8716ef..8a6b0ae 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,22 @@
# Changelog
+## 18/02/2021 - v2.4.8
+
+* (Improvement) Cache per layer and global used material for faster calculations
+* (Improvement) Better internal PrintTime management
+* **(Improvement) GUI:**
+ * Show per layer used material percentage compared to the rest model
+ * Show total of millimeters cured per layer if available
+ * Show bounds and ROI in millimeters if available
+ * Show display width and height below resolution if available
+ * Don't split (Actions / Refresh / Save) region when resize window and keep those fixed
+* **(Improvement) Calibrate - Grayscale:**
+ * Add a option to convert brightness to exposure time on divisions text
+ * Adjust text position to be better centered and near from the center within divisions
+* (Fix) Calculate the used material with global layer height instead of calculate height from layer difference which lead to wrong values in parallel computation
+* (Fix) Converting files were not setting the new file as parent for the layer manager, this affected auto convertions from SL1 and lead to crashes and bad calculations if file were not reloaded from the disk (#150, #151)
+* (Fix) PositionZ rounding error when removing layers
+
## 17/02/2021 - v2.4.7
* (Add) Computed used material milliliters for each layer, it will dynamic change if pixels are added or subtracted
diff --git a/UVtools.Core/Extensions/SizeExtensions.cs b/UVtools.Core/Extensions/SizeExtensions.cs
index 3f7f5a4..4af5c86 100644
--- a/UVtools.Core/Extensions/SizeExtensions.cs
+++ b/UVtools.Core/Extensions/SizeExtensions.cs
@@ -54,14 +54,14 @@ namespace UVtools.Core.Extensions
return Math.Max(size.Width, size.Height);
}
- public static float Area(this RectangleF rect)
+ public static float Area(this RectangleF rect, int round = -1)
{
- return rect.Width * rect.Height;
+ return round >= 0 ? (float) Math.Round(rect.Width * rect.Height, round) : rect.Width * rect.Height;
}
- public static float Area(this SizeF size)
+ public static float Area(this SizeF size, int round = -1)
{
- return size.Width * size.Height;
+ return round >= 0 ? (float)Math.Round(size.Width * size.Height, round) : size.Width * size.Height;
}
public static float Max(this SizeF size)
diff --git a/UVtools.Core/FileFormats/CWSFile.cs b/UVtools.Core/FileFormats/CWSFile.cs
index 896a1c3..a4beaa3 100644
--- a/UVtools.Core/FileFormats/CWSFile.cs
+++ b/UVtools.Core/FileFormats/CWSFile.cs
@@ -285,9 +285,9 @@ namespace UVtools.Core.FileFormats
#endregion
#region Properties
- public Slice SliceSettings { get; } = new Slice();
- public Output OutputSettings { get; } = new Output();
- public CWSSliceBuildConfig SliceBuildConfig { get; set; } = new CWSSliceBuildConfig();
+ public Slice SliceSettings { get; } = new();
+ public Output OutputSettings { get; } = new();
+ public CWSSliceBuildConfig SliceBuildConfig { get; set; } = new();
public override FileFormatType FileType => FileFormatType.Archive;
diff --git a/UVtools.Core/FileFormats/ChituboxFile.cs b/UVtools.Core/FileFormats/ChituboxFile.cs
index 9261a1d..d682425 100644
--- a/UVtools.Core/FileFormats/ChituboxFile.cs
+++ b/UVtools.Core/FileFormats/ChituboxFile.cs
@@ -1260,26 +1260,21 @@ namespace UVtools.Core.FileFormats
public override float PrintTime
{
- get => HeaderSettings.PrintTime;
+ get => base.PrintTime;
set
{
- HeaderSettings.PrintTime = (uint) value;
base.PrintTime = value;
+ HeaderSettings.PrintTime = (uint)base.PrintTime;
}
}
public override float MaterialMilliliters
{
- get
- {
- var materialMl = base.MaterialMilliliters;
- return materialMl > 0 ? materialMl : PrintParametersSettings.VolumeMl;
- }
+ get => base.MaterialMilliliters;
set
{
- if (value <= 0) value = base.MaterialMilliliters;
- PrintParametersSettings.VolumeMl = (float) Math.Round(value, 3);
- base.MaterialMilliliters = PrintParametersSettings.VolumeMl;
+ base.MaterialMilliliters = value;
+ PrintParametersSettings.VolumeMl = base.MaterialMilliliters;
}
}
diff --git a/UVtools.Core/FileFormats/ChituboxZipFile.cs b/UVtools.Core/FileFormats/ChituboxZipFile.cs
index 81f4eaf..938c1e4 100644
--- a/UVtools.Core/FileFormats/ChituboxZipFile.cs
+++ b/UVtools.Core/FileFormats/ChituboxZipFile.cs
@@ -338,22 +338,21 @@ namespace UVtools.Core.FileFormats
public override float PrintTime
{
- get => HeaderSettings.EstimatedPrintTime;
- set => base.PrintTime = HeaderSettings.EstimatedPrintTime = (float)Math.Round(value, 2);
+ get => base.PrintTime;
+ set
+ {
+ base.PrintTime = value;
+ HeaderSettings.EstimatedPrintTime = base.PrintTime;
+ }
}
public override float MaterialMilliliters
{
- get
- {
- var materialMl = base.MaterialMilliliters;
- return materialMl > 0 ? materialMl : HeaderSettings.VolumeMl;
- }
+ get => base.MaterialMilliliters;
set
{
- if (value <= 0) value = base.MaterialMilliliters;
- HeaderSettings.VolumeMl = (float)Math.Round(value, 3);
- base.MaterialMilliliters = HeaderSettings.VolumeMl;
+ base.MaterialMilliliters = value;
+ HeaderSettings.VolumeMl = base.MaterialMilliliters;
}
}
diff --git a/UVtools.Core/FileFormats/FDGFile.cs b/UVtools.Core/FileFormats/FDGFile.cs
index 8a3971b..10f96a1 100644
--- a/UVtools.Core/FileFormats/FDGFile.cs
+++ b/UVtools.Core/FileFormats/FDGFile.cs
@@ -925,26 +925,21 @@ namespace UVtools.Core.FileFormats
public override float PrintTime
{
- get => HeaderSettings.PrintTime;
+ get => base.PrintTime;
set
{
- HeaderSettings.PrintTime = (uint) value;
base.PrintTime = value;
+ HeaderSettings.PrintTime = (uint) base.PrintTime;
}
}
public override float MaterialMilliliters
{
- get
- {
- var materialMl = base.MaterialMilliliters;
- return materialMl > 0 ? materialMl : HeaderSettings.VolumeMl;
- }
+ get => base.MaterialMilliliters;
set
{
- if (value <= 0) value = base.MaterialMilliliters;
- HeaderSettings.VolumeMl = (float)Math.Round(value, 3);
- base.MaterialMilliliters = HeaderSettings.VolumeMl;
+ base.MaterialMilliliters = value;
+ HeaderSettings.VolumeMl = base.MaterialMilliliters;
}
}
diff --git a/UVtools.Core/FileFormats/FileFormat.cs b/UVtools.Core/FileFormats/FileFormat.cs
index 1fca133..4e8d3f8 100644
--- a/UVtools.Core/FileFormats/FileFormat.cs
+++ b/UVtools.Core/FileFormats/FileFormat.cs
@@ -308,6 +308,7 @@ namespace UVtools.Core.FileFormats
private bool _haveModifiedLayers;
private LayerManager _layerManager;
private float _printTime;
+ private float _materialMilliliters;
private float _maxPrintHeight;
#endregion
@@ -451,10 +452,11 @@ namespace UVtools.Core.FileFormats
set
{
var oldLayerManager = _layerManager;
- if (!RaiseAndSetIfChanged(ref _layerManager, value) || oldLayerManager is null || value is null) return;
- if (oldLayerManager.Count != LayerCount)
+ if (!RaiseAndSetIfChanged(ref _layerManager, value) || value is null) return;
+
+ if(!ReferenceEquals(this, _layerManager.SlicerFile)) // Auto fix parent slicer file
{
- LayerCount = _layerManager.Count;
+ _layerManager.SlicerFile = this;
}
// Recalculate changes
@@ -462,6 +464,13 @@ namespace UVtools.Core.FileFormats
PrintTime = PrintTimeComputed;
MaterialMilliliters = 0;
+ if (oldLayerManager is null) return; // Init
+
+ if (oldLayerManager.Count != LayerCount)
+ {
+ LayerCount = _layerManager.Count;
+ }
+
if (SuppressRebuildProperties) return;
if (LayerCount == 0 || this[LayerCount - 1] is null) return; // Not initialized
LayerManager.RebuildLayersProperties();
@@ -475,6 +484,11 @@ namespace UVtools.Core.FileFormats
public Rectangle BoundingRectangle => _layerManager?.BoundingRectangle ?? Rectangle.Empty;
/// <summary>
+ /// Gets the bounding rectangle of the object in millimeters
+ /// </summary>
+ public RectangleF BoundingRectangleMillimeters => _layerManager?.BoundingRectangleMillimeters ?? Rectangle.Empty;
+
+ /// <summary>
/// Gets or sets if modifications require a full encode to save
/// </summary>
public bool RequireFullEncode
@@ -763,24 +777,27 @@ namespace UVtools.Core.FileFormats
/// </summary>
public virtual float PrintTime
{
- get => _printTime;
+ get
+ {
+ if (_printTime <= 0)
+ {
+ _printTime = PrintTimeComputed;
+ }
+ return _printTime;
+ }
set
{
- _printTime = value;
- RaisePropertyChanged();
- RaisePropertyChanged(nameof(PrintTimeOrComputed));
- RaisePropertyChanged(nameof(PrintTimeComputed));
+ if (value <= 0)
+ {
+ value = PrintTimeComputed;
+ }
+ if(!RaiseAndSetIfChanged(ref _printTime, value)) return;
RaisePropertyChanged(nameof(PrintTimeHours));
RaisePropertyChanged(nameof(PrintTimeString));
}
}
/// <summary>
- /// Gets the estimate print time in seconds, if print doesn't support it it will be calculated
- /// </summary>
- public float PrintTimeOrComputed => PrintTime > 0 ? PrintTime : PrintTimeComputed;
-
- /// <summary>
/// Gets the calculated estimate print time in seconds
/// </summary>
public float PrintTimeComputed
@@ -825,30 +842,31 @@ namespace UVtools.Core.FileFormats
/// <summary>
/// Gets the estimate print time in hours
/// </summary>
- public float PrintTimeHours => (float) Math.Round(PrintTimeOrComputed / 3600, 2);
+ public float PrintTimeHours => (float) Math.Round(PrintTime / 3600, 2);
/// <summary>
/// Gets the estimate print time in hours and minutes formatted
/// </summary>
- public string PrintTimeString => TimeSpan.FromSeconds(PrintTimeOrComputed).ToString("hh\\hmm\\m");
+ public string PrintTimeString => TimeSpan.FromSeconds(PrintTime).ToString("hh\\hmm\\m");
/// <summary>
/// Gets the estimate used material in ml
/// </summary>
public virtual float MaterialMilliliters {
- get
+ get => _materialMilliliters;
+ set
{
- float pixelArea = PixelArea;
- float materialMl = 0;
- if (pixelArea <= 0) return materialMl;
-
- materialMl = this.Where(layer => layer is not null).Sum(layer => pixelArea * LayerHeight * layer.NonZeroPixelCount);
-
- return (float) Math.Round(materialMl / 1000, 3);
+ if (value <= 0)
+ {
+ value = (float)Math.Round(this.Where(layer => layer is not null).Sum(layer => layer.MaterialMilliliters), 3); ;
+ }
+ RaiseAndSetIfChanged(ref _materialMilliliters, value);
}
- set => RaisePropertyChanged();
}
+ //public float MaterialMillilitersComputed =>
+
+
/// <summary>
/// Gets the estimate material in grams
/// </summary>
@@ -1651,9 +1669,9 @@ namespace UVtools.Core.FileFormats
slicerFile.SuppressRebuildProperties = true;
- slicerFile.LayerManager = LayerManager;
+ slicerFile.LayerManager = _layerManager.Clone();
slicerFile.AntiAliasing = ValidateAntiAliasingLevel();
- slicerFile.LayerCount = LayerManager.Count;
+ slicerFile.LayerCount = _layerManager.Count;
slicerFile.BottomLayerCount = BottomLayerCount;
slicerFile.LayerHeight = LayerHeight;
slicerFile.ResolutionX = ResolutionX;
@@ -1685,7 +1703,7 @@ namespace UVtools.Core.FileFormats
slicerFile.MaterialCost = MaterialCost;
slicerFile.Xppmm = Xppmm;
slicerFile.Yppmm = Yppmm;
- slicerFile.PrintTime = PrintTimeOrComputed;
+ slicerFile.PrintTime = PrintTime;
slicerFile.PrintHeight = PrintHeight;
diff --git a/UVtools.Core/FileFormats/PHZFile.cs b/UVtools.Core/FileFormats/PHZFile.cs
index 073bead..bad77d1 100644
--- a/UVtools.Core/FileFormats/PHZFile.cs
+++ b/UVtools.Core/FileFormats/PHZFile.cs
@@ -943,26 +943,21 @@ namespace UVtools.Core.FileFormats
public override float PrintTime
{
- get => HeaderSettings.PrintTime;
+ get => base.PrintTime;
set
{
- HeaderSettings.PrintTime = (uint) value;
base.PrintTime = value;
+ HeaderSettings.PrintTime = (uint)base.PrintTime;
}
}
public override float MaterialMilliliters
{
- get
- {
- var materialMl = base.MaterialMilliliters;
- return materialMl > 0 ? materialMl : HeaderSettings.VolumeMl;
- }
+ get => base.MaterialMilliliters;
set
{
- if (value <= 0) value = base.MaterialMilliliters;
- HeaderSettings.VolumeMl = (float)Math.Round(value, 3);
- base.MaterialMilliliters = HeaderSettings.VolumeMl;
+ base.MaterialMilliliters = value;
+ HeaderSettings.VolumeMl = base.MaterialMilliliters;
}
}
diff --git a/UVtools.Core/FileFormats/PhotonSFile.cs b/UVtools.Core/FileFormats/PhotonSFile.cs
index d4feba8..0a1af1c 100644
--- a/UVtools.Core/FileFormats/PhotonSFile.cs
+++ b/UVtools.Core/FileFormats/PhotonSFile.cs
@@ -373,16 +373,11 @@ namespace UVtools.Core.FileFormats
public override float MaterialMilliliters
{
- get
- {
- var materialMl = base.MaterialMilliliters;
- return materialMl > 0 ? materialMl : (float) HeaderSettings.VolumeMl;
- }
+ get => base.MaterialMilliliters;
set
{
- if (value <= 0) value = base.MaterialMilliliters;
- HeaderSettings.VolumeMl = (float)Math.Round(value, 3);
- base.MaterialMilliliters = (float) HeaderSettings.VolumeMl;
+ base.MaterialMilliliters = value;
+ HeaderSettings.VolumeMl = base.MaterialMilliliters;
}
}
diff --git a/UVtools.Core/FileFormats/PhotonWorkshopFile.cs b/UVtools.Core/FileFormats/PhotonWorkshopFile.cs
index aa32532..1bada24 100644
--- a/UVtools.Core/FileFormats/PhotonWorkshopFile.cs
+++ b/UVtools.Core/FileFormats/PhotonWorkshopFile.cs
@@ -1046,26 +1046,21 @@ namespace UVtools.Core.FileFormats
public override float PrintTime
{
- get => HeaderSettings.PrintTime;
+ get => base.PrintTime;
set
{
- HeaderSettings.PrintTime = (uint)value;
base.PrintTime = value;
+ HeaderSettings.PrintTime = (uint) base.PrintTime;
}
}
public override float MaterialMilliliters
{
- get
- {
- var materialMl = base.MaterialMilliliters;
- return materialMl > 0 ? materialMl : HeaderSettings.VolumeMl;
- }
+ get => base.MaterialMilliliters;
set
{
- if (value <= 0) value = base.MaterialMilliliters;
- HeaderSettings.VolumeMl = (float)Math.Round(value, 3);
- base.MaterialMilliliters = HeaderSettings.VolumeMl;
+ base.MaterialMilliliters = value;
+ HeaderSettings.VolumeMl = base.MaterialMilliliters;
}
}
diff --git a/UVtools.Core/FileFormats/SL1File.cs b/UVtools.Core/FileFormats/SL1File.cs
index 23e0fb1..3cfbd5f 100644
--- a/UVtools.Core/FileFormats/SL1File.cs
+++ b/UVtools.Core/FileFormats/SL1File.cs
@@ -435,22 +435,21 @@ namespace UVtools.Core.FileFormats
public override float PrintTime
{
- get => OutputConfigSettings.PrintTime;
- set => base.PrintTime = OutputConfigSettings.PrintTime = (float)Math.Round(value, 2);
+ get => base.PrintTime;
+ set
+ {
+ base.PrintTime = value;
+ OutputConfigSettings.PrintTime = base.PrintTime;
+ }
}
public override float MaterialMilliliters
{
- get
- {
- var materialMl = base.MaterialMilliliters;
- return materialMl > 0 ? materialMl : OutputConfigSettings.UsedMaterial;
- }
+ get => base.MaterialMilliliters;
set
{
- if (value <= 0) value = base.MaterialMilliliters;
- OutputConfigSettings.UsedMaterial = (float)Math.Round(value, 3);
- base.MaterialMilliliters = OutputConfigSettings.UsedMaterial;
+ base.MaterialMilliliters = value;
+ OutputConfigSettings.UsedMaterial = base.MaterialMilliliters;
}
}
diff --git a/UVtools.Core/FileFormats/ZCodexFile.cs b/UVtools.Core/FileFormats/ZCodexFile.cs
index 6a366df..b7dca11 100644
--- a/UVtools.Core/FileFormats/ZCodexFile.cs
+++ b/UVtools.Core/FileFormats/ZCodexFile.cs
@@ -324,25 +324,20 @@ namespace UVtools.Core.FileFormats
get => ResinMetadataSettings.PrintTime;
set
{
- TimeSpan ts = new TimeSpan(0, 0, (int)value);
- ResinMetadataSettings.PrintTime = (uint) value;
- UserSettings.PrintTime = $"{ts.Hours}h {ts.Minutes}m";
base.PrintTime = value;
+ ResinMetadataSettings.PrintTime = (uint)base.PrintTime;
+ TimeSpan ts = new(0, 0, (int)base.PrintTime);
+ UserSettings.PrintTime = $"{ts.Hours}h {ts.Minutes}m";
}
}
public override float MaterialMilliliters
{
- get
- {
- var materialMl = base.MaterialMilliliters;
- return materialMl > 0 ? materialMl : ResinMetadataSettings.TotalMaterialVolumeUsed;
- }
+ get => base.MaterialMilliliters;
set
{
- if (value <= 0) value = base.MaterialMilliliters;
- ResinMetadataSettings.TotalMaterialVolumeUsed = (float)Math.Round(value, 3);
- base.MaterialMilliliters = ResinMetadataSettings.TotalMaterialVolumeUsed;
+ base.MaterialMilliliters = value;
+ ResinMetadataSettings.TotalMaterialVolumeUsed = base.MaterialMilliliters;
}
}
diff --git a/UVtools.Core/Layer/Layer.cs b/UVtools.Core/Layer/Layer.cs
index 4b65b64..5640096 100644
--- a/UVtools.Core/Layer/Layer.cs
+++ b/UVtools.Core/Layer/Layer.cs
@@ -7,9 +7,9 @@
*/
using System;
using System.Collections.Generic;
-using System.Diagnostics;
using System.Drawing;
using System.Linq;
+using System.Timers;
using Emgu.CV;
using Emgu.CV.CvEnum;
using Emgu.CV.Util;
@@ -38,6 +38,7 @@ namespace UVtools.Core
private float _liftSpeed = FileFormat.DefaultLiftSpeed;
private float _retractSpeed = FileFormat.DefaultRetractSpeed;
private byte _lightPwm = FileFormat.DefaultLightPWM;
+ private float _materialMilliliters;
#endregion
#region Properties
@@ -60,9 +61,17 @@ namespace UVtools.Core
internal set
{
if(!RaiseAndSetIfChanged(ref _nonZeroPixelCount, value)) return;
- RaisePropertyChanged(nameof(MaterialMilliliters));
- if (SlicerFile is null) return;
- SlicerFile.MaterialMilliliters = 0;
+ RaisePropertyChanged(nameof(ExposureMillimeters));
+ MaterialMilliliters = 0; // Recalculate
+ }
+ }
+
+ public float ExposureMillimeters
+ {
+ get
+ {
+ if (SlicerFile is null) return 0;
+ return (float) Math.Round(SlicerFile.PixelSizeMax * _nonZeroPixelCount, 2);
}
}
@@ -72,7 +81,28 @@ namespace UVtools.Core
public Rectangle BoundingRectangle
{
get => _boundingRectangle;
- internal set => RaiseAndSetIfChanged(ref _boundingRectangle, value);
+ internal set
+ {
+ RaiseAndSetIfChanged(ref _boundingRectangle, value);
+ RaisePropertyChanged(nameof(BoundingRectangleMillimeters));
+ }
+ }
+
+ /// <summary>
+ /// Gets the bounding rectangle for the image area in millimeters
+ /// </summary>
+ public RectangleF BoundingRectangleMillimeters
+ {
+ get
+ {
+ if (SlicerFile is null) return RectangleF.Empty;
+ var pixelSize = SlicerFile.PixelSize;
+ return new RectangleF(
+ (float) Math.Round(_boundingRectangle.X * pixelSize.Width, 2),
+ (float)Math.Round(_boundingRectangle.Y * pixelSize.Height, 2),
+ (float)Math.Round(_boundingRectangle.Width * pixelSize.Width, 2),
+ (float)Math.Round(_boundingRectangle.Height * pixelSize.Height, 2));
+ }
}
public bool IsBottomLayer => Index < ParentLayerManager.SlicerFile.BottomLayerCount;
@@ -206,14 +236,30 @@ namespace UVtools.Core
/// </summary>
public float MaterialMilliliters
{
- get
+ get => _materialMilliliters;
+ private set
{
- if (ParentLayerManager?.SlicerFile is null) return 0;
- return (float) Math.Round(ParentLayerManager.SlicerFile.PixelArea * LayerHeight * NonZeroPixelCount / 1000, 4);
+ if (ParentLayerManager?.SlicerFile is null) return;
+ if (value <= 0)
+ {
+ value = (float) Math.Round(ParentLayerManager.SlicerFile.PixelArea * ParentLayerManager.SlicerFile.LayerHeight * NonZeroPixelCount / 1000, 4);
+ }
+
+ if(!RaiseAndSetIfChanged(ref _materialMilliliters, value)) return;
+ SlicerFile.MaterialMilliliters = 0; // Recalculate global
+ RaisePropertyChanged(nameof(MaterialMillilitersPercent));
+ //ParentLayerManager.MaterialMillilitersTimer.Stop();
+ //if(!ParentLayerManager.MaterialMillilitersTimer.Enabled)
+ // ParentLayerManager.MaterialMillilitersTimer.Start();
}
}
/// <summary>
+ /// Gets the computed material milliliters percentage compared to the rest of the model
+ /// </summary>
+ public float MaterialMillilitersPercent => _materialMilliliters * 100 / SlicerFile.MaterialMilliliters;
+
+ /// <summary>
/// Gets or sets layer image compressed data
/// </summary>
public byte[] CompressedBytes
@@ -696,9 +742,11 @@ namespace UVtools.Core
BoundingRectangle = _boundingRectangle,
NonZeroPixelCount = _nonZeroPixelCount,
IsModified = _isModified,
+ MaterialMilliliters = _materialMilliliters
};
}
+
#endregion
}
}
diff --git a/UVtools.Core/Layer/LayerManager.cs b/UVtools.Core/Layer/LayerManager.cs
index a27386a..c2180c6 100644
--- a/UVtools.Core/Layer/LayerManager.cs
+++ b/UVtools.Core/Layer/LayerManager.cs
@@ -20,15 +20,16 @@ using Emgu.CV.Structure;
using Emgu.CV.Util;
using UVtools.Core.Extensions;
using UVtools.Core.FileFormats;
+using UVtools.Core.Objects;
using UVtools.Core.Operations;
using UVtools.Core.PixelEditor;
namespace UVtools.Core
{
- public class LayerManager : IEnumerable<Layer>
+ public class LayerManager : BindableBase, IEnumerable<Layer>, IDisposable
{
#region Properties
- public FileFormat SlicerFile { get; }
+ public FileFormat SlicerFile { get; set; }
private Layer[] _layers;
@@ -60,10 +61,32 @@ namespace UVtools.Core
public Rectangle BoundingRectangle
{
get => GetBoundingRectangle();
- set => _boundingRectangle = value;
+ set
+ {
+ RaiseAndSetIfChanged(ref _boundingRectangle, value);
+ RaisePropertyChanged(nameof(BoundingRectangleMillimeters));
+ }
}
/// <summary>
+ /// Gets the bounding rectangle of the object in millimeters
+ /// </summary>
+ public RectangleF BoundingRectangleMillimeters
+ {
+ get
+ {
+ if (SlicerFile is null) return RectangleF.Empty;
+ var pixelSize = SlicerFile.PixelSize;
+ return new RectangleF(
+ (float)Math.Round(_boundingRectangle.X * pixelSize.Width, 2),
+ (float)Math.Round(_boundingRectangle.Y * pixelSize.Height, 2),
+ (float)Math.Round(_boundingRectangle.Width * pixelSize.Width, 2),
+ (float)Math.Round(_boundingRectangle.Height * pixelSize.Height, 2));
+ }
+ }
+
+
+ /// <summary>
/// Gets the layers count
/// </summary>
public uint Count => (uint) Layers.Length;
@@ -87,7 +110,6 @@ namespace UVtools.Core
//public float LayerHeight => Layers[0].PositionZ;
-
#endregion
#region Constructors
@@ -282,12 +304,11 @@ namespace UVtools.Core
});
_boundingRectangle = this[0].BoundingRectangle;
- if (!ReferenceEquals(progress, null) && progress.Token.IsCancellationRequested)
+ if (progress is not null && progress.Token.IsCancellationRequested)
{
_boundingRectangle = Rectangle.Empty;
progress.Token.ThrowIfCancellationRequested();
}
-
}
progress.Reset(OperationProgress.StatusCalculatingBounds, Count-1);
@@ -297,7 +318,7 @@ namespace UVtools.Core
_boundingRectangle = Rectangle.Union(_boundingRectangle, this[i].BoundingRectangle);
progress++;
}
-
+ RaisePropertyChanged(nameof(BoundingRectangle));
return _boundingRectangle;
}
@@ -1298,6 +1319,7 @@ namespace UVtools.Core
return layerManager;
}
+ public void Dispose() { }
#endregion
@@ -1309,5 +1331,7 @@ namespace UVtools.Core
}
#endregion
+
+
}
}
diff --git a/UVtools.Core/Managers/ClipboardManager.cs b/UVtools.Core/Managers/ClipboardManager.cs
index f87085f..4815521 100644
--- a/UVtools.Core/Managers/ClipboardManager.cs
+++ b/UVtools.Core/Managers/ClipboardManager.cs
@@ -133,6 +133,7 @@ namespace UVtools.Core.Managers
{
SlicerFile.LayerHeight = clip.LayerHeight;
}
+
SlicerFile.LayerManager = layerManager.Clone();
if (i == _currentIndex) break;
}
diff --git a/UVtools.Core/Operations/OperationCalibrateGrayscale.cs b/UVtools.Core/Operations/OperationCalibrateGrayscale.cs
index 844d7fd..8e960f3 100644
--- a/UVtools.Core/Operations/OperationCalibrateGrayscale.cs
+++ b/UVtools.Core/Operations/OperationCalibrateGrayscale.cs
@@ -8,6 +8,7 @@
using System;
using System.Drawing;
+using System.Globalization;
using System.Text;
using System.Threading.Tasks;
using Emgu.CV;
@@ -39,6 +40,7 @@ namespace UVtools.Core.Operations
private byte _brightnessSteps = 10;
private bool _enableCenterHoleRelief = true;
private ushort _centerHoleDiameter = 200;
+ private bool _convertBrightnessToExposureTime;
private bool _enableLineDivisions = true;
private byte _lineDivisionThickness = 30;
private byte _lineDivisionBrightness = 255;
@@ -263,6 +265,12 @@ namespace UVtools.Core.Operations
set => RaiseAndSetIfChanged(ref _centerHoleDiameter, value);
}
+ public bool ConvertBrightnessToExposureTime
+ {
+ get => _convertBrightnessToExposureTime;
+ set => RaiseAndSetIfChanged(ref _convertBrightnessToExposureTime, value);
+ }
+
public bool EnableLineDivisions
{
get => _enableLineDivisions;
@@ -389,7 +397,7 @@ namespace UVtools.Core.Operations
FontFace fontFace = FontFace.HersheyDuplex;
double fontScale = 2;
int fontThickness = 5;
- Point fontPoint = new Point(center.X + radius / 2 + _textXOffset, (int)(center.Y + AngleStep / 1.1));
+ Point fontPoint = new Point((int) (center.X + radius / 2.5f + _textXOffset), (int)(center.Y + AngleStep / 1.5));
var halfAngleStep = AngleStep / 2;
var rotatedAngle = halfAngleStep;
@@ -398,7 +406,12 @@ namespace UVtools.Core.Operations
layers[2].Rotate(halfAngleStep);
for (ushort brightness = _startBrightness; brightness <= _endBrightness; brightness += _brightnessSteps)
{
- CvInvoke.PutText(layers[2], brightness.ToString(), fontPoint, fontFace, fontScale, EmguExtensions.BlackByte, fontThickness, lineType);
+ var text = brightness.ToString();
+ if (_convertBrightnessToExposureTime)
+ {
+ text = $"{Math.Round(brightness * _normalExposure / byte.MaxValue, 2)}s";
+ }
+ CvInvoke.PutText(layers[2], text, fontPoint, fontFace, fontScale, EmguExtensions.BlackByte, fontThickness, lineType);
rotatedAngle += AngleStep;
layers[2].Rotate(AngleStep);
}
diff --git a/UVtools.Core/Operations/OperationDynamicLayerHeight.cs b/UVtools.Core/Operations/OperationDynamicLayerHeight.cs
index c39b12a..83e213b 100644
--- a/UVtools.Core/Operations/OperationDynamicLayerHeight.cs
+++ b/UVtools.Core/Operations/OperationDynamicLayerHeight.cs
@@ -446,7 +446,7 @@ namespace UVtools.Core.Operations
Report report = new()
{
OldLayerCount = SlicerFile.LayerCount,
- OldPrintTime = SlicerFile.PrintTimeOrComputed
+ OldPrintTime = SlicerFile.PrintTime
};
var anchor = new Point(-1, -1);
@@ -699,7 +699,7 @@ namespace UVtools.Core.Operations
SlicerFile.SuppressRebuildProperties = false;
report.NewLayerCount = SlicerFile.LayerCount;
- report.NewPrintTime = SlicerFile.PrintTimeOrComputed;
+ report.NewPrintTime = SlicerFile.PrintTime;
Tag = report;
return true;
diff --git a/UVtools.Core/Operations/OperationLayerRemove.cs b/UVtools.Core/Operations/OperationLayerRemove.cs
index 117712a..c4d3ad2 100644
--- a/UVtools.Core/Operations/OperationLayerRemove.cs
+++ b/UVtools.Core/Operations/OperationLayerRemove.cs
@@ -100,7 +100,7 @@ namespace UVtools.Core.Operations
}
else
{
- posZ = layers[newLayerIndex - 1].PositionZ + layerHeight;
+ posZ = (float) Math.Round(layers[newLayerIndex - 1].PositionZ + layerHeight, 2);
}
}
diff --git a/UVtools.Core/UVtools.Core.csproj b/UVtools.Core/UVtools.Core.csproj
index a9b49ca..d6ef422 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.4.7</Version>
+ <Version>2.4.8</Version>
<Copyright>Copyright © 2020 PTRTECH</Copyright>
<PackageIcon>UVtools.png</PackageIcon>
<Platforms>AnyCPU;x64</Platforms>
diff --git a/UVtools.WPF/Controls/Calibrators/CalibrateGrayscaleControl.axaml b/UVtools.WPF/Controls/Calibrators/CalibrateGrayscaleControl.axaml
index 7087937..fb483b9 100644
--- a/UVtools.WPF/Controls/Calibrators/CalibrateGrayscaleControl.axaml
+++ b/UVtools.WPF/Controls/Calibrators/CalibrateGrayscaleControl.axaml
@@ -243,8 +243,14 @@
<TextBlock Grid.Row="4" Grid.Column="4"
VerticalAlignment="Center"
Text="px"/>
+
+ <CheckBox Grid.Row="6" Grid.Column="2" Grid.ColumnSpan="6"
+ VerticalAlignment="Center"
+ ToolTip.Tip="Convert the raw brightness text value to exposure time in seconds and intrude on divisions"
+ Content="Convert brightness to exposure time"
+ IsChecked="{Binding Operation.ConvertBrightnessToExposureTime}"/>
- <CheckBox Grid.Row="6" Grid.Column="2" Grid.ColumnSpan="4"
+ <CheckBox Grid.Row="6" Grid.Column="10" Grid.ColumnSpan="3"
VerticalAlignment="Center"
Content="Enable division lines"
IsChecked="{Binding Operation.EnableLineDivisions}"/>
diff --git a/UVtools.WPF/Controls/WindowEx.cs b/UVtools.WPF/Controls/WindowEx.cs
index 50c2c03..e3a643d 100644
--- a/UVtools.WPF/Controls/WindowEx.cs
+++ b/UVtools.WPF/Controls/WindowEx.cs
@@ -109,11 +109,11 @@ namespace UVtools.WPF.Controls
Close(DialogResult);
}
- public virtual void ResetDataContext()
+ public virtual void ResetDataContext(object newObject = null)
{
var old = DataContext;
DataContext = null;
- DataContext = old;
+ DataContext = newObject ?? old;
}
}
}
diff --git a/UVtools.WPF/MainWindow.Information.cs b/UVtools.WPF/MainWindow.Information.cs
index 2c4b169..e2faf3f 100644
--- a/UVtools.WPF/MainWindow.Information.cs
+++ b/UVtools.WPF/MainWindow.Information.cs
@@ -362,7 +362,7 @@ namespace UVtools.WPF
CurrentLayerProperties.Add(new StringTag(nameof(layer.LightPWM), layer.LightPWM.ToString()));
}
- CurrentLayerProperties.Add(new StringTag(nameof(layer.MaterialMilliliters), $"{layer.MaterialMilliliters:F4}ml"));
+ CurrentLayerProperties.Add(new StringTag(nameof(layer.MaterialMilliliters), $"{layer.MaterialMilliliters}ml ({layer.MaterialMillilitersPercent:F2}%)"));
}
#endregion
}
diff --git a/UVtools.WPF/MainWindow.LayerPreview.cs b/UVtools.WPF/MainWindow.LayerPreview.cs
index feb6439..4146643 100644
--- a/UVtools.WPF/MainWindow.LayerPreview.cs
+++ b/UVtools.WPF/MainWindow.LayerPreview.cs
@@ -299,21 +299,47 @@ namespace UVtools.WPF
{
get
{
- if (!LayerCache.IsCached) return "0";
- var pixelPercent =
- Math.Round(
- LayerCache.Layer.NonZeroPixelCount * 100.0 / (SlicerFile.ResolutionX * SlicerFile.ResolutionY), 2);
- return $"{LayerCache.Layer.NonZeroPixelCount} ({pixelPercent}%)";
+ if (!LayerCache.IsCached) return "Pixels: 0";
+ var pixelPercent = Math.Round(LayerCache.Layer.NonZeroPixelCount * 100.0 / (SlicerFile.ResolutionX * SlicerFile.ResolutionY), 2);
+ string text = $"Pixels: {LayerCache.Layer.NonZeroPixelCount} ({pixelPercent}%)";
+ var exposedMillimeters = LayerCache.Layer.ExposureMillimeters;
+ if (exposedMillimeters > 0)
+ {
+ text += $"\nMillimeters: {exposedMillimeters}";
+ }
+ return text;
}
}
- public string LayerBoundsStr => LayerCache.Layer is null ? "NS" : $"{LayerCache.Layer.BoundingRectangle} ({LayerCache.Layer.BoundingRectangle.Area()}px²)";
+ public string LayerBoundsStr
+ {
+ get
+ {
+ if (LayerCache.Layer is null) return "Bounds: NS";
+ var text = $"Bounds: {LayerCache.Layer.BoundingRectangle} ({LayerCache.Layer.BoundingRectangle.Area()}px²)";
+ var rectMillimeters = LayerCache.Layer.BoundingRectangleMillimeters;
+ if (!rectMillimeters.IsEmpty)
+ {
+ text += $"\nBounds: {rectMillimeters} ({rectMillimeters.Area(2)}mm²)";
+ }
+
+ return text;
+ }
+ }
+
public string LayerROIStr
{
get
{
var roi = ROI;
- return roi.IsEmpty ? "NS" : $"{roi} ({roi.Area()}px²)";
+ if(roi.IsEmpty) return "ROI: NS";
+ var text = $"ROI: {roi} ({roi.Area()}px²)";
+ var roiMillimeters = ROIMillimeters;
+ if (!roiMillimeters.IsEmpty)
+ {
+ text += $"\nROI: {roiMillimeters} ({roiMillimeters.Area(2)}mm²)";
+ }
+ return text;
}
}
@@ -323,11 +349,26 @@ namespace UVtools.WPF
set => RaiseAndSetIfChanged(ref _showLayerRenderMs, value);
}
- public PixelPicker LayerPixelPicker { get; } = new PixelPicker();
+ public PixelPicker LayerPixelPicker { get; } = new ();
public string LayerZoomStr => $"{LayerImageBox.Zoom / 100m}x" +
(AppSettings.LockedZoomLevel == LayerImageBox.Zoom ? " 🔒" : string.Empty);
- public string LayerResolutionStr => SlicerFile?.Resolution.ToString() ?? "Unloaded";
+
+ public string LayerResolutionStr
+ {
+ get
+ {
+ if (SlicerFile is null) return "Unloaded";
+ var text = $"{SlicerFile.Resolution} px";
+ var display = SlicerFile.Display;
+ if (!display.IsEmpty)
+ {
+ text += $"\n{SlicerFile.Display} mm";
+ }
+
+ return text;
+ }
+ }
public uint ActualLayer
{
@@ -395,6 +436,21 @@ namespace UVtools.WPF
set => LayerImageBox.SelectionRegion = value.ToAvalonia();
}
+ public RectangleF ROIMillimeters
+ {
+ get
+ {
+ var roi = ROI;
+ var pixelSize = SlicerFile.PixelSize;
+ if(roi.IsEmpty || pixelSize.IsEmpty) return RectangleF.Empty;
+ return new RectangleF(
+ (float)Math.Round(roi.X * pixelSize.Width, 2),
+ (float)Math.Round(roi.Y * pixelSize.Height, 2),
+ (float)Math.Round(roi.Width * pixelSize.Width, 2),
+ (float)Math.Round(roi.Height * pixelSize.Height, 2));
+ }
+ }
+
public void OnROIClick()
{
ZoomToFit(ZoomToFitType.Selection);
diff --git a/UVtools.WPF/MainWindow.axaml b/UVtools.WPF/MainWindow.axaml
index 53e000e..93d132f 100644
--- a/UVtools.WPF/MainWindow.axaml
+++ b/UVtools.WPF/MainWindow.axaml
@@ -659,7 +659,7 @@
ToolTip.Tip="Remove selected issue when possible.
&#x0a;Islands: All pixels are removed (turn black).
&#x0a;ResinTrap: All trap areas are filled with white pixels.
-&#x0a;TouchingBounds: No action, need reslice."
+&#x0a;TouchingBounds: No action, need re-slice."
IsEnabled="{Binding #IssuesGrid.SelectedItem, Converter={x:Static ObjectConverters.IsNotNull}}"
Command="{Binding OnClickIssueRemove}">
<StackPanel Orientation="Horizontal" Spacing="5">
@@ -1766,8 +1766,7 @@
IsChecked="{Binding IsPixelEditorActive}"
ToolTip.Tip="Edit layer image: Draw pixels, add supports and/or drain holes."
VerticalAlignment="Stretch"
- Margin="1,0,0,0"
- >
+ Margin="0,0,0,0">
<StackPanel Orientation="Horizontal">
<Image Source="/Assets/Icons/pixel-16x16.png"/>
<TextBlock Margin="5,0,5,0" Text="Pixel editor"/>
@@ -1777,14 +1776,14 @@
</WrapPanel>
- <WrapPanel HorizontalAlignment="Right" Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
+ <StackPanel HorizontalAlignment="Right" Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
<Button Name="LayerActionsButton"
Command="{Binding OpenContextMenu}"
VerticalAlignment="Stretch"
CommandParameter="LayerActions">
<StackPanel Orientation="Horizontal">
<Image Source="/Assets/Icons/layers-alt-16x16.png"/>
- <TextBlock Margin="5,0,5,0" Text="Actions ⮟"/>
+ <TextBlock VerticalAlignment="Center" Margin="5,0,5,0" Text="Actions ⮟"/>
</StackPanel>
<Button.ContextMenu>
<ContextMenu Name="LayerActionsContextMenu" PlacementMode="Bottom" Items="{Binding LayerActionsMenu}"/>
@@ -1813,7 +1812,7 @@
</Button>
- </WrapPanel>
+ </StackPanel>
</Grid>
<Border
@@ -1851,21 +1850,20 @@
ColumnDefinitions="4*,2*" RowDefinitions="Auto" Margin="5">
<WrapPanel Orientation="Horizontal">
<StackPanel
- ToolTip.Tip="Number of pixels to cure on this layer image and the percentage of them against total lcd pixels"
+ ToolTip.Tip="Number of pixels to cure on this layer image and the percentage of them against total lcd pixels and the total cured millimeters."
VerticalAlignment="Center" Orientation="Horizontal" Spacing="5">
<Image Source="/Assets/Icons/pixel-16x16.png"/>
- <TextBlock Text="{Binding LayerPixelCountStr, StringFormat=Pixels: \{0\}}"/>
+ <TextBlock Text="{Binding LayerPixelCountStr}"/>
</StackPanel>
<Button
- ToolTip.Tip="Object volume bounds for current layer, position and size.
+ ToolTip.Tip="Object volume bounds for current layer, position and size in pixels and millimeters.
&#x0a;Click: go to region"
Command="{Binding ZoomToFitPrintVolume}"
- Margin="5,0,0,0"
- >
+ Margin="5,0,0,0">
<StackPanel VerticalAlignment="Center" Orientation="Horizontal" Spacing="5">
<Image Source="/Assets/Icons/expand-16x16.png"/>
- <TextBlock Text="{Binding LayerBoundsStr, StringFormat=Bounds: \{0\}}"/>
+ <TextBlock Text="{Binding LayerBoundsStr}"/>
</StackPanel>
</Button>
@@ -1879,13 +1877,13 @@
>
<StackPanel VerticalAlignment="Center" Orientation="Horizontal" Spacing="5">
<Image Source="/Assets/Icons/object-group-16x16.png"/>
- <TextBlock Text="{Binding LayerROIStr, StringFormat=ROI: \{0\}}"/>
+ <TextBlock Text="{Binding LayerROIStr}"/>
</StackPanel>
</Button>
</WrapPanel>
- <WrapPanel Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Right" Orientation="Horizontal">
+ <WrapPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Right" Orientation="Horizontal">
<Button
IsEnabled="{Binding LayerPixelPicker.IsSet}"
Command="{Binding OnLayerPixelPickerClicked}"
@@ -1911,7 +1909,7 @@
</Button>
<Button
- ToolTip.Tip="Layer Resolution.
+ ToolTip.Tip="Layer Resolution and display size.
&#x0a;Click: Zoom to fit"
Command="{Binding ZoomToFitSimple}"
Margin="2,0,0,0"
diff --git a/UVtools.WPF/MainWindow.axaml.cs b/UVtools.WPF/MainWindow.axaml.cs
index ed55669..90882ee 100644
--- a/UVtools.WPF/MainWindow.axaml.cs
+++ b/UVtools.WPF/MainWindow.axaml.cs
@@ -21,7 +21,6 @@ using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
-using Avalonia.Controls.Primitives;
using UVtools.Core;
using UVtools.Core.Extensions;
using UVtools.Core.FileFormats;
@@ -918,7 +917,7 @@ namespace UVtools.WPF
if (!File.Exists(fileName)) return;
CloseFile();
var fileNameOnly = Path.GetFileName(fileName);
- App.SlicerFile = FileFormat.FindByExtension(fileName, true, true);
+ SlicerFile = FileFormat.FindByExtension(fileName, true, true);
if (SlicerFile is null) return;
IsGUIEnabled = false;
@@ -948,7 +947,7 @@ namespace UVtools.WPF
if (!task)
{
SlicerFile.Dispose();
- App.SlicerFile = null;
+ SlicerFile = null;
return;
}
@@ -961,7 +960,7 @@ namespace UVtools.WPF
"- An internal programing error\n\n" +
"Please check your file and retry", "Error reading file");
SlicerFile.Dispose();
- App.SlicerFile = null;
+ SlicerFile = null;
return;
}
@@ -1005,7 +1004,7 @@ namespace UVtools.WPF
if (task && convertedFile is not null)
{
- App.SlicerFile = convertedFile;
+ SlicerFile = convertedFile;
}
}
}
diff --git a/UVtools.WPF/UVtools.WPF.csproj b/UVtools.WPF/UVtools.WPF.csproj
index f2b6a94..fbf4dea 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.4.7</Version>
+ <Version>2.4.8</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">