Skip to content

Commit

Permalink
v4.1.0
Browse files Browse the repository at this point in the history
- **File formats:**
  - (Add) Emake3D Galaxy 1 (QDT) file format and PrusaSlicer printer profile
  - (Add) `ManufacturingProcess` property to get the manufacturing process used by the file/printer combination
  - (Add) `SupportAntiAliasing` property to get if the file supports antialiasing usage (grey pixels)
  - (Improvement) Goo: On encode image do not use gradient compression when going from grey to black or white
  - (Change) PZR: Disable gradient compression for this file format as it corrupt layer for Phrozen Sonic Mini 8K S (#776, #810, #814)
  - (Fix) Thumbnail text generation and for partial open files
- (Add) Title bar: Display the loaded file size and re-arrange the last operation run time to the right
- (Improvement) Re-arrange some items on `File` and `Help` menu
- (Fix) Layer actions - Import layer(s): Unable to process image files (#815)
- (Fix) PCB Exposure: Draw circles using ellipses in order to use non-square pixels (#822)
- (Fix) PrusaSlicer Printer: "Elegoo Mars 4" is wrongly named, renamed to "Elegoo Mars 4 DLP" and added the corresponding "Elegoo Mars 4"
- (Upgrade) .NET from 6.0.25 to 6.0.26
- (Upgrade) AvaloniaUI from 11.0.6 to 11.0.7 (Fixes #803, #812)
  • Loading branch information
sn4k3 committed Jan 17, 2024
1 parent 9cc8937 commit f0de25c
Show file tree
Hide file tree
Showing 77 changed files with 3,016 additions and 1,205 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Explicitly declare text files we want to always be normalized and converted
# to native line endings on checkout.
*.gitattributes text
*.gitignore text
*.txt text
*.ini text
*.md text diff=markdown
Expand All @@ -19,6 +20,8 @@
*.py text diff=python
*.py3 text diff=python
*.gcode text
*.bt text
*.1pj text

# Declare files that will always have CRLF line endings on checkout.
*.bat text eol=crlf
Expand Down
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## /12/2023 - v4.1.0

- **File formats:**
- (Add) Emake3D Galaxy 1 (QDT) file format and PrusaSlicer printer profile
- (Add) `ManufacturingProcess` property to get the manufacturing process used by the file/printer combination
- (Add) `SupportAntiAliasing` property to get if the file supports antialiasing usage (grey pixels)
- (Improvement) Goo: On encode image do not use gradient compression when going from grey to black or white
- (Change) PZR: Disable gradient compression for this file format as it corrupt layer for Phrozen Sonic Mini 8K S (#776, #810, #814)
- (Fix) Thumbnail text generation and for partial open files
- (Add) Title bar: Display the loaded file size and re-arrange the last operation run time to the right
- (Improvement) Re-arrange some items on `File` and `Help` menu
- (Fix) Layer actions - Import layer(s): Unable to process image files (#815)
- (Fix) PCB Exposure: Draw circles using ellipses in order to use non-square pixels (#822)
- (Fix) PrusaSlicer Printer: "Elegoo Mars 4" is wrongly named, renamed to "Elegoo Mars 4 DLP" and added the corresponding "Elegoo Mars 4"
- (Upgrade) .NET from 6.0.25 to 6.0.26
- (Upgrade) AvaloniaUI from 11.0.6 to 11.0.7 (Fixes #803, #812)

## 24/12/2023 - v4.0.6

- (Add) Setting: Automations - Restrict the file name to valid ASCII characters (Default: Off)
Expand All @@ -15,7 +32,7 @@
- (Improvement) File -> Open recent: Disable all inexistent files (Can no longer be clicked)
- (Upgrade) .NET from 6.0.24 to 6.0.25
- (Upgrade) AvaloniaUI from 11.0.5 to 11.0.6
-

## 09/11/2023 - v4.0.4

- **FileFormat Anycubic:**
Expand Down
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Platforms>AnyCPU;x64;ARM64</Platforms>

<Authors>Tiago Conceição, sn4k3</Authors>
<Company>PTRTECH</Company>
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ But also, I need victims for test subject. Proceed at your own risk!
- LGS (Longer Orange 10), LGS30 (Longer Orange 30), LGS120 (Longer Orange 120), LGS4K (Longer Orange 4K & mono)
- Flashforge SVGX
- Anet N4, Anet N7
- QDT (Emake3D Galaxy 1)
- OSLA (Open SLA universal binary file)
- OSF (Vlare Open File Format)
- UVJ (Vendor-neutral format for manual manipulation)
Expand Down
2 changes: 1 addition & 1 deletion Scripts/UVtools.ScriptSample/ScriptCustomGCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void ScriptInit()
/// <returns>A error message, empty or null if validation passes.</returns>
public string? ScriptValidate()
{
return SlicerFile.SupportsGCode ? null : "GCode is not supported on this file";
return SlicerFile.SupportGCode ? null : "GCode is not supported on this file";
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions Scripts/UVtools.ScriptSample/ScriptDebandingZSample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void ScriptInit()
"Check the Shield icon/tab and look for 'Wait time before cure' suggestion, you can also configure it and offers more possibilities.";
Script.Author = "Tiago Conceição";
Script.Version = new Version(0, 3);
if (SlicerFile.SupportsGCode) CreateEmptyLayerInput.Value = false;
if (SlicerFile.SupportGCode) CreateEmptyLayerInput.Value = false;
Script.UserInputs.Add(CreateEmptyLayerInput);
Script.UserInputs.Add(BottomSafeDebandingHeightInput);
Script.UserInputs.Add(BottomWaitTimeBeforeCureInput);
Expand Down Expand Up @@ -160,7 +160,7 @@ public bool ScriptExecute()
mat.SetByte(pixelPos.X, pixelPos.Y,
1); // Print a very fade pixel to ignore empty layer detection
firstLayer.LayerMat = mat;
firstLayer.ExposureTime = SlicerFile.SupportsGCode ? 0 : 0.05f;
firstLayer.ExposureTime = SlicerFile.SupportGCode ? 0 : 0.05f;
firstLayer.SetNoDelays();
SlicerFile.SuppressRebuildPropertiesWork(() => { SlicerFile.Prepend(firstLayer); });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public bool ScriptExecute()
coresLayer2.LayerMat = coresMat2;

// Try to disable lifts for last two subsequent layers
fullLayer.LiftHeightTotal = coresLayer2.LiftHeightTotal = SlicerFile.SupportsGCode ? 0f : 0.1f;
fullLayer.LiftHeightTotal = coresLayer2.LiftHeightTotal = SlicerFile.SupportGCode ? 0f : 0.1f;

newLayers[layerIndex * 3] = coresLayer1;
newLayers[layerIndex * 3 + 1] = coresLayer2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public bool ScriptExecute()

if (InputDoNotUseLift.Value)
{
SlicerFile.SetLiftForSamePositionedLayers(SlicerFile.SupportsGCode ? 0 : 0.1f);
SlicerFile.SetLiftForSamePositionedLayers(SlicerFile.SupportGCode ? 0 : 0.1f);
}
Progress++;

Expand Down
4 changes: 2 additions & 2 deletions Scripts/UVtools.ScriptSample/ScriptTimelapseSample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void ScriptInit()
Script.UserInputs.Add(InputRaiseEveryLayerN);
Script.UserInputs.Add(InputWaitTime);

if (!SlicerFile.SupportsGCode)
if (!SlicerFile.SupportGCode)
{
InputUseVirtualLayer.Value = true;
}
Expand Down Expand Up @@ -142,7 +142,7 @@ public bool ScriptExecute()
var layer = new Layer(SlicerFile.LayerCount, mat, SlicerFile)
{
PositionZ = InputPositionZ.Value,
ExposureTime = SlicerFile.SupportsGCode ? 0 : 0.05f,
ExposureTime = SlicerFile.SupportGCode ? 0 : 0.05f,
LiftSpeed = InputLiftSpeed.Value,
RetractSpeed = InputRetractSpeed.Value
};
Expand Down
4 changes: 2 additions & 2 deletions UVtools.AvaloniaControls/UVtools.AvaloniaControls.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,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>3.0.1</Version>
<Version>3.0.2</Version>

<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/sn4k3/UVtools/tree/master/UVtools.AvaloniaControls</RepositoryUrl>
Expand All @@ -24,7 +24,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.6" />
<PackageReference Include="Avalonia" Version="11.0.7" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion UVtools.Cmd/Symbols/PrintGCodeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal static Command CreateCommand()
command.SetHandler((inputFile) =>
{
var slicerFile = Program.OpenInputFile(inputFile, FileFormat.FileDecodeType.Partial);
if (slicerFile.SupportsGCode)
if (slicerFile.SupportGCode)
{
Console.WriteLine(slicerFile.GCodeStr);
}
Expand Down
2 changes: 1 addition & 1 deletion UVtools.Cmd/Symbols/SetThumbnailCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ internal static class SetThumbnailCommand
internal static Command CreateCommand()
{
var sourceArgument = new Argument<string>($"file path|layer index|{RandomLayerArg}|{HeatmapArg}", () => HeatmapArg, "Choose from a file, layer index, random layer or generate a heatmap");
var thumbnailIndexesOption = new Option<byte[]>(new[] { "-i", "--indexes" }, "Prints only the matching thumbnail(s) index(es)")
var thumbnailIndexesOption = new Option<byte[]>(new[] { "-i", "--indexes" }, "Replaces only the matching thumbnail(s) index(es)")
{
AllowMultipleArgumentsPerToken = true
};
Expand Down
3 changes: 1 addition & 2 deletions UVtools.Cmd/UVtools.Cmd.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>UVtoolsCmd</AssemblyName>
<Description>Commandline utility for UVtools</Description>
<Version>2.0.0</Version>
<Version>2.0.1</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 4 additions & 2 deletions UVtools.Core/About.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ public static class About
public const string License = "GNU Affero General Public License v3.0 (AGPL)";
public const string LicenseUrl = "https://github.com/sn4k3/UVtools/blob/master/LICENSE";
public const string Website = "https://github.com/sn4k3/UVtools";
public const string Donate = "https://paypal.me/SkillTournament";
public const string Sponsor = "https://github.com/sponsors/sn4k3";

public const string DonateGitHubUrl = "https://github.com/sponsors/sn4k3";
public const string DonatePayPalUrl = "https://www.paypal.com/donate/?hosted_button_id=3F9DKDNPWEYR6";
//public const string DonatePayPalUrl = "https://paypal.me/SkillTournament";

public const string TermsOfUseTitle = $"Terms of Use for {Software}";

Expand Down
17 changes: 17 additions & 0 deletions UVtools.Core/CoreSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@ public static int MaxDegreeOfParallelism
/// </summary>
public static ParallelOptions ParallelDebugOptions => new() { MaxDegreeOfParallelism = 1 };

/// <summary>
/// Gets the ParallelDebugOptions with the <see cref="CancellationToken"/> set
/// </summary>
public static ParallelOptions GetParallelDebugOptions(CancellationToken token = default)
{
var options = ParallelDebugOptions;
options.CancellationToken = token;
return options;
}

/// <summary>
/// Gets the ParallelDebugOptions with the <see cref="CancellationToken"/> set
/// </summary>
public static ParallelOptions GetParallelDebugOptions(OperationProgress progress) => GetParallelDebugOptions(progress.Token);


/// <summary>
/// Gets the ParallelOptions with <see cref="MaxDegreeOfParallelism"/> and the <see cref="CancellationToken"/> set
Expand All @@ -80,6 +95,8 @@ public static ParallelOptions GetParallelOptions(CancellationToken token = defau
/// </summary>
public static ParallelOptions GetParallelOptions(OperationProgress progress) => GetParallelOptions(progress.Token);



/// <summary>
/// Gets or sets if operations run via CUDA when possible
/// </summary>
Expand Down
98 changes: 92 additions & 6 deletions UVtools.Core/EmguCV/MatRoi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,125 @@
namespace UVtools.Core.EmguCV;

/// <summary>
/// A disposable Mat with associated ROI Mat
/// A disposable Mat with the associated ROI Mat
/// </summary>
public class MatRoi : IDisposable
public class MatRoi : IDisposable, IEquatable<MatRoi>
{
#region Members
private bool _disposed;
#endregion

#region Properties
public Mat SourceMat { get; }
public Rectangle Roi { get; }
public Mat RoiMat { get; }

/// <summary>
/// True to dispose the <see cref="SourceMat"/> on <see cref="Dispose()"/>
/// </summary>
public bool DisposeSourceMat { get; set; }


public Point RoiLocation => Roi.Location;
public Size RoiSize => Roi.Size;

#endregion

#region Constructor

public MatRoi(Mat sourceMat, Rectangle roi)
/// <summary>
///
/// </summary>
/// <param name="sourceMat">The source mat to apply the <paramref name="roi"/>.</param>
/// <param name="roi">The roi rectangle.</param>
/// <param name="disposeSourceMat">True if you want to dispose the <see cref="SourceMat"/> upon the <see cref="Dispose()"/> call.<br/>
/// Use true when creating a <see cref="Mat"/> directly on this constructor or not handling the <see cref="SourceMat"/> disposal, otherwise false.</param>
public MatRoi(Mat sourceMat, Rectangle roi, bool disposeSourceMat = false)
{
SourceMat = sourceMat;
Roi = roi;
RoiMat = sourceMat.Roi(roi);

DisposeSourceMat = disposeSourceMat;
}

public void Deconstruct(out Mat sourceMat, out Mat roiMat, out Rectangle roi)
{
sourceMat = SourceMat;
roiMat = RoiMat;
roi = Roi;
}

public void Deconstruct(out Mat sourceMat, out Mat roiMat)
{
sourceMat = SourceMat;
roiMat = RoiMat;
}

public void Deconstruct(out Mat roiMat, out Rectangle roi)
{
roiMat = RoiMat;
roi = Roi;
}

#endregion

#region Clone
public MatRoi Clone()
{
return new MatRoi(SourceMat.Clone(), Roi);
return new MatRoi(SourceMat.Clone(), Roi, true);
}
#endregion

#region Equality
public bool Equals(MatRoi? other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return Roi.Equals(other.Roi) && SourceMat.Equals(other.SourceMat);
}

public override bool Equals(object? obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((MatRoi)obj);
}

public override int GetHashCode()
{
return HashCode.Combine(SourceMat, Roi);
}

public static bool operator ==(MatRoi? left, MatRoi? right)
{
return Equals(left, right);
}

public static bool operator !=(MatRoi? left, MatRoi? right)
{
return !Equals(left, right);
}
#endregion

#region Dispose
protected virtual void Dispose(bool disposing)
{
if (_disposed) return;
if (disposing)
{
if (DisposeSourceMat) SourceMat.Dispose();
RoiMat.Dispose();
}

_disposed = true;
}

public void Dispose()
{
SourceMat.Dispose();
RoiMat.Dispose();
Dispose(true);
GC.SuppressFinalize(this);
}
#endregion
}
10 changes: 10 additions & 0 deletions UVtools.Core/Enumerations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@

namespace UVtools.Core;

/// <summary>
/// Enumeration of m manufacturing processes
/// </summary>
public enum PrinterManufacturingProcess : byte
{
mSLA,
DLP,
SLA
}

/// <summary>
/// Gets index start number, if starts on 0 or 1
/// </summary>
Expand Down
Loading

0 comments on commit f0de25c

Please sign in to comment.