229 lines
13 KiB
XML
229 lines
13 KiB
XML
<UserControl x:Class="MilUI.BarCodeSettingView"
|
|
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:behavior="http://schemas.microsoft.com/xaml/behaviors"
|
|
xmlns:aurora="clr-namespace:Aurora.View;assembly=Aurora"
|
|
xmlns:visionCommonUI="clr-namespace:VisionCommonUI;assembly=VisionCommonUI"
|
|
xmlns:local="clr-namespace:MilUI"
|
|
x:Name="codeSettingView"
|
|
mc:Ignorable="d"
|
|
d:DataContext="{d:DesignInstance Type=local:BarCodeSettingViewModel}"
|
|
Width="390" Height="610">
|
|
|
|
<UserControl.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<aurora:SharedResourceDictionary Source="pack://application:,,,/VisionCommonUI;component/Styles/VisionResources.xaml"/>
|
|
</ResourceDictionary.MergedDictionaries>
|
|
<aurora:BoolConverter
|
|
x:Key="boolInverter"
|
|
FalseValue="True"
|
|
TrueValue="False"/>
|
|
</ResourceDictionary>
|
|
</UserControl.Resources>
|
|
|
|
<behavior:Interaction.Triggers>
|
|
<behavior:PropertyChangedTrigger Binding="{Binding IsVisible, ElementName=codeSettingView}">
|
|
<behavior:InvokeCommandAction
|
|
Command="{Binding CMD_VisibleChanged}"
|
|
CommandParameter="{Binding IsVisible, ElementName=codeSettingView}"/>
|
|
</behavior:PropertyChangedTrigger>
|
|
</behavior:Interaction.Triggers>
|
|
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="100"/>
|
|
<RowDefinition Height="240"/>
|
|
<RowDefinition Height="100"/>
|
|
<RowDefinition Height="100"/>
|
|
<RowDefinition Height="5"/>
|
|
<RowDefinition Height="70"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<local:PatternInfoView Grid.Row="0" IsEnabled="{Binding ElementName=codeSettingView, Path=DataContext.IsPatternRegistered}"
|
|
IsActivated="{Binding ElementName=codeSettingView, Path=DataContext.PatternInfo.IsActivated}"
|
|
Description="{Binding ElementName=codeSettingView, Path=DataContext.PatternInfo.Description}"/>
|
|
|
|
<GroupBox Grid.Row="1" Margin="5">
|
|
<GroupBox.Header>
|
|
<TextBlock Style="{StaticResource styleTextBlockSubTitleSmall_Orange}">
|
|
<Run Text="{Binding [Find], Source={StaticResource langTokens}, Mode=OneWay}"/>
|
|
<Run Text="{Binding [Parameter], Source={StaticResource langTokens}, Mode=OneWay}"/>
|
|
</TextBlock>
|
|
</GroupBox.Header>
|
|
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="1*"/>
|
|
<RowDefinition Height="1*"/>
|
|
<RowDefinition Height="1*"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid Grid.Row="0">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="1*"/>
|
|
<ColumnDefinition Width="1*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<visionCommonUI:UCContentComboBox
|
|
Grid.Column="0"
|
|
ItemsSource="{Binding ElementName=codeSettingView, Path=DataContext.CodeTypeItems}"
|
|
SelectedItem="{Binding ElementName=codeSettingView, Path=DataContext.RunParam.CodeType}">
|
|
<TextBlock Style="{StaticResource stylePatternComboBoxTextBlock}">
|
|
<Run Text="{Binding [Code], Source={StaticResource langTokens}, Mode=OneWay}"/>
|
|
<Run Text="{Binding [Type], Source={StaticResource langTokens}, Mode=OneWay}"/>
|
|
</TextBlock>
|
|
</visionCommonUI:UCContentComboBox>
|
|
</Grid>
|
|
|
|
<Grid Grid.Row="1">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="1*"/>
|
|
<ColumnDefinition Width="1*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<visionCommonUI:UCContentComboBox
|
|
Grid.Column="0"
|
|
ItemsSource="{Binding ElementName=codeSettingView, Path=DataContext.ThresholdModeItems}"
|
|
SelectedItem="{Binding ElementName=codeSettingView, Path=DataContext.RunParam.ThresholdMode}">
|
|
<TextBlock Style="{StaticResource stylePatternComboBoxTextBlock}">
|
|
<Run Text="{Binding [Threshold], Source={StaticResource langTokens}, Mode=OneWay}"/>
|
|
<Run Text="{Binding [Mode], Source={StaticResource langTokens}, Mode=OneWay}"/>
|
|
</TextBlock>
|
|
</visionCommonUI:UCContentComboBox>
|
|
|
|
<visionCommonUI:UCContentComboBox
|
|
Grid.Column="1"
|
|
ItemsSource="{Binding ElementName=codeSettingView, Path=DataContext.SpeedItems}"
|
|
SelectedItem="{Binding ElementName=codeSettingView, Path=DataContext.RunParam.Speed}">
|
|
<TextBlock Style="{StaticResource stylePatternComboBoxTextBlock}">
|
|
<Run Text="{Binding [Speed], Source={StaticResource langTokens}, Mode=OneWay}"/>
|
|
</TextBlock>
|
|
</visionCommonUI:UCContentComboBox>
|
|
</Grid>
|
|
|
|
<Grid Grid.Row="2">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="2*"/>
|
|
<ColumnDefinition Width="8*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Grid Grid.Column="0" Margin="5">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="382*"/>
|
|
<RowDefinition Height="618*"/>
|
|
</Grid.RowDefinitions>
|
|
<TextBlock Grid.Row="0" Margin="0, 5" Style="{StaticResource stylePatternSliderTextBlock}"
|
|
HorizontalAlignment="Center">
|
|
<Run Text="{Binding [Auto], Source={StaticResource langTokens}, Mode=OneWay}"/>
|
|
</TextBlock>
|
|
<CheckBox Grid.Row="1" Style="{StaticResource styleToggleSwitch}"
|
|
IsChecked="{Binding ElementName=codeSettingView, Path=DataContext.RunParam.AutoThreshold}"/>
|
|
</Grid>
|
|
|
|
<visionCommonUI:UCContentSlider Grid.Column="1" Margin="0, 5"
|
|
MinValue="0" MaxValue="255"
|
|
KeyValue="{Binding ElementName=codeSettingView, Path=DataContext.RunParam.Threshold}"
|
|
IsEnabled="{Binding ElementName=codeSettingView, Path=DataContext.RunParam.AutoThreshold, Converter={StaticResource boolInverter}}">
|
|
<TextBlock Style="{StaticResource stylePatternSliderTextBlock}">
|
|
<Run Text="{Binding [Threshold], Source={StaticResource langTokens}, Mode=OneWay}"/>
|
|
</TextBlock>
|
|
</visionCommonUI:UCContentSlider>
|
|
</Grid>
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<GroupBox Grid.Row="2" Margin="5">
|
|
<GroupBox.Header>
|
|
<TextBlock Style="{StaticResource styleTextBlockSubTitleSmall_Orange}">
|
|
<Run Text="{Binding [Setting], Source={StaticResource langTokens}, Mode=OneWay}"/>
|
|
<Run Text="{Binding [Control], Source={StaticResource langTokens}, Mode=OneWay}"/>
|
|
</TextBlock>
|
|
</GroupBox.Header>
|
|
|
|
<Grid Margin="0, 10">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="50"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition/>
|
|
<ColumnDefinition/>
|
|
<ColumnDefinition/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Button Grid.Row="0" Grid.Column="0"
|
|
Style="{StaticResource styleBtnPatternSetting}"
|
|
Command="{Binding CMD_SetLight}">
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
<Image Style="{StaticResource stylePatternButtonImage}"
|
|
Source="pack://application:,,,/VisionCommonUI;component/Icons/ColorIcons/img_light.png"/>
|
|
<TextBlock Style="{StaticResource stylePatternButtonTextBlock}">
|
|
<Run Text="{Binding [Light], Source={StaticResource langTokens}, Mode=OneWay}"/>
|
|
</TextBlock>
|
|
</StackPanel>
|
|
</Button>
|
|
|
|
<Button Grid.Row="1" Grid.Column="1"
|
|
Style="{StaticResource styleBtnPatternSetting}"
|
|
Command="{Binding CMD_SetFindROI}">
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
<Image Style="{StaticResource stylePatternButtonImage}"
|
|
Source="pack://application:,,,/VisionCommonUI;component/Icons/ColorIcons/img_find_roi.png"/>
|
|
<TextBlock Style="{StaticResource stylePatternButtonTextBlock}">
|
|
<Run Text="{Binding [Find], Source={StaticResource langTokens}, Mode=OneWay}"/>
|
|
<Run Text="{Binding [ROI], Source={StaticResource langTokens}, Mode=OneWay}"/>
|
|
</TextBlock>
|
|
</StackPanel>
|
|
</Button>
|
|
|
|
<Button Grid.Row="1" Grid.Column="2"
|
|
Style="{StaticResource styleBtnPatternSetting}"
|
|
Command="{Binding CMD_FindPattern}">
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
<Image Style="{StaticResource stylePatternButtonImage}"
|
|
Source="pack://application:,,,/VisionCommonUI;component/Icons/ColorIcons/img_magnifying_glass.png"/>
|
|
<TextBlock Style="{StaticResource stylePatternButtonTextBlock}">
|
|
<Run Text="{Binding [Test], Source={StaticResource langTokens}, Mode=OneWay}"/>
|
|
<Run Text="{Binding [Find], Source={StaticResource langTokens}, Mode=OneWay}"/>
|
|
</TextBlock>
|
|
</StackPanel>
|
|
</Button>
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<local:FixtureSettingView Grid.Row="3"
|
|
Enabled="{Binding ElementName=codeSettingView, Path=DataContext.PatternInfo.FixtureSetting.Enabled}"
|
|
ItemsSource="{Binding ElementName=codeSettingView, Path=DataContext.FixturePatterns}"
|
|
SelectedItem="{Binding ElementName=codeSettingView, Path=DataContext.PatternInfo.FixtureSetting.Pattern1}"/>
|
|
|
|
<Separator Grid.Row="4"/>
|
|
|
|
<StackPanel Grid.Row="5" Margin="15, 10" Orientation="Horizontal" HorizontalAlignment="Right">
|
|
<Button Style="{StaticResource styleBtnPatternSetting}"
|
|
Command="{Binding CMD_Save}"
|
|
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}">
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
<Image Style="{StaticResource stylePatternButtonImage}"
|
|
Source="pack://application:,,,/VisionCommonUI;component/Icons/ColorIcons/img_ok.png"/>
|
|
<TextBlock Style="{StaticResource stylePatternButtonTextBlock}"
|
|
Text="{Binding [Save], Source={StaticResource langTokens}, Mode=OneWay}"/>
|
|
</StackPanel>
|
|
</Button>
|
|
|
|
<Button Style="{StaticResource styleBtnPatternSetting}"
|
|
Command="{Binding CMD_Cancel}"
|
|
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}">
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
<Image Style="{StaticResource stylePatternButtonImage}"
|
|
Source="pack://application:,,,/VisionCommonUI;component/Icons/ColorIcons/img_cancel.png"/>
|
|
<TextBlock Style="{StaticResource stylePatternButtonTextBlock}"
|
|
Text="{Binding [Close], Source={StaticResource langTokens}, Mode=OneWay}"/>
|
|
</StackPanel>
|
|
</Button>
|
|
</StackPanel>
|
|
</Grid>
|
|
</UserControl>
|