Skip to content

Commit

Permalink
v5.0.3
Browse files Browse the repository at this point in the history
- Anycubic file format:
  - (Fix) Reset TSMC values to comply with globals when decoding file and AdvancedMode is disabled (#971)
  - (Fix) Setting the LiftHeight2 was setting the base value to BottomLiftHeight2
  - (Fix) Setting the BottomRetractSpeed was not applying the value in the base property
- Multiple exposure finder:
   - (Fix) Counter triangles not taking all the new left space
   - (Fix) When doing multiple heights the text label always show the base height
- (Improvement) Layer image viewer internal handling
- (Fix) Settings - Send to process: Unable to pick a process file, it was selecting folder instead
- (Fix) Save As can show incorrect file extension description when there are other file formats with the same extension
  • Loading branch information
sn4k3 committed Dec 28, 2024
1 parent a3e5686 commit bf423f4
Show file tree
Hide file tree
Showing 15 changed files with 159 additions and 50 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 28/12/2024 - v5.0.3

- Anycubic file format:
- (Fix) Reset TSMC values to comply with globals when decoding file and AdvancedMode is disabled (#971)
- (Fix) Setting the LiftHeight2 was setting the base value to BottomLiftHeight2
- (Fix) Setting the BottomRetractSpeed was not applying the value in the base property
- Multiple exposure finder:
- (Fix) Counter triangles not taking all the new left space
- (Fix) When doing multiple heights the text label always show the base height
- (Improvement) Layer image viewer internal handling
- (Fix) Settings - Send to process: Unable to pick a process file, it was selecting folder instead
- (Fix) Save As can show incorrect file extension description when there are other file formats with the same extension

## 19/12/2024 - v5.0.2

- (Fix) Remove a condition that prevents the new Anycubic file format from being used
Expand Down
3 changes: 2 additions & 1 deletion CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,5 @@
- Landry David
- Jeremy Conoley
- Brady George
- Ryan Skow
- Ryan Skow
- Cainam
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>

<!-- Versions -->
<UVtoolsVersion>5.0.2</UVtoolsVersion>
<UVtoolsVersion>5.0.3</UVtoolsVersion>
<AvaloniaVersion>11.2.3</AvaloniaVersion>

<!-- MvvmToolkit -->
Expand Down
5 changes: 2 additions & 3 deletions PrusaSlicer/printer/Uniz IBEE (Klipper).ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# generated by PrusaSlicer 2.7.4+win64 on 2024-05-17 at 23:45:35 UTC
# generated by PrusaSlicer 2.9.0 on 2024-12-25 at 21:27:31 UTC
absolute_correction = 0
area_fill = 50
bed_custom_model =
bed_custom_texture =
bed_shape = 0x0,192x0,192x120,0x120
Expand All @@ -27,7 +26,7 @@ min_exposure_time = 1
min_initial_exposure_time = 1
print_host =
printer_model = SL1
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_PRUSA3D\nPRINTER_MODEL_SL1\nPRINTER_VENDOR_UNIZ\nPRINTER_MODEL_IBEE\nFILEFORMAT_ZIP\nFILECLASS_KLIPPER\n\nSTART_CUSTOM_VALUES\nBottomLiftHeight_4\nBottomLiftSpeed_600\nBottomLiftAcceleration_5\nBottomLiftHeight2_2\nBottomLiftSpeed2_600\nBottomLiftAcceleration2_100\nBottomWaitTimeAfterLift_0\nBottomRetractSpeed_600\nBottomRetractAcceleration_100\nBottomRetractHeight2_1.5\nBottomRetractSpeed2_600\nBottomRetractAcceleration2_5\nBottomWaitTimeBeforeCure_3\nBottomWaitTimeAfterCure_3\n\nLiftHeight_4\nLiftSpeed_600\nLiftAcceleration_5\nLiftHeight2_2\nLiftSpeed2_600\nLiftAcceleration2_100\nWaitTimeAfterLift_0\nRetractSpeed_600\nRetractAcceleration_100\nRetractHeight2_1.5\nRetractSpeed2_600\nRetractAcceleration2_5\nWaitTimeBeforeCure_2\nWaitTimeAfterCure_1\nEND_CUSTOM_VALUES
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_PRUSA3D\nPRINTER_MODEL_SL1\nPRINTER_VENDOR_UNIZ\nPRINTER_MODEL_IBEE\nFILEFORMAT_ZIP\nFILECLASS_KLIPPER\n\nSTART_CUSTOM_VALUES\nBottomLiftHeight_4\nBottomLiftSpeed_600\nBottomLiftAcceleration_4\nBottomLiftHeight2_3\nBottomLiftSpeed2_600\nBottomLiftAcceleration2_100\nBottomWaitTimeAfterLift_0\nBottomRetractSpeed_600\nBottomRetractAcceleration_100\nBottomRetractHeight2_1.5\nBottomRetractSpeed2_600\nBottomRetractAcceleration2_4\nBottomWaitTimeBeforeCure_3\nBottomWaitTimeAfterCure_3\n\nLiftHeight_4\nLiftSpeed_600\nLiftAcceleration_4\nLiftHeight2_3\nLiftSpeed2_600\nLiftAcceleration2_100\nWaitTimeAfterLift_0\nRetractSpeed_600\nRetractAcceleration_100\nRetractHeight2_1.5\nRetractSpeed2_600\nRetractAcceleration2_4\nWaitTimeBeforeCure_2\nWaitTimeAfterCure_1\nEND_CUSTOM_VALUES
printer_settings_id =
printer_technology = SLA
printer_variant = default
Expand Down
4 changes: 2 additions & 2 deletions PrusaSlicer/sla_print/Universal 0.10 - Light Supports.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# generated by PrusaSlicer 2.6.0+win64 on 2023-06-24 at 15:32:46 UTC
# generated by PrusaSlicer 2.9.0 on 2024-12-28 at 19:13:46 UTC
branchingsupport_base_diameter = 4
branchingsupport_base_height = 1
branchingsupport_base_safety_distance = 1
Expand Down Expand Up @@ -48,7 +48,7 @@ support_base_safety_distance = 1
support_buildplate_only = 0
support_critical_angle = 45
support_enforcers_only = 0
support_head_front_diameter = 0.6
support_head_front_diameter = 0.5
support_head_penetration = 0.4
support_head_width = 3
support_max_bridge_length = 10
Expand Down
12 changes: 10 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
- (Fix) Remove a condition that prevents the new Anycubic file format from being used
- (Upgrade) AvaloniaUI from 11.1.3 to 11.2.2
- Anycubic file format:
- (Fix) Reset TSMC values to comply with globals when decoding file and AdvancedMode is disabled (#971)
- (Fix) Setting the LiftHeight2 was setting the base value to BottomLiftHeight2
- (Fix) Setting the BottomRetractSpeed was not applying the value in the base property
- Multiple exposure finder:
- (Fix) Counter triangles not taking all the new left space
- (Fix) When doing multiple heights the text label always show the base height
- (Improvement) Layer image viewer internal handling
- (Fix) Settings - Send to process: Unable to pick a process file, it was selecting folder instead
- (Fix) Save As can show incorrect file extension description when there are other file formats with the same extension

43 changes: 35 additions & 8 deletions UVtools.AvaloniaControls/AdvancedImageBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,7 @@ static AdvancedImageBox()
GridColorProperty,
GridColorAlternateProperty,
PixelGridColorProperty,
ImageProperty,
//ImageProperty,
SelectionRegionProperty
);
}
Expand Down Expand Up @@ -1297,6 +1297,13 @@ protected override void OnLoaded(RoutedEventArgs e)
}
}

