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-08-01 18:58:33 +0300
committerTiago Conceição <Tiago_caza@hotmail.com>2021-08-01 18:58:33 +0300
commitada646f92d91175158b694e7b0c253036469d6f4 (patch)
treef0b8cbf33788e125d0ee2d3cffc8e53edcde1cb7 /UVtools.WPF
parentd104dc84f28a4709332a81700ff3a4058ebb946b (diff)
v2.16.0
- **(Add) PrusaSlicer printers:** - Creality HALOT-MAX CL-133 - Nova3D Elfin2 - Nova3D Elfin2 Mono SE - Nova3D Elfin3 Mini - Nova3D Bene4 - Nova3D Bene5 - Nova3D Whale - Nova3D Whale2 - **About box:** - (Add) Runtime information - (Fix) Limit panels width and height to not overgrow - **(Fix) macOS:** - macOS version auto-upgrade (Will only work on future releases and if running v2.16.0 or greater) - Demo file not loading - Auto disable windows scaling factor when on Monjave or greater on new instalations - (Add) Tool: Raise platform on print finish - (Add) CXDLP: Support for Halot MAX CL-133 - (Improvement) Tools: Better handling/validation of tools that are unable to run with abstraction - (Improvement) CWS: Simplify filenames inside the archive - (Upgrade) EmguCV from 4.5.2 to 4.5.3 - (Change) Allow to set layer `LightPWM` to 0 - (Fix) Arrange dropdown arrow from layer image save icon to be at center
Diffstat (limited to 'UVtools.WPF')
-rw-r--r--UVtools.WPF/App.axaml.cs2
-rw-r--r--UVtools.WPF/Assets/Icons/level-up-alt-16x16.pngbin0 -> 128 bytes
-rw-r--r--UVtools.WPF/Controls/Calibrators/CalibrateElephantFootControl.axaml.cs5
-rw-r--r--UVtools.WPF/Controls/Calibrators/CalibrateExposureFinderControl.axaml.cs5
-rw-r--r--UVtools.WPF/Controls/Calibrators/CalibrateExternalTestsControl.axaml.cs9
-rw-r--r--UVtools.WPF/Controls/Calibrators/CalibrateGrayscaleControl.axaml.cs6
-rw-r--r--UVtools.WPF/Controls/Calibrators/CalibrateStressTowerControl.axaml.cs11
-rw-r--r--UVtools.WPF/Controls/Calibrators/CalibrateToleranceControl.axaml.cs7
-rw-r--r--UVtools.WPF/Controls/Calibrators/CalibrateXYZAccuracyControl.axaml.cs5
-rw-r--r--UVtools.WPF/Controls/Tools/ToolBlurControl.axaml.cs5
-rw-r--r--UVtools.WPF/Controls/Tools/ToolCalculatorControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolChangeResolutionControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolControl.axaml.cs22
-rw-r--r--UVtools.WPF/Controls/Tools/ToolDynamicLayerHeightControl.axaml.cs23
-rw-r--r--UVtools.WPF/Controls/Tools/ToolDynamicLiftsControl.axaml.cs13
-rw-r--r--UVtools.WPF/Controls/Tools/ToolEditParametersControl.axaml.cs13
-rw-r--r--UVtools.WPF/Controls/Tools/ToolFlipControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolIPrintedThisFileControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolInfillControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolLayerArithmeticControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolLayerCloneControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolLayerExportGifControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolLayerExportHeatMapControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolLayerExportSkeletonControl.axaml.cs4
-rw-r--r--UVtools.WPF/Controls/Tools/ToolLayerImportControl.axaml.cs4
-rw-r--r--UVtools.WPF/Controls/Tools/ToolLayerReHeightControl.axaml.cs11
-rw-r--r--UVtools.WPF/Controls/Tools/ToolLayerRemoveControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolLightBleedCompensationControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolMaskControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolMorphControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolMoveControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolPatternControl.axaml.cs12
-rw-r--r--UVtools.WPF/Controls/Tools/ToolPixelArithmeticControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolPixelDimmingControl.axaml.cs10
-rw-r--r--UVtools.WPF/Controls/Tools/ToolRaftReliefControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolRaiseOnPrintFinishControl.axaml38
-rw-r--r--UVtools.WPF/Controls/Tools/ToolRaiseOnPrintFinishControl.axaml.cs23
-rw-r--r--UVtools.WPF/Controls/Tools/ToolRedrawModelControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolRepairLayersControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolResizeControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolRotateControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolScriptingControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolSolidifyControl.axaml.cs3
-rw-r--r--UVtools.WPF/Controls/Tools/ToolThresholdControl.axaml.cs3
-rw-r--r--UVtools.WPF/MainWindow.axaml2
-rw-r--r--UVtools.WPF/MainWindow.axaml.cs12
-rw-r--r--UVtools.WPF/Structures/AppVersionChecker.cs31
-rw-r--r--UVtools.WPF/Structures/OperationProfiles.cs1
-rw-r--r--UVtools.WPF/UVtools.WPF.csproj4
-rw-r--r--UVtools.WPF/UserSettings.cs15
-rw-r--r--UVtools.WPF/Windows/AboutWindow.axaml16
-rw-r--r--UVtools.WPF/Windows/AboutWindow.axaml.cs3
-rw-r--r--UVtools.WPF/Windows/SettingsWindow.axaml.cs2
53 files changed, 244 insertions, 139 deletions
diff --git a/UVtools.WPF/App.axaml.cs b/UVtools.WPF/App.axaml.cs
index ba3231c..c5199fe 100644
--- a/UVtools.WPF/App.axaml.cs
+++ b/UVtools.WPF/App.axaml.cs
@@ -108,7 +108,7 @@ namespace UVtools.WPF
{
try
{
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ if (OperatingSystem.IsWindows())
{
StartProcess($"{AppExecutable}.exe", $"\"{filePath}\"");
}
diff --git a/UVtools.WPF/Assets/Icons/level-up-alt-16x16.png b/UVtools.WPF/Assets/Icons/level-up-alt-16x16.png
new file mode 100644
index 0000000..0c18e5f
--- /dev/null
+++ b/UVtools.WPF/Assets/Icons/level-up-alt-16x16.png
Binary files differ
diff --git a/UVtools.WPF/Controls/Calibrators/CalibrateElephantFootControl.axaml.cs b/UVtools.WPF/Controls/Calibrators/CalibrateElephantFootControl.axaml.cs
index 3cdd6f6..f8cb3cd 100644
--- a/UVtools.WPF/Controls/Calibrators/CalibrateElephantFootControl.axaml.cs
+++ b/UVtools.WPF/Controls/Calibrators/CalibrateElephantFootControl.axaml.cs
@@ -29,9 +29,10 @@ namespace UVtools.WPF.Controls.Calibrators
public CalibrateElephantFootControl()
{
- InitializeComponent();
-
BaseOperation = new OperationCalibrateElephantFoot(SlicerFile);
+ if (!ValidateSpawn()) return;
+
+ InitializeComponent();
_kernelCtrl = this.Find<KernelControl>("KernelCtrl");
diff --git a/UVtools.WPF/Controls/Calibrators/CalibrateExposureFinderControl.axaml.cs b/UVtools.WPF/Controls/Calibrators/CalibrateExposureFinderControl.axaml.cs
index 5fc920d..c287f01 100644
--- a/UVtools.WPF/Controls/Calibrators/CalibrateExposureFinderControl.axaml.cs
+++ b/UVtools.WPF/Controls/Calibrators/CalibrateExposureFinderControl.axaml.cs
@@ -35,9 +35,12 @@ namespace UVtools.WPF.Controls.Calibrators
public CalibrateExposureFinderControl()
{
+ BaseOperation = new OperationCalibrateExposureFinder(SlicerFile);
+ if (!ValidateSpawn()) return;
+
InitializeComponent();
+
_exposureTable = this.FindControl<DataGrid>("ExposureTable");
- BaseOperation = new OperationCalibrateExposureFinder(SlicerFile);
_timer = new Timer(100)
{
diff --git a/UVtools.WPF/Controls/Calibrators/CalibrateExternalTestsControl.axaml.cs b/UVtools.WPF/Controls/Calibrators/CalibrateExternalTestsControl.axaml.cs
index 5030ce3..fd70ebb 100644
--- a/UVtools.WPF/Controls/Calibrators/CalibrateExternalTestsControl.axaml.cs
+++ b/UVtools.WPF/Controls/Calibrators/CalibrateExternalTestsControl.axaml.cs
@@ -1,7 +1,4 @@
-using System.Diagnostics;
-using Avalonia;
-using Avalonia.Controls;
-using Avalonia.Markup.Xaml;
+using Avalonia.Markup.Xaml;
using UVtools.Core.Operations;
using UVtools.WPF.Controls.Tools;
@@ -12,8 +9,10 @@ namespace UVtools.WPF.Controls.Calibrators
public OperationCalibrateExternalTests Operation => BaseOperation as OperationCalibrateExternalTests;
public CalibrateExternalTestsControl()
{
- InitializeComponent();
BaseOperation = new OperationCalibrateExternalTests(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
+
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Calibrators/CalibrateGrayscaleControl.axaml.cs b/UVtools.WPF/Controls/Calibrators/CalibrateGrayscaleControl.axaml.cs
index b585105..02a7a81 100644
--- a/UVtools.WPF/Controls/Calibrators/CalibrateGrayscaleControl.axaml.cs
+++ b/UVtools.WPF/Controls/Calibrators/CalibrateGrayscaleControl.axaml.cs
@@ -24,10 +24,12 @@ namespace UVtools.WPF.Controls.Calibrators
public CalibrateGrayscaleControl()
{
- InitializeComponent();
-
BaseOperation = new OperationCalibrateGrayscale(SlicerFile);
+ if (!ValidateSpawn()) return;
+
+ InitializeComponent();
+
_timer = new Timer(20)
{
AutoReset = false
diff --git a/UVtools.WPF/Controls/Calibrators/CalibrateStressTowerControl.axaml.cs b/UVtools.WPF/Controls/Calibrators/CalibrateStressTowerControl.axaml.cs
index 60f3fe7..77bcc06 100644
--- a/UVtools.WPF/Controls/Calibrators/CalibrateStressTowerControl.axaml.cs
+++ b/UVtools.WPF/Controls/Calibrators/CalibrateStressTowerControl.axaml.cs
@@ -1,12 +1,6 @@
-using System.Diagnostics;
-using System.Timers;
-using Avalonia.Markup.Xaml;
-using Avalonia.Media.Imaging;
-using Avalonia.Threading;
+using Avalonia.Markup.Xaml;
using UVtools.Core.Operations;
using UVtools.WPF.Controls.Tools;
-using UVtools.WPF.Extensions;
-using UVtools.WPF.Windows;
namespace UVtools.WPF.Controls.Calibrators
{
@@ -16,8 +10,9 @@ namespace UVtools.WPF.Controls.Calibrators
public CalibrateStressTowerControl()
{
- InitializeComponent();
BaseOperation = new OperationCalibrateStressTower(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Calibrators/CalibrateToleranceControl.axaml.cs b/UVtools.WPF/Controls/Calibrators/CalibrateToleranceControl.axaml.cs
index 544b49a..b37ce70 100644
--- a/UVtools.WPF/Controls/Calibrators/CalibrateToleranceControl.axaml.cs
+++ b/UVtools.WPF/Controls/Calibrators/CalibrateToleranceControl.axaml.cs
@@ -1,5 +1,4 @@
-using System.Diagnostics;
-using System.Timers;
+using System.Timers;
using Avalonia.Markup.Xaml;
using Avalonia.Media.Imaging;
using Avalonia.Threading;
@@ -38,8 +37,10 @@ namespace UVtools.WPF.Controls.Calibrators
public CalibrateToleranceControl()
{
- InitializeComponent();
BaseOperation = new OperationCalibrateTolerance(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
+
_timer = new Timer(100)
{
diff --git a/UVtools.WPF/Controls/Calibrators/CalibrateXYZAccuracyControl.axaml.cs b/UVtools.WPF/Controls/Calibrators/CalibrateXYZAccuracyControl.axaml.cs
index c3ded15..2d6a7f1 100644
--- a/UVtools.WPF/Controls/Calibrators/CalibrateXYZAccuracyControl.axaml.cs
+++ b/UVtools.WPF/Controls/Calibrators/CalibrateXYZAccuracyControl.axaml.cs
@@ -36,9 +36,10 @@ namespace UVtools.WPF.Controls.Calibrators
public CalibrateXYZAccuracyControl()
{
- InitializeComponent();
BaseOperation = new OperationCalibrateXYZAccuracy(SlicerFile);
-
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
+
_timer = new Timer(20)
{
AutoReset = false
diff --git a/UVtools.WPF/Controls/Tools/ToolBlurControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolBlurControl.axaml.cs
index 86e5c19..8cb952f 100644
--- a/UVtools.WPF/Controls/Tools/ToolBlurControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolBlurControl.axaml.cs
@@ -1,7 +1,6 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using UVtools.Core.Operations;
-using UVtools.WPF.Windows;
namespace UVtools.WPF.Controls.Tools
{
@@ -12,8 +11,10 @@ namespace UVtools.WPF.Controls.Tools
public ToolBlurControl()
{
- InitializeComponent();
BaseOperation = new OperationBlur(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
+
_kernelCtrl = this.Find<KernelControl>("KernelCtrl");
}
diff --git a/UVtools.WPF/Controls/Tools/ToolCalculatorControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolCalculatorControl.axaml.cs
index a31547f..5682747 100644
--- a/UVtools.WPF/Controls/Tools/ToolCalculatorControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolCalculatorControl.axaml.cs
@@ -19,8 +19,9 @@ namespace UVtools.WPF.Controls.Tools
public ToolCalculatorControl()
{
- InitializeComponent();
BaseOperation = new OperationCalculator(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolChangeResolutionControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolChangeResolutionControl.axaml.cs
index 8f60728..9eac9e5 100644
--- a/UVtools.WPF/Controls/Tools/ToolChangeResolutionControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolChangeResolutionControl.axaml.cs
@@ -33,8 +33,9 @@ namespace UVtools.WPF.Controls.Tools
public ToolChangeResolutionControl()
{
- InitializeComponent();
BaseOperation = new OperationChangeResolution(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolControl.axaml.cs
index d4937a1..89631a8 100644
--- a/UVtools.WPF/Controls/Tools/ToolControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolControl.axaml.cs
@@ -1,4 +1,5 @@
-using System.Threading.Tasks;
+using System.Diagnostics;
+using System.Threading.Tasks;
using Avalonia.Markup.Xaml;
using UVtools.Core.Objects;
using UVtools.Core.Operations;
@@ -50,6 +51,25 @@ namespace UVtools.WPF.Controls.Tools
AvaloniaXamlLoader.Load(this);
}
+ public bool ValidateSpawn()
+ {
+ if(_baseOperation is null)
+ {
+ App.MainWindow.MessageBoxInfo("The operation does not contain a valid configuration.\n" +
+ "Please contact the support/developer.", BaseOperation.NotSupportedTitle).ConfigureAwait(false);
+ CanRun = false;
+ return false;
+ }
+ if (!_baseOperation.ValidateSpawn(out var message))
+ {
+ App.MainWindow.MessageBoxInfo(message, BaseOperation.NotSupportedTitle).ConfigureAwait(false);
+ CanRun = false;
+ return false;
+ }
+
+ return true;
+ }
+
public virtual void Callback(ToolWindow.Callbacks callback) { }
public virtual bool UpdateOperation() => true;
diff --git a/UVtools.WPF/Controls/Tools/ToolDynamicLayerHeightControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolDynamicLayerHeightControl.axaml.cs
index 28a1599..1112e84 100644
--- a/UVtools.WPF/Controls/Tools/ToolDynamicLayerHeightControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolDynamicLayerHeightControl.axaml.cs
@@ -1,4 +1,3 @@
-using System;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using UVtools.Core;
@@ -22,27 +21,7 @@ namespace UVtools.WPF.Controls.Tools
public ToolDynamicLayerHeightControl()
{
BaseOperation = new OperationDynamicLayerHeight(SlicerFile);
-
- if (SlicerFile.LayerHeight * 2 > FileFormat.MaximumLayerHeight)
- {
- App.MainWindow.MessageBoxError($"This file already uses the maximum layer height possible ({SlicerFile.LayerHeight}mm).\n" +
- $"Layers can not be stacked, please re-slice your file with the lowest layer height of 0.01mm.",
- $"{BaseOperation.Title} unable to run");
- CanRun = false;
- return;
- }
-
- for (uint layerIndex = 1; layerIndex < SlicerFile.LayerCount; layerIndex++)
- {
- if ((decimal)Math.Round(SlicerFile[layerIndex].PositionZ - SlicerFile[layerIndex - 1].PositionZ, Layer.HeightPrecision) ==
- (decimal)SlicerFile.LayerHeight) continue;
- App.MainWindow.MessageBoxError($"This file contain layer(s) with modified positions, starting at layer {layerIndex}.\n" +
- $"This tool requires sequential layers with equal height.\n" +
- $"If you run this tool before, you cant re-run.",
- $"{BaseOperation.Title} unable to run");
- CanRun = false;
- return;
- }
+ if (!ValidateSpawn()) return;
if (!SlicerFile.HaveLayerParameterModifier(FileFormat.PrintParameterModifier.ExposureTime))
{
diff --git a/UVtools.WPF/Controls/Tools/ToolDynamicLiftsControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolDynamicLiftsControl.axaml.cs
index 3e6b548..ae001c9 100644
--- a/UVtools.WPF/Controls/Tools/ToolDynamicLiftsControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolDynamicLiftsControl.axaml.cs
@@ -1,7 +1,4 @@
-using System.Linq;
using Avalonia.Markup.Xaml;
-using MoreLinq.Extensions;
-using UVtools.Core.FileFormats;
using UVtools.Core.Operations;
using UVtools.WPF.Extensions;
@@ -12,14 +9,10 @@ namespace UVtools.WPF.Controls.Tools
public OperationDynamicLifts Operation => BaseOperation as OperationDynamicLifts;
public ToolDynamicLiftsControl()
{
- InitializeComponent();
BaseOperation = new OperationDynamicLifts(SlicerFile);
- if (!SlicerFile.HaveLayerParameterModifier(FileFormat.PrintParameterModifier.LiftHeight) ||
- !SlicerFile.HaveLayerParameterModifier(FileFormat.PrintParameterModifier.LiftSpeed))
- {
- App.MainWindow.MessageBoxInfo("Your printer/format does not support this tool.", "Dynamic lifts - Printer not supported");
- CanRun = false;
- }
+ if (!ValidateSpawn()) return;
+
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolEditParametersControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolEditParametersControl.axaml.cs
index 58107ad..475edb0 100644
--- a/UVtools.WPF/Controls/Tools/ToolEditParametersControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolEditParametersControl.axaml.cs
@@ -110,17 +110,10 @@ namespace UVtools.WPF.Controls.Tools
public ToolEditParametersControl()
{
- InitializeComponent();
-
BaseOperation = new OperationEditParameters(SlicerFile);
-
- if (Operation.Modifiers is null || Operation.Modifiers.Length == 0)
- {
- CanRun = false;
- App.MainWindow.MessageBoxError("No available properties to edit on this file format.", BaseOperation.Title).GetAwaiter();
- return;
- }
-
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
+
grid = this.FindControl<Grid>("grid");
}
diff --git a/UVtools.WPF/Controls/Tools/ToolFlipControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolFlipControl.axaml.cs
index 44ea089..e3ee20e 100644
--- a/UVtools.WPF/Controls/Tools/ToolFlipControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolFlipControl.axaml.cs
@@ -9,8 +9,9 @@ namespace UVtools.WPF.Controls.Tools
public ToolFlipControl()
{
- InitializeComponent();
BaseOperation = new OperationFlip(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolIPrintedThisFileControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolIPrintedThisFileControl.axaml.cs
index 91ed2f1..9a751b3 100644
--- a/UVtools.WPF/Controls/Tools/ToolIPrintedThisFileControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolIPrintedThisFileControl.axaml.cs
@@ -9,8 +9,9 @@ namespace UVtools.WPF.Controls.Tools
public ToolIPrintedThisFileControl()
{
- InitializeComponent();
BaseOperation = new OperationIPrintedThisFile(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolInfillControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolInfillControl.axaml.cs
index c8fbb10..e199f59 100644
--- a/UVtools.WPF/Controls/Tools/ToolInfillControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolInfillControl.axaml.cs
@@ -9,8 +9,9 @@ namespace UVtools.WPF.Controls.Tools
public ToolInfillControl()
{
- InitializeComponent();
BaseOperation = new OperationInfill(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolLayerArithmeticControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolLayerArithmeticControl.axaml.cs
index eaf2b35..379f8db 100644
--- a/UVtools.WPF/Controls/Tools/ToolLayerArithmeticControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolLayerArithmeticControl.axaml.cs
@@ -10,8 +10,9 @@ namespace UVtools.WPF.Controls.Tools
public ToolLayerArithmeticControl()
{
- InitializeComponent();
BaseOperation = new OperationLayerArithmetic(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolLayerCloneControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolLayerCloneControl.axaml.cs
index f562ba8..382c5c8 100644
--- a/UVtools.WPF/Controls/Tools/ToolLayerCloneControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolLayerCloneControl.axaml.cs
@@ -32,8 +32,9 @@ namespace UVtools.WPF.Controls.Tools
public ToolLayerCloneControl()
{
- InitializeComponent();
BaseOperation = new OperationLayerClone(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolLayerExportGifControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolLayerExportGifControl.axaml.cs
index 8afc78a..e998a5e 100644
--- a/UVtools.WPF/Controls/Tools/ToolLayerExportGifControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolLayerExportGifControl.axaml.cs
@@ -11,8 +11,9 @@ namespace UVtools.WPF.Controls.Tools
public OperationLayerExportGif Operation => BaseOperation as OperationLayerExportGif;
public ToolLayerExportGifControl()
{
- InitializeComponent();
BaseOperation = new OperationLayerExportGif(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolLayerExportHeatMapControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolLayerExportHeatMapControl.axaml.cs
index 6c6d74e..b3bf58c 100644
--- a/UVtools.WPF/Controls/Tools/ToolLayerExportHeatMapControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolLayerExportHeatMapControl.axaml.cs
@@ -12,8 +12,9 @@ namespace UVtools.WPF.Controls.Tools
public OperationLayerExportHeatMap Operation => BaseOperation as OperationLayerExportHeatMap;
public ToolLayerExportHeatMapControl()
{
- InitializeComponent();
BaseOperation = new OperationLayerExportHeatMap(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolLayerExportSkeletonControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolLayerExportSkeletonControl.axaml.cs
index 02091f4..653c304 100644
--- a/UVtools.WPF/Controls/Tools/ToolLayerExportSkeletonControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolLayerExportSkeletonControl.axaml.cs
@@ -1,5 +1,4 @@
using System.IO;
-using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using UVtools.Core.Operations;
@@ -11,8 +10,9 @@ namespace UVtools.WPF.Controls.Tools
public OperationLayerExportSkeleton Operation => BaseOperation as OperationLayerExportSkeleton;
public ToolLayerExportSkeletonControl()
{
- InitializeComponent();
BaseOperation = new OperationLayerExportSkeleton(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolLayerImportControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolLayerImportControl.axaml.cs
index baa6316..f2bfefa 100644
--- a/UVtools.WPF/Controls/Tools/ToolLayerImportControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolLayerImportControl.axaml.cs
@@ -84,8 +84,10 @@ namespace UVtools.WPF.Controls.Tools
public ToolLayerImportControl()
{
- InitializeComponent();
BaseOperation = new OperationLayerImport(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
+
FilesListBox = this.Find<ListBox>("FilesListBox");
FilesListBox.DoubleTapped += (sender, args) =>
{
diff --git a/UVtools.WPF/Controls/Tools/ToolLayerReHeightControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolLayerReHeightControl.axaml.cs
index 8a848b9..42d9582 100644
--- a/UVtools.WPF/Controls/Tools/ToolLayerReHeightControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolLayerReHeightControl.axaml.cs
@@ -1,6 +1,5 @@
using Avalonia.Markup.Xaml;
using UVtools.Core.Operations;
-using UVtools.WPF.Extensions;
namespace UVtools.WPF.Controls.Tools
{
@@ -12,14 +11,10 @@ namespace UVtools.WPF.Controls.Tools
public ToolLayerReHeightControl()
{
- InitializeComponent();
BaseOperation = new OperationLayerReHeight(SlicerFile);
- if (Operation.SelectedItem is null)
- {
- App.MainWindow.MessageBoxInfo("No valid configuration to be able to re-height.\n" +
- "As workaround clone first or last layer and try re run this tool.", "Not possible to re-height");
- CanRun = false;
- }
+ if (!ValidateSpawn()) return;
+
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolLayerRemoveControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolLayerRemoveControl.axaml.cs
index dc0a3bd..8beeede 100644
--- a/UVtools.WPF/Controls/Tools/ToolLayerRemoveControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolLayerRemoveControl.axaml.cs
@@ -32,8 +32,9 @@ namespace UVtools.WPF.Controls.Tools
public ToolLayerRemoveControl()
{
- InitializeComponent();
BaseOperation = new OperationLayerRemove(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolLightBleedCompensationControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolLightBleedCompensationControl.axaml.cs
index 1cb0f32..baa7825 100644
--- a/UVtools.WPF/Controls/Tools/ToolLightBleedCompensationControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolLightBleedCompensationControl.axaml.cs
@@ -8,8 +8,9 @@ namespace UVtools.WPF.Controls.Tools
public OperationLightBleedCompensation Operation => BaseOperation as OperationLightBleedCompensation;
public ToolLightBleedCompensationControl()
{
- InitializeComponent();
BaseOperation = new OperationLightBleedCompensation(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolMaskControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolMaskControl.axaml.cs
index aeff08d..12499ee 100644
--- a/UVtools.WPF/Controls/Tools/ToolMaskControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolMaskControl.axaml.cs
@@ -68,8 +68,9 @@ namespace UVtools.WPF.Controls.Tools
public ToolMaskControl()
{
- InitializeComponent();
BaseOperation = new OperationMask(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolMorphControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolMorphControl.axaml.cs
index b3ca26d..9e95c3e 100644
--- a/UVtools.WPF/Controls/Tools/ToolMorphControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolMorphControl.axaml.cs
@@ -12,8 +12,9 @@ namespace UVtools.WPF.Controls.Tools
public ToolMorphControl()
{
- InitializeComponent();
BaseOperation = new OperationMorph(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
_kernelCtrl = this.Find<KernelControl>("KernelCtrl");
}
diff --git a/UVtools.WPF/Controls/Tools/ToolMoveControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolMoveControl.axaml.cs
index 3754a4b..deb4634 100644
--- a/UVtools.WPF/Controls/Tools/ToolMoveControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolMoveControl.axaml.cs
@@ -17,9 +17,10 @@ namespace UVtools.WPF.Controls.Tools
public ToolMoveControl()
{
+ BaseOperation = new OperationMove(SlicerFile);
+ if (!ValidateSpawn()) return;
InitializeComponent();
- BaseOperation = new OperationMove(SlicerFile);
Operation.PropertyChanged += (sender, e) =>
{
diff --git a/UVtools.WPF/Controls/Tools/ToolPatternControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolPatternControl.axaml.cs
index 5c31b45..b98f605 100644
--- a/UVtools.WPF/Controls/Tools/ToolPatternControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolPatternControl.axaml.cs
@@ -19,17 +19,9 @@ namespace UVtools.WPF.Controls.Tools
public ToolPatternControl()
{
+ BaseOperation = new OperationPattern(SlicerFile, App.MainWindow.ROI);
+ if (!ValidateSpawn()) return;
InitializeComponent();
- var roi = App.MainWindow.ROI;
- BaseOperation = new OperationPattern(SlicerFile, roi);
-
- if (Operation.MaxRows < 2 && Operation.MaxCols < 2)
- {
- App.MainWindow.MessageBoxInfo("The available free volume is not enough to pattern this object.\n" +
- "To run this tool the free space must allow at least 1 copy.", "Unable to pattern");
- CanRun = false;
- return;
- }
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolPixelArithmeticControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolPixelArithmeticControl.axaml.cs
index eda6fcd..bc151a4 100644
--- a/UVtools.WPF/Controls/Tools/ToolPixelArithmeticControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolPixelArithmeticControl.axaml.cs
@@ -8,8 +8,9 @@ namespace UVtools.WPF.Controls.Tools
public OperationPixelArithmetic Operation => BaseOperation as OperationPixelArithmetic;
public ToolPixelArithmeticControl()
{
- InitializeComponent();
BaseOperation = new OperationPixelArithmetic(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolPixelDimmingControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolPixelDimmingControl.axaml.cs
index 2d32651..17f02cf 100644
--- a/UVtools.WPF/Controls/Tools/ToolPixelDimmingControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolPixelDimmingControl.axaml.cs
@@ -1,10 +1,6 @@
-using System;
-using Avalonia.Controls;
+using Avalonia.Controls;
using Avalonia.Markup.Xaml;
-using Emgu.CV;
-using UVtools.Core.Extensions;
using UVtools.Core.Operations;
-using UVtools.WPF.Extensions;
namespace UVtools.WPF.Controls.Tools
{
@@ -15,8 +11,10 @@ namespace UVtools.WPF.Controls.Tools
public ToolPixelDimmingControl()
{
- InitializeComponent();
BaseOperation = new OperationPixelDimming(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
+
Operation.GeneratePixelDimming("Chessboard");
}
diff --git a/UVtools.WPF/Controls/Tools/ToolRaftReliefControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolRaftReliefControl.axaml.cs
index 5d61417..1f51d70 100644
--- a/UVtools.WPF/Controls/Tools/ToolRaftReliefControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolRaftReliefControl.axaml.cs
@@ -9,8 +9,9 @@ namespace UVtools.WPF.Controls.Tools
public ToolRaftReliefControl()
{
- this.InitializeComponent();
BaseOperation = new OperationRaftRelief(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolRaiseOnPrintFinishControl.axaml b/UVtools.WPF/Controls/Tools/ToolRaiseOnPrintFinishControl.axaml
new file mode 100644
index 0000000..9b82482
--- /dev/null
+++ b/UVtools.WPF/Controls/Tools/ToolRaiseOnPrintFinishControl.axaml
@@ -0,0 +1,38 @@
+<UserControl xmlns="https://github.com/avaloniaui"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
+ MinWidth="600"
+ x:Class="UVtools.WPF.Controls.Tools.ToolRaiseOnPrintFinishControl">
+
+ <Grid RowDefinitions="Auto"
+ ColumnDefinitions="Auto,10,200,5,Auto,20,Auto">
+ <TextBlock Grid.Row="0" Grid.Column="0"
+ VerticalAlignment="Center"
+ Text="Raise to:"
+ />
+
+ <NumericUpDown Grid.Row="0" Grid.Column="2"
+ VerticalAlignment="Center"
+ Increment="1"
+ Minimum="{Binding Operation.MinimumPositionZ}"
+ Maximum="1000"
+ FormatString="F2"
+ Value="{Binding Operation.PositionZ}"
+ />
+
+ <TextBlock Grid.Row="0" Grid.Column="4"
+ VerticalAlignment="Center"
+ Text="mm"
+ />
+
+ <CheckBox Grid.Row="0" Grid.Column="6"
+ VerticalAlignment="Center"
+ ToolTip.Tip="If enabled, output a dummy pixel inside the layer bound to prevent a empty image and to ensure the correct handle by the firmware. This will also prevent layer being removed by auto-fix issues (Empty Layers)."
+ Content="Output a dummy pixel"
+ IsChecked="{Binding Operation.OutputDummyPixel}"
+ />
+ </Grid>
+
+</UserControl>
diff --git a/UVtools.WPF/Controls/Tools/ToolRaiseOnPrintFinishControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolRaiseOnPrintFinishControl.axaml.cs
new file mode 100644
index 0000000..82a9272
--- /dev/null
+++ b/UVtools.WPF/Controls/Tools/ToolRaiseOnPrintFinishControl.axaml.cs
@@ -0,0 +1,23 @@
+using Avalonia.Markup.Xaml;
+using UVtools.Core.Operations;
+
+namespace UVtools.WPF.Controls.Tools
+{
+ public partial class ToolRaiseOnPrintFinishControl : ToolControl
+ {
+ public OperationRaiseOnPrintFinish Operation => BaseOperation as OperationRaiseOnPrintFinish;
+
+ public ToolRaiseOnPrintFinishControl()
+ {
+ BaseOperation = new OperationRaiseOnPrintFinish(SlicerFile);
+ if (!ValidateSpawn()) return;
+
+ InitializeComponent();
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+ }
+}
diff --git a/UVtools.WPF/Controls/Tools/ToolRedrawModelControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolRedrawModelControl.axaml.cs
index 07778e8..5fbf6ed 100644
--- a/UVtools.WPF/Controls/Tools/ToolRedrawModelControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolRedrawModelControl.axaml.cs
@@ -12,8 +12,9 @@ namespace UVtools.WPF.Controls.Tools
public OperationRedrawModel Operation => BaseOperation as OperationRedrawModel;
public ToolRedrawModelControl()
{
- InitializeComponent();
BaseOperation = new OperationRedrawModel(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolRepairLayersControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolRepairLayersControl.axaml.cs
index a285344..235fdec 100644
--- a/UVtools.WPF/Controls/Tools/ToolRepairLayersControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolRepairLayersControl.axaml.cs
@@ -10,8 +10,9 @@ namespace UVtools.WPF.Controls.Tools
public ToolRepairLayersControl()
{
- InitializeComponent();
BaseOperation = new OperationRepairLayers(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolResizeControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolResizeControl.axaml.cs
index c55ac81..d062868 100644
--- a/UVtools.WPF/Controls/Tools/ToolResizeControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolResizeControl.axaml.cs
@@ -9,8 +9,9 @@ namespace UVtools.WPF.Controls.Tools
public ToolResizeControl()
{
- InitializeComponent();
BaseOperation = new OperationResize(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolRotateControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolRotateControl.axaml.cs
index 0fb6e9f..0883966 100644
--- a/UVtools.WPF/Controls/Tools/ToolRotateControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolRotateControl.axaml.cs
@@ -9,8 +9,9 @@ namespace UVtools.WPF.Controls.Tools
public ToolRotateControl()
{
- InitializeComponent();
BaseOperation = new OperationRotate(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolScriptingControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolScriptingControl.axaml.cs
index 7a82216..a786ac5 100644
--- a/UVtools.WPF/Controls/Tools/ToolScriptingControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolScriptingControl.axaml.cs
@@ -21,10 +21,11 @@ namespace UVtools.WPF.Controls.Tools
public ToolScriptingControl()
{
+ BaseOperation = new OperationScripting(SlicerFile);
+ if (!ValidateSpawn()) return;
InitializeComponent();
_scriptConfigurationPanel = this.FindControl<StackPanel>("ScriptConfigurationPanel");
_scriptVariablesGrid = this.FindControl<Grid>("ScriptVariablesGrid");
- BaseOperation = new OperationScripting(SlicerFile);
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolSolidifyControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolSolidifyControl.axaml.cs
index 7a138de..922dca8 100644
--- a/UVtools.WPF/Controls/Tools/ToolSolidifyControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolSolidifyControl.axaml.cs
@@ -8,8 +8,9 @@ namespace UVtools.WPF.Controls.Tools
public OperationSolidify Operation => BaseOperation as OperationSolidify;
public ToolSolidifyControl()
{
- InitializeComponent();
BaseOperation = new OperationSolidify(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/Controls/Tools/ToolThresholdControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolThresholdControl.axaml.cs
index 3be8386..4287b3b 100644
--- a/UVtools.WPF/Controls/Tools/ToolThresholdControl.axaml.cs
+++ b/UVtools.WPF/Controls/Tools/ToolThresholdControl.axaml.cs
@@ -73,8 +73,9 @@ namespace UVtools.WPF.Controls.Tools
public ToolThresholdControl()
{
- InitializeComponent();
BaseOperation = new OperationThreshold(SlicerFile);
+ if (!ValidateSpawn()) return;
+ InitializeComponent();
}
private void InitializeComponent()
diff --git a/UVtools.WPF/MainWindow.axaml b/UVtools.WPF/MainWindow.axaml
index 1d0d098..e078ba6 100644
--- a/UVtools.WPF/MainWindow.axaml
+++ b/UVtools.WPF/MainWindow.axaml
@@ -1975,7 +1975,7 @@
</Button.ContextMenu>
<StackPanel Orientation="Horizontal">
<Image Source="/Assets/Icons/save-16x16.png"/>
- <TextBlock Text=" ⮟"/>
+ <TextBlock VerticalAlignment="Center" Text=" ⮟"/>
</StackPanel>
</Button>
diff --git a/UVtools.WPF/MainWindow.axaml.cs b/UVtools.WPF/MainWindow.axaml.cs
index 925e554..22a966e 100644
--- a/UVtools.WPF/MainWindow.axaml.cs
+++ b/UVtools.WPF/MainWindow.axaml.cs
@@ -233,6 +233,14 @@ namespace UVtools.WPF
},
new()
{
+ Tag = new OperationRaiseOnPrintFinish(),
+ Icon = new Avalonia.Controls.Image
+ {
+ Source = new Bitmap(App.GetAsset("/Assets/Icons/level-up-alt-16x16.png"))
+ }
+ },
+ new()
+ {
Tag = new OperationChangeResolution(),
Icon = new Avalonia.Controls.Image
{
@@ -567,7 +575,7 @@ namespace UVtools.WPF
ProcessFiles(Program.Args);
if (!IsFileLoaded && Settings.General.LoadDemoFileOnStartup)
{
- ProcessFile(About.DemoFile);
+ ProcessFile(Path.Combine(App.ApplicationPath, About.DemoFile));
}
DispatcherTimer.Run(() =>
@@ -906,7 +914,7 @@ namespace UVtools.WPF
$"{VersionChecker.Changelog}", $"Update UVtools to v{VersionChecker.Version}?", ButtonEnum.YesNoCancel);
- if (result == ButtonResult.No || OperatingSystem.IsMacOS())
+ if (result == ButtonResult.No)
{
App.OpenBrowser(VersionChecker.UrlLatestRelease);
return;
diff --git a/UVtools.WPF/Structures/AppVersionChecker.cs b/UVtools.WPF/Structures/AppVersionChecker.cs
index 89cceaa..5511e2e 100644
--- a/UVtools.WPF/Structures/AppVersionChecker.cs
+++ b/UVtools.WPF/Structures/AppVersionChecker.cs
@@ -52,15 +52,15 @@ namespace UVtools.WPF.Structures
{
get
{
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ if (OperatingSystem.IsWindows())
{
return "win-x64";
}
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+ if (OperatingSystem.IsLinux())
{
return "linux-x64";
}
- if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
+ if (OperatingSystem.IsMacOS())
{
return "osx-x64";
}
@@ -195,15 +195,26 @@ namespace UVtools.WPF.Structures
stream.WriteLine($"cd '{App.ApplicationPath}'");
stream.WriteLine($"killall {About.Software}");
stream.WriteLine("sleep 0.5");
- stream.WriteLine($"cp -fR {upgradeFolder}/* .");
+
+
+ //stream.WriteLine($"[ -f {About.Software} ] && {App.AppExecutableQuoted} & || dotnet {About.Software}.dll &");
+ if (OperatingSystem.IsMacOS() && App.ApplicationPath.EndsWith(".app/Contents/MacOS"))
+ {
+ stream.WriteLine($"cp -fR {upgradeFolder}/* ../../../");
+ stream.WriteLine($"open ../../../{About.Software}.app");
+ }
+ else
+ {
+ stream.WriteLine($"cp -fR {upgradeFolder}/* .");
+ stream.WriteLine($"if [ -f '{About.Software}' ]; then");
+ stream.WriteLine($" ./{About.Software} &");
+ stream.WriteLine("else");
+ stream.WriteLine($" dotnet {About.Software}.dll &");
+ stream.WriteLine("fi");
+ }
+
stream.WriteLine($"rm -fr {upgradeFolder}");
stream.WriteLine("sleep 0.5");
- //stream.WriteLine($"[ -f {About.Software} ] && {App.AppExecutableQuoted} & || dotnet {About.Software}.dll &");
- stream.WriteLine($"if [ -f '{About.Software}' ]; then");
- stream.WriteLine($" ./{About.Software} &");
- stream.WriteLine("else");
- stream.WriteLine($" dotnet {About.Software}.dll &");
- stream.WriteLine("fi");
stream.WriteLine($"rm -f {upgradeFileName}");
//stream.WriteLine("exit");
stream.Close();
diff --git a/UVtools.WPF/Structures/OperationProfiles.cs b/UVtools.WPF/Structures/OperationProfiles.cs
index b7fd8e2..5372361 100644
--- a/UVtools.WPF/Structures/OperationProfiles.cs
+++ b/UVtools.WPF/Structures/OperationProfiles.cs
@@ -39,6 +39,7 @@ namespace UVtools.WPF.Structures
[XmlElement(typeof(OperationBlur))]
[XmlElement(typeof(OperationDynamicLayerHeight))]
[XmlElement(typeof(OperationDynamicLifts))]
+ [XmlElement(typeof(OperationRaiseOnPrintFinish))]
[XmlElement(typeof(OperationChangeResolution))]
[XmlElement(typeof(OperationLayerExportGif))]
diff --git a/UVtools.WPF/UVtools.WPF.csproj b/UVtools.WPF/UVtools.WPF.csproj
index 23296a9..88b3e89 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.15.1</Version>
+ <Version>2.16.0</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -29,7 +29,7 @@
<PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.6" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.6" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.6" />
- <PackageReference Include="Emgu.CV.runtime.windows" Version="4.5.2.4673" />
+ <PackageReference Include="Emgu.CV.runtime.windows" Version="4.5.3.4721" />
<PackageReference Include="MessageBox.Avalonia" Version="1.5.1" />
<PackageReference Include="ThemeEditor.Controls.ColorPicker" Version="0.10.6" />
</ItemGroup>
diff --git a/UVtools.WPF/UserSettings.cs b/UVtools.WPF/UserSettings.cs
index 23dab0c..a5b3df2 100644
--- a/UVtools.WPF/UserSettings.cs
+++ b/UVtools.WPF/UserSettings.cs
@@ -1369,8 +1369,18 @@ namespace UVtools.WPF
#endregion
#region Constructor
+
private UserSettings()
- { }
+ {
+ if (OperatingSystem.IsMacOS()) // Fix macOS scaling information
+ {
+ var monjave = new Version(10, 14, 6);
+ if (Environment.OSVersion.Version.CompareTo(monjave) >= 0)
+ {
+ General.WindowsTakeIntoAccountScreenScaling = false;
+ }
+ }
+ }
#endregion
#region Static Methods
@@ -1450,7 +1460,8 @@ namespace UVtools.WPF
Instance.LayerPreview,
Instance.Issues,
Instance.PixelEditor,
- Instance.LayerRepair
+ Instance.LayerRepair,
+ Instance.Automations
};
#endregion
diff --git a/UVtools.WPF/Windows/AboutWindow.axaml b/UVtools.WPF/Windows/AboutWindow.axaml
index f339916..9d71d9c 100644
--- a/UVtools.WPF/Windows/AboutWindow.axaml
+++ b/UVtools.WPF/Windows/AboutWindow.axaml
@@ -14,8 +14,11 @@
<StackPanel Orientation="Vertical">
<StackPanel VerticalAlignment="Center" Orientation="Horizontal">
<Border Margin="20,20,0,20">
- <StackPanel Spacing="5">
- <Image Margin="0,0,0,15" HorizontalAlignment="Center" Source="/Assets/Icons/UVtools_alt.ico" Width="256"/>
+ <StackPanel Spacing="5" MaxWidth="360">
+ <Image Margin="0,0,0,15"
+ HorizontalAlignment="Center"
+ Source="/Assets/Icons/UVtools_alt.ico"
+ Width="256"/>
<TextBox
Text="{Binding OSDescription}"
IsReadOnly="True"
@@ -25,6 +28,14 @@
UseFloatingWatermark="True"/>
<TextBox
+ Text="{Binding RuntimeDescription}"
+ IsReadOnly="True"
+ BorderBrush="Transparent"
+ CaretBrush="Transparent"
+ Watermark="Runtime:"
+ UseFloatingWatermark="True"/>
+
+ <TextBox
Text="{Binding FrameworkDescription}"
IsReadOnly="True"
BorderBrush="Transparent"
@@ -74,6 +85,7 @@
<TextBlock Grid.Row="6" Text="{Binding Company}"/>
<TextBox Grid.Row="8"
IsReadOnly="True"
+ MaxHeight="550"
Text="{Binding Description}"/>
</Grid>
</StackPanel>
diff --git a/UVtools.WPF/Windows/AboutWindow.axaml.cs b/UVtools.WPF/Windows/AboutWindow.axaml.cs
index caba156..b8c5f8a 100644
--- a/UVtools.WPF/Windows/AboutWindow.axaml.cs
+++ b/UVtools.WPF/Windows/AboutWindow.axaml.cs
@@ -20,6 +20,9 @@ namespace UVtools.WPF.Windows
public string Description => App.AssemblyDescription;
public string OSDescription => $"{RuntimeInformation.OSDescription} {RuntimeInformation.OSArchitecture}";
+
+ public string RuntimeDescription => RuntimeInformation.RuntimeIdentifier;
+
public string FrameworkDescription => RuntimeInformation.FrameworkDescription;
public string OpenCVDescription
diff --git a/UVtools.WPF/Windows/SettingsWindow.axaml.cs b/UVtools.WPF/Windows/SettingsWindow.axaml.cs
index 0052bd0..80d1a66 100644
--- a/UVtools.WPF/Windows/SettingsWindow.axaml.cs
+++ b/UVtools.WPF/Windows/SettingsWindow.axaml.cs
@@ -146,7 +146,7 @@ namespace UVtools.WPF.Windows
foreach (var propertyInfo in properties)
{
if (propertyInfo.Name != property) continue;
- var color = (Color)propertyInfo.GetValue(packObject, null) ?? new Color(0,255,255,255);
+ var color = (Color)propertyInfo.GetValue(packObject, null) ?? new Color(255,255,255,255);
var window = new ColorPickerWindow(color.ToAvalonia());
var result = await window.ShowDialog<DialogResults>(this);
if (result != DialogResults.OK) return;