TFLH/Views/Vision/V_Location.xaml
2026-08-06 09:50:46 +08:00

109 lines
7.8 KiB
XML

<UserControl x:Class="Views.Vision.V_Location"
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:Views.Vision"
xmlns:myconver="clr-namespace:Community;assembly=Community"
xmlns:model="clr-namespace:Model.Vision;assembly=Model"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="500">
<UserControl.Resources>
<myconver:EnumToBooleanConverter x:Key="EnumTobool"></myconver:EnumToBooleanConverter>
</UserControl.Resources>
<GroupBox Name="GB" Header="{Binding SelectVEI.VEIname}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Border>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Button Grid.Row="1" Grid.ColumnSpan="4" Style="{DynamicResource commBtn}" Background="{Binding BorderBrush, ElementName=TAB1}" Command="{Binding GetImageCommand}" Margin="0,2">
<Viewbox>
<ContentControl Content="相机采集"></ContentControl>
</Viewbox>
</Button>
<TextBox Grid.ColumnSpan="3" Text="{Binding ImgPath}" IsReadOnly="True" VerticalContentAlignment="Center" Background="Transparent" Foreground="White"/>
<Button Grid.Column="4" Grid.ColumnSpan="2" Style="{DynamicResource commBtn}" Background="{Binding BorderBrush, ElementName=TAB1}" Content="加载图片" Command="{Binding LoadingImageCommand}" Margin="1,3" />
<CheckBox Content="使用本地图像" Grid.Row="2" Grid.ColumnSpan="4" HorizontalAlignment="Center" Style="{StaticResource CheckBoxStyle1}" Foreground="White" BorderBrush="{Binding BorderBrush, ElementName=GB}" IsChecked="{Binding EnableLocalImage}"/>
<RadioButton GroupName="A" Grid.Row="3" Content="矩形" Background="Transparent" Foreground="White" Command="{Binding RoiShapeSelectCommand}" CommandParameter="R1"/>
<RadioButton GroupName="A" Grid.Row="3" Grid.Column="1" Content="矩形2" Background="Transparent" Foreground="White" Command="{Binding RoiShapeSelectCommand}" CommandParameter="R2"/>
<RadioButton GroupName="A" Grid.Row="3" Grid.Column="2" Content="圆形" Background="Transparent" Foreground="White" Command="{Binding RoiShapeSelectCommand}" CommandParameter="C"/>
<TextBlock Text="列间距" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Row="4" Grid.ColumnSpan="2" Foreground="White"/>
<TextBox Grid.Row="4" Grid.Column="2" Grid.ColumnSpan="2" Margin="1" VerticalContentAlignment="Center" VerticalAlignment="Center" Text="{Binding CircularCenterDistanceColum}" Background="Transparent" Foreground="White"/>
<TextBlock Text="行间距" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Row="5" Grid.ColumnSpan="4" Foreground="White"/>
<TextBox Grid.Row="5" Grid.Column="2" Grid.ColumnSpan="2" Margin="1" VerticalContentAlignment="Center" VerticalAlignment="Center" Text="{Binding CircularCenterDistanceRow}" Background="Transparent" Foreground="White"/>
<Button Grid.Row="6" Grid.ColumnSpan="4" Style="{DynamicResource commBtn}" Background="{Binding BorderBrush, ElementName=TAB1}" Command="{Binding NinePointCalibrationCommand}">
<Viewbox>
<ContentControl Content="标定并保存"></ContentControl>
</Viewbox>
</Button>
</Grid>
</Border>
<Border Grid.Column="1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="识别系数" Foreground="White" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Right" />
<ComboBox x:Name="coe" Grid.Column="1" Foreground="White" FontSize="16" VerticalContentAlignment="Center" VerticalAlignment="Center" ItemsSource="{Binding CoeList}" SelectedItem="{Binding SelectModel.MyROI.RecognitionCoefficient}" Background="Transparent"/>
<Button Grid.Row="1" Grid.ColumnSpan="2" FontSize="20" Content="定位设置" Style="{DynamicResource commBtn}" Background="{Binding BorderBrush, ElementName=TAB1}" Margin="1" Command="{Binding LocationSettingCommand}"/>
<Image Grid.Row="2" Grid.ColumnSpan="2" Source="/Views;component/Resources/arrow.png" Height="30"/>
<Button Grid.Row="3" FontSize="20" Content="定位测试" Style="{DynamicResource commBtn}" Background="{Binding BorderBrush, ElementName=TAB1}" Margin="1" Command="{Binding LocationCheckCommand}"/>
<Button Grid.Row="3" Grid.Column="1" Style="{DynamicResource commBtn}" Background="{Binding BorderBrush, ElementName=TAB1}" Margin="1" Command="{Binding SaveInspectPerCommand}">
<Viewbox>
<Label Foreground="White" Content="保存"></Label>
</Viewbox>
</Button>
<Border Grid.Row="4" Grid.ColumnSpan="2">
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="灰度Min" Foreground="White" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Right" />
<TextBox Text="{Binding SelectModel.MyROI.ShapeA_Min}" Background="Transparent" Foreground="White" Grid.Column="1" VerticalAlignment="Center"></TextBox>
<TextBlock Grid.Row="1" Text="灰度Max" Foreground="White" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Right" />
<TextBox Grid.Row="1" Text="{Binding SelectModel.MyROI.ShapeA_Max}" Background="Transparent" Foreground="White" Grid.Column="1" VerticalAlignment="Center"></TextBox>
</Grid>
</Border>
</Grid>
</Border>
</Grid>
</GroupBox>
</UserControl>