2026-06-30 12:10:29 +08:00
|
|
|
|
<UserControl x:Class="SSPCTester.UI.Views.ProtectView"
|
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
2026-07-02 17:43:32 +08:00
|
|
|
|
xmlns:model="clr-namespace:SSPCTester.Logic.Models;assembly=SSPCTester.Logic"
|
2026-06-30 12:10:29 +08:00
|
|
|
|
xmlns:vm="clr-namespace:SSPCTester.UI.ViewModels"
|
|
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
|
|
mc:Ignorable="d"
|
|
|
|
|
|
d:DataContext="{d:DesignInstance Type=vm:ProtectViewModel}">
|
|
|
|
|
|
<Grid Margin="20">
|
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
|
<RowDefinition Height="3*" MinHeight="240" />
|
|
|
|
|
|
<RowDefinition Height="2*" MinHeight="200" />
|
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
|
|
|
|
|
|
<TextBlock Text="保护功能(覆盖指标 11/14/15/17/19/21/22/23)" FontSize="{StaticResource FsH1}" FontWeight="Bold" Margin="0,0,0,8" />
|
|
|
|
|
|
|
2026-07-02 17:43:32 +08:00
|
|
|
|
|
2026-06-30 12:10:29 +08:00
|
|
|
|
|
2026-07-02 17:43:32 +08:00
|
|
|
|
<Grid Grid.Row="2" Margin="0,12,0,0">
|
2026-06-30 12:10:29 +08:00
|
|
|
|
<Grid.ColumnDefinitions>
|
2026-07-02 17:43:32 +08:00
|
|
|
|
<ColumnDefinition Width="*" />
|
2026-06-30 12:10:29 +08:00
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
|
|
|
|
|
|
<Border Style="{StaticResource Card}" Margin="0,0,12,0">
|
|
|
|
|
|
<DockPanel>
|
2026-07-02 17:43:32 +08:00
|
|
|
|
<TextBlock DockPanel.Dock="Top" Style="{StaticResource CardTitle}" Text="测试记录" />
|
2026-07-02 21:38:25 +08:00
|
|
|
|
<DataGrid ItemsSource="{Binding Rows}" IsReadOnly="False">
|
2026-06-30 12:10:29 +08:00
|
|
|
|
<DataGrid.Columns>
|
2026-07-02 21:38:25 +08:00
|
|
|
|
<DataGridTextColumn Header="序号" Binding="{Binding Index}" Width="60" IsReadOnly="True" />
|
|
|
|
|
|
<DataGridTextColumn Header="保护类型" Binding="{Binding ProtectType}" Width="*" IsReadOnly="True" />
|
|
|
|
|
|
<DataGridTextColumn Header="触发条件" Binding="{Binding Trigger, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="2*" />
|
|
|
|
|
|
<DataGridTemplateColumn Header="实测值" Width="*">
|
|
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
|
<DockPanel LastChildFill="True">
|
|
|
|
|
|
<Button DockPanel.Dock="Right"
|
|
|
|
|
|
Content="测"
|
|
|
|
|
|
Width="30"
|
|
|
|
|
|
Height="24"
|
|
|
|
|
|
Padding="0"
|
|
|
|
|
|
Margin="6,0,0,0"
|
|
|
|
|
|
Command="{Binding DataContext.MeasurePowerCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
|
|
|
|
|
|
CommandParameter="{Binding}"
|
|
|
|
|
|
Visibility="{Binding CanMeasureFromPower, Converter={StaticResource BoolToVis}}" />
|
|
|
|
|
|
<TextBlock Text="{Binding MeasuredValue}"
|
|
|
|
|
|
Style="{StaticResource MonoText}"
|
|
|
|
|
|
VerticalAlignment="Center" />
|
|
|
|
|
|
</DockPanel>
|
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
<DataGridTemplateColumn.CellEditingTemplate>
|
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
|
<DockPanel LastChildFill="True">
|
|
|
|
|
|
<Button DockPanel.Dock="Right"
|
|
|
|
|
|
Content="测"
|
|
|
|
|
|
Width="30"
|
|
|
|
|
|
Height="24"
|
|
|
|
|
|
Padding="0"
|
|
|
|
|
|
Margin="6,0,0,0"
|
|
|
|
|
|
Command="{Binding DataContext.MeasurePowerCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
|
|
|
|
|
|
CommandParameter="{Binding}"
|
|
|
|
|
|
Visibility="{Binding CanMeasureFromPower, Converter={StaticResource BoolToVis}}" />
|
|
|
|
|
|
<TextBox Text="{Binding MeasuredValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
|
|
|
|
|
FontFamily="{StaticResource FontMono}"
|
|
|
|
|
|
VerticalContentAlignment="Center" />
|
|
|
|
|
|
</DockPanel>
|
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn.CellEditingTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn>
|
2026-07-02 17:43:32 +08:00
|
|
|
|
<DataGridTemplateColumn Header="判别模式" Width="120">
|
2026-06-30 12:10:29 +08:00
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
<DataTemplate>
|
2026-07-02 17:43:32 +08:00
|
|
|
|
<ComboBox SelectedValue="{Binding JudgeMode, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
|
|
|
|
|
SelectedValuePath="Content"
|
|
|
|
|
|
MinWidth="100">
|
|
|
|
|
|
<ComboBoxItem Content="人工判别" />
|
|
|
|
|
|
<ComboBoxItem Content="自动判别" />
|
|
|
|
|
|
</ComboBox>
|
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
<DataGridTemplateColumn Header="判别结果" Width="110">
|
|
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
|
<ComboBox SelectedValue="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
|
|
|
|
|
SelectedValuePath="Tag"
|
|
|
|
|
|
MinWidth="90">
|
|
|
|
|
|
<ComboBoxItem Content="合格" Tag="{x:Static model:TestStatus.Pass}" />
|
|
|
|
|
|
<ComboBoxItem Content="不合格" Tag="{x:Static model:TestStatus.Fail}" />
|
2026-07-02 21:38:25 +08:00
|
|
|
|
<ComboBoxItem Content="已测量" Tag="{x:Static model:TestStatus.Measured}" />
|
|
|
|
|
|
<ComboBoxItem Content="未判定" Tag="{x:Static model:TestStatus.Untested}" />
|
2026-07-02 17:43:32 +08:00
|
|
|
|
</ComboBox>
|
2026-06-30 12:10:29 +08:00
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
</DataGrid.Columns>
|
|
|
|
|
|
</DataGrid>
|
|
|
|
|
|
</DockPanel>
|
2026-07-02 17:43:32 +08:00
|
|
|
|
</Border>
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
|
|
<Grid Grid.Row="3" Margin="0,12,0,0">
|
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
|
2026-06-30 12:10:29 +08:00
|
|
|
|
|
2026-07-02 21:38:25 +08:00
|
|
|
|
<Border Grid.Column="0" Style="{StaticResource Card}" Padding="14">
|
2026-06-30 12:10:29 +08:00
|
|
|
|
<Grid>
|
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
<TextBlock Style="{StaticResource CardTitle}" Text="测试说明" />
|
|
|
|
|
|
<TextBox Grid.Row="1"
|
|
|
|
|
|
Text="{Binding Project.TestFunction.Protect, UpdateSourceTrigger=PropertyChanged}"
|
|
|
|
|
|
AcceptsReturn="True"
|
|
|
|
|
|
TextWrapping="Wrap"
|
|
|
|
|
|
VerticalScrollBarVisibility="Auto"
|
|
|
|
|
|
Height="Auto"
|
|
|
|
|
|
MinHeight="130"
|
|
|
|
|
|
Padding="8"
|
|
|
|
|
|
VerticalContentAlignment="Top" />
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
</Border>
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
</UserControl>
|