mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-08 17:42:31 +02:00
v3.12.1
- **File formats:** - (Improvement) Does not set `PerLayerSettings` flag when found different exposure times on transition layers, this fix the issue where users can't edit settings on printer menu when having transition layers (#507) - (Fix) CTB for UniFormation GKtwo: Unable to show nor print files (#673) - (Fix) CBDDLP corruption when downgrade version (#675) - **PCB exposure:** - (Add) EagleCAD XLN drill format (#676) - (Add) Allow to re-order gerbers up and down on the grid - (Change) Drill files does not require G05 to do the holes (#676) - (Fix) Infinite loop on refresh preview when selecting drl files - (Fix) Unable to individual invert drl files - (Upgrade) .NET from 6.0.14 to 6.0.15
This commit is contained in:
@@ -1,5 +1,19 @@
|
||||
# Changelog
|
||||
|
||||
## 22/03/2023 - v3.12.1
|
||||
|
||||
- **File formats:**
|
||||
- (Improvement) Does not set `PerLayerSettings` flag when found different exposure times on transition layers, this fixes the issue where users can't edit settings on printer menu when having transition layers (#507)
|
||||
- (Fix) CTB for UniFormation GKtwo: Unable to show nor print files (#673)
|
||||
- (Fix) CBDDLP corruption when downgrade version (#675)
|
||||
- **PCB exposure:**
|
||||
- (Add) EagleCAD XLN drill format (#676)
|
||||
- (Add) Allow to re-order gerbers up and down on the grid
|
||||
- (Change) Drill files do not require G05 to do the holes (#676)
|
||||
- (Fix) Infinite loop on refresh preview when selecting drl files
|
||||
- (Fix) Unable to individual invert drl files
|
||||
- (Upgrade) .NET from 6.0.14 to 6.0.15
|
||||
|
||||
## 27/02/2023 - v3.12.0
|
||||
|
||||
- (Add) Allow to pause and resume operations (#654)
|
||||
|
||||
+11
-11
@@ -1,12 +1,12 @@
|
||||
- (Add) Allow to pause and resume operations (#654)
|
||||
- (Add) `Layer.FirstTransitionLayer`
|
||||
- (Add) `Layer.LastTransitionLayer`
|
||||
- (Add) File format: Elegoo GOO
|
||||
- (Add) PrusaSlicer Printer: Elegoo Mars 4
|
||||
- (Improvement) Allocate maximum GPU memory for Skia up to 256 MB
|
||||
- (Improvement) Set and sanitize transition layers exposure time from last bottom layer and first normal layer instead of global times (#659)
|
||||
- (Change) CXDLP: Default version from 2 to 3
|
||||
- (Fix) UI was not rendering with GPU (ANGLE)
|
||||
- (Fix) `Layer.IsTransitionLayer` was returning the wrong value
|
||||
- (Upgrade) .NET from 6.0.13 to 6.0.14
|
||||
- **File formats:**
|
||||
- (Improvement) Does not set `PerLayerSettings` flag when found different exposure times on transition layers, this fix the issue where users can't edit settings on printer menu when having transition layers (#507)
|
||||
- (Fix) CTB for UniFormation GKtwo: Unable to show nor print files (#673)
|
||||
- (Fix) CBDDLP corruption when downgrade version (#675)
|
||||
- **PCB exposure:**
|
||||
- (Add) EagleCAD XLN drill format (#676)
|
||||
- (Add) Allow to re-order gerbers up and down on the grid
|
||||
- (Change) Drill files does not require G05 to do the holes (#676)
|
||||
- (Fix) Infinite loop on refresh preview when selecting drl files
|
||||
- (Fix) Unable to individual invert drl files
|
||||
- (Upgrade) .NET from 6.0.14 to 6.0.15
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
// Purpose: CTB File Format
|
||||
//--------------------------------------
|
||||
|
||||
LittleEndian();
|
||||
|
||||
struct HEADER {
|
||||
uint Magic <fgcolor=cBlack, bgcolor=cRed, format=hex>;
|
||||
uint HeaderSize <fgcolor=cBlack, bgcolor=cRed>;
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
// Purpose: CTB File Format
|
||||
//--------------------------------------
|
||||
|
||||
LittleEndian();
|
||||
|
||||
struct HEADER {
|
||||
uint Magic <fgcolor=cBlack, bgcolor=cRed>;
|
||||
uint EncryptedHeaderSize <fgcolor=cBlack, bgcolor=cRed>;
|
||||
|
||||
@@ -102,7 +102,8 @@ public class ExcellonDrillFormat
|
||||
#endregion
|
||||
|
||||
#region Constants
|
||||
public const string Extension = "drl";
|
||||
|
||||
public static readonly string[] Extensions = {"drl", "xln"};
|
||||
|
||||
/// <summary>
|
||||
/// Indicates the start of the header. should always be the first line in the header
|
||||
@@ -183,7 +184,7 @@ public class ExcellonDrillFormat
|
||||
Drills.Clear();
|
||||
|
||||
bool endOfHeader = false;
|
||||
bool drillMode = false;
|
||||
bool drillMode = true;
|
||||
uint selectedToolIndex = 0;
|
||||
|
||||
float x = 0, y = 0;
|
||||
@@ -192,11 +193,12 @@ public class ExcellonDrillFormat
|
||||
{
|
||||
if (line.Length == 0) continue;
|
||||
|
||||
if (line is "M30") break; // End
|
||||
|
||||
if (line.StartsWith("FMAT,"))
|
||||
{
|
||||
var split = line.Split(',', StringSplitOptions.TrimEntries);
|
||||
FormatVersion = uint.Parse(split[1]);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -222,7 +224,7 @@ public class ExcellonDrillFormat
|
||||
continue;
|
||||
}
|
||||
|
||||
if (line == "ICI")
|
||||
if (line is "ICI" or "ICI,ON")
|
||||
{
|
||||
throw new NotImplementedException("ICI (Incremental input of program coordinates) is not yet implemented, please use absolute coordinate system.");
|
||||
}
|
||||
@@ -233,7 +235,7 @@ public class ExcellonDrillFormat
|
||||
continue;
|
||||
}
|
||||
|
||||
if (line == "G05")
|
||||
if (line is "G81" or "G05")
|
||||
{
|
||||
drillMode = true;
|
||||
continue;
|
||||
|
||||
@@ -48,6 +48,10 @@ public sealed class ChituboxFile : FileFormat
|
||||
|
||||
private const string CTBv4_DISCLAIMER = "Layout and record format for the ctb and cbddlp file types are the copyrighted programs or codes of CBD Technology (China) Inc..The Customer or User shall not in any manner reproduce, distribute, modify, decompile, disassemble, decrypt, extract, reverse engineer, lease, assign, or sublicense the said programs or codes.";
|
||||
private const ushort CTBv4_DISCLAIMER_SIZE = 320;
|
||||
|
||||
private const string CTBv4_GKtwo_DISCLAIMER = "Layout and record format for the jxs,ctb and cbddlp file types are the copyrighted programs or codes of CBD Technology (China) Inc.The Customer or User shall not in any manner reproduce, distribute, modify, decompile, disassemble, decrypt, extract, reverse engineer, lease, assign, or sublicense the said programs or codes.";
|
||||
private const ushort CTBv4_GKtwo_DISCLAIMER_SIZE = 323;
|
||||
|
||||
private const ushort CTBv4_RESERVED_SIZE = 384;
|
||||
|
||||
public const long PageSize = 4_294_967_296L; // Page-size for layers, limited to 4GB
|
||||
@@ -1695,6 +1699,7 @@ public sealed class ChituboxFile : FileFormat
|
||||
|
||||
public bool IsCbddlpFile => HeaderSettings.Magic == MAGIC_CBDDLP;
|
||||
public bool IsCtbFile => HeaderSettings.Magic is MAGIC_CTB or MAGIC_CTBv4 or MAGIC_CTBv4_GKtwo;
|
||||
public bool IsGkTwoFile => HeaderSettings.Magic is MAGIC_CTBv4_GKtwo;
|
||||
|
||||
public bool IsMagicValid => IsValidKnownMagic(HeaderSettings.Magic);
|
||||
|
||||
@@ -1803,7 +1808,7 @@ public sealed class ChituboxFile : FileFormat
|
||||
|
||||
SlicerInfoSettings.PerLayerSettings = AllLayersAreUsingGlobalParameters
|
||||
? PERLAYER_SETTINGS_DISALLOW
|
||||
: (byte)(Version * 16); // 0x10, 0x20, 0x30, 0x40, 0x50, ...
|
||||
: (byte)(Version * 0x10); // 0x10, 0x20, 0x30, 0x40, 0x50, ...
|
||||
|
||||
SlicerInfoSettings.ModifiedTimestampMinutes = (uint)DateTimeExtensions.TimestampMinutes;
|
||||
}
|
||||
@@ -1813,7 +1818,7 @@ public sealed class ChituboxFile : FileFormat
|
||||
SanitizeMagicVersion();
|
||||
|
||||
HeaderSettings.PrintParametersSize = (uint)Helpers.Serializer.SizeOf(PrintParametersSettings);
|
||||
|
||||
|
||||
if (IsCtbFile)
|
||||
{
|
||||
if (HeaderSettings.EncryptionKey == 0)
|
||||
@@ -1821,10 +1826,12 @@ public sealed class ChituboxFile : FileFormat
|
||||
HeaderSettings.EncryptionKey = (uint)new Random().Next(byte.MaxValue, int.MaxValue);
|
||||
}
|
||||
}
|
||||
else
|
||||
else // IsCbddlp
|
||||
{
|
||||
//HeaderSettings.Version = 2;
|
||||
HeaderSettings.EncryptionKey = 0; // Force disable encryption
|
||||
HeaderSettings.SlicerOffset = 0; // Force remove SlicerInfo for cbddlp
|
||||
HeaderSettings.SlicerSize = 0;
|
||||
}
|
||||
|
||||
//uint currentOffset = (uint)Helpers.Serializer.SizeOf(HeaderSettings);
|
||||
@@ -1880,16 +1887,26 @@ public sealed class ChituboxFile : FileFormat
|
||||
|
||||
if (HeaderSettings.Version >= 4)
|
||||
{
|
||||
SlicerInfoSettings.PrintParametersV4Address = (uint) (HeaderSettings.SlicerOffset + Helpers.Serializer.SizeOf(SlicerInfoSettings) + CTBv4_DISCLAIMER_SIZE);
|
||||
SlicerInfoSettings.PrintParametersV4Address = (uint) (HeaderSettings.SlicerOffset
|
||||
+ Helpers.Serializer.SizeOf(SlicerInfoSettings)
|
||||
+ (IsGkTwoFile ? CTBv4_GKtwo_DISCLAIMER_SIZE : CTBv4_DISCLAIMER_SIZE));
|
||||
}
|
||||
|
||||
outputFile.WriteSerialize(SlicerInfoSettings);
|
||||
|
||||
if (HeaderSettings.Version >= 4)
|
||||
{
|
||||
PrintParametersV4Settings.DisclaimerAddress = (uint) outputFile.Position;
|
||||
PrintParametersV4Settings.DisclaimerLength = (uint) CTBv4_DISCLAIMER.Length;
|
||||
outputFile.WriteBytes(Encoding.UTF8.GetBytes(CTBv4_DISCLAIMER));
|
||||
PrintParametersV4Settings.DisclaimerAddress = (uint)outputFile.Position;
|
||||
|
||||
if (IsGkTwoFile)
|
||||
{
|
||||
PrintParametersV4Settings.DisclaimerLength = outputFile.WriteBytes(Encoding.UTF8.GetBytes(CTBv4_GKtwo_DISCLAIMER));
|
||||
}
|
||||
else
|
||||
{
|
||||
PrintParametersV4Settings.DisclaimerLength = outputFile.WriteBytes(Encoding.UTF8.GetBytes(CTBv4_DISCLAIMER));
|
||||
}
|
||||
|
||||
outputFile.WriteSerialize(PrintParametersV4Settings);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1018,7 +1018,8 @@ public class Layer : BindableBase, IEquatable<Layer>, IEquatable<uint>
|
||||
_positionZ != RoundHeight(SlicerFile.LayerHeight * Number) ||
|
||||
_lightOffDelay != SlicerFile.LightOffDelay ||
|
||||
_waitTimeBeforeCure != SlicerFile.WaitTimeBeforeCure ||
|
||||
_exposureTime != SlicerFile.ExposureTime ||
|
||||
(!IsTransitionLayer && _exposureTime != SlicerFile.ExposureTime) || // Fix for can't edit settings on menu https://github.com/sn4k3/UVtools/issues/507
|
||||
//_exposureTime != SlicerFile.ExposureTime ||
|
||||
_waitTimeAfterCure != SlicerFile.WaitTimeAfterCure ||
|
||||
_liftHeight != SlicerFile.LiftHeight ||
|
||||
_liftSpeed != SlicerFile.LiftSpeed ||
|
||||
|
||||
@@ -32,8 +32,8 @@ public class OperationPCBExposure : Operation
|
||||
|
||||
public sealed class PCBExposureFile : GenericFileRepresentation
|
||||
{
|
||||
private bool _invertPolarity;
|
||||
private double _sizeScale = 1;
|
||||
public bool _invertPolarity;
|
||||
public double _sizeScale = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets to invert the polarity when drawing
|
||||
@@ -76,7 +76,8 @@ public class OperationPCBExposure : Operation
|
||||
"gbo", // Bottom silkscreen layer
|
||||
"gbs", // Bottom solder mask layer
|
||||
"gml", // Mechanical layer
|
||||
"drl" // Drill holes
|
||||
"drl", // Drill holes
|
||||
"xln" // Eagle drill holes
|
||||
};
|
||||
#endregion
|
||||
|
||||
@@ -293,14 +294,6 @@ public class OperationPCBExposure : Operation
|
||||
var file = new PCBExposureFile(filePath);
|
||||
if (_files.Contains(file)) return;
|
||||
_files.Add(file);
|
||||
|
||||
/*var drlFiles = _files.Where(exposureFile => exposureFile.FileExtension == ".drl");
|
||||
var drlArray = drlFiles.ToArray();
|
||||
if (drlArray.Length > 0)
|
||||
{
|
||||
_files.RemoveRange(drlArray);
|
||||
_files.AddRange(drlArray);
|
||||
}*/
|
||||
}
|
||||
|
||||
public void AddFiles(string[] files, bool handleZipFiles = true)
|
||||
@@ -324,7 +317,8 @@ public class OperationPCBExposure : Operation
|
||||
{
|
||||
if (!file.Exists) return;
|
||||
|
||||
if (file.IsExtension("drl"))
|
||||
|
||||
if (ExcellonDrillFormat.Extensions.Any(file.IsExtension))
|
||||
{
|
||||
ExcellonDrillFormat.ParseAndDraw(file, mat, SlicerFile.Ppmm, _sizeMidpointRounding, new SizeF((float)OffsetX, (float)OffsetY), _enableAntiAliasing);
|
||||
}
|
||||
@@ -355,7 +349,8 @@ public class OperationPCBExposure : Operation
|
||||
using var mergeMat = SlicerFile.CreateMat();
|
||||
progress.ItemCount = FileCount;
|
||||
|
||||
var orderFiles = _files.OrderBy(file => file.IsExtension(".drl")).ToArray();
|
||||
//var orderFiles = _files.OrderBy(file => file.IsExtension(".drl") || file.IsExtension(".xln")).ToArray();
|
||||
var orderFiles = _files.OrderBy(file => ExcellonDrillFormat.Extensions.Any(file.IsExtension)).ToArray();
|
||||
|
||||
for (var i = 0; i < orderFiles.Length; i++)
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<RepositoryUrl>https://github.com/sn4k3/UVtools</RepositoryUrl>
|
||||
<PackageProjectUrl>https://github.com/sn4k3/UVtools</PackageProjectUrl>
|
||||
<Description>MSLA/DLP, file analysis, calibration, repair, conversion and manipulation</Description>
|
||||
<Version>3.12.0</Version>
|
||||
<Version>3.12.1</Version>
|
||||
<Copyright>Copyright © 2020 PTRTECH</Copyright>
|
||||
<PackageIcon>UVtools.png</PackageIcon>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
|
||||
@@ -323,8 +323,8 @@
|
||||
<Component Id="cmpE35DDB3C925C83E74C7DAAE6FEA6C156" Guid="*">
|
||||
<File Id="filEAEAE1CB9E8AC1FF00B05453ABEE2ADF" KeyPath="yes" Source="$(var.HarvestPath)\mscordaccore.dll" />
|
||||
</Component>
|
||||
<Component Id="cmp7F40D10D653BD27A9F8720C0FEDD1899" Guid="*">
|
||||
<File Id="filB816040612FB7214C9AF36224BEC56AE" KeyPath="yes" Source="$(var.HarvestPath)\mscordaccore_amd64_amd64_6.0.1423.7309.dll" />
|
||||
<Component Id="cmp63A44A8BC9D62002060FCD40658ABC18" Guid="*">
|
||||
<File Id="fil55164DBA7C7DFB1F4BC9DF8BD2F3FE21" KeyPath="yes" Source="$(var.HarvestPath)\mscordaccore_amd64_amd64_6.0.1523.11507.dll" />
|
||||
</Component>
|
||||
<Component Id="cmpA5ABEAD31F33B1E5825EC6F159ABFB0F" Guid="*">
|
||||
<File Id="fil1A6B0EBD5A5BF8DD0582A2665D3492F1" KeyPath="yes" Source="$(var.HarvestPath)\mscordbi.dll" />
|
||||
@@ -1700,7 +1700,7 @@
|
||||
<ComponentRef Id="cmp3E4F3E4686A9B425B5812E5171CCDEEF" />
|
||||
<ComponentRef Id="cmp16861E24C897764CA922EC062BA74EC9" />
|
||||
<ComponentRef Id="cmpE35DDB3C925C83E74C7DAAE6FEA6C156" />
|
||||
<ComponentRef Id="cmp7F40D10D653BD27A9F8720C0FEDD1899" />
|
||||
<ComponentRef Id="cmp63A44A8BC9D62002060FCD40658ABC18" />
|
||||
<ComponentRef Id="cmpA5ABEAD31F33B1E5825EC6F159ABFB0F" />
|
||||
<ComponentRef Id="cmp5D6845991403E371A015DF7EBDF71F13" />
|
||||
<ComponentRef Id="cmp57B8361D25AD503DC733F4039E5A38B0" />
|
||||
|
||||
@@ -400,9 +400,10 @@ public class App : Application
|
||||
public static Bitmap GetBitmapFromAsset(string url) => new(GetAsset(url));
|
||||
|
||||
|
||||
public static string? GetPrusaSlicerDirectory(bool isSuperSlicer = false)
|
||||
public static string? GetPrusaSlicerDirectory(bool isSuperSlicer = false, bool isAlpha = false)
|
||||
{
|
||||
var slicerFolder = isSuperSlicer ? "SuperSlicer" : "PrusaSlicer";
|
||||
if (isAlpha) slicerFolder += "-alpha";
|
||||
if (OperatingSystem.IsWindows())
|
||||
{
|
||||
return Path.Combine(
|
||||
|
||||
@@ -12,47 +12,76 @@
|
||||
<Border BorderBrush="Gray" BorderThickness="1" Padding="5"
|
||||
DragDrop.AllowDrop="True">
|
||||
<Grid>
|
||||
<StackPanel Spacing="5" Orientation="Horizontal">
|
||||
<controls:ButtonWithIcon Padding="5"
|
||||
Command="{Binding AddFiles}"
|
||||
Text="Add"
|
||||
Spacing="5"
|
||||
Icon="fa-solid fa-plus"/>
|
||||
<StackPanel Spacing="5" Orientation="Vertical">
|
||||
<StackPanel Spacing="5" Orientation="Horizontal">
|
||||
<controls:ButtonWithIcon Padding="5"
|
||||
Command="{Binding AddFiles}"
|
||||
Text="Add"
|
||||
Spacing="5"
|
||||
Icon="fa-solid fa-plus"/>
|
||||
|
||||
<controls:ButtonWithIcon Padding="5"
|
||||
Command="{Binding AddFilesFromZip}"
|
||||
Text="Import zip"
|
||||
Spacing="5"
|
||||
Icon="fa-solid fa-file-zipper"/>
|
||||
<controls:ButtonWithIcon Padding="5"
|
||||
Command="{Binding AddFilesFromZip}"
|
||||
Text="Import zip"
|
||||
Spacing="5"
|
||||
Icon="fa-solid fa-file-zipper"/>
|
||||
|
||||
<controls:ButtonWithIcon Padding="5"
|
||||
IsEnabled="{Binding SelectedFile, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
Command="{Binding RemoveFiles}"
|
||||
Text="Remove"
|
||||
Spacing="5"
|
||||
Icon="fa-solid fa-minus"/>
|
||||
<controls:ButtonWithIcon Padding="5"
|
||||
IsEnabled="{Binding SelectedFile, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
Command="{Binding RemoveFiles}"
|
||||
Text="Remove"
|
||||
Spacing="5"
|
||||
Icon="fa-solid fa-minus"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="2" Orientation="Horizontal">
|
||||
<controls:ButtonWithIcon Padding="5"
|
||||
IsEnabled="{Binding SelectedFile, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
Command="{Binding MoveFileTop}"
|
||||
ToolTip.Tip="Move gerber to top"
|
||||
Spacing="5"
|
||||
Icon="fa-solid fa-angles-up"/>
|
||||
|
||||
<controls:ButtonWithIcon Padding="5"
|
||||
IsEnabled="{Binding SelectedFile, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
Command="{Binding MoveFileUp}"
|
||||
ToolTip.Tip="Move gerber up"
|
||||
Spacing="5"
|
||||
Icon="fa-solid fa-sort-up"/>
|
||||
|
||||
<controls:ButtonWithIcon Padding="5"
|
||||
IsEnabled="{Binding SelectedFile, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
Command="{Binding MoveFileDown}"
|
||||
ToolTip.Tip="Move gerber down"
|
||||
Spacing="5"
|
||||
Icon="fa-solid fa-sort-down"/>
|
||||
|
||||
<controls:ButtonWithIcon Padding="5"
|
||||
IsEnabled="{Binding SelectedFile, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
Command="{Binding MoveFileBottom}"
|
||||
ToolTip.Tip="Move gerber to bottom"
|
||||
Spacing="5"
|
||||
Icon="fa-solid fa-angles-down"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel HorizontalAlignment="Right"
|
||||
Spacing="5" Orientation="Horizontal">
|
||||
|
||||
<controls:ButtonWithIcon Padding="5"
|
||||
IsEnabled="{Binding Operation.Files.Count}"
|
||||
Command="{Binding Operation.Sort}"
|
||||
Text="Sort ASC"
|
||||
Spacing="5"
|
||||
Icon="fa-solid fa-sort-alpha-up"/>
|
||||
|
||||
<controls:ButtonWithIcon
|
||||
IsEnabled="{Binding Operation.Files.Count}"
|
||||
Padding="5" Command="{Binding ClearFiles}"
|
||||
Text="Clear"
|
||||
Spacing="5"
|
||||
Icon="fa-solid fa-xmark"/>
|
||||
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Operation.Files.Count, StringFormat=Files: {0}}"/>
|
||||
<StackPanel HorizontalAlignment="Right" Spacing="5" Orientation="Vertical">
|
||||
<StackPanel HorizontalAlignment="Right" Spacing="5" Orientation="Horizontal">
|
||||
<controls:ButtonWithIcon
|
||||
IsEnabled="{Binding Operation.Files.Count}"
|
||||
Padding="5" Command="{Binding ClearFiles}"
|
||||
Text="{Binding Operation.Files.Count, StringFormat=Clear {0} files}"
|
||||
Spacing="5"
|
||||
Icon="fa-solid fa-xmark"/>
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Right" Spacing="5" Orientation="Horizontal">
|
||||
<controls:ButtonWithIcon Padding="5"
|
||||
IsEnabled="{Binding Operation.Files.Count}"
|
||||
Command="{Binding Operation.Sort}"
|
||||
Text="Sort ASC"
|
||||
Spacing="5"
|
||||
Icon="fa-solid fa-sort-alpha-up"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Timers;
|
||||
using UVtools.Core.Excellon;
|
||||
using UVtools.Core.Extensions;
|
||||
using UVtools.Core.Operations;
|
||||
using UVtools.WPF.Extensions;
|
||||
@@ -70,7 +71,10 @@ namespace UVtools.WPF.Controls.Tools
|
||||
{
|
||||
AutoReset = false
|
||||
};
|
||||
_timer.Elapsed += (sender, e) => Dispatcher.UIThread.InvokeAsync(UpdatePreview);
|
||||
_timer.Elapsed += (sender, e) =>
|
||||
{
|
||||
Dispatcher.UIThread.InvokeAsync(UpdatePreview);
|
||||
};
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
@@ -125,7 +129,7 @@ namespace UVtools.WPF.Controls.Tools
|
||||
|
||||
if (!OperationPCBExposure.ValidExtensions.Any(extension => _selectedFile.IsExtension(extension)) || !_selectedFile.Exists) return;
|
||||
var file = (OperationPCBExposure.PCBExposureFile)_selectedFile.Clone();
|
||||
file.InvertPolarity = file.IsExtension(".drl");
|
||||
file._invertPolarity = ExcellonDrillFormat.Extensions.Any(extension => file.IsExtension(extension));
|
||||
_previewImage?.Dispose();
|
||||
using var mat = Operation.GetMat(file);
|
||||
|
||||
@@ -186,6 +190,49 @@ namespace UVtools.WPF.Controls.Tools
|
||||
Operation.Files.RemoveRange(FilesDataGrid.SelectedItems.OfType<OperationPCBExposure.PCBExposureFile>());
|
||||
}
|
||||
|
||||
public void MoveFileTop()
|
||||
{
|
||||
if (FilesDataGrid.SelectedIndex <= 0) return;
|
||||
var selectedFile = SelectedFile;
|
||||
Operation.Files.RemoveAt(FilesDataGrid.SelectedIndex);
|
||||
Operation.Files.Insert(0, selectedFile);
|
||||
FilesDataGrid.SelectedIndex = 0;
|
||||
FilesDataGrid.ScrollIntoView(selectedFile, FilesDataGrid.Columns[0]);
|
||||
}
|
||||
|
||||
public void MoveFileUp()
|
||||
{
|
||||
if (FilesDataGrid.SelectedIndex <= 0) return;
|
||||
var selectedFile = SelectedFile;
|
||||
var newIndex = FilesDataGrid.SelectedIndex - 1;
|
||||
Operation.Files.RemoveAt(FilesDataGrid.SelectedIndex);
|
||||
Operation.Files.Insert(newIndex, selectedFile);
|
||||
FilesDataGrid.SelectedIndex = newIndex;
|
||||
FilesDataGrid.ScrollIntoView(selectedFile, FilesDataGrid.Columns[0]);
|
||||
}
|
||||
|
||||
public void MoveFileDown()
|
||||
{
|
||||
if (FilesDataGrid.SelectedIndex == -1 || FilesDataGrid.SelectedIndex == Operation.FileCount - 1) return;
|
||||
var selectedFile = SelectedFile;
|
||||
var newIndex = FilesDataGrid.SelectedIndex + 1;
|
||||
Operation.Files.RemoveAt(FilesDataGrid.SelectedIndex);
|
||||
Operation.Files.Insert(newIndex, selectedFile);
|
||||
FilesDataGrid.SelectedIndex = newIndex;
|
||||
FilesDataGrid.ScrollIntoView(selectedFile, FilesDataGrid.Columns[0]);
|
||||
}
|
||||
|
||||
public void MoveFileBottom()
|
||||
{
|
||||
var lastIndex = Operation.Files.Count - 1;
|
||||
if (FilesDataGrid.SelectedIndex == -1 || FilesDataGrid.SelectedIndex == lastIndex) return;
|
||||
var selectedFile = SelectedFile;
|
||||
Operation.Files.RemoveAt(FilesDataGrid.SelectedIndex);
|
||||
Operation.Files.Insert(lastIndex, selectedFile);
|
||||
FilesDataGrid.SelectedIndex = lastIndex;
|
||||
FilesDataGrid.ScrollIntoView(selectedFile, FilesDataGrid.Columns[0]);
|
||||
}
|
||||
|
||||
public void ClearFiles()
|
||||
{
|
||||
Operation.Files.Clear();
|
||||
|
||||
@@ -54,13 +54,6 @@ public static class Program
|
||||
Console.WriteLine(e);
|
||||
return;
|
||||
}
|
||||
|
||||
/*foreach (var s in FileFormat.AllFileExtensions.Where(extension => !extension.Extension.Contains('.')).DistinctBy(extension => extension.Extension))
|
||||
{
|
||||
Debug.WriteLine($"- {s.Extension}");
|
||||
}
|
||||
Debug.WriteLine(FileFormat.AllFileExtensions.Where(extension => !extension.Extension.Contains('.')).DistinctBy(extension => extension.Extension).Count());
|
||||
return;*/
|
||||
|
||||
if (Args.Length >= 1)
|
||||
{
|
||||
@@ -75,7 +68,6 @@ public static class Program
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*using var mat = CvInvoke.Imread(@"D:\layer0.png", ImreadModes.Grayscale);
|
||||
var contours = mat.FindContours(out var hierarchy, RetrType.Tree, ChainApproxMethod.ChainApproxTc89Kcos);
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<PackageLicenseFile>LICENSE</PackageLicenseFile>
|
||||
<RepositoryUrl>https://github.com/sn4k3/UVtools</RepositoryUrl>
|
||||
<RepositoryType>Git</RepositoryType>
|
||||
<Version>3.12.0</Version>
|
||||
<Version>3.12.1</Version>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<PackageIcon>UVtools.png</PackageIcon>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
@@ -48,9 +48,9 @@
|
||||
<PackageReference Include="Avalonia.Desktop" Version="0.10.18" />
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.18" />
|
||||
<PackageReference Include="MessageBox.Avalonia" Version="2.1.0" />
|
||||
<PackageReference Include="Projektanker.Icons.Avalonia" Version="5.9.0" />
|
||||
<PackageReference Include="Projektanker.Icons.Avalonia.FontAwesome" Version="5.9.0" />
|
||||
<PackageReference Include="Projektanker.Icons.Avalonia.MaterialDesign" Version="5.9.0" />
|
||||
<PackageReference Include="Projektanker.Icons.Avalonia" Version="5.10.0" />
|
||||
<PackageReference Include="Projektanker.Icons.Avalonia.FontAwesome" Version="5.10.0" />
|
||||
<PackageReference Include="Projektanker.Icons.Avalonia.MaterialDesign" Version="5.10.0" />
|
||||
<PackageReference Include="ThemeEditor.Controls.ColorPicker" Version="0.10.17" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user