diff options
author | Tiago Conceição <Tiago_caza@hotmail.com> | 2021-05-19 23:42:07 +0300 |
---|---|---|
committer | Tiago Conceição <Tiago_caza@hotmail.com> | 2021-05-19 23:42:07 +0300 |
commit | c43badb9c15b22a27b1cae5e386f158c6c2f3b11 (patch) | |
tree | 915dfabcb509ab5a8397e67f97e7f10e9d006cc1 /UVtools.WPF | |
parent | 51c82318cf27b8e0d3425aa2ea1b093fc5b7d23f (diff) |
v2.12.1v2.12.1
- (Upgrade) AvaloniaUI from 0.10.4 to 0.10.5
- (Improvement) VDT: Implement a new key for better auto convert files between with latest version of Tango
- (Change) Exposure time finder: Bar fence offset from 2px to 4px
Diffstat (limited to 'UVtools.WPF')
-rw-r--r-- | UVtools.WPF/Controls/Calibrators/CalibrateXYZAccuracyControl.axaml.cs | 2 | ||||
-rw-r--r-- | UVtools.WPF/Controls/StaticControls.cs | 6 | ||||
-rw-r--r-- | UVtools.WPF/MainWindow.LayerPreview.cs | 21 | ||||
-rw-r--r-- | UVtools.WPF/MainWindow.axaml.cs | 5 | ||||
-rw-r--r-- | UVtools.WPF/Structures/Color.cs | 2 | ||||
-rw-r--r-- | UVtools.WPF/Structures/PEProfileFolder.cs | 6 | ||||
-rw-r--r-- | UVtools.WPF/Structures/PixelPicker.cs | 2 | ||||
-rw-r--r-- | UVtools.WPF/UVtools.WPF.csproj | 10 | ||||
-rw-r--r-- | UVtools.WPF/Windows/BenchmarkWindow.axaml.cs | 10 | ||||
-rw-r--r-- | UVtools.WPF/Windows/SettingsWindow.axaml.cs | 2 |
10 files changed, 33 insertions, 33 deletions
diff --git a/UVtools.WPF/Controls/Calibrators/CalibrateXYZAccuracyControl.axaml.cs b/UVtools.WPF/Controls/Calibrators/CalibrateXYZAccuracyControl.axaml.cs index 09c514f..04f256e 100644 --- a/UVtools.WPF/Controls/Calibrators/CalibrateXYZAccuracyControl.axaml.cs +++ b/UVtools.WPF/Controls/Calibrators/CalibrateXYZAccuracyControl.axaml.cs @@ -88,7 +88,7 @@ namespace UVtools.WPF.Controls.Calibrators public async void AddProfile() { - OperationResize resize = new OperationResize + OperationResize resize = new() { ProfileName = ProfileName, X = Operation.ScaleXFactor, diff --git a/UVtools.WPF/Controls/StaticControls.cs b/UVtools.WPF/Controls/StaticControls.cs index 3d0f943..488891c 100644 --- a/UVtools.WPF/Controls/StaticControls.cs +++ b/UVtools.WPF/Controls/StaticControls.cs @@ -4,8 +4,8 @@ namespace UVtools.WPF.Controls { public static class StaticControls { - public static Cursor ArrowCursor = new Cursor(StandardCursorType.Arrow); - public static Cursor CrossCursor = new Cursor(StandardCursorType.Cross); - public static Cursor HandCursor = new Cursor(StandardCursorType.Hand); + public static Cursor ArrowCursor = new(StandardCursorType.Arrow); + public static Cursor CrossCursor = new(StandardCursorType.Cross); + public static Cursor HandCursor = new(StandardCursorType.Hand); } } diff --git a/UVtools.WPF/MainWindow.LayerPreview.cs b/UVtools.WPF/MainWindow.LayerPreview.cs index b837352..49ed2d8 100644 --- a/UVtools.WPF/MainWindow.LayerPreview.cs +++ b/UVtools.WPF/MainWindow.LayerPreview.cs @@ -57,7 +57,7 @@ namespace UVtools.WPF private Canvas _issuesSliderCanvas; - private Timer _layerNavigationTooltipTimer = new Timer(0.1) { AutoReset = false }; + private Timer _layerNavigationTooltipTimer = new(0.1) { AutoReset = false }; private uint _actualLayer; private bool _showLayerImageRotated; @@ -99,22 +99,23 @@ namespace UVtools.WPF _showLayerOutlineHollowAreas = Settings.LayerPreview.HollowOutline; LayerImageBox.ZoomLevels = new AdvancedImageBox.ZoomLevelCollection(AppSettings.ZoomLevels); - + LayerImageBox.GetObservable(AdvancedImageBox.ZoomProperty).Subscribe(zoom => { + var newZoom = zoom; var oldZoom = LayerImageBox.OldZoom; RaisePropertyChanged(nameof(LayerZoomStr)); - AddLogVerbose($"Zoomed from {oldZoom} to {zoom}"); + AddLogVerbose($"Zoomed from {oldZoom} to {newZoom}"); if (_showLayerImageCrosshairs && Issues.Count > 0 && (oldZoom < 50 && - zoom >= 50 // Trigger refresh as crosshair thickness increases at lower zoom levels - || oldZoom > 100 && zoom <= 100 - || oldZoom is >= 50 and <= 100 && (zoom is < 50 or > 100) + newZoom >= 50 // Trigger refresh as crosshair thickness increases at lower zoom levels + || oldZoom > 100 && newZoom <= 100 + || oldZoom is >= 50 and <= 100 && (newZoom is < 50 or > 100) || oldZoom <= AppSettings.CrosshairFadeLevel && - zoom > AppSettings.CrosshairFadeLevel // Trigger refresh as zoom level manually crosses fade threshold - || oldZoom > AppSettings.CrosshairFadeLevel && zoom <= AppSettings.CrosshairFadeLevel) + newZoom > AppSettings.CrosshairFadeLevel // Trigger refresh as zoom level manually crosses fade threshold + || oldZoom > AppSettings.CrosshairFadeLevel && newZoom <= AppSettings.CrosshairFadeLevel) ) { @@ -1739,7 +1740,7 @@ namespace UVtools.WPF public uint SelectObjectRoi(Rectangle roiRectangle) { if (roiRectangle.IsEmpty) return 0; - List<Rectangle> rectangles = new List<Rectangle>(); + List<Rectangle> rectangles = new(); for (int i = 0; i < LayerCache.LayerContours.Size; i++) { var rectangle = CvInvoke.BoundingRectangle(LayerCache.LayerContours[i]); @@ -1827,7 +1828,7 @@ namespace UVtools.WPF public void UpdatePixelEditorCursor() { Mat cursor = null; - MCvScalar _pixelEditorCursorColor = new MCvScalar( + MCvScalar _pixelEditorCursorColor = new( Settings.PixelEditor.CursorColor.B, Settings.PixelEditor.CursorColor.G, Settings.PixelEditor.CursorColor.R, diff --git a/UVtools.WPF/MainWindow.axaml.cs b/UVtools.WPF/MainWindow.axaml.cs index de6127a..d0ffafc 100644 --- a/UVtools.WPF/MainWindow.axaml.cs +++ b/UVtools.WPF/MainWindow.axaml.cs @@ -1047,7 +1047,7 @@ namespace UVtools.WPF string convertFileExtension = SlicerFile switch { SL1File sl1File => sl1File.LookupCustomValue<string>(SL1File.Keyword_FileFormat, null), - VDTFile vdtFile => vdtFile.LookupCustomValue<string>(SL1File.Keyword_FileFormat, null), + VDTFile vdtFile => vdtFile.ManifestFile.Machine.UVToolsConvertTo, _ => null }; @@ -1074,8 +1074,7 @@ namespace UVtools.WPF return true; } catch (OperationCanceledException) - { - } + { } catch (Exception exception) { Dispatcher.UIThread.InvokeAsync(async () => diff --git a/UVtools.WPF/Structures/Color.cs b/UVtools.WPF/Structures/Color.cs index f347d2e..9370653 100644 --- a/UVtools.WPF/Structures/Color.cs +++ b/UVtools.WPF/Structures/Color.cs @@ -62,7 +62,7 @@ namespace UVtools.WPF.Structures return new Color(a, r, g, b); } - public static Color Empty => new Color(0,0,0,0); + public static Color Empty => new(0,0,0,0); public Color FactorColor(byte pixelColor, byte min = 0, byte max = byte.MaxValue) => FactorColor(pixelColor / 255f, min, max); diff --git a/UVtools.WPF/Structures/PEProfileFolder.cs b/UVtools.WPF/Structures/PEProfileFolder.cs index d0ce382..2c6a410 100644 --- a/UVtools.WPF/Structures/PEProfileFolder.cs +++ b/UVtools.WPF/Structures/PEProfileFolder.cs @@ -49,7 +49,7 @@ namespace UVtools.WPF.Structures { get { - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new(); foreach (CheckBox item in Items) { if (!item.IsChecked.HasValue || !item.IsChecked.Value) continue; @@ -87,7 +87,7 @@ namespace UVtools.WPF.Structures Updates = 0; Installed = 0; if (!Directory.Exists(SourcePath)) return; - DirectoryInfo di = new DirectoryInfo(SourcePath); + DirectoryInfo di = new(SourcePath); var files = di.GetFiles("*.ini"); if (files.Length == 0) return; @@ -104,7 +104,7 @@ namespace UVtools.WPF.Structures if (folderExists) { var targetFile = $"{TargetPath}{Path.DirectorySeparatorChar}{files[i].Name}"; - FileInfo targetFileInfo = new FileInfo(targetFile); + FileInfo targetFileInfo = new(targetFile); if (targetFileInfo.Exists) { Installed++; diff --git a/UVtools.WPF/Structures/PixelPicker.cs b/UVtools.WPF/Structures/PixelPicker.cs index a3d26a0..c0459ff 100644 --- a/UVtools.WPF/Structures/PixelPicker.cs +++ b/UVtools.WPF/Structures/PixelPicker.cs @@ -6,7 +6,7 @@ namespace UVtools.WPF.Structures public class PixelPicker : BindableBase { private bool _isSet; - private Point _location = new Point(0,0); + private Point _location = new(0,0); private byte _brightness; public bool IsSet diff --git a/UVtools.WPF/UVtools.WPF.csproj b/UVtools.WPF/UVtools.WPF.csproj index 3eb829a..564edcf 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.12.0</Version> + <Version>2.12.1</Version> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> @@ -24,11 +24,11 @@ <NoWarn>1701;1702;</NoWarn> </PropertyGroup> <ItemGroup> - <PackageReference Include="Avalonia" Version="0.10.4" /> + <PackageReference Include="Avalonia" Version="0.10.5" /> <PackageReference Include="Avalonia.Angle.Windows.Natives" Version="2.1.0.2020091801" /> - <PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.4" /> - <PackageReference Include="Avalonia.Desktop" Version="0.10.4" /> - <PackageReference Include="Avalonia.Diagnostics" Version="0.10.4" /> + <PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.5" /> + <PackageReference Include="Avalonia.Desktop" Version="0.10.5" /> + <PackageReference Include="Avalonia.Diagnostics" Version="0.10.5" /> <PackageReference Include="Emgu.CV.runtime.windows" Version="4.5.1.4349" /> <PackageReference Include="MessageBox.Avalonia" Version="1.2.0" /> <PackageReference Include="ThemeEditor.Controls.ColorPicker" Version="0.10.4" /> diff --git a/UVtools.WPF/Windows/BenchmarkWindow.axaml.cs b/UVtools.WPF/Windows/BenchmarkWindow.axaml.cs index 1b8a499..7eb4229 100644 --- a/UVtools.WPF/Windows/BenchmarkWindow.axaml.cs +++ b/UVtools.WPF/Windows/BenchmarkWindow.axaml.cs @@ -33,7 +33,7 @@ namespace UVtools.WPF.Windows public const string RunsAbbreviation = "TDPS"; public const string StressCPUTestName = "Stress CPU (Run until stop)"; - private readonly RNGCryptoServiceProvider _randomProvider = new RNGCryptoServiceProvider(); + private readonly RNGCryptoServiceProvider _randomProvider = new(); private CancellationTokenSource _tokenSource; private CancellationToken _token => _tokenSource.Token; @@ -219,7 +219,7 @@ namespace UVtools.WPF.Windows #region Tests public byte[] EncodeCbddlpImage(Mat image, byte bit = 0) { - List<byte> rawData = new List<byte>(); + List<byte> rawData = new(); var span = image.GetPixelSpan<byte>(); bool obit = false; @@ -279,7 +279,7 @@ namespace UVtools.WPF.Windows private byte[] EncodeCbtImage(Mat image) { - List<byte> rawData = new List<byte>(); + List<byte> rawData = new(); byte color = byte.MaxValue >> 1; uint stride = 0; var span = image.GetPixelSpan<byte>(); @@ -359,7 +359,7 @@ namespace UVtools.WPF.Windows public byte[] EncodePW0Image(Mat image) { - List<byte> rawData = new List<byte>(); + List<byte> rawData = new(); var span = image.GetPixelSpan<byte>(); int lastColor = -1; @@ -424,7 +424,7 @@ namespace UVtools.WPF.Windows { var bytes = new byte[width * height]; _randomProvider.GetBytes(bytes); - Mat mat = new Mat(new Size(width, height), DepthType.Cv8U, 1); + Mat mat = new(new Size(width, height), DepthType.Cv8U, 1); mat.SetBytes(bytes); return mat; } diff --git a/UVtools.WPF/Windows/SettingsWindow.axaml.cs b/UVtools.WPF/Windows/SettingsWindow.axaml.cs index edc4bc4..0052bd0 100644 --- a/UVtools.WPF/Windows/SettingsWindow.axaml.cs +++ b/UVtools.WPF/Windows/SettingsWindow.axaml.cs @@ -116,7 +116,7 @@ namespace UVtools.WPF.Windows foreach (PropertyInfo propertyInfo in Settings.General.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) { if (propertyInfo.Name != field) continue; - OpenFolderDialog dialog = new OpenFolderDialog(); + OpenFolderDialog dialog = new(); var filename = await dialog.ShowAsync(this); if (string.IsNullOrEmpty(filename)) return; propertyInfo.SetValue(Settings.General, filename); |