protected override void OnSizeChanged(SizeChangedEventArgs e)
{
base.OnSizeChanged(e);
UpdateViewPort();
e.Handled = true;
}

protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs e)
{
base.OnPropertyChanged(e);
Expand Down Expand Up @@ -1339,6 +1346,7 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs e)
else if (ReferenceEquals(e.Property, SizeModeProperty))
{
SizeModeChanged();
TriggerRender();
RaisePropertyChanged(nameof(IsHorizontalBarVisible));
RaisePropertyChanged(nameof(IsVerticalBarVisible));
}
Expand All @@ -1355,6 +1363,11 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs e)
RaisePropertyChanged(nameof(ScaledImageSize));
RaisePropertyChanged(nameof(Extent));
}
else if(ReferenceEquals(e.Property, PaddingProperty))
{
UpdateViewPort();
TriggerRender();
}
}

#endregion
Expand All @@ -1371,7 +1384,7 @@ public override void Render(DrawingContext context)
{
//Debug.WriteLine($"Render: {DateTime.Now.Ticks}");
base.Render(context);

var viewPortSize = Viewport;
// Draw Grid
var gridCellSize = GridCellSize;
Expand Down Expand Up @@ -1466,7 +1479,7 @@ private bool UpdateViewPort()
var verticalScrollBar = VerticalScrollBar;
if (verticalScrollBar is null) return false;

if (!IsImageLoaded)
if (!IsImageLoaded || SizeMode != SizeModes.Normal)
{
horizontalScrollBar.Maximum = 0;
verticalScrollBar.Maximum = 0;
Expand Down Expand Up @@ -2728,6 +2741,8 @@ public Rect GetImageViewPort()
double width = 0.0;
double height = 0.0;

var padding = Padding;

switch (SizeMode)
{
case SizeModes.Normal:
Expand All @@ -2736,16 +2751,23 @@ public Rect GetImageViewPort()
xOffset = (!IsHorizontalBarVisible ? (viewPortSize.Width - ScaledImageWidth) / 2.0 : 0.0);
yOffset = (!IsVerticalBarVisible ? (viewPortSize.Height - ScaledImageHeight) / 2.0 : 0.0);
}

width = Math.Min(ScaledImageWidth - Math.Abs(Offset.X), viewPortSize.Width);
height = Math.Min(ScaledImageHeight - Math.Abs(Offset.Y), viewPortSize.Height);
break;
case SizeModes.Stretch:
width = viewPortSize.Width;
height = viewPortSize.Height;
width = viewPortSize.Width - padding.Left - padding.Right;
if (width <= 0) return new Rect();
height = viewPortSize.Height - padding.Top - padding.Bottom;
if (height <= 0) return new Rect();

xOffset = padding.Left;
yOffset = padding.Top;
break;
case SizeModes.Fit:
double scaleFactor = Math.Min(viewPortSize.Width / image.Size.Width, viewPortSize.Height / image.Size.Height);
double scaleFactor = Math.Min((viewPortSize.Width - padding.Left - padding.Right) / image.Size.Width, (viewPortSize.Height - padding.Top - padding.Bottom) / image.Size.Height);

if (scaleFactor <= 0) return new Rect();

width = Math.Floor(image.Size.Width * scaleFactor);
height = Math.Floor(image.Size.Height * scaleFactor);
Expand All @@ -2755,13 +2777,18 @@ public Rect GetImageViewPort()
xOffset = (viewPortSize.Width - width) / 2.0;
yOffset = (viewPortSize.Height - height) / 2.0;
}
else
{
xOffset = padding.Left;
yOffset = padding.Top;
}

break;
default:
throw new ArgumentOutOfRangeException(nameof(SizeMode), SizeMode, null);
}

