Skip to content

Commit cbf935d

Browse files
committed
v5.0.9
- (Add) PrusaSlicer printer: Elegoo Mars 5 Ultra (#1006) - (Fix) Ignore the "org.freedesktop.DBus.Error.UnknownMethod" exception to prevent crash on Linux (#964) - (Fix) Goo: Bad print when using tilting VAT printer (#1013) - (Upgrade) .NET from 9.0.2 to 9.0.3 - (Upgrade) AvaloniaUI from 11.2.5 to 11.2.6
1 parent 7e34d59 commit cbf935d

File tree

14 files changed

+108
-82
lines changed

14 files changed

+108
-82
lines changed

CHANGELOG.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
# Changelog
22

3+
## 04/04/2025 - v5.0.9
4+
5+
- (Add) PrusaSlicer printer: Elegoo Mars 5 Ultra (#1006)
6+
- (Fix) Ignore the "org.freedesktop.DBus.Error.UnknownMethod" exception to prevent crash on Linux (#964)
7+
- (Fix) Goo: Bad print when using tilting VAT printer (#1013)
8+
- (Upgrade) .NET from 9.0.2 to 9.0.3
9+
- (Upgrade) AvaloniaUI from 11.2.5 to 11.2.6
10+
311
## 10/03/2025 - v5.0.8
412

5-
- (Fix) Ignore "org.freedesktop.DBus.Error.ServiceUnknown" exception to prevent crash on Linux (#964)
6-
- (Upgrade) AvaloniaUI from 11.2.3 to 11.2.4
13+
- (Fix) Ignore the "org.freedesktop.DBus.Error.ServiceUnknown" exception to prevent crash on Linux (#964)
14+
- (Upgrade) AvaloniaUI from 11.2.4 to 11.2.5
715

816
## 15/02/2025 - v5.0.7
917

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
3838

3939
<!-- Versions -->
40-
<UVtoolsVersion>5.0.8</UVtoolsVersion>
41-
<AvaloniaVersion>11.2.5</AvaloniaVersion>
40+
<UVtoolsVersion>5.0.9</UVtoolsVersion>
41+
<AvaloniaVersion>11.2.6</AvaloniaVersion>
4242

4343
<!-- MvvmToolkit -->
4444
<MvvmToolkitEnableINotifyPropertyChangingSupport>false</MvvmToolkitEnableINotifyPropertyChangingSupport>

RELEASE_NOTES.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
- (Fix) Ignore "org.freedesktop.DBus.Error.ServiceUnknown" exception to prevent crash on Linux (#964)
2-
- (Upgrade) AvaloniaUI from 11.2.3 to 11.2.4
1+
- (Add) PrusaSlicer printer: Elegoo Mars 5 Ultra (#1006)
2+
- (Fix) Ignore the "org.freedesktop.DBus.Error.UnknownMethod" exception to prevent crash on Linux (#964)
3+
- (Fix) Goo: Bad print when using tilting VAT printer (#1013)
4+
- (Upgrade) .NET from 9.0.2 to 9.0.3
5+
- (Upgrade) AvaloniaUI from 11.2.5 to 11.2.6
36

UVtools.Core/FileFormats/AnycubicFile.cs

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public enum PhotonRleFormat
8080
PWS,
8181
PW0
8282
}
83-
83+
8484
public enum AnyCubicMachine : byte
8585
{
8686
PhotonS,
@@ -152,7 +152,7 @@ public class FileMark
152152
/// <summary>
153153
/// Spotted on version 515 only
154154
/// </summary>
155-
[FieldOrder(6)] public uint LayerImageColorTableAddress { get; set; }
155+
[FieldOrder(6)] public uint LayerImageColorTableAddress { get; set; }
156156

157157
/// <summary>
158158
/// Gets the layer definition start address
@@ -269,7 +269,7 @@ public override string ToString()
269269
/// <param name="lengthOffset">Offset to length</param>
270270
/// <exception cref="FileLoadException"></exception>
271271
public void Validate(bool validateName, int lengthOffset = 0) => ValidateExpecting((int)GetFinalTableLength() + lengthOffset, validateName);
272-
272+
273273
public void Validate(sbyte lengthOffset) => Validate(true, lengthOffset);
274274
public void Validate(byte lengthOffset) => Validate(true, lengthOffset);
275275
public void Validate(ushort lengthOffset) => Validate(true, lengthOffset);
@@ -317,12 +317,12 @@ public sealed class Header : AnycubicNamedTable
317317

318318
[FieldOrder(4)] public float WaitTimeBeforeCure { get; set; } = 1;
319319

320-
[FieldOrder(5)] public float BottomExposureTime { get; set; }
320+
[FieldOrder(5)] public float BottomExposureTime { get; set; }
321321

322322
[FieldOrder(6)] public float BottomLayersCount { get; set; }
323323

324324
[FieldOrder(7)] public float LiftHeight { get; set; } = DefaultLiftHeight;
325-
325+
326326
/// <summary>
327327
/// Gets the lift speed in mm/s
328328
/// </summary>
@@ -784,7 +784,7 @@ private unsafe Mat DecodePWS(AnycubicFile slicerFile)
784784

785785
span[i] = (byte)newC;
786786
}
787-
787+
788788
return image;
789789
}
790790

@@ -1065,7 +1065,7 @@ public override string ToString()
10651065
new(typeof(AnycubicFile), "pwc", "Anycubic Custom Machine (PWC)"),
10661066
//new(typeof(PhotonWorkshopFile), "pwmb", "Photon M3 Plus (PWMB)"),
10671067
};
1068-
1068+
10691069
public override SpeedUnit FormatSpeedUnit => SpeedUnit.MillimetersPerSecond;
10701070

10711071
public override PrintParameterModifier[] PrintParameterModifiers
@@ -1382,8 +1382,8 @@ public override float ExposureTime
13821382

13831383
public override float BottomLiftHeight
13841384
{
1385-
get => FileMarkSettings.Version >= VERSION_516
1386-
? ExtraSettings.BottomLiftHeight1
1385+
get => FileMarkSettings.Version >= VERSION_516
1386+
? ExtraSettings.BottomLiftHeight1
13871387
: base.BottomLiftHeight;
13881388
set
13891389
{
@@ -1405,7 +1405,7 @@ public override float BottomLiftHeight
14051405
public override float BottomLiftSpeed
14061406
{
14071407
get => FileMarkSettings.Version >= VERSION_516
1408-
? SpeedConverter.Convert(ExtraSettings.BottomLiftSpeed1, FormatSpeedUnit, CoreSpeedUnit)
1408+
? SpeedConverter.Convert(ExtraSettings.BottomLiftSpeed1, FormatSpeedUnit, CoreSpeedUnit)
14091409
: base.BottomLiftSpeed;
14101410
set
14111411
{
@@ -1417,8 +1417,8 @@ public override float BottomLiftSpeed
14171417

14181418
public override float LiftHeight
14191419
{
1420-
get => FileMarkSettings.Version >= VERSION_516
1421-
? ExtraSettings.LiftHeight1
1420+
get => FileMarkSettings.Version >= VERSION_516
1421+
? ExtraSettings.LiftHeight1
14221422
: HeaderSettings.LiftHeight;
14231423
set
14241424
{
@@ -1440,7 +1440,7 @@ public override float LiftHeight
14401440
public override float LiftSpeed
14411441
{
14421442
get => SpeedConverter.Convert(FileMarkSettings.Version >= VERSION_516
1443-
? ExtraSettings.LiftSpeed1
1443+
? ExtraSettings.LiftSpeed1
14441444
: HeaderSettings.LiftSpeed, FormatSpeedUnit, CoreSpeedUnit);
14451445
set
14461446
{
@@ -1453,7 +1453,7 @@ public override float LiftSpeed
14531453
public override float BottomLiftHeight2
14541454
{
14551455
get => FileMarkSettings.Version >= VERSION_516
1456-
? ExtraSettings.BottomLiftHeight2
1456+
? ExtraSettings.BottomLiftHeight2
14571457
: 0;
14581458
set
14591459
{
@@ -1470,7 +1470,7 @@ public override float BottomLiftHeight2
14701470
public override float BottomLiftSpeed2
14711471
{
14721472
get => FileMarkSettings.Version >= VERSION_516
1473-
? SpeedConverter.Convert(ExtraSettings.BottomLiftSpeed2, FormatSpeedUnit, CoreSpeedUnit)
1473+
? SpeedConverter.Convert(ExtraSettings.BottomLiftSpeed2, FormatSpeedUnit, CoreSpeedUnit)
14741474
: 0;
14751475
set
14761476
{
@@ -1484,7 +1484,7 @@ public override float BottomLiftSpeed2
14841484
public override float LiftHeight2
14851485
{
14861486
get => FileMarkSettings.Version >= VERSION_516
1487-
? ExtraSettings.LiftHeight2
1487+
? ExtraSettings.LiftHeight2
14881488
: 0;
14891489
set
14901490
{
@@ -1500,8 +1500,8 @@ public override float LiftHeight2
15001500

15011501
public override float LiftSpeed2
15021502
{
1503-
get => FileMarkSettings.Version >= VERSION_516
1504-
? SpeedConverter.Convert(ExtraSettings.LiftSpeed2, FormatSpeedUnit, CoreSpeedUnit)
1503+
get => FileMarkSettings.Version >= VERSION_516
1504+
? SpeedConverter.Convert(ExtraSettings.LiftSpeed2, FormatSpeedUnit, CoreSpeedUnit)
15051505
: 0;
15061506
set
15071507
{
@@ -1514,8 +1514,8 @@ public override float LiftSpeed2
15141514

15151515
public override float BottomRetractSpeed
15161516
{
1517-
get => FileMarkSettings.Version >= VERSION_516
1518-
? SpeedConverter.Convert(ExtraSettings.BottomRetractSpeed1, FormatSpeedUnit, CoreSpeedUnit)
1517+
get => FileMarkSettings.Version >= VERSION_516
1518+
? SpeedConverter.Convert(ExtraSettings.BottomRetractSpeed1, FormatSpeedUnit, CoreSpeedUnit)
15191519
: RetractSpeed;
15201520
set
15211521
{
@@ -1528,8 +1528,8 @@ public override float BottomRetractSpeed
15281528

15291529
public override float RetractSpeed
15301530
{
1531-
get => SpeedConverter.Convert(FileMarkSettings.Version >= VERSION_516
1532-
? ExtraSettings.RetractSpeed1
1531+
get => SpeedConverter.Convert(FileMarkSettings.Version >= VERSION_516
1532+
? ExtraSettings.RetractSpeed1
15331533
: HeaderSettings.RetractSpeed, FormatSpeedUnit, CoreSpeedUnit);
15341534
set
15351535
{
@@ -1542,7 +1542,7 @@ public override float RetractSpeed
15421542
public override float BottomRetractSpeed2
15431543
{
15441544
get => FileMarkSettings.Version >= VERSION_516
1545-
? SpeedConverter.Convert(ExtraSettings.BottomRetractSpeed2, FormatSpeedUnit, CoreSpeedUnit)
1545+
? SpeedConverter.Convert(ExtraSettings.BottomRetractSpeed2, FormatSpeedUnit, CoreSpeedUnit)
15461546
: 0;
15471547
set
15481548
{
@@ -1556,7 +1556,7 @@ public override float BottomRetractSpeed2
15561556
public override float RetractSpeed2
15571557
{
15581558
get => FileMarkSettings.Version >= VERSION_516
1559-
? SpeedConverter.Convert(ExtraSettings.RetractSpeed2, FormatSpeedUnit, CoreSpeedUnit)
1559+
? SpeedConverter.Convert(ExtraSettings.RetractSpeed2, FormatSpeedUnit, CoreSpeedUnit)
15601560
: 0;
15611561
set
15621562
{
@@ -1633,7 +1633,7 @@ public override string MachineName
16331633
}
16341634
set => base.MachineName = MachineSettings.MachineName = value;
16351635
}
1636-
1636+
16371637
public override object[] Configs
16381638
{
16391639
get
@@ -1651,7 +1651,7 @@ public override object[] Configs
16511651
return new object[]
16521652
{
16531653
FileMarkSettings, HeaderSettings, PreviewSettings, LayerImageColorSettings, LayersDefinition,
1654-
ExtraSettings, MachineSettings
1654+
ExtraSettings, MachineSettings
16551655
};
16561656
case VERSION_517:
16571657
return new object[]
@@ -1792,7 +1792,7 @@ public AnyCubicMachine PrinterModel
17921792

17931793
return AnyCubicMachine.PhotonS;
17941794
}
1795-
}
1795+
}
17961796
#endregion
17971797

17981798
#region Constructors
@@ -1878,16 +1878,18 @@ protected override void EncodeInternally(OperationProgress progress)
18781878
if (LayerImageColorSettings.GreyMaxCount < 16 || LayerImageColorSettings.Grey.Length < 16)
18791879
{
18801880
LayerImageColorSettings.GreyMaxCount = 16;
1881-
LayerImageColorSettings.Grey = new byte[16];
18821881
}
1883-
1882+
18841883
// But if the AntiAliasing is higher than 16, we adjust the table (Experimental)
18851884
if (HeaderSettings.AntiAliasing > LayerImageColorSettings.GreyMaxCount || HeaderSettings.AntiAliasing > LayerImageColorSettings.Grey.Length)
18861885
{
18871886
LayerImageColorSettings.GreyMaxCount = HeaderSettings.AntiAliasing;
1888-
LayerImageColorSettings.Grey = new byte[HeaderSettings.AntiAliasing];
18891887
}
18901888

1889+
// Ensure the table is the correct size
1890+
if (LayerImageColorSettings.Grey.Length != LayerImageColorSettings.GreyMaxCount)
1891+
LayerImageColorSettings.Grey = new byte[LayerImageColorSettings.GreyMaxCount];
1892+
18911893
// Map the grey values
18921894
for (var i = 0; i < LayerImageColorSettings.GreyMaxCount; i++)
18931895
{
@@ -1906,7 +1908,7 @@ protected override void EncodeInternally(OperationProgress progress)
19061908
FileMarkSettings.LayerImageAddress = FileMarkSettings.LayerDefinitionAddress + LayersDefinition.TableLength + AnycubicNamedTable.TableBaseLength;
19071909

19081910
outputFile.Seek(FileMarkSettings.LayerImageAddress, SeekOrigin.Begin);
1909-
1911+
19101912
if (Version >= VERSION_516)
19111913
{
19121914
FileMarkSettings.ExtraAddress = FileMarkSettings.LayerImageAddress;
@@ -1984,7 +1986,7 @@ protected override void EncodeInternally(OperationProgress progress)
19841986

19851987

19861988
//layersHash.Add(hash, layerDef);
1987-
1989+
19881990
outputFile.WriteBytes(layerDef.EncodedRle);
19891991
layerDef.EncodedRle = null!;
19901992
//}
@@ -2074,7 +2076,7 @@ protected override void DecodeInternally(OperationProgress progress)
20742076
ExtraSettings.BottomLiftSpeed2 = HeaderSettings.LiftSpeed;
20752077
ExtraSettings.BottomRetractSpeed1 = HeaderSettings.RetractSpeed;
20762078
ExtraSettings.BottomRetractSpeed2 = HeaderSettings.RetractSpeed;
2077-
2079+
20782080
ExtraSettings.LiftHeight1 = HeaderSettings.LiftHeight;
20792081
ExtraSettings.LiftSpeed1 = HeaderSettings.LiftSpeed;
20802082
ExtraSettings.LiftHeight2 = 0;
@@ -2148,9 +2150,9 @@ protected override void DecodeInternally(OperationProgress progress)
21482150
Debug.Write("LayersDefinition -> ");
21492151
Debug.WriteLine(LayersDefinition);
21502152
LayersDefinition.Validate();
2151-
2153+
21522154
Init(LayersDefinition.LayerCount, DecodeType == FileDecodeType.Partial);
2153-
2155+
21542156
progress.Reset(OperationProgress.StatusDecodeLayers, LayerCount);
21552157
foreach (var batch in BatchLayersIndexes())
21562158
{

UVtools.Core/FileFormats/FileFormat.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2243,6 +2243,11 @@ public virtual float MachineZ
22432243
/// </summary>
22442244
public float PixelAreaMicrons => PixelSizeMicrons.Area();
22452245

2246+
/// <summary>
2247+
/// Gets if the pixels are square, otherwise false.
2248+
/// </summary>
2249+
public bool UsingSquarePixels => Math.Abs(PixelWidthMicrons - PixelHeightMicrons) < 0.01;
2250+
22462251
/// <summary>
22472252
/// Gets the pixel scale normalized with X relative to Y
22482253
/// </summary>

UVtools.Core/FileFormats/GooFile.cs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public Mat DecodeImage(uint layerIndex, bool consumeRle = true)
273273
/* When byte0[7:6] is [1:0], the meaning of byte0[5:4] follow below definition:
274274
* 0 0 byte0[3:0] is the positive diff value. that's mean
275275
current value subtract previous value is bigger
276-
than 0. The range is from 0 to 15. 0x0 map to 0.
276+
than 0. The range is from 0 to 15. 0x0 map to 0.
277277
0xf map to 15.
278278
* 0 1 byte0[3:0] is the positive diff value. And this
279279
value's run-length represent by byte1[7:0]
@@ -388,7 +388,7 @@ void AddRep()
388388
rle[firstByteIndex] |= 0x1 << 4;
389389
rle.Add((byte)stride);
390390
}
391-
391+
392392
if (currentColor < previousColor)
393393
{
394394
rle[firstByteIndex] |= 0x1 << 5;
@@ -638,7 +638,7 @@ public override bool HaveTiltingVat
638638
{
639639
if (MachineName.Contains("Saturn 4 Ultra", StringComparison.OrdinalIgnoreCase)) return true;
640640
if (MachineName.Contains("Mars 5 Ultra", StringComparison.OrdinalIgnoreCase)) return true;
641-
return LayerHeight == LiftHeight && LiftHeight < 0.5 && LiftSpeed < 0.5;
641+
return LiftHeight == 0;
642642
}
643643
}
644644

@@ -835,7 +835,7 @@ public override float LiftHeight
835835
get => Header.LiftHeight;
836836
set => base.LiftHeight = Header.LiftHeight = MathF.Round(value, 2);
837837
}
838-
838+
839839
public override float LiftSpeed
840840
{
841841
get => Header.LiftSpeed;
@@ -1041,7 +1041,7 @@ protected override void DecodeInternally(OperationProgress progress)
10411041
Parallel.ForEach(batch, CoreSettings.GetParallelOptions(progress), layerIndex =>
10421042
{
10431043
progress.PauseIfRequested();
1044-
1044+
10451045
using (var mat = LayersDefinition[layerIndex].DecodeImage((uint)layerIndex))
10461046
{
10471047
_layers[layerIndex] = new Layer((uint)layerIndex, mat, this);
@@ -1079,17 +1079,15 @@ protected override void OnBeforeEncode(bool isPartialEncode)
10791079
Header.Volume = Volume;
10801080
Header.MaterialGrams = MaterialMilliliters;
10811081

1082+
10821083
if (HaveTiltingVat)
10831084
{
1084-
BottomLiftHeightTotal = LayerHeight;
1085-
LiftHeightTotal = LayerHeight;
1086-
if (BottomLiftSpeed > 0.5 || LiftSpeed > 0.5 || BottomRetractSpeed > 0.5 || RetractSpeed > 0.5)
1087-
{
1088-
BottomLiftSpeed = 0.05f;
1089-
LiftSpeed = 0.05f;
1090-
BottomRetractSpeed = 0.05f;
1091-
RetractSpeed = 0.05f;
1092-
}
1085+
BottomLiftHeightTotal = 0;
1086+
LiftHeightTotal = 0;
1087+
BottomLiftSpeed = 0;
1088+
LiftSpeed = 0;
1089+
BottomRetractSpeed = 0;
1090+
RetractSpeed = 0;
10931091
}
10941092
}
10951093

UVtools.Core/SystemOS/SystemAware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ public static void OpenBrowser(string url)
289289
}
290290
else
291291
{
292-
// throw
292+
// throw
293293
}
294294
}
295295
catch (Exception e)

0 commit comments

Comments
 (0)