mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-12 19:42:32 +02:00
3cd46728f1
- **Shortcuts:** - (Add) (Ctrl + Shift + R) to turn on and cycle the Rotate modes - (Add) (Ctrl + Shift + F) to turn on and cycle the Flip modes - (Add) (Ctrl + Shift + B) to select the build volume as ROI - **GUI:** - (Add) Allow to drag and drop '.uvtop' files into UVtools to sequential show and load operations from files - (Change) Rotate icon on layer preview - (Upgrade) AvaloniaUI from 0.10.3 to 0.10.4 - **Tools:** - (Add) 'Reset to defaults' button on every dialog - (Improvement) Window size and position handling - (Improvement) Constrain profile box width to not stretch the window - (Improvement) ROI section design - **Dynamic lift:** - (Add) View buttons to show the largest/smallest layers - (Add) Light-off mode: Set the light-off with an extra delay - (Add) Light-off mode: Set the light-off without an extra delay - (Add) Light-off mode: Set the light-off to zero - (Improvement) Disable bottom and/or normal layer fields when the selected range is outside - (Add) Settings - Automations: Light-off delay set modes - (Fix) Exposure time finder: Add staircase, bullseye and counter triangles to feature count at thumbnail
60 lines
1.8 KiB
C#
60 lines
1.8 KiB
C#
using System;
|
|
using Avalonia.Markup.Xaml;
|
|
using UVtools.Core;
|
|
using UVtools.Core.Operations;
|
|
using UVtools.WPF.Windows;
|
|
|
|
namespace UVtools.WPF.Controls.Tools
|
|
{
|
|
public class ToolLayerRemoveControl : ToolControl
|
|
{
|
|
public OperationLayerRemove Operation => BaseOperation as OperationLayerRemove;
|
|
|
|
public uint ExtraLayers => (uint)Math.Max(0, (int)Operation.LayerIndexEnd - Operation.LayerIndexStart + 1);
|
|
|
|
public string InfoLayersStr
|
|
{
|
|
get
|
|
{
|
|
uint extraLayers = ExtraLayers;
|
|
return $"Layers: {SlicerFile.LayerCount} → {SlicerFile.LayerCount - extraLayers} (- {extraLayers})";
|
|
}
|
|
}
|
|
|
|
public string InfoHeightsStr
|
|
{
|
|
get
|
|
{
|
|
float extraHeight = Layer.RoundHeight(ExtraLayers * SlicerFile.LayerHeight);
|
|
return $"Height: {SlicerFile.PrintHeight}mm → {Layer.RoundHeight(App.SlicerFile.PrintHeight - extraHeight)}mm (- {extraHeight}mm)";
|
|
}
|
|
}
|
|
|
|
public ToolLayerRemoveControl()
|
|
{
|
|
InitializeComponent();
|
|
BaseOperation = new OperationLayerRemove(SlicerFile);
|
|
}
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
AvaloniaXamlLoader.Load(this);
|
|
}
|
|
|
|
public override void Callback(ToolWindow.Callbacks callback)
|
|
{
|
|
switch (callback)
|
|
{
|
|
case ToolWindow.Callbacks.Init:
|
|
case ToolWindow.Callbacks.Loaded:
|
|
Operation.PropertyChanged += (sender, args) =>
|
|
{
|
|
RaisePropertyChanged(nameof(InfoLayersStr));
|
|
RaisePropertyChanged(nameof(InfoHeightsStr));
|
|
};
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|