return new(xOffset, yOffset, width, height);
return new Rect(xOffset, yOffset, width, height);
}
#endregion

Expand Down
2 changes: 1 addition & 1 deletion UVtools.AvaloniaControls/UVtools.AvaloniaControls.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- ExtendedNumericUpDown: Initial value with a reset button and value unit label
- IndexSelector: Allow to choose an index from a collection count and display the selected number
- GroupBox: Similar to GroupBox of WinForms, it contain an Header and Content</Description>
<Version>4.0.1</Version>
<Version>4.0.2</Version>

<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/sn4k3/UVtools/tree/master/UVtools.AvaloniaControls</RepositoryUrl>
Expand Down
72 changes: 57 additions & 15 deletions UVtools.Core/FileFormats/AnycubicFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,9 @@ public override float ExposureTime

public override float BottomLiftHeight
{
get => FileMarkSettings.Version >= VERSION_516 ? ExtraSettings.BottomLiftHeight1 : base.BottomLiftHeight;
get => FileMarkSettings.Version >= VERSION_516
? ExtraSettings.BottomLiftHeight1
: base.BottomLiftHeight;
set
{
value = (float)Math.Round(value, 2);
Expand All @@ -1402,7 +1404,7 @@ public override float BottomLiftHeight

public override float BottomLiftSpeed
{
get => FileMarkSettings.Version >= VERSION_516
get => FileMarkSettings.Version >= VERSION_516
? SpeedConverter.Convert(ExtraSettings.BottomLiftSpeed1, FormatSpeedUnit, CoreSpeedUnit)
: base.BottomLiftSpeed;
set
Expand All @@ -1415,7 +1417,9 @@ public override float BottomLiftSpeed

public override float LiftHeight
{
get => FileMarkSettings.Version >= VERSION_516 ? ExtraSettings.LiftHeight1 : HeaderSettings.LiftHeight;
get => FileMarkSettings.Version >= VERSION_516
? ExtraSettings.LiftHeight1
: HeaderSettings.LiftHeight;
set
{
value = (float)Math.Round(value, 2);
Expand All @@ -1435,7 +1439,9 @@ public override float LiftHeight

public override float LiftSpeed
{
get => SpeedConverter.Convert(FileMarkSettings.Version >= VERSION_516 ? ExtraSettings.LiftSpeed1 : HeaderSettings.LiftSpeed, FormatSpeedUnit, CoreSpeedUnit);
get => SpeedConverter.Convert(FileMarkSettings.Version >= VERSION_516
? ExtraSettings.LiftSpeed1
: HeaderSettings.LiftSpeed, FormatSpeedUnit, CoreSpeedUnit);
set
{
value = (float)Math.Round(value, 2);
Expand All @@ -1446,7 +1452,9 @@ public override float LiftSpeed

public override float BottomLiftHeight2
{
get => FileMarkSettings.Version >= VERSION_516 ? ExtraSettings.BottomLiftHeight2 : 0;
get => FileMarkSettings.Version >= VERSION_516
? ExtraSettings.BottomLiftHeight2
: 0;
set
{
if (FileMarkSettings.Version < VERSION_516) return;
Expand All @@ -1455,12 +1463,15 @@ public override float BottomLiftHeight2
BottomLiftHeight = bottomLiftHeight;
base.BottomLiftHeight2 = ExtraSettings.BottomLiftHeight2;
HeaderSettings.AdvancedMode = System.Convert.ToUInt32(IsUsingTSMC);
RaisePropertyChanged();
}
}

public override float BottomLiftSpeed2
{
get => FileMarkSettings.Version >= VERSION_516 ? SpeedConverter.Convert(ExtraSettings.BottomLiftSpeed2, FormatSpeedUnit, CoreSpeedUnit) : 0;
get => FileMarkSettings.Version >= VERSION_516
? SpeedConverter.Convert(ExtraSettings.BottomLiftSpeed2, FormatSpeedUnit, CoreSpeedUnit)
: 0;
set
{
if (FileMarkSettings.Version < VERSION_516) return;
Expand All @@ -1472,21 +1483,26 @@ public override float BottomLiftSpeed2

public override float LiftHeight2
{
get => FileMarkSettings.Version >= VERSION_516 ? ExtraSettings.LiftHeight2 : 0;
get => FileMarkSettings.Version >= VERSION_516
? ExtraSettings.LiftHeight2
: 0;
set
{
if (FileMarkSettings.Version < VERSION_516) return;
var liftHeight = LiftHeight;
ExtraSettings.LiftHeight2 = (float)Math.Round(value, 2);
LiftHeight = liftHeight;
base.BottomLiftHeight2 = ExtraSettings.LiftHeight2;
base.LiftHeight2 = ExtraSettings.LiftHeight2;
HeaderSettings.AdvancedMode = System.Convert.ToUInt32(IsUsingTSMC);
RaisePropertyChanged();
}
}

public override float LiftSpeed2
{
get => FileMarkSettings.Version >= VERSION_516 ? SpeedConverter.Convert(ExtraSettings.LiftSpeed2, FormatSpeedUnit, CoreSpeedUnit) : 0;
get => FileMarkSettings.Version >= VERSION_516
? SpeedConverter.Convert(ExtraSettings.LiftSpeed2, FormatSpeedUnit, CoreSpeedUnit)
: 0;
set
{
if (FileMarkSettings.Version < VERSION_516) return;
Expand All @@ -1498,19 +1514,23 @@ public override float LiftSpeed2

public override float BottomRetractSpeed
{
get => FileMarkSettings.Version >= VERSION_516 ? SpeedConverter.Convert(ExtraSettings.BottomRetractSpeed1, FormatSpeedUnit, CoreSpeedUnit) : RetractSpeed;
get => FileMarkSettings.Version >= VERSION_516
? SpeedConverter.Convert(ExtraSettings.BottomRetractSpeed1, FormatSpeedUnit, CoreSpeedUnit)
: RetractSpeed;
set
{
value = (float)Math.Round(value, 2);

if (FileMarkSettings.Version < VERSION_516) return;
value = (float)Math.Round(value, 2);
ExtraSettings.BottomRetractSpeed1 = SpeedConverter.Convert(value, CoreSpeedUnit, FormatSpeedUnit);
base.BottomRetractSpeed = value;
}
}

public override float RetractSpeed
{
get => SpeedConverter.Convert(FileMarkSettings.Version >= VERSION_516 ? ExtraSettings.RetractSpeed1 : HeaderSettings.RetractSpeed, FormatSpeedUnit, CoreSpeedUnit);
get => SpeedConverter.Convert(FileMarkSettings.Version >= VERSION_516
? ExtraSettings.RetractSpeed1
: HeaderSettings.RetractSpeed, FormatSpeedUnit, CoreSpeedUnit);
set
{
value = (float)Math.Round(value, 2);
Expand All @@ -1521,7 +1541,9 @@ public override float RetractSpeed

public override float BottomRetractSpeed2
{
get => FileMarkSettings.Version >= VERSION_516 ? SpeedConverter.Convert(ExtraSettings.BottomRetractSpeed2, FormatSpeedUnit, CoreSpeedUnit) : 0;
get => FileMarkSettings.Version >= VERSION_516
? SpeedConverter.Convert(ExtraSettings.BottomRetractSpeed2, FormatSpeedUnit, CoreSpeedUnit)
: 0;
set
{
if (FileMarkSettings.Version < VERSION_516) return;
Expand All @@ -1533,7 +1555,9 @@ public override float BottomRetractSpeed2

public override float RetractSpeed2
{
get => FileMarkSettings.Version >= VERSION_516 ? SpeedConverter.Convert(ExtraSettings.RetractSpeed2, FormatSpeedUnit, CoreSpeedUnit) : 0;
get => FileMarkSettings.Version >= VERSION_516
? SpeedConverter.Convert(ExtraSettings.RetractSpeed2, FormatSpeedUnit, CoreSpeedUnit)
: 0;
set
{
if (FileMarkSettings.Version < VERSION_516) return;
Expand Down Expand Up @@ -2040,6 +2064,24 @@ protected override void DecodeInternally(OperationProgress progress)
Debug.Write("Extra -> ");
Debug.WriteLine(ExtraSettings);
//ExtraSettings.ValidateExpecting(24);

if (HeaderSettings.AdvancedMode == 0)
{
// Reset TSMC values to comply with globals
ExtraSettings.BottomLiftHeight1 = HeaderSettings.LiftHeight;
ExtraSettings.BottomLiftSpeed1 = HeaderSettings.LiftSpeed;
ExtraSettings.BottomLiftHeight2 = 0;
ExtraSettings.BottomLiftSpeed2 = HeaderSettings.LiftSpeed;
ExtraSettings.BottomRetractSpeed1 = HeaderSettings.RetractSpeed;
ExtraSettings.BottomRetractSpeed2 = HeaderSettings.RetractSpeed;

ExtraSettings.LiftHeight1 = HeaderSettings.LiftHeight;
ExtraSettings.LiftSpeed1 = HeaderSettings.LiftSpeed;
ExtraSettings.LiftHeight2 = 0;
ExtraSettings.LiftSpeed2 = HeaderSettings.LiftSpeed;
ExtraSettings.RetractSpeed1 = HeaderSettings.RetractSpeed;
ExtraSettings.RetractSpeed2 = HeaderSettings.RetractSpeed;
}
}

if (FileMarkSettings.MachineAddress > 0)
Expand Down
Loading

0 comments on commit bf423f4

Please sign in to comment.