mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-11 19:12:31 +02:00
2c7ad09dc0
- (Change) `Layer.IsBottomLayer` no longer calculate the value using the position of the layer, a new property `IsBottomLayerByHeight` is now used to get that result - (Improvement) Tool - Double exposure: Increase the bottom layer count per cloned bottom layer - (Improvement) Calibration - Exposure time finder: Set the absolute bottom layer count accordingly when also testing for bottom time - (Improvement) Goo: Enforce Wait times or Light-off-delay flag based on property set - (Fix) AnyCubic and Goo: `PerLayerSetting` flag was set inverted causing printer not to follow layer settings when it should and also the otherwise (#689) - (Fix) Tool - Scripting: Prevent from reload UI multiple times when using profiles (#694)
60 lines
1.7 KiB
C#
60 lines
1.7 KiB
C#
using System.ComponentModel;
|
|
using Avalonia.Markup.Xaml;
|
|
using UVtools.Core.Layers;
|
|
using UVtools.Core.Operations;
|
|
using UVtools.WPF.Windows;
|
|
|
|
namespace UVtools.WPF.Controls.Tools;
|
|
|
|
public class ToolLayerCloneControl : ToolControl
|
|
{
|
|
public OperationLayerClone Operation => BaseOperation as OperationLayerClone;
|
|
|
|
|
|
public string InfoLayersStr
|
|
{
|
|
get
|
|
{
|
|
uint extraLayers = Operation.ExtraLayers;
|
|
return $"Layers: {SlicerFile.LayerCount} → {SlicerFile.LayerCount + extraLayers} (+ {extraLayers})";
|
|
}
|
|
}
|
|
|
|
public string InfoHeightsStr
|
|
{
|
|
get
|
|
{
|
|
float extraHeight = Operation.KeepSamePositionZ ? 0 : Layer.RoundHeight(Operation.ExtraLayers * SlicerFile.LayerHeight);
|
|
return $"Height: {SlicerFile.PrintHeight}mm → {Layer.RoundHeight(SlicerFile.PrintHeight + extraHeight)}mm (+ {extraHeight}mm)";
|
|
}
|
|
}
|
|
|
|
public ToolLayerCloneControl()
|
|
{
|
|
BaseOperation = new OperationLayerClone(SlicerFile);
|
|
if (!ValidateSpawn()) return;
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
AvaloniaXamlLoader.Load(this);
|
|
}
|
|
|
|
public override void Callback(ToolWindow.Callbacks callback)
|
|
{
|
|
switch (callback)
|
|
{
|
|
case ToolWindow.Callbacks.Init:
|
|
case ToolWindow.Callbacks.AfterLoadProfile:
|
|
Operation.PropertyChanged += OnPropertyChanged;
|
|
break;
|
|
}
|
|
}
|
|
|
|
private void OnPropertyChanged(object sender, PropertyChangedEventArgs args)
|
|
{
|
|
RaisePropertyChanged(nameof(InfoLayersStr));
|
|
RaisePropertyChanged(nameof(InfoHeightsStr));
|
|
}
|
|
} |