SicMultiplate/SicUI/Models/PMs/PMMfcTestView.xaml

309 lines
16 KiB
Plaintext
Raw Normal View History

<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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:deviceControl="clr-namespace:Aitex.Core.UI.DeviceControl;assembly=MECF.Framework.UI.Core"
xmlns:cal="http://www.caliburn.org"
xmlns:local="clr-namespace:SicUI.Models.PMs"
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="1500">
<UserControl.Resources>
<local:ColorConverter_IsTestOK x:Key="ColorConverter_IsTestOK"/>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1150"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<ListView
Background="White"
FontSize="12"
HorizontalAlignment="Left"
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 Header="Mfc测试内容" Width="1150">
<GridViewColumn.CellTemplate>
<DataTemplate>
<Grid Width="1110" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border BorderBrush="Gray" BorderThickness="1,1,0,1" >
<Label Content="{Binding MfcName}" FontSize="18" FontFamily="Bold" HorizontalAlignment="Center" VerticalAlignment="Center" 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="70"/>
<RowDefinition Height="100"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Orientation="Vertical" Height="70">
<Label FontSize="15" FontWeight="Black">DI点位监控</Label>
<Border BorderBrush="Gray" BorderThickness="2" Margin="3" Width="500" HorizontalAlignment="Left">
<StackPanel Orientation="Horizontal">
<deviceControl:AITSensor
Margin="10,8,0,8"
HorizontalAlignment="Center"
VerticalAlignment="Center"
CustomColorOff="Gray"
CustomColorOn="Green"
DeviceData="{Binding GBDoorClosed}"
IsCustomRender="True" />
<Label Margin="0,0,10,0" VerticalAlignment="Center" Content="GBDoorClosed" />
<Border BorderBrush="Gray" BorderThickness="1"/>
<deviceControl:AITSensor
Margin="10,8,0,8"
HorizontalAlignment="Center"
VerticalAlignment="Center"
CustomColorOff="Gray"
CustomColorOn="Green"
DeviceData="{Binding GN2InletPressSW}"
IsCustomRender="True" />
<Label Margin="0,0,10,0" VerticalAlignment="Center" Content="GN2InletPress" />
<Border BorderBrush="Gray" BorderThickness="1"/>
<deviceControl:AITSensor
Margin="10,8,0,8"
HorizontalAlignment="Center"
VerticalAlignment="Center"
CustomColorOff="Gray"
CustomColorOn="Green"
DeviceData="{Binding ArInletPressSW}"
IsCustomRender="True" />
<Label Margin="0,0,10,0" VerticalAlignment="Center" Content="ArInletPress" />
<Border BorderBrush="Gray" BorderThickness="1"/>
<deviceControl:AITSensor
Margin="10,8,0,8"
HorizontalAlignment="Center"
VerticalAlignment="Center"
CustomColorOff="Gray"
CustomColorOn="Green"
DeviceData="{Binding H2PressureSW}"
IsCustomRender="True" />
<Label Margin="0,0,10,0" VerticalAlignment="Center" Content="H2Pressure" />
</StackPanel>
</Border>
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Vertical" Margin="0,30,0,0">
<Border BorderBrush="Gray" BorderThickness="0,0,0,3" Width="150" HorizontalAlignment="Left">
<Label FontSize="15" FontWeight="Black">清空所有测试结果</Label>
</Border>
<StackPanel Orientation="Horizontal">
<ComboBox
ItemsSource="{Binding MfcTestList}"
SelectedItem="{Binding SelectedMfc}"
Width="120" Height="30">
<ComboBox.ItemTemplate>
<DataTemplate >
<TextBlock Text="{Binding MfcName}" Foreground="{Binding IsPass,Converter={StaticResource ColorConverter_IsTestOK}}"/>
</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"
Content="Clear"
HorizontalAlignment="Left"
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="2"
VerticalScrollBarVisibility="Auto">
<StackPanel >
<Border BorderBrush="Gray" BorderThickness="0,0,0,3" Margin="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 BorderBrush="Gray" BorderThickness="1" Margin="3">
<StackPanel Orientation="Horizontal" Height="32">
<Border Width="14" Height="14" CornerRadius="7" Margin="10,0,2,0" VerticalAlignment="Center" Background="{Binding IsPass,Converter={StaticResource ColorConverter_IsTestOK}}"/>
<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 BorderBrush="Gray" BorderThickness="0,0,0,3" Margin="3">
<Label FontSize="15" FontWeight="Black">气阀测试结果</Label>
</Border>
<ItemsControl ItemsSource="{Binding ValueTestList}">
<!--指定子项目容器为WrapPanel控件-->
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<!--指定子项目模板-->
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderBrush="Gray" BorderThickness="1" Margin="3">
<StackPanel Orientation="Horizontal" Height="32">
<Border Width="14" Height="14" CornerRadius="7" Margin="10,0,2,0" VerticalAlignment="Center" Background="{Binding State,Converter={StaticResource ColorConverter_IsTestOK}}"/>
<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 BorderBrush="Gray" BorderThickness="0,0,0,3" Margin="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 BorderBrush="Gray" BorderThickness="1" Margin="3">
<StackPanel Orientation="Horizontal" Height="32">
<Border Width="14" Height="14" CornerRadius="7" Margin="10,0,2,0" VerticalAlignment="Center" Background="{Binding State,Converter={StaticResource ColorConverter_IsTestOK}}"/>
<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>