2026-01-26 14:51:28 +09:00

165 lines
9.4 KiB
XML

<UserControl x:Class="CogUI.LineWidthSettingView"
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:cogPattern="clr-namespace:CogPattern;assembly=CogPattern"
xmlns:visionCommonUI="clr-namespace:VisionCommonUI;assembly=VisionCommonUI"
xmlns:local="clr-namespace:CogUI"
xmlns:view="clr-namespace:Aurora.View;assembly=Aurora"
x:Name="lineWidthSettingView"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:LineWidthSettingViewModel}"
Width="410" Height="950">
<UserControl.Resources>
<ResourceDictionary>
<local:PolarityConverter x:Key="polarityConverter"/>
<Style TargetType="{x:Type GroupBox}" BasedOn="{StaticResource AVDefaultGB}" />
</ResourceDictionary>
</UserControl.Resources>
<behavior:Interaction.Triggers>
<behavior:PropertyChangedTrigger Binding="{Binding IsVisible, ElementName=lineWidthSettingView}">
<behavior:InvokeCommandAction
Command="{Binding CMD_VisibleChanged}"
CommandParameter="{Binding IsVisible, ElementName=lineWidthSettingView}"/>
</behavior:PropertyChangedTrigger>
</behavior:Interaction.Triggers>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="100"/>
<RowDefinition Height="4*"/>
<RowDefinition Height="100"/>
<RowDefinition Height="100"/>
<RowDefinition Height="5"/>
<RowDefinition Height="70"/>
</Grid.RowDefinitions>
<visionCommonUI:PatternInfoView Grid.Row="0" IsEnabled="{Binding ElementName=lineWidthSettingView, Path=DataContext.IsPatternRegistered}"
IsActivated="{Binding ElementName=lineWidthSettingView, Path=DataContext.PatternInfo.IsActivated}"
Description="{Binding ElementName=lineWidthSettingView, Path=DataContext.PatternInfo.Description}"/>
<GroupBox Grid.Row="1">
<GroupBox.Header>
<TextBlock Style="{StaticResource styleTextBlockSubTitleSmall}">
<Run Text="{Binding [Pattern], Source={StaticResource langTokens}, Mode=OneWay}"/>
<Run Text="{Binding [Blocks], Source={StaticResource langTokens}, Mode=OneWay}"/>
</TextBlock>
</GroupBox.Header>
<TabControl Background="#323232">
<TabItem>
<TabItem.Header>
<TextBlock Style="{StaticResource styleTextBlockSubTitleSmall}">
<Run Text="{Binding [Line], Source={StaticResource langTokens}, Mode=OneWay}"/>
<Run Text="1"/>
</TextBlock>
</TabItem.Header>
<local:LineSettingPatternBlockView Grid.Column="0" x:Name="line1SettingView" DataContext="{Binding Line1ViewModel}"/>
</TabItem>
<TabItem>
<TabItem.Header>
<TextBlock Style="{StaticResource styleTextBlockSubTitleSmall}">
<Run Text="{Binding [Line], Source={StaticResource langTokens}, Mode=OneWay}"/>
<Run Text="2"/>
</TextBlock>
</TabItem.Header>
<local:LineSettingPatternBlockView Grid.Column="1" x:Name="line2SettingView" DataContext="{Binding Line2ViewModel}"/>
</TabItem>
</TabControl>
</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="0" Grid.Column="1"
Style="{StaticResource styleBtnPatternSetting}"
Command="{Binding CMD_SetPreProc}">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<Image Style="{StaticResource stylePatternButtonImage}"
Source="pack://application:,,,/VisionCommonUI;component/Icons/ColorIcons/img_filtering.png"/>
<TextBlock Style="{StaticResource stylePatternButtonTextBlock}">
<Run Text="{Binding [Pre], Source={StaticResource langTokens}, Mode=OneWay}"/>
<Run Text="{Binding [Proc], Source={StaticResource langTokens}, Mode=OneWay}"/>
</TextBlock>
</StackPanel>
</Button>
<Button Grid.Row="0" 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>
<visionCommonUI:FixtureSettingView Grid.Row="3"
Enabled="{Binding ElementName=lineWidthSettingView, Path=DataContext.PatternInfo.FixtureSetting.Enabled}"
ItemsSource="{Binding ElementName=lineWidthSettingView, Path=DataContext.FixturePatterns}"
SelectedItem="{Binding ElementName=lineWidthSettingView, 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>