diff --git a/CHANGELOG.md b/CHANGELOG.md
index ff46a03..a0d60de 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## 30/01/2023 - v3.11.1
+
+- (Improvement) Remove developer machine path in PDB / error messages
+- (Fix) HoneyComb infill not going to the right most edge of the image (#649)
+- (Fix) AnyCubic machine names were not showing in most files
+- (Fix) PWMX: Unable to set version 1
+- (Fix) LGS: Converted files to lgs cause program to crash with `Value was either too large or too small for a Decimal` (#653)
+
## 15/01/2023 - v3.11.0
- **UI:**
diff --git a/Directory.Build.props b/Directory.Build.props
new file mode 100644
index 0000000..114f31d
--- /dev/null
+++ b/Directory.Build.props
@@ -0,0 +1,5 @@
+
+
+ $(MSBuildProjectDirectory)=$(MSBuildProjectName)
+
+
\ No newline at end of file
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 0e89cdb..d4b2464 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -1,22 +1,6 @@
-- **UI:**
- - (Improvement) Layer navigation load time by parallel `Mat` to `Bitmap` conversion
- - (Improvement) Allow to show exceptions without the stack trace and detailed trigger action by using the `MessageExceiption` (#644)
- - (Improvement) Allow progress to have and display a detailed log (#644)
- - (Improvement) Convert format to another with multiple versions will now only show the possible versions for the extension
-- **Suggestion - Wait time before cure:**
- - (Improvement) Set the first wait time based on first valid layer mass rather than use the fixed limit
- - (Improvement) Set zero time to empty and dummy layers
- - (Improvement) When creating the dummy layer also increment the bottom layer count as the created layer count as one
-- **PCB Exposure:**
- - (Add) Excellon Drill Format (drl) to cut off holes (Implementation may lack some advanced features, please confirm the result) (#646)
- - (Fix) Arc (G03) with negative offsets (I-/J-) was not drawing the shape correctly
- - (Fix) Implement the rotation for the outline primitive (#645)
-- **File formats:**
- - (Improvement) Formats now sanitize the selected version before encode given the file extension, if version is out of range it will force the last known version
- - (Fix) CBDDLP: Remove a table from the file that might cause layer corruption
-- (Add) Operations - `AfterCompleteReport` property: Gets or sets an report to show to the user after complete the operation with success
-- (Improvement) Suggestion - Wait time after cure: Set zero time to empty and dummy layers
-- (Improvement) Slight improvement on the contour intersection check, yields better performance on resin and suction cup detection
-- (Improvement) Allow to trigger message boxes from operations and scripts (#644)
-- (Upgrade) .NET from 6.0.12 to 6.0.13
+- (Improvement) Remove developer machine path in PDB / error messages
+- (Fix) HoneyComb infill not going to the right most edge of the image (#649)
+- (Fix) AnyCubic machine names were not showing in most files
+- (Fix) PWMX: Unable to set version 1
+- (Fix) LGS: Converted files to lgs cause program to crash with `Value was either too large or too small for a Decimal` (#653)
diff --git a/UVtools.Core/FileFormats/FileFormat.cs b/UVtools.Core/FileFormats/FileFormat.cs
index a9d94d2..7be6fd6 100644
--- a/UVtools.Core/FileFormats/FileFormat.cs
+++ b/UVtools.Core/FileFormats/FileFormat.cs
@@ -1566,6 +1566,11 @@ public abstract class FileFormat : BindableBase, IDisposable, IEquatable
/// Gets or sets the pixels per mm on X direction
///
- public virtual float Xppmm => DisplayWidth > 0 ? ResolutionX / DisplayWidth : 0;
+ public virtual float Xppmm => ResolutionX > 0 && DisplayWidth > 0 ? ResolutionX / DisplayWidth : 0;
///
/// Gets or sets the pixels per mm on Y direction
///
- public virtual float Yppmm => DisplayHeight > 0 ? ResolutionY / DisplayHeight : 0;
+ public virtual float Yppmm => ResolutionY > 0 && DisplayHeight > 0 ? ResolutionY / DisplayHeight : 0;
///
/// Gets or sets the pixels per mm
@@ -1749,12 +1765,12 @@ public abstract class FileFormat : BindableBase, IDisposable, IEquatable
/// Gets the pixel width in microns
///
- public float PixelWidthMicrons => DisplayWidth > 0 ? (float)Math.Round(DisplayWidth / ResolutionX * 1000, 3) : 0;
+ public float PixelWidthMicrons => DisplayWidth > 0 && ResolutionX > 0 ? (float)Math.Round(DisplayWidth / ResolutionX * 1000, 3) : 0;
///
/// Gets the pixel height in microns
///
- public float PixelHeightMicrons => DisplayHeight > 0 ? (float)Math.Round(DisplayHeight / ResolutionY * 1000, 3) : 0;
+ public float PixelHeightMicrons => DisplayHeight > 0 && ResolutionY > 0 ? (float)Math.Round(DisplayHeight / ResolutionY * 1000, 3) : 0;
///
/// Gets the pixel size in microns
@@ -3241,20 +3257,14 @@ public abstract class FileFormat : BindableBase, IDisposable, IEquatable
protected void NotifyAspectChange()
{
- RaisePropertyChanged(nameof(Xppmm));
- RaisePropertyChanged(nameof(Yppmm));
RaisePropertyChanged(nameof(Ppmm));
RaisePropertyChanged(nameof(PpmmMax));
RaisePropertyChanged(nameof(PixelSizeMicrons));
RaisePropertyChanged(nameof(PixelArea));
RaisePropertyChanged(nameof(PixelAreaMicrons));
RaisePropertyChanged(nameof(PixelSizeMicronsMax));
- RaisePropertyChanged(nameof(PixelHeight));
- RaisePropertyChanged(nameof(PixelHeightMicrons));
RaisePropertyChanged(nameof(PixelSize));
RaisePropertyChanged(nameof(PixelSizeMax));
- RaisePropertyChanged(nameof(PixelWidth));
- RaisePropertyChanged(nameof(PixelWidthMicrons));
}
#endregion
@@ -6443,10 +6453,10 @@ public abstract class FileFormat : BindableBase, IDisposable, IEquatable GenerateHeatmap(0, uint.MaxValue, roi, progress);
public Task GenerateHeatmapAsync(uint layerIndexStart = 0, uint layerIndexEnd = uint.MaxValue, Rectangle roi = default, OperationProgress? progress = null)
- => Task.Run(() => GenerateHeatmap(layerIndexStart, layerIndexEnd, roi, progress));
+ => Task.Run(() => GenerateHeatmap(layerIndexStart, layerIndexEnd, roi, progress), progress?.Token ?? default);
public Task GenerateHeatmapAsync(Rectangle roi, OperationProgress? progress = null)
- => Task.Run(() => GenerateHeatmap(0, uint.MaxValue, roi, progress));
+ => Task.Run(() => GenerateHeatmap(0, uint.MaxValue, roi, progress), progress?.Token ?? default);
#endregion
}
\ No newline at end of file
diff --git a/UVtools.Core/FileFormats/LGSFile.cs b/UVtools.Core/FileFormats/LGSFile.cs
index d97d6bc..402e3cd 100644
--- a/UVtools.Core/FileFormats/LGSFile.cs
+++ b/UVtools.Core/FileFormats/LGSFile.cs
@@ -11,7 +11,6 @@ using Emgu.CV;
using Emgu.CV.CvEnum;
using System;
using System.Collections.Generic;
-using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
@@ -298,6 +297,7 @@ public sealed class LGSFile : FileFormat
{
HeaderSettings.ResolutionX = value;
base.ResolutionX = value;
+ HeaderSettings.PixelPerMmX = Xppmm;
}
}
@@ -308,19 +308,28 @@ public sealed class LGSFile : FileFormat
{
HeaderSettings.ResolutionY = value;
base.ResolutionY = value;
+ HeaderSettings.PixelPerMmY = Yppmm;
}
}
public override float DisplayWidth
{
- get => ResolutionX / HeaderSettings.PixelPerMmX;
- set { }
+ get => (float) Math.Round(ResolutionX / HeaderSettings.PixelPerMmX, 3);
+ set
+ {
+ base.DisplayWidth = value;
+ HeaderSettings.PixelPerMmX = Xppmm;
+ }
}
public override float DisplayHeight
{
- get => ResolutionY / HeaderSettings.PixelPerMmY;
- set { }
+ get => (float)Math.Round(ResolutionY / HeaderSettings.PixelPerMmY, 3);
+ set
+ {
+ base.DisplayHeight = value;
+ HeaderSettings.PixelPerMmY = Yppmm;
+ }
}
public override float MachineZ
@@ -439,23 +448,6 @@ public sealed class LGSFile : FileFormat
#endregion
#region Methods
-
- protected override void OnPropertyChanged(PropertyChangedEventArgs e)
- {
- base.OnPropertyChanged(e);
- switch (e.PropertyName)
- {
- case nameof(Xppmm):
- HeaderSettings.PixelPerMmX = Xppmm;
- RaisePropertyChanged(nameof(DisplayWidth));
- break;
- case nameof(Yppmm):
- HeaderSettings.PixelPerMmY = Yppmm;
- RaisePropertyChanged(nameof(DisplayHeight));
- break;
- }
- }
-
protected override void EncodeInternally(OperationProgress progress)
{
if (FileEndsWith(".lgs")) // Longer Orange 10
@@ -542,7 +534,7 @@ public sealed class LGSFile : FileFormat
{
throw new FileLoadException("Not a valid LGS file!", FileFullPath);
}
-
+
//if (HeaderSettings.PrinterModel is 10 or 30 or 120)
//{
// Fix inconsistencies found of different version of plugin and slicers
diff --git a/UVtools.Core/FileFormats/PhotonWorkshopFile.cs b/UVtools.Core/FileFormats/PhotonWorkshopFile.cs
index 5463b19..d14ee70 100644
--- a/UVtools.Core/FileFormats/PhotonWorkshopFile.cs
+++ b/UVtools.Core/FileFormats/PhotonWorkshopFile.cs
@@ -1125,13 +1125,13 @@ public sealed class PhotonWorkshopFile : FileFormat
case "pw0":
case "pwx":
return new uint[] {VERSION_1};
+ case "pwmx":
case "pwmo":
case "pwms":
case "pmsq":
case "dlp":
return new uint[] { VERSION_1, VERSION_515 };
case "pwma":
- case "pwmx":
case "pm3":
case "pm3m":
return new uint[] { VERSION_515, VERSION_516 };
@@ -1523,7 +1523,7 @@ public sealed class PhotonWorkshopFile : FileFormat
{
get
{
- if (string.IsNullOrWhiteSpace(MachineSettings.MachineName)) return MachineSettings.MachineName;
+ if (!string.IsNullOrWhiteSpace(MachineSettings.MachineName)) return MachineSettings.MachineName;
return PrinterModel switch
{
AnyCubicMachine.PhotonS => "Photon S",
diff --git a/UVtools.Core/Operations/OperationInfill.cs b/UVtools.Core/Operations/OperationInfill.cs
index 74c4835..1d578c0 100644
--- a/UVtools.Core/Operations/OperationInfill.cs
+++ b/UVtools.Core/Operations/OperationInfill.cs
@@ -161,6 +161,8 @@ public sealed class OperationInfill : Operation
if (_infillType == InfillAlgorithm.Honeycomb)
{
mask = GetHoneycombMask(GetRoiSizeOrVolumeSize());
+ CvInvoke.Imshow("Honeycomb", mask);
+ CvInvoke.WaitKey();
}
else if (_infillType == InfillAlgorithm.Concentric)
{
@@ -484,20 +486,24 @@ public sealed class OperationInfill : Operation
{
var patternMask = EmguExtensions.InitMat(targetSize);
- var halfInfillSpacing = _infillSpacing / 2;
+ var halfInfillSpacingD = _infillSpacing / 2.0;
+ var halfInfillSpacing = (int)Math.Round(halfInfillSpacingD);
var halfThickenss = _infillThickness / 2;
- int width = (int)Math.Round(4 * (_infillSpacing / 2.0 / Math.Sqrt(3)));
+ int width = (int)Math.Round(4 * (halfInfillSpacing / Math.Sqrt(3)));
var infillColor = new MCvScalar(_infillBrightness);
- for (int col = 0; col <= targetSize.Width / _infillSpacing; col++)
+ int cols = (int)Math.Ceiling((float)targetSize.Width / _infillSpacing) + 2;
+ int rows = (int)Math.Ceiling((float)targetSize.Height / _infillSpacing);
+
+ for (int col = 0; col <= cols; col++)
{
- for (int row = 0; row <= targetSize.Height / _infillSpacing; row++)
+ for (int row = 0; row <= rows; row++)
{
// Move over for the column number.
- int x = (int)Math.Round(col * (width * 0.75f));
+ int x = (int)Math.Round(halfThickenss + col * (width * 0.75f));
// Move down the required number of rows.
- int y = row * _infillSpacing;
+ int y = halfThickenss + halfInfillSpacing + row * _infillSpacing;
// If the column is odd, move down half a hex more.
if (col % 2 == 1) y += halfInfillSpacing;
@@ -505,11 +511,11 @@ public sealed class OperationInfill : Operation
var points = new Point[]
{
new(x, y),
- new((int) Math.Round(x + width * 0.25f), y - _infillSpacing / 2),
- new((int) Math.Round(x + width * 0.75f), y - _infillSpacing / 2),
+ new((int) Math.Round(x + width * 0.25f), y - halfInfillSpacing),
+ new((int) Math.Round(x + width * 0.75f), y - halfInfillSpacing),
new(x + width, y),
- new((int) Math.Round(x + width * 0.75f), y + _infillSpacing / 2),
- new((int) Math.Round(x + width * 0.25f), y + _infillSpacing / 2),
+ new((int) Math.Round(x + width * 0.75f), y + halfInfillSpacing),
+ new((int) Math.Round(x + width * 0.25f), y + halfInfillSpacing),
};
CvInvoke.Polylines(patternMask, points, true, infillColor, _infillThickness);
@@ -525,7 +531,7 @@ public sealed class OperationInfill : Operation
//var halfInfillSpacing = _infillSpacing / 2;
//var halfThickenss = _infillThickness / 2;
- int multiplicator = 1;
+ int multiplier = 1;
byte position = 0;
int x = patternMask.Width / 2;
@@ -550,18 +556,18 @@ public sealed class OperationInfill : Operation
while (hitLimits.Any(hitLimit => !hitLimit))
{
- x += directions[position].X * multiplicator;
- y += directions[position].Y * multiplicator;
+ x += directions[position].X * multiplier;
+ y += directions[position].Y * multiplier;
if (x < 0 || y < 0 || x >= patternMask.Width || y >= patternMask.Height) hitLimits[position] = true;
points.Add(new Point(x, y));
position++;
if (position == 2)
{
- multiplicator++;
+ multiplier++;
}
else if (position == 4)
{
- multiplicator++;
+ multiplier++;
position = 0;
}
}
diff --git a/UVtools.Core/UVtools.Core.csproj b/UVtools.Core/UVtools.Core.csproj
index c2053bd..052adab 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.11.0
+ 3.11.1
Copyright © 2020 PTRTECH
UVtools.png
AnyCPU;x64
@@ -27,24 +27,28 @@
true
..\documentation\$(AssemblyName).xml
1701;1702;1591
+ portable
true
..\documentation\$(AssemblyName).xml
1701;1702;1591
+ portable
true
..\documentation\$(AssemblyName).xml
1701;1702;1591
+ portable
true
..\documentation\$(AssemblyName).xml
1701;1702;1591
+ portable
@@ -74,7 +78,7 @@
-
+
diff --git a/UVtools.WPF/MainWindow.Issues.cs b/UVtools.WPF/MainWindow.Issues.cs
index b3cb0d4..2df8907 100644
--- a/UVtools.WPF/MainWindow.Issues.cs
+++ b/UVtools.WPF/MainWindow.Issues.cs
@@ -295,7 +295,7 @@ public partial class MainWindow
}
return true;
- });
+ }, Progress.Token);
IsGUIEnabled = true;
@@ -469,7 +469,7 @@ public partial class MainWindow
}
return null;
- });
+ }, Progress.Token);
IsGUIEnabled = true;
@@ -674,7 +674,7 @@ public partial class MainWindow
}
return null;
- });
+ }, Progress.Token);
IsGUIEnabled = true;
diff --git a/UVtools.WPF/MainWindow.LayerPreview.cs b/UVtools.WPF/MainWindow.LayerPreview.cs
index 2016c72..bdf7700 100644
--- a/UVtools.WPF/MainWindow.LayerPreview.cs
+++ b/UVtools.WPF/MainWindow.LayerPreview.cs
@@ -855,7 +855,7 @@ public partial class MainWindow
InvalidateLayerNavigation();
}
- if (_actualLayer >= SlicerFile.LayerCount) // No valid layer
+ if (_actualLayer >= SlicerFile.LayerCount) // No valid layer but should never happen
{
CurrentLayerProperties.Clear();
LayerImageBox.Image = null;
diff --git a/UVtools.WPF/MainWindow.PixelEditor.cs b/UVtools.WPF/MainWindow.PixelEditor.cs
index 9163f2d..4b500c3 100644
--- a/UVtools.WPF/MainWindow.PixelEditor.cs
+++ b/UVtools.WPF/MainWindow.PixelEditor.cs
@@ -576,7 +576,7 @@ public partial class MainWindow
}
return Task.FromResult(false);
- });
+ }, Progress.Token);
IsGUIEnabled = true;
diff --git a/UVtools.WPF/MainWindow.axaml.cs b/UVtools.WPF/MainWindow.axaml.cs
index f221fa8..b5f754c 100644
--- a/UVtools.WPF/MainWindow.axaml.cs
+++ b/UVtools.WPF/MainWindow.axaml.cs
@@ -658,7 +658,7 @@ public partial class MainWindow : WindowEx
}
return false;
- });
+ }, Progress.Token);
if (!ejectResult)
{
@@ -1356,7 +1356,7 @@ public partial class MainWindow : WindowEx
}
return false;
- });
+ }, Progress.Token);
IsGUIEnabled = true;
@@ -1485,7 +1485,7 @@ public partial class MainWindow : WindowEx
}
return false;
- });
+ }, Progress.Token);
IsGUIEnabled = true;
@@ -1861,7 +1861,7 @@ public partial class MainWindow : WindowEx
}
return false;
- });
+ }, Progress.Token);
IsGUIEnabled = true;
@@ -1950,7 +1950,7 @@ public partial class MainWindow : WindowEx
}
return false;
- });
+ }, Progress.Token);
IsGUIEnabled = true;
@@ -2193,7 +2193,7 @@ public partial class MainWindow : WindowEx
}
return false;
- });
+ }, Progress.Token);
IsGUIEnabled = true;
diff --git a/UVtools.WPF/UVtools.WPF.csproj b/UVtools.WPF/UVtools.WPF.csproj
index 787e8f7..586baf4 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.11.0
+ 3.11.1
AnyCPU;x64
UVtools.png
README.md
@@ -24,19 +24,23 @@
true
1701;1702;
+ portable
true
1701;1702;
+ portable
true
1701;1702;
+ portable
true
1701;1702;
+ portable
diff --git a/UVtools.sln b/UVtools.sln
index f2faaf9..394ae8e 100644
--- a/UVtools.sln
+++ b/UVtools.sln
@@ -39,6 +39,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "root", "root", "{E91CEB7A-5
ProjectSection(SolutionItems) = preProject
CHANGELOG.md = CHANGELOG.md
CREDITS.md = CREDITS.md
+ Directory.Build.props = Directory.Build.props
LICENSE = LICENSE
README.md = README.md
RELEASE_NOTES.md = RELEASE_NOTES.md