From f7d989d29fa58f08fc8f5ef41c4366dc966a6421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiago=20Concei=C3=A7=C3=A3o?= Date: Fri, 19 Aug 2022 03:26:05 +0100 Subject: [PATCH] v3.6.1 - (Fix) GCode: Improve the regex for parsing layer index from comments, also fixes chitubox zip format layer parsing - (Fix) MacOS: Auto updater was not copying the files to the right location, leading to not upgrade the program. However this version still need to update manually --- CHANGELOG.md | 5 +++++ RELEASE_NOTES.md | 13 ++----------- Scripts/010 Editor/osf.bt | 14 ++++++++++++++ UVtools.Core/GCode/GCodeBuilder.cs | 3 ++- UVtools.Core/GCode/GCodeLayer.cs | 5 ----- UVtools.Core/SystemOS/SystemAware.cs | 2 +- UVtools.Core/UVtools.Core.csproj | 2 +- UVtools.InstallerMM/UVtools.InstallerMM.wxs | 2 +- UVtools.WPF/UVtools.WPF.csproj | 2 +- 9 files changed, 27 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 585c8248..36aa75a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 19/08/2022 - v3.6.1 + +- (Fix) GCode: Improve the regex for parsing layer index from comments, also fixes chitubox zip format layer parsing +- (Fix) MacOS: Auto updater was not copying the files to the right location, leading to not upgrade the program. However this version still need to update manually + ## 17/08/2022 - v3.6.0 - **File formats:** diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 73c7297e..f84e0338 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,12 +1,3 @@ -- **File formats:** - - (Add) OSF (Vlare Open File Format) - - (Fix) CTB Encrypted: Bottom Retract Height for TSMC was constraining incorrectly with the normal total retract height - - (Fix) CWS: Only issue `;` command when the exposure is about to happen (#514) -- **GCode:** - - (Add) Command `CommandWaitSyncDelay` for movement wait sync delay instead of depending on G4 wait command - - (Fix) Wrong parsing and set of wait times when using a wait after lift / wait before retract -- (Improvement) Auto update: Make sure the download url exists before attempt the download, if not, instead it will prompt for manual download and update -- (Improvement) MacOS: Remove `com.apple.quarantine` flag from the auto downloaded files -- (Upgrade) .NET from 6.0.7 to 6.0.8 -- (Upgrade) AvaloniaUI from 0.10.17 to 0.10.18 +- (Fix) GCode: Improve the regex for parsing layer index from comments, also fixes chitubox zip format layer parsing +- (Fix) MacOS: Auto updater was not copying the files to the right location, leading to not upgrade the program. However this version still need to update manually diff --git a/Scripts/010 Editor/osf.bt b/Scripts/010 Editor/osf.bt index c8b96380..1904fcc6 100644 --- a/Scripts/010 Editor/osf.bt +++ b/Scripts/010 Editor/osf.bt @@ -105,6 +105,20 @@ struct HEADER { ushort Reserved ; ubyte ProtocolType ; // 0 + + local int leftover = HeaderLength - 350001; + if(HeaderLength == 350013) // VLR + { + uint Unknown ; // 350054 + ubyte Unknown1[8] ; + leftover -= 12; + } + + + if(leftover > 0) + { + ubyte LeftOvers[leftover] ; + } } header; diff --git a/UVtools.Core/GCode/GCodeBuilder.cs b/UVtools.Core/GCode/GCodeBuilder.cs index 382a60e9..cb2791df 100644 --- a/UVtools.Core/GCode/GCodeBuilder.cs +++ b/UVtools.Core/GCode/GCodeBuilder.cs @@ -931,7 +931,8 @@ public void ParseLayersFromGCode(FileFormat slicerFile, string? gcode, bool rebu if (line[0] == ';') { - match = Regex.Match(line, @"^;.*(layer\s+|layer:\s*|LAYER_START:\s*)(\d+)", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); + // Can be dangerous! + match = Regex.Match(line, @"^;\W*(layer\W*|LAYER_START:\s*)(\d+)", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); if (match.Success && match.Groups.Count > 2 && uint.TryParse(match.Groups[2].Value, out var layerIndex)) { if (layerIndex > slicerFile.LayerCount) diff --git a/UVtools.Core/GCode/GCodeLayer.cs b/UVtools.Core/GCode/GCodeLayer.cs index afbbcf2f..400b5621 100644 --- a/UVtools.Core/GCode/GCodeLayer.cs +++ b/UVtools.Core/GCode/GCodeLayer.cs @@ -29,11 +29,6 @@ public class GCodeLayer private float? _retractHeight2; private float? _retractSpeed2; - public enum GCodeLastParsedLine : byte - { - LayerIndex, - } - public bool IsValid => LayerIndex.HasValue; public FileFormat SlicerFile { get; } diff --git a/UVtools.Core/SystemOS/SystemAware.cs b/UVtools.Core/SystemOS/SystemAware.cs index 2b892176..39f5089c 100644 --- a/UVtools.Core/SystemOS/SystemAware.cs +++ b/UVtools.Core/SystemOS/SystemAware.cs @@ -309,7 +309,7 @@ public static bool IsRunningLinuxAppImage(out string? path) /// /// Gets if is running under MacOS and under app format /// - public static bool IsRunningMacOSApp => OperatingSystem.IsMacOS() && AppContext.BaseDirectory.EndsWith(".app/Contents/MacOS"); + public static bool IsRunningMacOSApp => OperatingSystem.IsMacOS() && AppContext.BaseDirectory.EndsWith(Path.Combine(".app", "Contents", $"MacOS{Path.DirectorySeparatorChar}")); /// /// Gets the main name of the operative system diff --git a/UVtools.Core/UVtools.Core.csproj b/UVtools.Core/UVtools.Core.csproj index f870d8e6..11f6740a 100644 --- a/UVtools.Core/UVtools.Core.csproj +++ b/UVtools.Core/UVtools.Core.csproj @@ -10,7 +10,7 @@ https://github.com/sn4k3/UVtools https://github.com/sn4k3/UVtools MSLA/DLP, file analysis, calibration, repair, conversion and manipulation - 3.6.0 + 3.6.1 Copyright © 2020 PTRTECH UVtools.png AnyCPU;x64 diff --git a/UVtools.InstallerMM/UVtools.InstallerMM.wxs b/UVtools.InstallerMM/UVtools.InstallerMM.wxs index 7784883c..8203d5ca 100644 --- a/UVtools.InstallerMM/UVtools.InstallerMM.wxs +++ b/UVtools.InstallerMM/UVtools.InstallerMM.wxs @@ -2,7 +2,7 @@ - + diff --git a/UVtools.WPF/UVtools.WPF.csproj b/UVtools.WPF/UVtools.WPF.csproj index 8c2eca61..164a10fe 100644 --- a/UVtools.WPF/UVtools.WPF.csproj +++ b/UVtools.WPF/UVtools.WPF.csproj @@ -12,7 +12,7 @@ LICENSE https://github.com/sn4k3/UVtools Git - 3.6.0 + 3.6.1 AnyCPU;x64 UVtools.png README.md