123 lines
6.5 KiB
XML
123 lines
6.5 KiB
XML
<Window xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:vm="using:LindtLeerformPlugin.ViewModels"
|
|
x:Class="LindtLeerformPlugin.Views.CalibrationWindow"
|
|
x:DataType="vm:CalibrationWindowViewModel"
|
|
Title="Leerform Calibration"
|
|
Width="1024" Height="800">
|
|
|
|
<DockPanel>
|
|
<!-- Toolbar -->
|
|
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Spacing="8" Margin="8">
|
|
<Button Content="Start Preview" Command="{Binding StartPreviewCommand}" IsEnabled="{Binding !IsPreviewRunning}" />
|
|
<Button Content="Stop Preview" Command="{Binding StopPreviewCommand}" IsEnabled="{Binding IsPreviewRunning}" />
|
|
<Button Content="Capture Image" Command="{Binding CaptureImageCommand}" />
|
|
</StackPanel>
|
|
|
|
<!-- Status Bar -->
|
|
<Border DockPanel.Dock="Bottom" Background="#1E1E1E" Padding="8,4">
|
|
<StackPanel Orientation="Horizontal" Spacing="16">
|
|
<TextBlock Text="{Binding StatusText}" Foreground="LightGray" />
|
|
<TextBlock Foreground="LightGray">
|
|
<TextBlock.Text>
|
|
<MultiBinding StringFormat="Captured: {0}">
|
|
<Binding Path="CapturedImageCount" />
|
|
</MultiBinding>
|
|
</TextBlock.Text>
|
|
</TextBlock>
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<!-- Settings Panel -->
|
|
<Border DockPanel.Dock="Right" Width="260" Padding="12" Background="White">
|
|
<ScrollViewer>
|
|
<StackPanel Spacing="8">
|
|
<TextBlock Text="Calibration Settings" FontWeight="Bold" FontSize="14" Foreground="Black" />
|
|
|
|
|
|
<Button Content="Calibrate" Command="{Binding RunCalibrationCommand}" Margin="0,4"
|
|
Background="Red" Foreground="White" FontWeight="Bold" />
|
|
<Button Content="Clear Images" Command="{Binding ClearCalibrationImagesCommand}" Margin="0,4"
|
|
Background="White" Foreground="Red" FontWeight="Bold"
|
|
BorderBrush="Red" BorderThickness="1" />
|
|
|
|
<Separator Margin="0,8" />
|
|
|
|
<TextBlock Text="Calibrated" Foreground="LimeGreen" 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" />
|
|
|
|
<Separator Margin="0,8" />
|
|
|
|
<TextBlock Text="Pattern" FontWeight="Bold" FontSize="14" Foreground="Black" />
|
|
|
|
<TextBlock Text="Rows" Foreground="Black" />
|
|
<NumericUpDown Value="{Binding Rows}" Minimum="1" Maximum="200" Increment="1" FormatString="0" />
|
|
|
|
<TextBlock Text="Cols" Foreground="Black" />
|
|
<NumericUpDown Value="{Binding Cols}" Minimum="1" Maximum="200" Increment="1" FormatString="0" />
|
|
|
|
<TextBlock Text="Shape" Foreground="Black" />
|
|
<ComboBox ItemsSource="{Binding AvailableCellShapes}" SelectedItem="{Binding SelectedCellShape}" HorizontalAlignment="Stretch" />
|
|
|
|
<TextBlock Text="Padding (px)" Foreground="Black" />
|
|
<NumericUpDown Value="{Binding Padding}" Minimum="0" Maximum="500" Increment="1" FormatString="0" />
|
|
|
|
<Separator Margin="0,8" />
|
|
|
|
<TextBlock Text="ROI (px)" FontWeight="Bold" FontSize="14" Foreground="Black" />
|
|
|
|
<TextBlock Text="X" Foreground="Black" />
|
|
<NumericUpDown Value="{Binding RoiX}" Minimum="0" Maximum="100000" Increment="1" FormatString="0" />
|
|
<TextBlock Text="Y" Foreground="Black" />
|
|
<NumericUpDown Value="{Binding RoiY}" Minimum="0" Maximum="100000" Increment="1" FormatString="0" />
|
|
<TextBlock Text="Width" Foreground="Black" />
|
|
<NumericUpDown Value="{Binding RoiWidth}" Minimum="0" Maximum="100000" Increment="1" FormatString="0" />
|
|
<TextBlock Text="Height" Foreground="Black" />
|
|
<NumericUpDown Value="{Binding RoiHeight}" Minimum="0" Maximum="100000" Increment="1" FormatString="0" />
|
|
|
|
<Separator Margin="0,8" />
|
|
|
|
<Button Content="Set Reference" Command="{Binding SetReferenceHistogramCommand}" Margin="0,4"
|
|
Background="#2E7D32" Foreground="White" FontWeight="Bold" HorizontalAlignment="Stretch" />
|
|
<TextBlock Text="✓ Reference set" Foreground="LimeGreen" IsVisible="{Binding HasReferenceHistogram}" />
|
|
|
|
<TextBlock Text="Tolerance" Foreground="Black" Margin="0,4,0,0" />
|
|
<NumericUpDown Value="{Binding Tolerance}" Minimum="0" Maximum="1" Increment="0.05" FormatString="0.00" />
|
|
|
|
<Button Content="Test Pattern" Command="{Binding TestPatternCommand}" Margin="0,4"
|
|
Background="#1565C0" Foreground="White" FontWeight="Bold" HorizontalAlignment="Stretch" />
|
|
|
|
<Separator Margin="0,8" />
|
|
|
|
<TextBlock Text="Recipe" FontWeight="Bold" FontSize="14" Foreground="Black" />
|
|
<TextBlock Foreground="Black">
|
|
<TextBlock.Text>
|
|
<MultiBinding StringFormat="Current: {0}">
|
|
<Binding Path="CurrentRecipeName" />
|
|
</MultiBinding>
|
|
</TextBlock.Text>
|
|
</TextBlock>
|
|
<Button Content="Save Recipe" Command="{Binding SaveRecipeCommand}" Margin="0,4"
|
|
Background="#6A1B9A" Foreground="White" FontWeight="Bold" HorizontalAlignment="Stretch" />
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
</Border>
|
|
|
|
<!-- Live Preview -->
|
|
<Border Background="#1A1A1A" Margin="4">
|
|
<Image x:Name="PreviewImageControl"
|
|
Source="{Binding PreviewImage}"
|
|
Stretch="Uniform" />
|
|
</Border>
|
|
</DockPanel>
|
|
|
|
</Window>
|