|
@@ -0,0 +1,318 @@
|
|
|
+<UserControl x:Class="PLCTool.Views.BasicConfigView.EditSchView"
|
|
|
+ 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:PLCTool.Views.BasicConfigView"
|
|
|
+ xmlns:prism="http://prismlibrary.com/"
|
|
|
+ BorderBrush="#CBCBCB" BorderThickness="1"
|
|
|
+ Height="600" Width="1000" >
|
|
|
+
|
|
|
+ <UserControl.Resources>
|
|
|
+ <Style TargetType="TextBlock" x:Key="textBlockStyle">
|
|
|
+ <Setter Property="Width" Value="80"/>
|
|
|
+ <Setter Property="FontSize" Value="12"/>
|
|
|
+ <Setter Property="VerticalAlignment" Value="Center"/>
|
|
|
+ <Setter Property="TextAlignment" Value="Right"/>
|
|
|
+ <Setter Property="Margin" Value="0,0,5,0"/>
|
|
|
+ </Style>
|
|
|
+ </UserControl.Resources>
|
|
|
+
|
|
|
+ <Grid>
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+
|
|
|
+ <RowDefinition Height="50" />
|
|
|
+ <RowDefinition />
|
|
|
+ <RowDefinition />
|
|
|
+ <RowDefinition />
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+
|
|
|
+ <StackPanel Orientation="Horizontal" Grid.Row="0" Margin="10">
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
+ <TextBlock Text="测试方案名称:" Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
|
|
|
+ <TextBox Height="28" Width="120" Text="{Binding ScheduleName}" />
|
|
|
+ </StackPanel>
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
+ <TextBlock Text="设备名称:" Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
|
|
|
+ <TextBox Height="28" Width="120" Text="{Binding DeviceName}"/>
|
|
|
+ </StackPanel>
|
|
|
+ <StackPanel Orientation="Horizontal" >
|
|
|
+ <TextBlock Text="测试项类型:" Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
|
|
|
+ <ComboBox Height="28" Width="120" ItemsSource="{Binding TestKinds}" SelectedItem="{Binding SelectTest}" />
|
|
|
+ </StackPanel>
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
+ <TextBlock Text="测试项名称:" Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
|
|
|
+ <TextBox Height="28" Width="120" Text="{Binding TestName}"/>
|
|
|
+ </StackPanel>
|
|
|
+ <Button Content="确认" Width="80" Margin="5,0" Command="{Binding SureCommand}" Style="{StaticResource NormalButtonStyle}" />
|
|
|
+ <Button Content="重置" Width="80" Margin="5,0" Command="{Binding ResetCommand}" Style="{StaticResource NormalButtonStyle}" />
|
|
|
+ </StackPanel>
|
|
|
+ <Border Grid.Row="0" BorderBrush="#CBCBCB" BorderThickness="0,1" />
|
|
|
+ <Grid Grid.Row="1">
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
+ <ColumnDefinition Width="80"/>
|
|
|
+ <ColumnDefinition/>
|
|
|
+ <ColumnDefinition Width="1.3*"/>
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
+ <TextBlock Grid.Column="0" Text="前置项" Style="{StaticResource NormalTextBlockStyle}" TextAlignment="Center">
|
|
|
+ </TextBlock>
|
|
|
+ <Border Grid.Column="1" BorderBrush="#CBCBCB" BorderThickness="1,0" />
|
|
|
+ <Grid Grid.Column="1">
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition/>
|
|
|
+ <RowDefinition/>
|
|
|
+ <RowDefinition Height="2*"/>
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+ <Grid Grid.Row="0">
|
|
|
+ <StackPanel Orientation="Horizontal" >
|
|
|
+ <TextBlock Text="测试项类型:" Style="{StaticResource textBlockStyle}"/>
|
|
|
+ <ComboBox Height="28" Width="150" ItemsSource="{Binding BeforeJudgeKinds}" SelectedItem="{Binding BeforeSelectJudge}" />
|
|
|
+ </StackPanel>
|
|
|
+ </Grid>
|
|
|
+ <Grid Grid.Row="1" >
|
|
|
+ <StackPanel Orientation="Horizontal" >
|
|
|
+ <TextBlock Text="明细判定逻辑:" Style="{StaticResource textBlockStyle}"/>
|
|
|
+ <ComboBox Height="28" Width="150" ItemsSource="{Binding JudgeLogicKinds}" SelectedItem="{Binding SelectLogic}"/>
|
|
|
+ </StackPanel>
|
|
|
+ </Grid>
|
|
|
+ <Grid Grid.Row="2">
|
|
|
+ <DockPanel LastChildFill="True" >
|
|
|
+ <TextBlock Text="前置项描述:" Style="{StaticResource textBlockStyle}" />
|
|
|
+ <RichTextBox Margin="0,5,5,5" >
|
|
|
+ <FlowDocument>
|
|
|
+ <Paragraph>
|
|
|
+ <Run Text="{Binding BeforeDetail,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
|
|
|
+ </Paragraph>
|
|
|
+ </FlowDocument>
|
|
|
+
|
|
|
+ </RichTextBox>
|
|
|
+ </DockPanel>
|
|
|
+ </Grid>
|
|
|
+ </Grid>
|
|
|
+ <Grid Grid.Column="2" >
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition Height="30"/>
|
|
|
+ <RowDefinition/>
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+ <DockPanel LastChildFill="False">
|
|
|
+ <TextBlock Text="前置项明细:" Style="{StaticResource textBlockStyle}" />
|
|
|
+ <Button Content="新增" Height="22" Width="60" Margin="5,0" Command="{Binding AddDetailCommand}" CommandParameter="Before" Style="{StaticResource NormalButtonStyle}" DockPanel.Dock="Right" />
|
|
|
+ </DockPanel>
|
|
|
+ <DataGrid Grid.Row="1" ColumnWidth="*" AutoGenerateColumns="False" HeadersVisibility="All" CanUserAddRows="False" SelectionUnit="FullRow" SelectionMode="Single" RowHeaderWidth="0" HorizontalScrollBarVisibility="Disabled"
|
|
|
+ ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}" x:Name="DeviceDataGrid" RowHeaderStyle="{StaticResource RowHeaderStyle}" RowStyle="{StaticResource DataGridRowtyle}" AlternationCount="2"
|
|
|
+ ItemsSource="{Binding BeforeConList}" IsReadOnly="True" >
|
|
|
+ <DataGrid.Columns >
|
|
|
+ <DataGridTextColumn Header="序号" Width="40" Binding="{Binding Id}" CellStyle="{StaticResource MyDataGridCellStyle}" />
|
|
|
+ <DataGridTextColumn Header="PLC地址" Binding="{Binding PlcAddress}" CellStyle="{StaticResource MyDataGridCellStyle}" />
|
|
|
+ <DataGridTextColumn Header="PLC变量名" Binding="{Binding PlcItem}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
|
|
|
+ <DataGridTextColumn Header="判定值" Binding="{Binding PlcValue}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
|
|
|
+ <DataGridTemplateColumn Header="操作" Width="160" CellStyle="{StaticResource MyDataGridCellStyle}">
|
|
|
+ <DataGridTemplateColumn.CellTemplate>
|
|
|
+ <DataTemplate>
|
|
|
+ <UniformGrid Columns="2">
|
|
|
+ <Button Width="auto" Background="Transparent" HorizontalContentAlignment ="Left" Foreground="Black" Height="25" BorderThickness="0"
|
|
|
+ Command="{Binding DataContext.EditBeforeCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" CommandParameter="{Binding Id}" Cursor="Hand" Margin="0,0,10,0" >
|
|
|
+
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
+ <TextBlock Text="编辑" VerticalAlignment="Center" Foreground="Blue"/>
|
|
|
+ </StackPanel>
|
|
|
+ </Button>
|
|
|
+ <Button Width="auto" Background="Transparent" HorizontalContentAlignment ="Left" Foreground="Black" Height="25" BorderThickness="0"
|
|
|
+ Command="{Binding DataContext.DeleteBeforeCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" CommandParameter="{Binding Id}" Cursor="Hand" >
|
|
|
+
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
+ <TextBlock Text="删除" VerticalAlignment="Center" Foreground="Blue"/>
|
|
|
+ </StackPanel>
|
|
|
+ </Button>
|
|
|
+
|
|
|
+ </UniformGrid>
|
|
|
+ </DataTemplate>
|
|
|
+ </DataGridTemplateColumn.CellTemplate>
|
|
|
+ </DataGridTemplateColumn>
|
|
|
+
|
|
|
+ </DataGrid.Columns>
|
|
|
+
|
|
|
+ </DataGrid>
|
|
|
+
|
|
|
+ </Grid>
|
|
|
+ </Grid>
|
|
|
+ <Grid Grid.Row="2">
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
+ <ColumnDefinition Width="80"/>
|
|
|
+ <ColumnDefinition/>
|
|
|
+ <ColumnDefinition Width="1.3*"/>
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
+ <TextBlock Grid.Column="0" Text="输入项" Style="{StaticResource NormalTextBlockStyle}" TextAlignment="Center">
|
|
|
+ </TextBlock>
|
|
|
+ <Border Grid.Column="1" BorderBrush="#CBCBCB" BorderThickness="1,0" />
|
|
|
+ <Grid Grid.Column="1">
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition/>
|
|
|
+ <RowDefinition/>
|
|
|
+ <RowDefinition Height="2*"/>
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+ <Grid Grid.Row="0">
|
|
|
+ <StackPanel Orientation="Horizontal" >
|
|
|
+ <TextBlock Text="测试项类型:" Style="{StaticResource textBlockStyle}"/>
|
|
|
+ <ComboBox Height="28" Width="150" ItemsSource="{Binding InJudgeKinds}" SelectedItem="{Binding SelectInJudge}" />
|
|
|
+ </StackPanel>
|
|
|
+ </Grid>
|
|
|
+ <Grid Grid.Row="1" >
|
|
|
+ <StackPanel Orientation="Horizontal" >
|
|
|
+ <TextBlock Text="明细判定逻辑:" Style="{StaticResource textBlockStyle}"/>
|
|
|
+ <ComboBox Height="28" Width="150" ItemsSource="{Binding InJudgeLogicKinds}" SelectedItem="{Binding InSelectLogic}"/>
|
|
|
+ </StackPanel>
|
|
|
+ </Grid>
|
|
|
+ <Grid Grid.Row="2">
|
|
|
+ <DockPanel LastChildFill="True" >
|
|
|
+ <TextBlock Text="输入项描述:" Style="{StaticResource textBlockStyle}" />
|
|
|
+ <RichTextBox Margin="0,5,5,5" >
|
|
|
+ <FlowDocument>
|
|
|
+ <Paragraph>
|
|
|
+ <Run Text="{Binding InDetail,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
|
|
|
+ </Paragraph>
|
|
|
+ </FlowDocument>
|
|
|
+
|
|
|
+ </RichTextBox>
|
|
|
+ </DockPanel>
|
|
|
+ </Grid>
|
|
|
+ </Grid>
|
|
|
+ <Grid Grid.Column="2" >
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition Height="30"/>
|
|
|
+ <RowDefinition/>
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+ <DockPanel LastChildFill="False">
|
|
|
+ <TextBlock Text="输入项明细:" Style="{StaticResource textBlockStyle}" />
|
|
|
+ <Button Content="新增" Height="22" Width="60" Margin="5,0" Command="{Binding AddDetailCommand}" CommandParameter="In" Style="{StaticResource NormalButtonStyle}" DockPanel.Dock="Right" />
|
|
|
+ </DockPanel>
|
|
|
+ <DataGrid Grid.Row="1" ColumnWidth="*" AutoGenerateColumns="False" HeadersVisibility="All" CanUserAddRows="False" SelectionUnit="FullRow" SelectionMode="Single" RowHeaderWidth="0" HorizontalScrollBarVisibility="Disabled"
|
|
|
+ ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}" RowHeaderStyle="{StaticResource RowHeaderStyle}" RowStyle="{StaticResource DataGridRowtyle}" AlternationCount="2"
|
|
|
+ ItemsSource="{Binding InConList}" IsReadOnly="True" >
|
|
|
+ <DataGrid.Columns >
|
|
|
+ <DataGridTextColumn Header="序号" Width="40" Binding="{Binding Id}" CellStyle="{StaticResource MyDataGridCellStyle}" />
|
|
|
+ <DataGridTextColumn Header="PLC地址" Binding="{Binding PlcAddress}" CellStyle="{StaticResource MyDataGridCellStyle}" />
|
|
|
+ <DataGridTextColumn Header="PLC变量名" Binding="{Binding PlcItem}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
|
|
|
+ <DataGridTextColumn Header="判定值" Binding="{Binding PlcValue}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
|
|
|
+ <DataGridTemplateColumn Header="操作" Width="160" CellStyle="{StaticResource MyDataGridCellStyle}">
|
|
|
+ <DataGridTemplateColumn.CellTemplate>
|
|
|
+ <DataTemplate>
|
|
|
+ <UniformGrid Columns="2">
|
|
|
+ <Button Width="auto" Background="Transparent" HorizontalContentAlignment ="Left" Foreground="Black" Height="25" BorderThickness="0"
|
|
|
+ Command="{Binding DataContext.EditBeforeCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" CommandParameter="{Binding Id}" Cursor="Hand" Margin="0,0,10,0" >
|
|
|
+
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
+ <TextBlock Text="编辑" VerticalAlignment="Center" Foreground="Blue"/>
|
|
|
+ </StackPanel>
|
|
|
+ </Button>
|
|
|
+ <Button Width="auto" Background="Transparent" HorizontalContentAlignment ="Left" Foreground="Black" Height="25" BorderThickness="0"
|
|
|
+ Command="{Binding DataContext.DeleteBeforeCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" CommandParameter="{Binding Id}" Cursor="Hand" >
|
|
|
+
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
+ <TextBlock Text="删除" VerticalAlignment="Center" Foreground="Blue"/>
|
|
|
+ </StackPanel>
|
|
|
+ </Button>
|
|
|
+
|
|
|
+ </UniformGrid>
|
|
|
+ </DataTemplate>
|
|
|
+ </DataGridTemplateColumn.CellTemplate>
|
|
|
+ </DataGridTemplateColumn>
|
|
|
+
|
|
|
+ </DataGrid.Columns>
|
|
|
+
|
|
|
+ </DataGrid>
|
|
|
+
|
|
|
+ </Grid>
|
|
|
+ </Grid>
|
|
|
+ <Border Grid.Row="2" BorderBrush="#CBCBCB" BorderThickness="0,1,0,0" />
|
|
|
+ <Grid Grid.Row="3">
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
+ <ColumnDefinition Width="80"/>
|
|
|
+ <ColumnDefinition/>
|
|
|
+ <ColumnDefinition Width="1.3*"/>
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
+ <TextBlock Grid.Column="0" Text="结果项" Style="{StaticResource NormalTextBlockStyle}" TextAlignment="Center">
|
|
|
+ </TextBlock>
|
|
|
+ <Border Grid.Column="1" BorderBrush="#CBCBCB" BorderThickness="1,0" />
|
|
|
+ <Grid Grid.Column="1">
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition/>
|
|
|
+ <RowDefinition/>
|
|
|
+ <RowDefinition Height="2*"/>
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+ <Grid Grid.Row="0">
|
|
|
+ <StackPanel Orientation="Horizontal" >
|
|
|
+ <TextBlock Text="测试项类型:" Style="{StaticResource textBlockStyle}"/>
|
|
|
+ <ComboBox Height="28" Width="150" ItemsSource="{Binding OutJudgeKinds}" SelectedItem="{Binding SelectOutJudge}" />
|
|
|
+ </StackPanel>
|
|
|
+ </Grid>
|
|
|
+ <Grid Grid.Row="1" >
|
|
|
+ <StackPanel Orientation="Horizontal" >
|
|
|
+ <TextBlock Text="明细判定逻辑:" Style="{StaticResource textBlockStyle}"/>
|
|
|
+ <ComboBox Height="28" Width="150" ItemsSource="{Binding OutJudgeLogicKinds}" SelectedItem="{Binding OutSelectLogic}"/>
|
|
|
+ </StackPanel>
|
|
|
+ </Grid>
|
|
|
+ <Grid Grid.Row="2">
|
|
|
+ <DockPanel LastChildFill="True" >
|
|
|
+ <TextBlock Text="结果项描述:" Style="{StaticResource textBlockStyle}" />
|
|
|
+ <RichTextBox Margin="0,5,5,5" >
|
|
|
+ <FlowDocument>
|
|
|
+ <Paragraph>
|
|
|
+ <Run Text="{Binding OutDetail,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
|
|
|
+ </Paragraph>
|
|
|
+ </FlowDocument>
|
|
|
+
|
|
|
+ </RichTextBox>
|
|
|
+ </DockPanel>
|
|
|
+ </Grid>
|
|
|
+ </Grid>
|
|
|
+ <Grid Grid.Column="2" >
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition Height="30"/>
|
|
|
+ <RowDefinition/>
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+ <DockPanel LastChildFill="False">
|
|
|
+ <TextBlock Text="前置项明细:" Style="{StaticResource textBlockStyle}" />
|
|
|
+ <Button Content="新增" Height="22" Width="60" Margin="5,0" Command="{Binding AddDetailCommand}" CommandParameter="Out" Style="{StaticResource NormalButtonStyle}" DockPanel.Dock="Right" />
|
|
|
+ </DockPanel>
|
|
|
+ <DataGrid Grid.Row="1" ColumnWidth="*" AutoGenerateColumns="False" HeadersVisibility="All" CanUserAddRows="False" SelectionUnit="FullRow" SelectionMode="Single" RowHeaderWidth="0" HorizontalScrollBarVisibility="Disabled"
|
|
|
+ ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}" RowHeaderStyle="{StaticResource RowHeaderStyle}" RowStyle="{StaticResource DataGridRowtyle}" AlternationCount="2"
|
|
|
+ ItemsSource="{Binding OutConList}" IsReadOnly="True" >
|
|
|
+ <DataGrid.Columns >
|
|
|
+ <DataGridTextColumn Header="序号" Width="40" Binding="{Binding Id}" CellStyle="{StaticResource MyDataGridCellStyle}" />
|
|
|
+ <DataGridTextColumn Header="PLC地址" Binding="{Binding PlcAddress}" CellStyle="{StaticResource MyDataGridCellStyle}" />
|
|
|
+ <DataGridTextColumn Header="PLC变量名" Binding="{Binding PlcItem}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
|
|
|
+ <DataGridTextColumn Header="判定值" Binding="{Binding PlcValue}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
|
|
|
+ <DataGridTemplateColumn Header="操作" Width="160" CellStyle="{StaticResource MyDataGridCellStyle}">
|
|
|
+ <DataGridTemplateColumn.CellTemplate>
|
|
|
+ <DataTemplate>
|
|
|
+ <UniformGrid Columns="2">
|
|
|
+ <Button Width="auto" Background="Transparent" HorizontalContentAlignment ="Left" Foreground="Black" Height="25" BorderThickness="0"
|
|
|
+ Command="{Binding DataContext.EditBeforeCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" CommandParameter="{Binding Id}" Cursor="Hand" Margin="0,0,10,0" >
|
|
|
+
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
+ <TextBlock Text="编辑" VerticalAlignment="Center" Foreground="Blue"/>
|
|
|
+ </StackPanel>
|
|
|
+ </Button>
|
|
|
+ <Button Width="auto" Background="Transparent" HorizontalContentAlignment ="Left" Foreground="Black" Height="25" BorderThickness="0"
|
|
|
+ Command="{Binding DataContext.DeleteBeforeCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" CommandParameter="{Binding Id}" Cursor="Hand" >
|
|
|
+
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
+ <TextBlock Text="删除" VerticalAlignment="Center" Foreground="Blue"/>
|
|
|
+ </StackPanel>
|
|
|
+ </Button>
|
|
|
+
|
|
|
+ </UniformGrid>
|
|
|
+ </DataTemplate>
|
|
|
+ </DataGridTemplateColumn.CellTemplate>
|
|
|
+ </DataGridTemplateColumn>
|
|
|
+
|
|
|
+ </DataGrid.Columns>
|
|
|
+
|
|
|
+ </DataGrid>
|
|
|
+
|
|
|
+ </Grid>
|
|
|
+ </Grid>
|
|
|
+ <Border Grid.Row="3" BorderBrush="#CBCBCB" BorderThickness="0,1,0,0" />
|
|
|
+ </Grid>
|
|
|
+</UserControl>
|