200 lines
12 KiB
XML
200 lines
12 KiB
XML
<UserControl x:Class="Views.Vision.V_Inspect"
|
|
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>
|
|
<Label Content="相机采集" Foreground="White"></Label>
|
|
</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}" Command="{Binding LoadingImageCommand}" Margin="1,3" >
|
|
<Viewbox>
|
|
<Label Content="加载图片" Foreground="White"></Label>
|
|
</Viewbox>
|
|
</Button>
|
|
|
|
<CheckBox Content="使用本地图像" Grid.Row="2" Grid.ColumnSpan="2" 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"/>
|
|
|
|
<Label HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Row="4" Foreground="White">
|
|
<Viewbox>
|
|
<ContentControl Content="列间距:"></ContentControl>
|
|
</Viewbox>
|
|
</Label>
|
|
|
|
<TextBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" Margin="1" VerticalContentAlignment="Center" VerticalAlignment="Center" Text="{Binding CircularCenterDistanceColum}" Background="Transparent" Foreground="White"/>
|
|
<Label HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Row="5" Foreground="White">
|
|
<Viewbox>
|
|
<ContentControl Content="行间距:"></ContentControl>
|
|
</Viewbox>
|
|
</Label>
|
|
<TextBox Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2" Margin="1" VerticalContentAlignment="Center" VerticalAlignment="Center" Text="{Binding CircularCenterDistanceRow}" Background="Transparent" Foreground="White"/>
|
|
|
|
<Label Grid.Row="4" Grid.Column="3" Foreground="White" VerticalAlignment="Center">
|
|
<Viewbox>
|
|
<ContentControl Content="识别系数"></ContentControl>
|
|
</Viewbox>
|
|
</Label>
|
|
<ComboBox Grid.Row="5" Grid.Column="3" VerticalContentAlignment="Center" VerticalAlignment="Center" ItemsSource="{Binding CoeList}" SelectedItem="{Binding SelectVEI. ImageCorrectionRM.MyROI.RecognitionCoefficient}" Background="Transparent" Foreground="White"/>
|
|
|
|
<Button Grid.Row="6" Grid.ColumnSpan="2" Style="{DynamicResource commBtn}" Background="{Binding BorderBrush, ElementName=TAB1}" Command="{Binding NinePointCalibrationCommand}" CommandParameter="{Binding RelativeSource={x:Static RelativeSource.Self}}">
|
|
<Viewbox>
|
|
<Label Content="标定并保存" Foreground="White"></Label>
|
|
</Viewbox>
|
|
</Button>
|
|
<Button Grid.Row="6" Grid.Column="2" Style="{DynamicResource commBtn}" Background="{Binding BorderBrush, ElementName=TAB1}" Command="{Binding CreateImageCorrectionModelCommand}">
|
|
<Viewbox>
|
|
<Label Content="校正设置" Foreground="White"></Label>
|
|
</Viewbox>
|
|
</Button>
|
|
<Button Grid.Row="6" Grid.Column="3" Style="{DynamicResource commBtn}" Background="{Binding BorderBrush, ElementName=TAB1}" Command="{Binding ImageCorrectionTestCommand}">
|
|
<Viewbox>
|
|
<Label Content="校正测试" Foreground="White"></Label>
|
|
</Viewbox>
|
|
</Button>
|
|
|
|
</Grid>
|
|
</Border>
|
|
<Border Grid.Column="1" >
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition/>
|
|
<ColumnDefinition/>
|
|
</Grid.ColumnDefinitions>
|
|
<GroupBox Header="PCB二值化">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<Label Content="最小值" Foreground="White"></Label>
|
|
<TextBox Text="{Binding SelectModel.MyROI.ThresholdMin}" Background="Transparent" Foreground="White" Grid.Column="1" VerticalAlignment="Center"></TextBox>
|
|
<Label Content="最大值" Grid.Row="1" Foreground="White"></Label>
|
|
<TextBox Text="{Binding SelectModel.MyROI.ThresholdMax}" Background="Transparent" Foreground="White" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center"></TextBox>
|
|
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
|
|
|
|
<GroupBox Grid.Column="1" Header="图像灰度" DataContext="{Binding SelectModel.MyROI}">
|
|
<Grid >
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<Label Content="最小值" Foreground="White"></Label>
|
|
<TextBox Text="{Binding ShapeA_Min}" Background="Transparent" Foreground="White" Grid.Column="1" VerticalAlignment="Center"></TextBox>
|
|
<Label Content="最大值" Grid.Row="1" Foreground="White"></Label>
|
|
<TextBox Text="{Binding ShapeA_Max}" Background="Transparent" Foreground="White" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center"></TextBox>
|
|
</Grid>
|
|
</GroupBox>
|
|
<GroupBox Grid.Row="1" Grid.Column="1" Header="曝光设置" DataContext="{Binding SelectModel.MyROI}">
|
|
<Grid >
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<Label Content="曝光值" Foreground="White"></Label>
|
|
<TextBox Text="{Binding ShapeB_Max}" Background="Transparent" Foreground="White" Grid.Column="1" VerticalAlignment="Center"></TextBox>
|
|
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
|
|
<Border Grid.Row="2" Grid.ColumnSpan="2">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition></RowDefinition>
|
|
<RowDefinition></RowDefinition>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition></ColumnDefinition>
|
|
<ColumnDefinition></ColumnDefinition>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Button Style="{DynamicResource commBtn}" Background="{Binding BorderBrush, ElementName=TAB1}" Margin="1" Command="{Binding InspectionFeaturesEditCommand}">
|
|
<Viewbox>
|
|
<Label Content="区域设置" Foreground="White"></Label>
|
|
</Viewbox>
|
|
</Button>
|
|
|
|
<Button Grid.Column="1" Style="{DynamicResource commBtn}" Background="{Binding BorderBrush, ElementName=TAB1}" Command="{Binding ThresholdRunCommand}" Margin="1">
|
|
<Viewbox>
|
|
<Label Content="二值化预览" Foreground="White"></Label>
|
|
</Viewbox>
|
|
</Button>
|
|
|
|
<Button Grid.Row="1" Style="{DynamicResource commBtn}" Background="{Binding BorderBrush, ElementName=TAB1}" Margin="1" Command="{Binding InspectionFeaturesTestCommand}">
|
|
<Viewbox>
|
|
<Label Content="检查测试" Foreground="White"></Label>
|
|
</Viewbox>
|
|
</Button>
|
|
|
|
|
|
<Button Grid.Row="1" Grid.Column="1" Style="{DynamicResource commBtn}" Background="{Binding BorderBrush, ElementName=TAB1}" Margin="1" Command="{Binding SaveInspectPerCommand}">
|
|
<Viewbox>
|
|
<Label Foreground="White" Content="保存"></Label>
|
|
</Viewbox>
|
|
</Button>
|
|
</Grid>
|
|
</Border>
|
|
</Grid>
|
|
</Border>
|
|
</Grid>
|
|
</GroupBox>
|
|
</UserControl>
|