Files
UVtools/UVtools.WPF/Controls/Tools/ToolLayerRemoveControl.axaml.cs
T
Tiago Conceição 1e787ba11b Nuke issue system
- Issues:
   - (Add) Suction cups: Add a auto repair feature for this issues by drill a vertical vent hole (#296)
   - (Add) Layer issue track bar: Colorize the issue tracker map with it own colors (Configurable)
   - (Add) Allow to group issues by type and/or layer
   - (Improvement) Order issues by area in descending order
   - (Improvement) Always bring the selected issue into view on the list
   - (Fix) When manually removing a issue from the list, it will no longer reselect other and make the user lost track of the remove issue
   - (Fix) Allow to ignore all issue type
- (Fix) Material ml calculation was calculating a bad value for PhotonWorkshop files
2021-09-19 02:03:04 +01:00

62 lines
1.9 KiB
C#

using System;
using Avalonia.Markup.Xaml;
using UVtools.Core;
using UVtools.Core.Layers;
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()
{
BaseOperation = new OperationLayerRemove(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.Loaded:
Operation.PropertyChanged += (sender, args) =>
{
RaisePropertyChanged(nameof(InfoLayersStr));
RaisePropertyChanged(nameof(InfoHeightsStr));
};
break;
}
}
}
}