mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-11 11:02:32 +02:00
a648610d59
- **File formats:** - (Add) Wait time before cure: The time to rest/wait in seconds before cure a new layer - (Add) Wait time before after: The time to rest/wait in seconds after cure a new layer - (Add) Wait time after lift: The time to rest/wait in seconds after a lift/peel move - (Change) All gcode file formats dropped light-off delay field in favor of new 'Wait time before cure' field, setting light-off delay still valid but it redirects to the new field - (Change) Reorder 'Light-off delay' before 'Exposure time' - (Improvement) Recalculate the print time when a related property changes - (Fix) Generic time estimation calculation was ignoring exposure times - (Fix) Unable to load files with uppercase extensions - (Fix) ZIP: Use G1 at end of gcode instead of G0 - (Fix) CWS: Use G1 for movements - **(Fix) CXDLP:** (#240) - Layer area calculation - Validation checksum - **(Fix) ZCODE:** - Use G1 at end of gcode instead of G0 to prevent crash to top bug on firmware - Put back the M18 motors off at end of gcode - **GCode Builder/Parser:** - (Add) Allow to choose between G0 and G1 for layer movements and end gcode - (Fix) Safe guard: If the total print height is larger than set machine Z, do not raise/lower print on completeness - (Fix) Light-off delay is the real delay time and not the calculated movement of the lifts plus the extra time - (Improvement) Parse gcode line by line instead searching on a group of layers to allow a better control and identification - **Tools:** - **Change print parameters:** - (Add) Tooltips to labels - (Add) Sun UTF-8 to the Light PWM value unit to describe intensity - (Improvement) Dynamic lifts: Round lift height and speed to 1 decimal - (Fix) Exposure time finder: Time estimation when using 'Use different settings for layers with same Z positioning' - **Prusa Slicer:** - (Add) Note keyword: BottomWaitBeforeCure_xxx - (Add) Note keyword: WaitBeforeCure_xxx - (Add) Note keyword: BottomWaitAfterCure_xxx - (Add) Note keyword: WaitAfterCure_xxx - (Add) Note keyword: BottomWaitAfterLift_xxx - (Add) Note keyword: WaitAfterLift_xxx - (Change) Uniz IBEE: Remove light-off delay and implement wait time keywords - **macOS:** (#236) - (Remove) osx legacy packages from build and downloads - (Fix) macOS: Simplify the libcvextern.dylib and remove libtesseract dependency - (Fix) macOS: Include libusb-1.0.0.dylib - Note: `brew install libusb` still required - **UI:** - (Fix) Refresh gcode does not update text on UI for ZIP, CWS, ZCODEX files - (Fix) Operations: Import a .uvtop file by drag and drop into the UI would not load the layer range - (Change) When convert a file, the result dialog will have Yes, No and Cancel actions, where No will open the converted file on current window, while Cancel will not perform any action (The old No behaviour)
114 lines
3.5 KiB
C#
114 lines
3.5 KiB
C#
/*
|
|
* GNU AFFERO GENERAL PUBLIC LICENSE
|
|
* Version 3, 19 November 2007
|
|
* Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
* Everyone is permitted to copy and distribute verbatim copies
|
|
* of this license document, but changing it is not allowed.
|
|
*/
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace UVtools.Core.FileFormats
|
|
{
|
|
/// <summary>
|
|
/// Represents a file extension for slicer file formats
|
|
/// </summary>
|
|
public sealed class FileExtension : IEquatable<FileExtension>, IEquatable<string>
|
|
{
|
|
#region Properties
|
|
/// <summary>
|
|
/// Gets the extension name without the dot (.)
|
|
/// </summary>
|
|
public string Extension { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the extension description
|
|
/// </summary>
|
|
public string Description { get; }
|
|
|
|
/// <summary>
|
|
/// Gets a tag object
|
|
/// </summary>
|
|
public object Tag { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the file filter for open and save dialogs
|
|
/// </summary>
|
|
public string Filter => $@"{Description} (*.{Extension})|*.{Extension}";
|
|
#endregion
|
|
|
|
#region Constructor
|
|
|
|
/// <summary>
|
|
/// Constructor
|
|
/// </summary>
|
|
/// <param name="extension">The extension name without the dot (.)</param>
|
|
/// <param name="description">The extension description</param>
|
|
/// <param name="tag">Tag object</param>
|
|
public FileExtension(string extension, string description, object tag = null)
|
|
{
|
|
Extension = extension;
|
|
Description = description;
|
|
Tag = tag;
|
|
}
|
|
#endregion
|
|
|
|
#region Overrides
|
|
|
|
public override string ToString()
|
|
{
|
|
return $"{Description} ({Extension})";
|
|
}
|
|
|
|
public bool Equals(FileExtension other)
|
|
{
|
|
return Extension.Equals(other.Extension, StringComparison.OrdinalIgnoreCase);
|
|
}
|
|
|
|
public bool Equals(string other)
|
|
{
|
|
return Extension.Equals(other, StringComparison.OrdinalIgnoreCase);
|
|
}
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
return ReferenceEquals(this, obj) || obj is FileExtension other && Equals(other);
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return (Extension != null ? Extension.GetHashCode() : 0);
|
|
}
|
|
|
|
private sealed class ExtensionEqualityComparer : IEqualityComparer<FileExtension>
|
|
{
|
|
public bool Equals(FileExtension x, FileExtension y)
|
|
{
|
|
if (ReferenceEquals(x, y)) return true;
|
|
if (ReferenceEquals(x, null)) return false;
|
|
if (ReferenceEquals(y, null)) return false;
|
|
if (x.GetType() != y.GetType()) return false;
|
|
return x.Extension == y.Extension;
|
|
}
|
|
|
|
public int GetHashCode(FileExtension obj)
|
|
{
|
|
return (obj.Extension != null ? obj.Extension.GetHashCode() : 0);
|
|
}
|
|
}
|
|
|
|
public static IEqualityComparer<FileExtension> ExtensionComparer { get; } = new ExtensionEqualityComparer();
|
|
#endregion
|
|
|
|
#region Methods
|
|
|
|
public FileFormat GetFileFormat() =>
|
|
FileFormat.FindByExtension(Extension);
|
|
|
|
public static FileExtension Find(string extension)=>
|
|
FileFormat.FindExtension(extension);
|
|
#endregion
|
|
}
|
|
}
|