mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-12 03:22: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
62 lines
2.1 KiB
C#
62 lines
2.1 KiB
C#
using System;
|
|
using Avalonia.Markup.Xaml;
|
|
using UVtools.Core.Operations;
|
|
using UVtools.WPF.Extensions;
|
|
using UVtools.WPF.Windows;
|
|
|
|
namespace UVtools.WPF.Controls.Tools
|
|
{
|
|
public class ToolPatternControl : ToolControl
|
|
{
|
|
public OperationPattern Operation => BaseOperation as OperationPattern;
|
|
private bool _isDefaultAnchorChecked = true;
|
|
|
|
public bool IsDefaultAnchorChecked
|
|
{
|
|
get => _isDefaultAnchorChecked;
|
|
set => RaiseAndSetIfChanged(ref _isDefaultAnchorChecked, value);
|
|
}
|
|
|
|
public ToolPatternControl()
|
|
{
|
|
InitializeComponent();
|
|
var roi = App.MainWindow.ROI;
|
|
BaseOperation = new OperationPattern(SlicerFile, roi);
|
|
|
|
if (Operation.MaxRows < 2 && Operation.MaxCols < 2)
|
|
{
|
|
App.MainWindow.MessageBoxInfo("The available free volume is not enough to pattern this object.\n" +
|
|
"To run this tool the free space must allow at least 1 copy.", "Unable to pattern");
|
|
CanRun = false;
|
|
return;
|
|
}
|
|
}
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
AvaloniaXamlLoader.Load(this);
|
|
}
|
|
|
|
public override void Callback(ToolWindow.Callbacks callback)
|
|
{
|
|
switch (callback)
|
|
{
|
|
case ToolWindow.Callbacks.Init:
|
|
case ToolWindow.Callbacks.Loaded:
|
|
Operation.ROI = App.MainWindow.ROI.IsEmpty ? SlicerFile.BoundingRectangle : App.MainWindow.ROI;
|
|
Operation.PropertyChanged += (sender, e) =>
|
|
{
|
|
if (e.PropertyName.Equals(nameof(Operation.IsWithinBoundary)))
|
|
{
|
|
ParentWindow.ButtonOkEnabled = Operation.IsWithinBoundary;
|
|
}
|
|
};
|
|
break;
|
|
case ToolWindow.Callbacks.ClearROI:
|
|
Operation.SetRoi(SlicerFile.BoundingRectangle);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|