diff options
author | Tiago Conceição <Tiago_caza@hotmail.com> | 2022-07-07 04:56:11 +0300 |
---|---|---|
committer | Tiago Conceição <Tiago_caza@hotmail.com> | 2022-07-07 04:56:11 +0300 |
commit | 6bd3bb7bca6f587b30b0d063bef69309c28d7ce3 (patch) | |
tree | bcfabd0e8612c484c8f77ccb90a649a9b0b2c7de /UVtools.WPF | |
parent | 9711bb7474d90ea6b54bbcae6db059364b44655e (diff) |
v3.5.3v3.5.3
- (Add) Layer action - Export layers to HTML: Export file information and layers to an html file
- (Change) CXDLP: Validate header and footer value must start with "CXSW3D" instead of force equal to "CXSW3DV2" (#501)
- (Upgrade) .NET from 6.0.5 to 6.0.6
Diffstat (limited to 'UVtools.WPF')
-rw-r--r-- | UVtools.WPF/Controls/Tools/ToolLayerExportHtmlControl.axaml | 43 | ||||
-rw-r--r-- | UVtools.WPF/Controls/Tools/ToolLayerExportHtmlControl.axaml.cs | 44 | ||||
-rw-r--r-- | UVtools.WPF/MainWindow.axaml.cs | 1 | ||||
-rw-r--r-- | UVtools.WPF/Structures/OperationProfiles.cs | 1 | ||||
-rw-r--r-- | UVtools.WPF/UVtools.WPF.csproj | 8 |
5 files changed, 93 insertions, 4 deletions
diff --git a/UVtools.WPF/Controls/Tools/ToolLayerExportHtmlControl.axaml b/UVtools.WPF/Controls/Tools/ToolLayerExportHtmlControl.axaml new file mode 100644 index 0000000..4d866d6 --- /dev/null +++ b/UVtools.WPF/Controls/Tools/ToolLayerExportHtmlControl.axaml @@ -0,0 +1,43 @@ +<UserControl xmlns="https://github.com/avaloniaui" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:i="clr-namespace:Projektanker.Icons.Avalonia;assembly=Projektanker.Icons.Avalonia" + mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" + x:Class="UVtools.WPF.Controls.Tools.ToolLayerExportHtmlControl"> + <StackPanel Spacing="10"> + + <StackPanel Orientation="Horizontal" Spacing="5"> + <TextBox Watermark="Output filepath" + UseFloatingWatermark="True" + VerticalAlignment="Center" + IsReadOnly="True" + Width="500" + Text="{Binding Operation.FilePath}"/> + <Button VerticalAlignment="Stretch" + Command="{Binding ChooseFilePath}" + i:Attached.Icon="fa-solid fa-folder"/> + </StackPanel> + + <CheckBox Content="Export thumbnails" + ToolTip.Tip="If enabled it will export all the available thumbnails" + IsChecked="{Binding Operation.ExportThumbnails}"/> + + <CheckBox Content="Export file raw data structure" + ToolTip.Tip="If enabled it will export the raw data structure of the file" + IsChecked="{Binding Operation.ExportRawData}"/> + + <CheckBox Content="Export layer settings" + ToolTip.Tip="If enabled it will export an table with all the layer settings" + IsChecked="{Binding Operation.ExportLayerSettings}"/> + + <CheckBox Content="Export GCode" + ToolTip.Tip="If enabled it will export the GCode text" + IsChecked="{Binding Operation.ExportGCode}"/> + + <CheckBox Content="Export layer preview" + ToolTip.Tip="If enabled it will export all the layers images and able to navigate between them but will produce a larger and slower file" + IsChecked="{Binding Operation.ExportLayerPreview}"/> + + </StackPanel> +</UserControl> diff --git a/UVtools.WPF/Controls/Tools/ToolLayerExportHtmlControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolLayerExportHtmlControl.axaml.cs new file mode 100644 index 0000000..ba835fb --- /dev/null +++ b/UVtools.WPF/Controls/Tools/ToolLayerExportHtmlControl.axaml.cs @@ -0,0 +1,44 @@ +using System.Collections.Generic; +using System.IO; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; +using UVtools.Core.Operations; + +namespace UVtools.WPF.Controls.Tools +{ + public partial class ToolLayerExportHtmlControl : ToolControl + { + public OperationLayerExportHtml Operation => BaseOperation as OperationLayerExportHtml; + public ToolLayerExportHtmlControl() + { + BaseOperation = new OperationLayerExportHtml(SlicerFile); + if (!ValidateSpawn()) return; + InitializeComponent(); + } + + private void InitializeComponent() + { + AvaloniaXamlLoader.Load(this); + } + + public async void ChooseFilePath() + { + var dialog = new SaveFileDialog + { + Filters = new List<FileDialogFilter> + { + new() + { + Extensions = new List<string>{"html"}, + Name = "HTML files" + } + }, + InitialFileName = Path.GetFileName(SlicerFile.FileFullPath) + ".html", + Directory = Path.GetDirectoryName(SlicerFile.FileFullPath) + }; + var file = await dialog.ShowAsync(ParentWindow); + if (string.IsNullOrWhiteSpace(file)) return; + Operation.FilePath = file; + } + } +} diff --git a/UVtools.WPF/MainWindow.axaml.cs b/UVtools.WPF/MainWindow.axaml.cs index 7787eed..db22d89 100644 --- a/UVtools.WPF/MainWindow.axaml.cs +++ b/UVtools.WPF/MainWindow.axaml.cs @@ -111,6 +111,7 @@ public partial class MainWindow : WindowEx new() { Tag = new OperationLayerRemove()}, new() { Tag = new OperationLayerExportImage()}, new() { Tag = new OperationLayerExportGif()}, + new() { Tag = new OperationLayerExportHtml()}, new() { Tag = new OperationLayerExportSkeleton()}, new() { Tag = new OperationLayerExportHeatMap()}, new() { Tag = new OperationLayerExportMesh()}, diff --git a/UVtools.WPF/Structures/OperationProfiles.cs b/UVtools.WPF/Structures/OperationProfiles.cs index 890f566..e097b67 100644 --- a/UVtools.WPF/Structures/OperationProfiles.cs +++ b/UVtools.WPF/Structures/OperationProfiles.cs @@ -52,6 +52,7 @@ public class OperationProfiles //: IList<Operation> [XmlElement(typeof(OperationScripting))] [XmlElement(typeof(OperationLayerExportGif))] + [XmlElement(typeof(OperationLayerExportHtml))] [XmlElement(typeof(OperationCalibrateExposureFinder))] [XmlElement(typeof(OperationCalibrateElephantFoot))] diff --git a/UVtools.WPF/UVtools.WPF.csproj b/UVtools.WPF/UVtools.WPF.csproj index 7cb97cc..fe54b0d 100644 --- a/UVtools.WPF/UVtools.WPF.csproj +++ b/UVtools.WPF/UVtools.WPF.csproj @@ -12,7 +12,7 @@ <PackageLicenseFile>LICENSE</PackageLicenseFile> <RepositoryUrl>https://github.com/sn4k3/UVtools</RepositoryUrl> <RepositoryType>Git</RepositoryType> - <Version>3.5.2</Version> + <Version>3.5.3</Version> <Platforms>AnyCPU;x64</Platforms> <PackageIcon>UVtools.png</PackageIcon> <PackageReadmeFile>README.md</PackageReadmeFile> @@ -44,9 +44,9 @@ <PackageReference Include="Avalonia.Desktop" Version="0.10.15" /> <PackageReference Include="Avalonia.Diagnostics" Version="0.10.15" /> <PackageReference Include="MessageBox.Avalonia" Version="2.0.1" /> - <PackageReference Include="Projektanker.Icons.Avalonia" Version="5.0.2" /> - <PackageReference Include="Projektanker.Icons.Avalonia.FontAwesome" Version="5.0.2" /> - <PackageReference Include="Projektanker.Icons.Avalonia.MaterialDesign" Version="5.0.2" /> + <PackageReference Include="Projektanker.Icons.Avalonia" Version="5.1.0" /> + <PackageReference Include="Projektanker.Icons.Avalonia.FontAwesome" Version="5.1.0" /> + <PackageReference Include="Projektanker.Icons.Avalonia.MaterialDesign" Version="5.1.0" /> <PackageReference Include="ThemeEditor.Controls.ColorPicker" Version="0.10.14" /> </ItemGroup> <ItemGroup> |