2026-06-05 13:44:39 +09:00

237 lines
19 KiB
XML

<UserControl x:Class="WeldingCommon.Views.Manual.UCManualModelFinder"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WeldingCommon.Views.Manual"
xmlns:behavior="http://schemas.microsoft.com/xaml/behaviors"
xmlns:view="clr-namespace:Aurora.View;assembly=Aurora"
xmlns:aurorauicomponent="clr-namespace:AuroraUIComponent;assembly=AuroraUIComponent"
xmlns:usercontrols="clr-namespace:AuroraUIComponent.UserControls;assembly=AuroraUIComponent"
xmlns:uiconverter="clr-namespace:AuroraUIComponent.UIConverter;assembly=AuroraUIComponent"
d:DataContext="{d:DesignInstance Type=local:UCManualModelFinderViewModel}"
mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="1200" x:Name="uc" IsVisibleChanged="uc_IsVisibleChanged">
<behavior:Interaction.Triggers>
<behavior:PropertyChangedTrigger Binding="{Binding IsVisible, ElementName=uc}">
<behavior:InvokeCommandAction Command="{Binding CMD_VisibleChanged}" CommandParameter="{Binding IsVisible, ElementName=uc}"/>
</behavior:PropertyChangedTrigger>
</behavior:Interaction.Triggers>
<UserControl.Resources>
<uiconverter:BoolToBrushConverter x:Key="StrToBrush" True="Green"/>
</UserControl.Resources>
<Grid Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.3*"/>
<ColumnDefinition Width="0.3*"/>
<ColumnDefinition Width="0.7*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.65*"/>
<RowDefinition Height="0.35*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Margin="5" x:Name="gridScannerCameraView"/>
<Grid Grid.Row="0" Grid.Column="1" Margin="5">
<GroupBox Visibility="Visible" Header="File Path Manager" Margin="5">
<TreeView ItemsSource="{Binding FileSystemItems}" SelectedItemChanged="TreeView_SelectedItemChanged">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Children}">
<TextBlock Text="{Binding Name}" Background="{Binding IsSelected, Converter={StaticResource StrToBrush}}"/>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
</GroupBox>
</Grid>
<Grid Grid.Row="0" Grid.Column="2">
<GroupBox Visibility="Visible" Header="Parameter Manager" Margin="5">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<GroupBox Grid.Column="0" Header="Current Model Param">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="4*"/>
<RowDefinition Height="7*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<GroupBox Grid.Row="0" Header="ROI">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<usercontrols:UCKeyValue KeyText="LT_X" Grid.Row ="0" Value="{Binding CurrentParam.MmfParamExt.FindROI.LeftTop.X}"
KeyTextSize="15" KeyTextWidth="1*"
ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="0" IsReadOnly="True"/>
<usercontrols:UCKeyValue KeyText="LT_Y" Grid.Row ="1" Value="{Binding CurrentParam.MmfParamExt.FindROI.LeftTop.Y}"
KeyTextSize="15" KeyTextWidth="1*"
ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="0" IsReadOnly="True"/>
<usercontrols:UCKeyValue KeyText="Width" Grid.Row ="2" Value="{Binding CurrentParam.MmfParamExt.FindROI.Width}"
KeyTextSize="15" KeyTextWidth="1*"
ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="0" IsReadOnly="True"/>
<usercontrols:UCKeyValue KeyText="Height" Grid.Row ="3" Value="{Binding CurrentParam.MmfParamExt.FindROI.Height}"
KeyTextSize="15" KeyTextWidth="1*"
ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="0" IsReadOnly="True"/>
</Grid>
</GroupBox>
<GroupBox Grid.Row="1" Header="Model Control">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<usercontrols:UCKeyValue KeyText="Accept" Grid.Row ="0" Value="{Binding CurrentParam.Acceptance}"
KeyTextSize="15" KeyTextWidth="1*"
ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="0" ToolTip ="검출을 위한 최소 점수" IsReadOnly="True"/>
<usercontrols:UCKeyValue KeyText="Certainty" Grid.Row ="1" Value="{Binding CurrentParam.Certainty}"
KeyTextSize="15" KeyTextWidth="1*"
ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="0" ToolTip ="해당 점수 이상이면, 검출 종료" IsReadOnly="True"/>
<usercontrols:UCKeyValue KeyText="ScaleMin" Grid.Row ="2" Value="{Binding CurrentParam.ScaleTolerance}"
KeyTextSize="15" KeyTextWidth="1*"
ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="3" ToolTip ="검출 Scale 최저값(Default : 0.5)" IsReadOnly="True"/>
<usercontrols:UCKeyValue KeyText="ScaleMax" Grid.Row ="3" Value="{Binding CurrentParam.ScaleTolerance}"
KeyTextSize="15" KeyTextWidth="1*"
ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="3" ToolTip ="검출 Scale 최대값(Default : 2.0)" IsReadOnly="True"/>
<usercontrols:UCKeyValue KeyText="AngleMin" Grid.Row ="4" Value="{Binding CurrentParam.AngleTolerance.Degree}"
KeyTextSize="15" KeyTextWidth="1*"
ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="3" ToolTip ="검출 각도 최소 값(음의 방향, 단위 : deg)" IsReadOnly="True"/>
<usercontrols:UCKeyValue KeyText="AngleMax" Grid.Row ="5" Value="{Binding CurrentParam.AngleTolerance.Degree}"
KeyTextSize="15" KeyTextWidth="1*"
ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="3" ToolTip ="검출 각도 최대 값(양의 방향, 단위 : deg)" IsReadOnly="True"/>
<usercontrols:UCKeyValue KeyText="Smoothness" Grid.Row ="6" Value="100"
KeyTextSize="15" KeyTextWidth="1*"
ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="0" ToolTip ="검출 정도. 높을 수록 작은 패턴도 검출. (100 권장)" IsReadOnly="True"/>
</Grid>
</GroupBox>
<Grid Grid.Row="2" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Margin="3" Command="{Binding CMD_LoadPreviousPage}" Content="PREV" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="auto" Style="{StaticResource StButtonAccentBlue}" />
<Button Grid.Column="1" Margin="3" Command="{Binding CMD_LoadNextImage}" Content="NEXT" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="auto" Style="{StaticResource StButtonAccentBlue}" />
<Button Grid.Column="2" Margin="3" Command="{Binding CMD_FindPattern}" Content="FIND" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="auto" Style="{StaticResource StButtonAccentBlue}" />
<Button Grid.Column="3" Margin="3" Command="{Binding CMD_GrabFind}" Content="GRAB FIND" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="auto" Style="{StaticResource StButtonAccentBlue}" />
</Grid>
</Grid>
</GroupBox>
<GroupBox Grid.Column="1" Header="Test Model Param">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="4*"/>
<RowDefinition Height="7*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<GroupBox Grid.Row="0" Header="ROI">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<usercontrols:UCKeyValue KeyText="LT_X" Grid.Row ="0" Value="{Binding TestLeftTopPoint.X}"
KeyTextSize="15" KeyTextWidth="1*" ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="0"/>
<usercontrols:UCKeyValue KeyText="LT_Y" Grid.Row ="1" Value="{Binding TestLeftTopPoint.Y}"
KeyTextSize="15" KeyTextWidth="1*"
ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="0"/>
<usercontrols:UCKeyValue KeyText="Width" Grid.Row ="2" Value="{Binding TestParam.MmfParamExt.FindROI.Width}"
KeyTextSize="15" KeyTextWidth="1*"
ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="0"/>
<usercontrols:UCKeyValue KeyText="Height" Grid.Row ="3" Value="{Binding TestParam.MmfParamExt.FindROI.Height}"
KeyTextSize="15" KeyTextWidth="1*"
ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="0"/>
</Grid>
</GroupBox>
<GroupBox Grid.Row="1" Header="Model Control">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<usercontrols:UCKeyValue KeyText="Accept" Grid.Row ="0" Value="{Binding TestParam.Acceptance}"
KeyTextSize="15" KeyTextWidth="1*"
ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="0" ToolTip ="검출을 위한 최소 점수"/>
<usercontrols:UCKeyValue KeyText="Certainty" Grid.Row ="1" Value="{Binding TestParam.Certainty}"
KeyTextSize="15" KeyTextWidth="1*"
ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="0" ToolTip ="해당 점수 이상이면, 검출 종료"/>
<usercontrols:UCKeyValue KeyText="ScaleMin" Grid.Row ="2" Value="{Binding TestParam.ScaleTolerance}"
KeyTextSize="15" KeyTextWidth="1*"
ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="3" ToolTip ="검출 Scale 최저값(Default : 0.5)"/>
<usercontrols:UCKeyValue KeyText="ScaleMax" Grid.Row ="3" Value="{Binding TestParam.ScaleTolerance}"
KeyTextSize="15" KeyTextWidth="1*"
ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="3" ToolTip ="검출 Scale 최대값(Default : 2.0)"/>
<usercontrols:UCKeyValue KeyText="AngleMin" Grid.Row ="4" Value="{Binding TestParam.AngleTolerance.Degree}"
KeyTextSize="15" KeyTextWidth="1*"
ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="3" ToolTip ="검출 각도 최소 값(음의 방향, 단위 : deg)"/>
<usercontrols:UCKeyValue KeyText="AngleMax" Grid.Row ="5" Value="{Binding TestParam.AngleTolerance.Degree}"
KeyTextSize="15" KeyTextWidth="1*"
ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="3" ToolTip ="검출 각도 최대 값(양의 방향, 단위 : deg)"/>
<usercontrols:UCKeyValue KeyText="Smoothness" Grid.Row ="6" Value="100"
KeyTextSize="15" KeyTextWidth="1*"
ValueTextSize="15" ValueTextWidth="1*"
KeyHorizontalAlignment="Right" DecimalPlaces="0" ToolTip ="검출 정도. 높을 수록 작은 패턴도 검출. (100 권장)"/>
</Grid>
</GroupBox>
<Grid Grid.Row="2" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Margin="3" Command="{Binding CMD_LoadPreviousPage}" Content="PREV" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="auto" Style="{StaticResource StButtonAccentBlue}" />
<Button Grid.Column="1" Margin="3" Command="{Binding CMD_LoadNextImage}" Content="NEXT" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="auto" Style="{StaticResource StButtonAccentBlue}" />
<Button Grid.Column="2" Margin="3" Command="{Binding CMD_FindTestPattern}" Content="FIND" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="auto" Style="{StaticResource StButtonAccentBlue}" />
<Button Grid.Column="3" Margin="3" Command="{Binding CMD_GrabFindTest}" Content="GRAB FIND" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="auto" Style="{StaticResource StButtonAccentBlue}" />
</Grid>
</Grid>
</GroupBox>
</Grid>
</GroupBox>
</Grid>
<GroupBox Header="Pattern List" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Margin="5 5 0 0" Style="{StaticResource StGroupBox2nd}">
<Grid x:Name="gridPatternListView"></Grid>
</GroupBox>
</Grid>
</UserControl>