SicMultiplate/SicUI/Models/PMs/PMMfcTestView.xaml

319 lines
16 KiB
XML

<UserControl
x:Class="SicUI.Models.PMs.PMMfcTestView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cal="http://www.caliburn.org"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:deviceControl="clr-namespace:Aitex.Core.UI.DeviceControl;assembly=MECF.Framework.UI.Core"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:local="clr-namespace:SicUI.Models.PMs"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="600"
d:DesignWidth="1500"
mc:Ignorable="d">
<UserControl.Resources>
<local:ColorConverter_IsTestOK x:Key="ColorConverter_IsTestOK" />
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1150" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<ListView
HorizontalAlignment="Left"
Background="White"
FontSize="12"
ItemsSource="{Binding MfcTestList}">
<ListView.Resources>
<Style TargetType="ListViewItem">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="White" />
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
<Setter Property="Background" Value="White" />
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="Label">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="LightSkyBlue" />
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
<Setter Property="Background" Value="White" />
</Trigger>
</Style.Triggers>
</Style>
</ListView.Resources>
<ListView.View>
<GridView>
<GridViewColumn Width="1150" Header="Mfc测试内容">
<GridViewColumn.CellTemplate>
<DataTemplate>
<Grid Width="1110">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Border BorderBrush="Gray" BorderThickness="1,1,0,1">
<Label
HorizontalAlignment="Center"
VerticalAlignment="Center"
Content="{Binding MfcName}"
FontFamily="Bold"
FontSize="18"
Foreground="{Binding IsPass, Converter={StaticResource ColorConverter_IsTestOK}}" />
</Border>
<StackPanel Grid.Column="1">
<Border BorderBrush="Gray" BorderThickness="1">
<StackPanel Orientation="Horizontal">
<Label Width="60">测试结果:</Label>
<Label
Width="60"
Content="{Binding IsPass}"
Foreground="{Binding IsPass, Converter={StaticResource ColorConverter_IsTestOK}}" />
</StackPanel>
</Border>
<Border BorderBrush="Gray" BorderThickness="1,0,1,1">
<StackPanel Orientation="Horizontal">
<Label Width="60">设定流量:</Label>
<Label Width="100" Content="{Binding BaseValue}" />
</StackPanel>
</Border>
<Border BorderBrush="Gray" BorderThickness="1,0,1,1">
<StackPanel Orientation="Horizontal">
<Label Width="60">测试时间:</Label>
<Label Content="{Binding Time}" />
</StackPanel>
</Border>
<Border BorderBrush="Gray" BorderThickness="1,0,1,1">
<StackPanel Orientation="Horizontal">
<Label Width="60">采集结果:</Label>
<Label Content="{Binding Values}" />
</StackPanel>
</Border>
<Border BorderBrush="Gray" BorderThickness="1,0,1,1">
<StackPanel Orientation="Horizontal">
<Label Width="60">计算结果:</Label>
<Label Content="{Binding Result}" />
</StackPanel>
</Border>
<Border BorderBrush="Gray" BorderThickness="1,0,1,1">
<StackPanel Orientation="Horizontal">
<Label Width="60">测试气阀:</Label>
<Label Content="{Binding Infor}" Foreground="{Binding IsPass, Converter={StaticResource ColorConverter_IsTestOK}}" />
</StackPanel>
</Border>
</StackPanel>
</Grid>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="140" />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel Margin="0,30,0,0" Orientation="Vertical">
<Border
Width="300"
HorizontalAlignment="Left"
BorderBrush="Gray"
BorderThickness="0,0,0,3">
<Label FontSize="15" FontWeight="Black">操作</Label>
</Border>
<StackPanel Orientation="Horizontal">
<ComboBox
Width="120"
Height="30"
ItemsSource="{Binding MfcTestList}"
SelectedItem="{Binding SelectedMfc}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Foreground="{Binding IsPass, Converter={StaticResource ColorConverter_IsTestOK}}" Text="{Binding MfcName}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<Button
Width="70"
Height="30"
Margin="10,0"
Content="Start"
IsEnabled="{Binding IsTestOver}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<cal:ActionMessage MethodName="MfcStart" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button
Width="70"
Height="30"
Margin="3"
HorizontalAlignment="Left"
Content="Clear"
IsEnabled="{Binding IsTestOver}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<cal:ActionMessage MethodName="DeleteMfcTest" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</StackPanel>
</StackPanel>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<StackPanel>
<Border
Margin="3"
BorderBrush="Gray"
BorderThickness="0,0,0,3">
<Label FontSize="15" FontWeight="Black">MFC测试结果</Label>
</Border>
<ItemsControl ItemsSource="{Binding MfcTestList}">
<!-- 指定子项目容器为WrapPanel控件 -->
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<!-- 指定子项目模板 -->
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border
Margin="3"
BorderBrush="Gray"
BorderThickness="1">
<StackPanel Height="32" Orientation="Horizontal">
<Border
Width="14"
Height="14"
Margin="10,0,2,0"
VerticalAlignment="Center"
Background="{Binding IsPass, Converter={StaticResource ColorConverter_IsTestOK}}"
CornerRadius="7" />
<Label
Width="60"
Margin="2,0,2,0"
VerticalAlignment="Center"
Content="{Binding MfcName}"
Foreground="{Binding IsPass, Converter={StaticResource ColorConverter_IsTestOK}}" />
</StackPanel>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<Border
Margin="3"
BorderBrush="Gray"
BorderThickness="0,0,0,3">
<Label FontSize="15" FontWeight="Black">气阀测试结果</Label>
</Border>
<ItemsControl ItemsSource="{Binding ValueTestList}">
<!-- 指定子项目容器为WrapPanel控件 -->
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<!-- 指定子项目模板 -->
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border
Margin="3"
BorderBrush="Gray"
BorderThickness="1">
<StackPanel Height="32" Orientation="Horizontal">
<Border
Width="14"
Height="14"
Margin="10,0,2,0"
VerticalAlignment="Center"
Background="{Binding State, Converter={StaticResource ColorConverter_IsTestOK}}"
CornerRadius="7" />
<Label
Width="60"
Margin="2,0,2,0"
VerticalAlignment="Center"
Content="{Binding ControlName}"
Foreground="{Binding State, Converter={StaticResource ColorConverter_IsTestOK}}" />
</StackPanel>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<Border
Margin="3"
BorderBrush="Gray"
BorderThickness="0,0,0,3">
<Label FontSize="15" FontWeight="Black">PC测试结果</Label>
</Border>
<ItemsControl ItemsSource="{Binding PCTestList}">
<!-- 指定子项目容器为WrapPanel控件 -->
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<!-- 指定子项目模板 -->
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border
Margin="3"
BorderBrush="Gray"
BorderThickness="1">
<StackPanel Height="32" Orientation="Horizontal">
<Border
Width="14"
Height="14"
Margin="10,0,2,0"
VerticalAlignment="Center"
Background="{Binding State, Converter={StaticResource ColorConverter_IsTestOK}}"
CornerRadius="7" />
<Label
Width="60"
Margin="2,0,2,0"
VerticalAlignment="Center"
Content="{Binding ControlName}"
Foreground="{Binding State, Converter={StaticResource ColorConverter_IsTestOK}}" />
</StackPanel>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</ScrollViewer>
</Grid>
</Grid>
</UserControl>