diff options
author | Tiago Conceição <Tiago_caza@hotmail.com> | 2021-10-12 23:38:26 +0300 |
---|---|---|
committer | Tiago Conceição <Tiago_caza@hotmail.com> | 2021-10-12 23:38:26 +0300 |
commit | c230a8429006a82ec074ebde73db3d3367b8b44a (patch) | |
tree | 5ddb1da489a11127614c1fdc0bcd2811ff53e1b8 | |
parent | 8ef55e2e059470a4748c14f9e06c33924de53fd1 (diff) |
v2.23.6v2.23.6
- **(Improvement) SL1:** (#314)
- Complete the SL1 file format with some defaults for convertions
- Change some data types from bool to byte as in recent prusaslicer changes
- (Upgrade) .NET from 5.0.10 to 5.0.11
- (Upgrade) AvaloniaUI from 0.10.7 to 0.10.8
- (Fix) PWS, PW0, PWM, PWMX, PWMO, PWMS: Incorrect set of layer height for the layer definition when using same positioned layers
-rw-r--r-- | CHANGELOG.md | 12 | ||||
-rw-r--r-- | UVtools.AvaloniaControls/UVtools.AvaloniaControls.csproj | 2 | ||||
-rw-r--r-- | UVtools.Core/Extensions/StringExtensions.cs | 4 | ||||
-rw-r--r-- | UVtools.Core/FileFormats/PhotonWorkshopFile.cs | 3 | ||||
-rw-r--r-- | UVtools.Core/FileFormats/SL1File.cs | 72 | ||||
-rw-r--r-- | UVtools.Core/Helpers.cs | 25 | ||||
-rw-r--r-- | UVtools.Core/Layers/Layer.cs | 12 | ||||
-rw-r--r-- | UVtools.Core/UVtools.Core.csproj | 4 | ||||
-rw-r--r-- | UVtools.InstallerMM/UVtools.InstallerMM.wxs | 4 | ||||
-rw-r--r-- | UVtools.WPF/UVtools.WPF.csproj | 14 |
10 files changed, 96 insertions, 56 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 165658c..4c5af42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,18 @@ # Changelog +## 12/10/2021 - v2.23.6 + +- **(Improvement) SL1:** (#314) + - Complete the SL1 file format with some defaults for convertions + - Change some data types from bool to byte as in recent prusaslicer changes +- (Upgrade) .NET from 5.0.10 to 5.0.11 +- (Upgrade) AvaloniaUI from 0.10.7 to 0.10.8 +- (Fix) PWS, PW0, PWM, PWMX, PWMO, PWMS: Incorrect set of layer height for the layer definition when using same positioned layers + + ## 07/10/2021 - v2.23.5 -- (Fix) Odd crash when detecing for resin trap issues which was duplicating contours +- (Fix) Odd crash when detecting for resin trap issues which was duplicating contours (#311, #312) ## 04/10/2021 - v2.23.4 diff --git a/UVtools.AvaloniaControls/UVtools.AvaloniaControls.csproj b/UVtools.AvaloniaControls/UVtools.AvaloniaControls.csproj index 2832bc4..e7ba28e 100644 --- a/UVtools.AvaloniaControls/UVtools.AvaloniaControls.csproj +++ b/UVtools.AvaloniaControls/UVtools.AvaloniaControls.csproj @@ -34,7 +34,7 @@ </ItemGroup> <ItemGroup> - <PackageReference Include="Avalonia" Version="0.10.7" /> + <PackageReference Include="Avalonia" Version="0.10.8" /> </ItemGroup> <ItemGroup> diff --git a/UVtools.Core/Extensions/StringExtensions.cs b/UVtools.Core/Extensions/StringExtensions.cs index 9967c66..825f7aa 100644 --- a/UVtools.Core/Extensions/StringExtensions.cs +++ b/UVtools.Core/Extensions/StringExtensions.cs @@ -31,7 +31,7 @@ namespace UVtools.Core.Extensions { case null: throw new ArgumentNullException(nameof(input)); case "": throw new ArgumentException($"{nameof(input)} cannot be empty", nameof(input)); - default: return input.First().ToString().ToUpper() + input[1..]; + default: return $"{char.ToUpper(input[0])}{input[1..]}"; } } @@ -52,7 +52,7 @@ namespace UVtools.Core.Extensions //Cast ConvertFromString(string text) : object to (T) return (T)converter.ConvertFromString(input); } - return default(T); + return default; } } } diff --git a/UVtools.Core/FileFormats/PhotonWorkshopFile.cs b/UVtools.Core/FileFormats/PhotonWorkshopFile.cs index b742128..3e5b2d1 100644 --- a/UVtools.Core/FileFormats/PhotonWorkshopFile.cs +++ b/UVtools.Core/FileFormats/PhotonWorkshopFile.cs @@ -536,7 +536,7 @@ namespace UVtools.Core.FileFormats public void SetFrom(Layer layer) { - LayerHeight = layer.LayerHeight; + LayerHeight = layer.RelativeLayerHeight; ExposureTime = layer.ExposureTime; LiftHeight = layer.LiftHeight; LiftSpeed = (float) Math.Round(layer.LiftSpeed / 60, 2); @@ -545,6 +545,7 @@ namespace UVtools.Core.FileFormats public void CopyTo(Layer layer) { + // Don't forget to compute LayerHeight outside here layer.ExposureTime = ExposureTime; layer.LiftHeight = LiftHeight; layer.LiftSpeed = (float)Math.Round(LiftSpeed * 60, 2); diff --git a/UVtools.Core/FileFormats/SL1File.cs b/UVtools.Core/FileFormats/SL1File.cs index 5fde729..feac9dd 100644 --- a/UVtools.Core/FileFormats/SL1File.cs +++ b/UVtools.Core/FileFormats/SL1File.cs @@ -63,24 +63,24 @@ namespace UVtools.Core.FileFormats { #region Printer public string InheritsCummulative { get; set; } - public string HostType { get; set; } + public string HostType { get; set; } = "octoprint"; public string PhysicalPrinterSettingsId { get; set; } public string PrinterSettingsId { get; set; } - public string PrinterTechnology { get; set; } - public string PrinterModel { get; set; } - public string PrinterVariant { get; set; } + public string PrinterTechnology { get; set; } = "SLA"; + public string PrinterModel { get; set; } = "SL1"; + public string PrinterVariant { get; set; } = "default"; public string PrinterVendor { get; set; } public string DefaultSlaMaterialProfile { get; set; } - public string DefaultSlaPrintProfile { get; set; } + public string DefaultSlaPrintProfile { get; set; } = "0.05 Normal"; public string PrinterNotes { get; set; } - public string Thumbnails { get; set; } + public string Thumbnails { get; set; } = "400x400,800x480"; #endregion #region Size and Coordinates public string BedCustomModel { get; set; } public string BedCustomTexture { get; set; } - public string BedShape { get; set; } - public float MaxPrintHeight { get; set; } + public string BedShape { get; set; } = "1.48x1.02,119.48x1.02,119.48x67.02,1.48x67.02"; + public float MaxPrintHeight { get; set; } = 150; #endregion #region Display @@ -88,32 +88,34 @@ namespace UVtools.Core.FileFormats public float DisplayHeight { get; set; } public uint DisplayPixelsX { get; set; } public uint DisplayPixelsY { get; set; } - public string DisplayOrientation { get; set; } - public bool DisplayMirrorX { get; set; } - public bool DisplayMirrorY { get; set; } + public string DisplayOrientation { get; set; } = "portrait"; + public byte DisplayMirrorX { get; set; } = 1; + public byte DisplayMirrorY { get; set; } #endregion #region Tilt - public float FastTiltTime { get; set; } - public float SlowTiltTime { get; set; } - public float AreaFill { get; set; } + + public float FastTiltTime { get; set; } = 5; + public float SlowTiltTime { get; set; } = 8; + public float AreaFill { get; set; } = 50; #endregion #region Corrections - public string RelativeCorrection { get; set; } + + public string RelativeCorrection { get; set; } = "1,1"; public float AbsoluteCorrection { get; set; } - public float ElefantFootCompensation { get; set; } - public float ElefantFootMinWidth { get; set; } - public float GammaCorrection { get; set; } + public float ElefantFootCompensation { get; set; } = 0.2f; + public float ElefantFootMinWidth { get; set; } = 0.2f; + public float GammaCorrection { get; set; } = 1; #endregion #region Exposure - public float MinExposureTime { get; set; } - public float MaxExposureTime { get; set; } - public float MinInitialExposureTime { get; set; } - public float MaxInitialExposureTime { get; set; } + public float MinExposureTime { get; set; } = 1; + public float MaxExposureTime { get; set; } = 120; + public float MinInitialExposureTime { get; set; } = 1; + public float MaxInitialExposureTime { get; set; } = 300; #endregion @@ -188,9 +190,9 @@ namespace UVtools.Core.FileFormats #endregion #region Supports - public bool SupportsEnable { get; set; } - + public byte SupportsEnable { get; set; } + public float SupportHeadFrontDiameter { get; set; } public float SupportHeadPenetration { get; set; } public float SupportHeadWidth { get; set; } @@ -200,11 +202,11 @@ namespace UVtools.Core.FileFormats public string SupportSmallPillarDiameterPercent { get; set; } public float SupportMaxBridgesOnPillar { get; set; } public string SupportPillarConnectionMode { get; set; } - public bool SupportBuildplateOnly { get; set; } + public byte SupportBuildplateOnly { get; set; } public float SupportBaseDiameter { get; set; } public float SupportBaseHeight { get; set; } public float SupportBaseSafetyDistance { get; set; } - public bool PadAroundObject { get; set; } + public byte PadAroundObject { get; set; } public float SupportObjectElevation { get; set; } @@ -220,14 +222,14 @@ namespace UVtools.Core.FileFormats #region Pad - public bool PadEnable { set; get; } + public byte PadEnable { set; get; } public float PadWallThickness { set; get; } public float PadWallHeight { set; get; } public float PadBrimSize { set; get; } public float PadMaxMergeDistance { set; get; } public float PadWallSlope { set; get; } //public float PadAroundObject { set; get; } - public bool PadAroundObjectEverywhere { set; get; } + public byte PadAroundObjectEverywhere { set; get; } public float PadObjectGap { set; get; } public float PadObjectConnectorStride { set; get; } public float PadObjectConnectorWidth { set; get; } @@ -235,7 +237,7 @@ namespace UVtools.Core.FileFormats #endregion #region Hollowing - public bool HollowingEnable { set; get; } + public byte HollowingEnable { set; get; } public float HollowingMinThickness { set; get; } public float HollowingQuality { set; get; } public float HollowingClosingDistance { set; get; } @@ -291,7 +293,7 @@ namespace UVtools.Core.FileFormats public string PrinterModel { get; set; } = "SL1"; public string PrinterProfile { get; set; } = About.Software; public string PrinterVariant { get; set; } = "default"; - public string PrusaSlicerVersion { get; set; } = "PrusaSlicer-2.3.0+win64-202101111315"; + public string PrusaSlicerVersion { get; set; } = "PrusaSlicer-2.3.3+win64-202107161027"; public float UsedMaterial { get; set; } public override string ToString() @@ -388,15 +390,15 @@ namespace UVtools.Core.FileFormats { get { - if (PrinterSettings.DisplayMirrorX && PrinterSettings.DisplayMirrorY) return Enumerations.FlipDirection.Both; - if (PrinterSettings.DisplayMirrorX) return Enumerations.FlipDirection.Horizontally; - if (PrinterSettings.DisplayMirrorY) return Enumerations.FlipDirection.Vertically; + if (PrinterSettings.DisplayMirrorX > 0 && PrinterSettings.DisplayMirrorY > 0) return Enumerations.FlipDirection.Both; + if (PrinterSettings.DisplayMirrorX > 0) return Enumerations.FlipDirection.Horizontally; + if (PrinterSettings.DisplayMirrorY > 0) return Enumerations.FlipDirection.Vertically; return Enumerations.FlipDirection.None; } set { - PrinterSettings.DisplayMirrorX = value is Enumerations.FlipDirection.Horizontally or Enumerations.FlipDirection.Both; - PrinterSettings.DisplayMirrorY = value is Enumerations.FlipDirection.Vertically or Enumerations.FlipDirection.Both; + PrinterSettings.DisplayMirrorX = (byte)(value is Enumerations.FlipDirection.Horizontally or Enumerations.FlipDirection.Both ? 1 : 0); + PrinterSettings.DisplayMirrorY = (byte)(value is Enumerations.FlipDirection.Vertically or Enumerations.FlipDirection.Both ? 1 : 0); RaisePropertyChanged(); } } diff --git a/UVtools.Core/Helpers.cs b/UVtools.Core/Helpers.cs index 9dc5fed..5443edf 100644 --- a/UVtools.Core/Helpers.cs +++ b/UVtools.Core/Helpers.cs @@ -59,20 +59,35 @@ namespace UVtools.Core attribute.SetValue(obj, value.Convert<string>()); return true; case "boolean": - if(char.IsDigit(value[0])) - attribute.SetValue(obj, !value.Equals("0")); - else - attribute.SetValue(obj, value.Equals("True", StringComparison.InvariantCultureIgnoreCase)); + if(char.IsDigit(value[0])) attribute.SetValue(obj, !value.Equals("0")); + else attribute.SetValue(obj, value.Equals("True", StringComparison.InvariantCultureIgnoreCase)); return true; case "byte": - attribute.SetValue(obj, value.Convert<byte>()); + if (value.Equals("true", StringComparison.InvariantCultureIgnoreCase)) attribute.SetValue(obj, (byte)1); + else if (value.Equals("false", StringComparison.InvariantCultureIgnoreCase)) attribute.SetValue(obj, byte.MinValue); + else attribute.SetValue(obj, value.Convert<byte>()); + return true; + case "sbyte": + attribute.SetValue(obj, value.Convert<sbyte>()); return true; case "uint16": attribute.SetValue(obj, value.Convert<ushort>()); return true; + case "int16": + attribute.SetValue(obj, value.Convert<short>()); + return true; case "uint32": attribute.SetValue(obj, value.Convert<uint>()); return true; + case "int32": + attribute.SetValue(obj, value.Convert<int>()); + return true; + case "uint64": + attribute.SetValue(obj, value.Convert<ulong>()); + return true; + case "int64": + attribute.SetValue(obj, value.Convert<long>()); + return true; case "single": attribute.SetValue(obj, (float)Math.Round(float.Parse(value, CultureInfo.InvariantCulture.NumberFormat), 3)); return true; diff --git a/UVtools.Core/Layers/Layer.cs b/UVtools.Core/Layers/Layer.cs index 99a6f87..7f425c3 100644 --- a/UVtools.Core/Layers/Layer.cs +++ b/UVtools.Core/Layers/Layer.cs @@ -410,6 +410,18 @@ namespace UVtools.Core.Layers } /// <summary> + /// Gets the layer height in millimeters of this layer relative to the previous layer + /// </summary> + public float RelativeLayerHeight + { + get + { + var previousLayer = PreviousLayer(); + return previousLayer is null ? LayerHeight : RoundHeight(_positionZ - previousLayer.PositionZ); + } + } + + /// <summary> /// Gets the computed material milliliters spent on this layer /// </summary> public float MaterialMilliliters diff --git a/UVtools.Core/UVtools.Core.csproj b/UVtools.Core/UVtools.Core.csproj index 1a240dc..97dd5a9 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.23.5</Version> + <Version>2.23.6</Version> <Copyright>Copyright © 2020 PTRTECH</Copyright> <PackageIcon>UVtools.png</PackageIcon> <Platforms>AnyCPU;x64</Platforms> @@ -51,7 +51,7 @@ <PackageReference Include="AnimatedGif" Version="1.0.5" /> <PackageReference Include="BinarySerializer" Version="8.6.0" /> <PackageReference Include="Emgu.CV" Version="4.5.3.4721" /> - <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.0.0-4.final" /> + <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.0.0-5.final" /> <PackageReference Include="morelinq" Version="3.3.2" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> <PackageReference Include="Portable.BouncyCastle" Version="1.8.10" /> diff --git a/UVtools.InstallerMM/UVtools.InstallerMM.wxs b/UVtools.InstallerMM/UVtools.InstallerMM.wxs index 4616c5a..0a2a953 100644 --- a/UVtools.InstallerMM/UVtools.InstallerMM.wxs +++ b/UVtools.InstallerMM/UVtools.InstallerMM.wxs @@ -311,8 +311,8 @@ <Component Id="owc6F31DEF09608AA645959666A4CB7FBBC" Guid="c94570a5-5bb4-a53f-e12f-9581bddf7d08" Win64="yes"> <File Id="owf6F31DEF09608AA645959666A4CB7FBBC" Source="$(var.SourceDir)\mscordaccore.dll" KeyPath="yes" /> </Component> - <Component Id="owc52B1D8ABAD8563890B2ADC4CB4CA9D2F" Guid="c385e4a5-35bb-70e3-9163-2ce40be093de" Win64="yes"> - <File Id="owf52B1D8ABAD8563890B2ADC4CB4CA9D2F" Source="$(var.SourceDir)\mscordaccore_amd64_amd64_5.0.1021.41214.dll" KeyPath="yes" /> + <Component Id="owc27CB197EDF512C6F35063F15D0267964" Guid="0b282fd7-a70b-0156-f3c6-3ea462e82c6b" Win64="yes"> + <File Id="owf27CB197EDF512C6F35063F15D0267964" Source="$(var.SourceDir)\mscordaccore_amd64_amd64_5.0.1121.47308.dll" KeyPath="yes" /> </Component> <Component Id="owc5FC34571A1AE47A011FC6C2A95B00DA6" Guid="2591451e-0fe5-ccad-abf6-1d1097251253" Win64="yes"> <File Id="owf5FC34571A1AE47A011FC6C2A95B00DA6" Source="$(var.SourceDir)\mscordbi.dll" KeyPath="yes" /> diff --git a/UVtools.WPF/UVtools.WPF.csproj b/UVtools.WPF/UVtools.WPF.csproj index eef7830..0406f46 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.23.5</Version> + <Version>2.23.6</Version> <Platforms>AnyCPU;x64</Platforms> </PropertyGroup> @@ -34,14 +34,14 @@ <NoWarn>1701;1702;</NoWarn> </PropertyGroup> <ItemGroup> - <PackageReference Include="Avalonia" Version="0.10.7" /> + <PackageReference Include="Avalonia" Version="0.10.8" /> <PackageReference Include="Avalonia.Angle.Windows.Natives" Version="2.1.0.2020091801" /> - <PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.7" /> - <PackageReference Include="Avalonia.Desktop" Version="0.10.7" /> - <PackageReference Include="Avalonia.Diagnostics" Version="0.10.7" /> + <PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.8" /> + <PackageReference Include="Avalonia.Desktop" Version="0.10.8" /> + <PackageReference Include="Avalonia.Diagnostics" Version="0.10.8" /> <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.7" /> + <PackageReference Include="MessageBox.Avalonia" Version="1.5.3" /> + <PackageReference Include="ThemeEditor.Controls.ColorPicker" Version="0.10.8" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\UVtools.AvaloniaControls\UVtools.AvaloniaControls.csproj" /> |