leerform recipe subsystem created

This commit is contained in:
EugeneTes
2026-03-31 13:26:26 +02:00
parent 4bd117af47
commit 1c7a4abd5c
20 changed files with 823 additions and 70 deletions

View File

@@ -29,31 +29,30 @@
</Border>
<!-- Settings Panel -->
<Border DockPanel.Dock="Right" Width="220" Padding="12" Background="#2D2D2D">
<Border DockPanel.Dock="Right" Width="220" Padding="12" Background="White">
<ScrollViewer>
<StackPanel Spacing="8">
<TextBlock Text="Calibration Settings" FontWeight="Bold" FontSize="14" Foreground="White" />
<TextBlock Text="Image Directory" Foreground="LightGray" />
<TextBox Text="{Binding CalibrationImageDirectory}" />
<Separator Margin="0,8" />
<TextBlock Text="Calibration Settings" FontWeight="Bold" FontSize="14" Foreground="Black" />
<Button Content="Calibrate" Command="{Binding RunCalibrationCommand}" Margin="0,4"
Background="#00C853" Foreground="White" FontWeight="Bold" />
Background="Red" Foreground="White" FontWeight="Bold" />
<Button Content="Clear Images" Command="{Binding ClearCalibrationImagesCommand}" Margin="0,4"
Background="#FF6D00" Foreground="White" FontWeight="Bold" />
Background="White" Foreground="Red" FontWeight="Bold"
BorderBrush="Red" BorderThickness="1" />
<Separator Margin="0,8" />
<TextBlock Text="Calibrated" Foreground="LimeGreen" IsVisible="{Binding IsCalibrated}" />
<TextBlock Foreground="LightGray" IsVisible="{Binding IsCalibrated}">
<TextBlock Foreground="Gray" IsVisible="{Binding IsCalibrated}">
<TextBlock.Text>
<MultiBinding StringFormat="RMS Error: {0:F4}">
<Binding Path="RmsError" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
<CheckBox Content="Apply Calibration" IsChecked="{Binding ApplyCalibration}"
IsEnabled="{Binding IsCalibrated}" Foreground="Black" Margin="0,4" />
</StackPanel>
</ScrollViewer>
</Border>

View File

@@ -0,0 +1,33 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="LindtLeerformPlugin.Views.RecipeNameDialog"
Title="New Recipe"
Width="400" Height="180"
CanResize="False"
WindowStartupLocation="CenterOwner">
<Grid RowDefinitions="Auto,Auto,Auto" Margin="16">
<TextBlock Grid.Row="0"
Text="Recipe name:"
FontSize="14"
Margin="0,0,0,8" />
<TextBox Grid.Row="1"
x:Name="TxtRecipeName"
Margin="0,0,0,16" />
<StackPanel Grid.Row="2"
Orientation="Horizontal"
HorizontalAlignment="Right"
Spacing="8">
<Button x:Name="BtnOk"
Content="OK"
Width="80" Height="36"
HorizontalContentAlignment="Center" />
<Button x:Name="BtnCancel"
Content="Cancel"
Width="80" Height="36"
HorizontalContentAlignment="Center" />
</StackPanel>
</Grid>
</Window>

View File

@@ -0,0 +1,23 @@
using Avalonia.Controls;
using Avalonia.Input;
namespace LindtLeerformPlugin.Views;
public partial class RecipeNameDialog : Window
{
public RecipeNameDialog()
{
InitializeComponent();
BtnOk.Click += (_, _) => Close(TxtRecipeName.Text);
BtnCancel.Click += (_, _) => Close(null);
TxtRecipeName.KeyDown += (_, e) =>
{
if (e.Key == Key.Enter)
Close(TxtRecipeName.Text);
else if (e.Key == Key.Escape)
Close(null);
};
}
}