661 lines
42 KiB
XML
661 lines
42 KiB
XML
<Window x:Class="TabletTester2025.MainWindow"
|
||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||
xmlns:oxy="http://oxyplot.org/wpf"
|
||
xmlns:helpers="clr-namespace:TabletTester2025.Helpers"
|
||
Title="片剂四用仪 (中国药典2025)"
|
||
Width="1024"
|
||
MinHeight="768"
|
||
WindowState="Maximized"
|
||
WindowStartupLocation="CenterScreen"
|
||
Background="#EDF1F5">
|
||
<Window.Resources>
|
||
<helpers:BasketOffsetConverter x:Key="BasketOffsetConverter"/>
|
||
<helpers:PassToTextConverter x:Key="PassToTextConverter"/>
|
||
<helpers:BoolToColorConverter x:Key="BoolToColorConverter"/>
|
||
<helpers:StatusColorConverter x:Key="StatusColorConverter"/>
|
||
|
||
<DropShadowEffect x:Key="DropShadowLight" BlurRadius="6" ShadowDepth="1" Opacity="0.14"/>
|
||
|
||
<SolidColorBrush x:Key="PrimaryBrush" Color="#1565A9"/>
|
||
<SolidColorBrush x:Key="PanelBorderBrush" Color="#D8E1EC"/>
|
||
<SolidColorBrush x:Key="PanelBackgroundBrush" Color="#FFFFFF"/>
|
||
<SolidColorBrush x:Key="SubtleBackgroundBrush" Color="#F7FAFC"/>
|
||
<SolidColorBrush x:Key="LabelBrush" Color="#526273"/>
|
||
<SolidColorBrush x:Key="ValueBrush" Color="#102A43"/>
|
||
|
||
<Style TargetType="Button" x:Key="ActionButton">
|
||
<Setter Property="MinWidth" Value="112"/>
|
||
<Setter Property="Height" Value="42"/>
|
||
<Setter Property="Margin" Value="6"/>
|
||
<Setter Property="Padding" Value="14,0"/>
|
||
<Setter Property="Cursor" Value="Hand"/>
|
||
<Setter Property="Background" Value="{StaticResource PrimaryBrush}"/>
|
||
<Setter Property="Foreground" Value="White"/>
|
||
<Setter Property="BorderThickness" Value="0"/>
|
||
<Setter Property="FontSize" Value="15"/>
|
||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||
<Setter Property="Template">
|
||
<Setter.Value>
|
||
<ControlTemplate TargetType="Button">
|
||
<Border Background="{TemplateBinding Background}" CornerRadius="4" Padding="{TemplateBinding Padding}">
|
||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||
</Border>
|
||
<ControlTemplate.Triggers>
|
||
<Trigger Property="IsMouseOver" Value="True">
|
||
<Setter Property="Opacity" Value="0.9"/>
|
||
</Trigger>
|
||
<Trigger Property="IsPressed" Value="True">
|
||
<Setter Property="Opacity" Value="0.78"/>
|
||
</Trigger>
|
||
<Trigger Property="IsEnabled" Value="False">
|
||
<Setter Property="Opacity" Value="0.45"/>
|
||
</Trigger>
|
||
</ControlTemplate.Triggers>
|
||
</ControlTemplate>
|
||
</Setter.Value>
|
||
</Setter>
|
||
</Style>
|
||
|
||
<Style TargetType="Button" x:Key="StartButton" BasedOn="{StaticResource ActionButton}">
|
||
<Setter Property="Background" Value="#2E7D32"/>
|
||
</Style>
|
||
|
||
<Style TargetType="Button" x:Key="StopButton" BasedOn="{StaticResource ActionButton}">
|
||
<Setter Property="Background" Value="#C62828"/>
|
||
</Style>
|
||
|
||
<Style TargetType="Button" x:Key="ResetButton" BasedOn="{StaticResource ActionButton}">
|
||
<Setter Property="Background" Value="#687789"/>
|
||
</Style>
|
||
|
||
<Style TargetType="Button" x:Key="SecondaryButton" BasedOn="{StaticResource ActionButton}">
|
||
<Setter Property="Background" Value="#496579"/>
|
||
</Style>
|
||
|
||
<Style TargetType="TabControl">
|
||
<Setter Property="Background" Value="Transparent"/>
|
||
<Setter Property="BorderThickness" Value="0"/>
|
||
<Setter Property="Margin" Value="0"/>
|
||
</Style>
|
||
|
||
<Style TargetType="TabItem">
|
||
<Setter Property="FontSize" Value="16"/>
|
||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||
<Setter Property="Padding" Value="24,12"/>
|
||
<Setter Property="Foreground" Value="#465A6E"/>
|
||
<Setter Property="Template">
|
||
<Setter.Value>
|
||
<ControlTemplate TargetType="TabItem">
|
||
<Border x:Name="TabBorder"
|
||
Background="#F6F9FC"
|
||
BorderBrush="#D3DEEA"
|
||
BorderThickness="1,1,1,0"
|
||
CornerRadius="6,6,0,0"
|
||
Padding="{TemplateBinding Padding}"
|
||
Margin="0,0,6,0">
|
||
<ContentPresenter ContentSource="Header" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||
</Border>
|
||
<ControlTemplate.Triggers>
|
||
<Trigger Property="IsSelected" Value="True">
|
||
<Setter TargetName="TabBorder" Property="Background" Value="White"/>
|
||
<Setter TargetName="TabBorder" Property="BorderBrush" Value="{StaticResource PrimaryBrush}"/>
|
||
<Setter Property="Foreground" Value="#0F3D68"/>
|
||
</Trigger>
|
||
</ControlTemplate.Triggers>
|
||
</ControlTemplate>
|
||
</Setter.Value>
|
||
</Setter>
|
||
</Style>
|
||
|
||
<Style TargetType="GroupBox">
|
||
<Setter Property="BorderBrush" Value="{StaticResource PanelBorderBrush}"/>
|
||
<Setter Property="BorderThickness" Value="1"/>
|
||
<Setter Property="Padding" Value="14"/>
|
||
<Setter Property="Margin" Value="0,0,0,12"/>
|
||
<Setter Property="FontSize" Value="15"/>
|
||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||
<Setter Property="Background" Value="{StaticResource PanelBackgroundBrush}"/>
|
||
</Style>
|
||
|
||
<Style TargetType="TextBox">
|
||
<Setter Property="Width" Value="110"/>
|
||
<Setter Property="Height" Value="36"/>
|
||
<Setter Property="Padding" Value="8,2"/>
|
||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||
<Setter Property="BorderBrush" Value="#B7C4D2"/>
|
||
<Setter Property="BorderThickness" Value="1"/>
|
||
<Setter Property="FontSize" Value="15"/>
|
||
</Style>
|
||
|
||
<Style TargetType="RadioButton">
|
||
<Setter Property="FontSize" Value="15"/>
|
||
<Setter Property="Margin" Value="0,0,22,0"/>
|
||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||
</Style>
|
||
|
||
<Style TargetType="TextBlock" x:Key="ParamLabel">
|
||
<Setter Property="Width" Value="150"/>
|
||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||
<Setter Property="Foreground" Value="{StaticResource LabelBrush}"/>
|
||
<Setter Property="FontSize" Value="15"/>
|
||
<Setter Property="FontWeight" Value="Normal"/>
|
||
</Style>
|
||
|
||
<Style TargetType="StackPanel" x:Key="ParamRow">
|
||
<Setter Property="Orientation" Value="Horizontal"/>
|
||
<Setter Property="Margin" Value="0,6,26,6"/>
|
||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||
</Style>
|
||
|
||
<Style TargetType="Border" x:Key="MetricCard">
|
||
<Setter Property="Background" Value="{StaticResource SubtleBackgroundBrush}"/>
|
||
<Setter Property="BorderBrush" Value="#E0E7EF"/>
|
||
<Setter Property="BorderThickness" Value="1"/>
|
||
<Setter Property="CornerRadius" Value="6"/>
|
||
<Setter Property="Padding" Value="12,10"/>
|
||
<Setter Property="Margin" Value="6"/>
|
||
<Setter Property="MinHeight" Value="86"/>
|
||
</Style>
|
||
|
||
<Style TargetType="TextBlock" x:Key="MetricLabel">
|
||
<Setter Property="Foreground" Value="{StaticResource LabelBrush}"/>
|
||
<Setter Property="FontSize" Value="14"/>
|
||
<Setter Property="FontWeight" Value="Normal"/>
|
||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||
<Setter Property="TextAlignment" Value="Center"/>
|
||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||
</Style>
|
||
|
||
<Style TargetType="TextBlock" x:Key="MetricValue">
|
||
<Setter Property="Foreground" Value="{StaticResource ValueBrush}"/>
|
||
<Setter Property="FontSize" Value="26"/>
|
||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||
<Setter Property="TextAlignment" Value="Center"/>
|
||
<Setter Property="Margin" Value="0,8,0,0"/>
|
||
</Style>
|
||
|
||
<Style TargetType="WrapPanel" x:Key="CommandBar">
|
||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||
<Setter Property="Margin" Value="0,8,0,0"/>
|
||
</Style>
|
||
|
||
<Style TargetType="Border" x:Key="FooterItem">
|
||
<Setter Property="Background" Value="#F8FBFD"/>
|
||
<Setter Property="BorderBrush" Value="#DFE7EF"/>
|
||
<Setter Property="BorderThickness" Value="1"/>
|
||
<Setter Property="CornerRadius" Value="5"/>
|
||
<Setter Property="Padding" Value="12,7"/>
|
||
<Setter Property="MinHeight" Value="36"/>
|
||
</Style>
|
||
|
||
<Style TargetType="TextBlock" x:Key="FooterLabel">
|
||
<Setter Property="Foreground" Value="#647487"/>
|
||
<Setter Property="FontSize" Value="13"/>
|
||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||
</Style>
|
||
|
||
<Style TargetType="TextBlock" x:Key="FooterValue">
|
||
<Setter Property="Foreground" Value="#102A43"/>
|
||
<Setter Property="FontSize" Value="14"/>
|
||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||
</Style>
|
||
|
||
<DataTemplate x:Key="StationCardTemplate">
|
||
<Border BorderBrush="{StaticResource PanelBorderBrush}"
|
||
BorderThickness="1"
|
||
CornerRadius="8"
|
||
Padding="12"
|
||
Background="White"
|
||
Effect="{StaticResource DropShadowLight}">
|
||
<Grid>
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="*"/>
|
||
</Grid.RowDefinitions>
|
||
|
||
<TextBlock Text="{Binding LocalAlarm}"
|
||
FontSize="15"
|
||
FontWeight="SemiBold"
|
||
Margin="0,0,0,8"
|
||
HorizontalAlignment="Center">
|
||
<TextBlock.Style>
|
||
<Style TargetType="TextBlock">
|
||
<Setter Property="Foreground" Value="#C62828"/>
|
||
<Setter Property="Visibility" Value="Visible"/>
|
||
<Style.Triggers>
|
||
<DataTrigger Binding="{Binding LocalAlarm}" Value="{x:Null}">
|
||
<Setter Property="Visibility" Value="Collapsed"/>
|
||
</DataTrigger>
|
||
<DataTrigger Binding="{Binding LocalAlarm}" Value="">
|
||
<Setter Property="Visibility" Value="Collapsed"/>
|
||
</DataTrigger>
|
||
<DataTrigger Binding="{Binding LocalAlarm}" Value="硬度测试合格">
|
||
<Setter Property="Foreground" Value="#2E7D32"/>
|
||
</DataTrigger>
|
||
<DataTrigger Binding="{Binding LocalAlarm}" Value="脆碎度测试合格">
|
||
<Setter Property="Foreground" Value="#2E7D32"/>
|
||
</DataTrigger>
|
||
<DataTrigger Binding="{Binding LocalAlarm}" Value="崩解测试合格">
|
||
<Setter Property="Foreground" Value="#2E7D32"/>
|
||
</DataTrigger>
|
||
<DataTrigger Binding="{Binding LocalAlarm}" Value="溶出测试合格">
|
||
<Setter Property="Foreground" Value="#2E7D32"/>
|
||
</DataTrigger>
|
||
<DataTrigger Binding="{Binding LocalAlarm}" Value="溶出1测试合格">
|
||
<Setter Property="Foreground" Value="#2E7D32"/>
|
||
</DataTrigger>
|
||
<DataTrigger Binding="{Binding LocalAlarm}" Value="溶出2测试合格">
|
||
<Setter Property="Foreground" Value="#2E7D32"/>
|
||
</DataTrigger>
|
||
</Style.Triggers>
|
||
</Style>
|
||
</TextBlock.Style>
|
||
</TextBlock>
|
||
|
||
<TabControl Grid.Row="1" FontSize="13" BorderThickness="0">
|
||
<TabItem Header="硬度测试">
|
||
<Grid Margin="4,14,4,4">
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="*"/>
|
||
<RowDefinition Height="Auto"/>
|
||
</Grid.RowDefinitions>
|
||
|
||
<GroupBox Header="测试参数设置" Grid.Row="0" Margin="0,5">
|
||
<UniformGrid Columns="2" Rows="2" Margin="10">
|
||
|
||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,10,0,0" >
|
||
<TextBlock Text="测试次数" Width="180" VerticalAlignment="Center"/>
|
||
<TextBox Text="{Binding HardnessTestCount, UpdateSourceTrigger=PropertyChanged}" Width="120" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,10,0,0" >
|
||
<TextBlock Text="硬度速度输入(mm/min)" Width="180" VerticalAlignment="Center"/>
|
||
<TextBox Text="{Binding HardnessSudu, UpdateSourceTrigger=PropertyChanged}" Width="120" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,10,0,0">
|
||
<TextBlock Text="硬度位移输入(mm)" Width="180" VerticalAlignment="Center"/>
|
||
<TextBox Text="{Binding HardnessWeiyi, UpdateSourceTrigger=PropertyChanged}" Width="120" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,10,0,0">
|
||
<TextBlock Text="硬度破损判定输入(N)" Width="180" VerticalAlignment="Center"/>
|
||
<TextBox Text="{Binding HardnessPoSun, UpdateSourceTrigger=PropertyChanged}" Width="120" />
|
||
</StackPanel>
|
||
</UniformGrid>
|
||
</GroupBox>
|
||
|
||
<Grid Grid.Row="1">
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
</Grid.RowDefinitions>
|
||
|
||
<GroupBox Header="测试结果" Grid.Row="0">
|
||
<UniformGrid Columns="3">
|
||
<Border Style="{StaticResource MetricCard}">
|
||
<StackPanel>
|
||
<TextBlock Text="最大值(N)" Style="{StaticResource MetricLabel}"/>
|
||
<TextBlock Text="{Binding HardnessMax, StringFormat=F1}" Foreground="#1565C0" Style="{StaticResource MetricValue}"/>
|
||
</StackPanel>
|
||
</Border>
|
||
<Border Style="{StaticResource MetricCard}">
|
||
<StackPanel>
|
||
<TextBlock Text="最小值(N)" Style="{StaticResource MetricLabel}"/>
|
||
<TextBlock Text="{Binding HardnessMin, StringFormat=F1}" Foreground="#1565C0" Style="{StaticResource MetricValue}"/>
|
||
</StackPanel>
|
||
</Border>
|
||
<Border Style="{StaticResource MetricCard}">
|
||
<StackPanel>
|
||
<TextBlock Text="平均值(N)" Style="{StaticResource MetricLabel}"/>
|
||
<TextBlock Text="{Binding HardnessAvg, StringFormat=F1}" Foreground="#2E7D32" Style="{StaticResource MetricValue}"/>
|
||
</StackPanel>
|
||
</Border>
|
||
</UniformGrid>
|
||
</GroupBox>
|
||
|
||
<GroupBox Header="参数状态显示" Grid.Row="1">
|
||
<UniformGrid Columns="2">
|
||
<Border Style="{StaticResource MetricCard}">
|
||
<StackPanel>
|
||
<TextBlock Text="试验次数" Style="{StaticResource MetricLabel}"/>
|
||
<TextBlock Text="{Binding HardnessCurrentCount, StringFormat=F0}" Style="{StaticResource MetricValue}"/>
|
||
</StackPanel>
|
||
</Border>
|
||
<Border Style="{StaticResource MetricCard}">
|
||
<StackPanel>
|
||
<TextBlock Text="测试力值(N)" Style="{StaticResource MetricLabel}"/>
|
||
<TextBlock Text="{Binding HardnessValue, StringFormat=F1}" Foreground="#D98200" Style="{StaticResource MetricValue}"/>
|
||
</StackPanel>
|
||
</Border>
|
||
</UniformGrid>
|
||
</GroupBox>
|
||
</Grid>
|
||
|
||
<WrapPanel Grid.Row="2" Style="{StaticResource CommandBar}">
|
||
<Button Command="{Binding HardnessResetCommand}" Content="复位" Style="{StaticResource ResetButton}"/>
|
||
<Button Command="{Binding HardnessForward}" Content="前进" Style="{StaticResource ActionButton}" Background="#607D8B"/>
|
||
<Button Command="{Binding HardnessBack}" Content="后退" Style="{StaticResource ActionButton}" Background="#607D8B"/>
|
||
<Button Command="{Binding StartHardnessCommand}" Content="启动测试" Style="{StaticResource StartButton}"/>
|
||
<Button Command="{Binding StopHardnessCommand}" Content="测试停止" Style="{StaticResource StopButton}"/>
|
||
</WrapPanel>
|
||
</Grid>
|
||
</TabItem>
|
||
|
||
<TabItem Header="脆碎度测试">
|
||
<Grid Margin="4,14,4,4">
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="*"/>
|
||
<RowDefinition Height="Auto"/>
|
||
</Grid.RowDefinitions>
|
||
|
||
<GroupBox Header="测试参数设置" Grid.Row="0">
|
||
<WrapPanel>
|
||
<StackPanel Style="{StaticResource ParamRow}">
|
||
<TextBlock Text="转速设置(r/min):" Style="{StaticResource ParamLabel}"/>
|
||
<TextBox Text="{Binding FriabilityTargetRpm, UpdateSourceTrigger=PropertyChanged}"/>
|
||
</StackPanel>
|
||
<StackPanel Style="{StaticResource ParamRow}">
|
||
<TextBlock Text="转数设置(秒):" Style="{StaticResource ParamLabel}"/>
|
||
<TextBox Text="{Binding FriabilityTargetTimeSec, UpdateSourceTrigger=PropertyChanged}"/>
|
||
</StackPanel>
|
||
<StackPanel Style="{StaticResource ParamRow}">
|
||
<TextBlock Text="方向:" Style="{StaticResource ParamLabel}"/>
|
||
<RadioButton Content="顺时针" IsChecked="{Binding FriabilityClockwise}"/>
|
||
<RadioButton Content="逆时针" IsChecked="{Binding FriabilityCounterClockwise}"/>
|
||
</StackPanel>
|
||
</WrapPanel>
|
||
</GroupBox>
|
||
|
||
<GroupBox Header="参数状态显示" Grid.Row="1">
|
||
<UniformGrid Columns="2">
|
||
<Border Style="{StaticResource MetricCard}">
|
||
<StackPanel>
|
||
<TextBlock Text="转速显示(r/min)" Style="{StaticResource MetricLabel}"/>
|
||
<TextBlock Text="{Binding FriabilityCurrentRpm, StringFormat=F1}" Style="{StaticResource MetricValue}"/>
|
||
</StackPanel>
|
||
</Border>
|
||
<Border Style="{StaticResource MetricCard}">
|
||
<StackPanel>
|
||
<TextBlock Text="剩余圈数" Style="{StaticResource MetricLabel}"/>
|
||
<TextBlock Text="{Binding FriabilityRemainingRounds}" Foreground="#1565C0" Style="{StaticResource MetricValue}"/>
|
||
</StackPanel>
|
||
</Border>
|
||
</UniformGrid>
|
||
</GroupBox>
|
||
|
||
<WrapPanel Grid.Row="2" Style="{StaticResource CommandBar}">
|
||
<Button Command="{Binding StartFriabilityCommand}" Content="开始" Style="{StaticResource StartButton}"/>
|
||
<Button Command="{Binding StopFriabilityCommand}" Content="停止" Style="{StaticResource StopButton}"/>
|
||
<Button Command="{Binding ResetFriabilityCommand}" Content="复位" Style="{StaticResource ResetButton}"/>
|
||
</WrapPanel>
|
||
</Grid>
|
||
</TabItem>
|
||
|
||
<TabItem Header="溶出度">
|
||
<Grid Margin="4,14,4,4">
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="*"/>
|
||
<RowDefinition Height="Auto"/>
|
||
</Grid.RowDefinitions>
|
||
|
||
<ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Auto">
|
||
<Grid>
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
</Grid.RowDefinitions>
|
||
|
||
<GroupBox Header="测试参数设置" Grid.Row="0">
|
||
<WrapPanel>
|
||
<StackPanel Style="{StaticResource ParamRow}">
|
||
<TextBlock Text="溶出1时间(min):" Style="{StaticResource ParamLabel}"/>
|
||
<TextBox Text="{Binding Dissolution1TimeMin, UpdateSourceTrigger=PropertyChanged}"/>
|
||
</StackPanel>
|
||
<StackPanel Style="{StaticResource ParamRow}">
|
||
<TextBlock Text="溶出2时间(min):" Style="{StaticResource ParamLabel}"/>
|
||
<TextBox Text="{Binding Dissolution2TimeMin, UpdateSourceTrigger=PropertyChanged}"/>
|
||
</StackPanel>
|
||
<StackPanel Style="{StaticResource ParamRow}">
|
||
<TextBlock Text="溶出1间隔取样时间(min):" Style="{StaticResource ParamLabel}"/>
|
||
<TextBox Text="{Binding Dissolution1SampleIntervalMin, UpdateSourceTrigger=PropertyChanged}"/>
|
||
</StackPanel>
|
||
<StackPanel Style="{StaticResource ParamRow}">
|
||
<TextBlock Text="溶出2间隔取样时间(min):" Style="{StaticResource ParamLabel}"/>
|
||
<TextBox Text="{Binding Dissolution2SampleIntervalMin, UpdateSourceTrigger=PropertyChanged}"/>
|
||
</StackPanel>
|
||
</WrapPanel>
|
||
</GroupBox>
|
||
|
||
<GroupBox Header="测试状态显示" Grid.Row="1">
|
||
<UniformGrid Columns="5">
|
||
<Border Style="{StaticResource MetricCard}">
|
||
<StackPanel>
|
||
<TextBlock Text="水浴温度显示(℃)" Style="{StaticResource MetricLabel}"/>
|
||
<TextBlock Text="{Binding DisintegrationTemp, StringFormat=F1}" Foreground="#C2185B" Style="{StaticResource MetricValue}"/>
|
||
</StackPanel>
|
||
</Border>
|
||
<Border Style="{StaticResource MetricCard}">
|
||
<StackPanel>
|
||
<TextBlock Text="试验运行时间(min)" Style="{StaticResource MetricLabel}"/>
|
||
<TextBlock Text="{Binding DissolutionElapsedTime, StringFormat=F1}" Style="{StaticResource MetricValue}"/>
|
||
</StackPanel>
|
||
</Border>
|
||
<Border Style="{StaticResource MetricCard}">
|
||
<StackPanel>
|
||
<TextBlock Text="取样倒计时(min)" Style="{StaticResource MetricLabel}"/>
|
||
<TextBlock Text="{Binding DissolutionCountdown, StringFormat=F1}" Foreground="#D98200" Style="{StaticResource MetricValue}"/>
|
||
</StackPanel>
|
||
</Border>
|
||
<Border Style="{StaticResource MetricCard}">
|
||
<StackPanel>
|
||
<TextBlock Text="溶出1溶出度(%)" Style="{StaticResource MetricLabel}"/>
|
||
<TextBlock Text="{Binding Dissolution1Percent, StringFormat=F1}" Foreground="#2E7D32" Style="{StaticResource MetricValue}"/>
|
||
</StackPanel>
|
||
</Border>
|
||
<Border Style="{StaticResource MetricCard}">
|
||
<StackPanel>
|
||
<TextBlock Text="溶出2溶出度(%)" Style="{StaticResource MetricLabel}"/>
|
||
<TextBlock Text="{Binding Dissolution2Percent, StringFormat=F1}" Foreground="#1565C0" Style="{StaticResource MetricValue}"/>
|
||
</StackPanel>
|
||
</Border>
|
||
</UniformGrid>
|
||
</GroupBox>
|
||
|
||
<GroupBox Header="溶出双曲线和R²值" Grid.Row="2">
|
||
<Grid>
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="240"/>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="Auto"/>
|
||
</Grid.RowDefinitions>
|
||
<oxy:PlotView Grid.Row="0" Model="{Binding DissolutionPlotModel}" Margin="4"/>
|
||
<WrapPanel Grid.Row="1" Margin="4,8,4,2">
|
||
<TextBlock Text="{Binding Dissolution1RSquared, StringFormat='溶出1 R² = {0:F4}'}"
|
||
FontSize="15"
|
||
FontWeight="SemiBold"
|
||
Foreground="#2E7D32"
|
||
Margin="0,0,28,0"/>
|
||
<TextBlock Text="{Binding Dissolution2RSquared, StringFormat='溶出2 R² = {0:F4}'}"
|
||
FontSize="15"
|
||
FontWeight="SemiBold"
|
||
Foreground="#1565C0"/>
|
||
</WrapPanel>
|
||
<TextBlock Grid.Row="2"
|
||
Text="{Binding DissolutionCurveStatus}"
|
||
Foreground="#C62828"
|
||
FontWeight="SemiBold"
|
||
Margin="4,4,4,0"
|
||
TextWrapping="Wrap"/>
|
||
</Grid>
|
||
</GroupBox>
|
||
</Grid>
|
||
</ScrollViewer>
|
||
|
||
<WrapPanel Grid.Row="1" Style="{StaticResource CommandBar}">
|
||
<Button Command="{Binding StartDissolution1Command}" Content="溶出1开始" Style="{StaticResource StartButton}"/>
|
||
<Button Command="{Binding StopDissolution1Command}" Content="溶出1停止" Style="{StaticResource StopButton}"/>
|
||
<Button Command="{Binding ResetDissolution1Command}" Content="溶出1复位" Style="{StaticResource ResetButton}"/>
|
||
<Button Command="{Binding StartDissolution2Command}" Content="溶出2开始" Style="{StaticResource StartButton}"/>
|
||
<Button Command="{Binding StopDissolution2Command}" Content="溶出2停止" Style="{StaticResource StopButton}"/>
|
||
<Button Command="{Binding ResetDissolution2Command}" Content="溶出2复位" Style="{StaticResource ResetButton}"/>
|
||
</WrapPanel>
|
||
</Grid>
|
||
</TabItem>
|
||
|
||
<TabItem Header="崩解时限">
|
||
<Grid Margin="4,14,4,4">
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="*"/>
|
||
<RowDefinition Height="Auto"/>
|
||
</Grid.RowDefinitions>
|
||
|
||
<GroupBox Header="测试参数设置" Grid.Row="0">
|
||
<WrapPanel>
|
||
<StackPanel Style="{StaticResource ParamRow}">
|
||
<TextBlock Text="崩速度(r/min):" Style="{StaticResource ParamLabel}"/>
|
||
<TextBox Text="{Binding DisintegrationSpeedRpm, UpdateSourceTrigger=PropertyChanged}"/>
|
||
</StackPanel>
|
||
<StackPanel Style="{StaticResource ParamRow}">
|
||
<TextBlock Text="崩解时间(min):" Style="{StaticResource ParamLabel}"/>
|
||
<TextBox Text="{Binding DisintegrationTimeMin, UpdateSourceTrigger=PropertyChanged}"/>
|
||
</StackPanel>
|
||
</WrapPanel>
|
||
</GroupBox>
|
||
|
||
<GroupBox Header="测试状态显示" Grid.Row="1">
|
||
<UniformGrid Columns="3">
|
||
<Border Style="{StaticResource MetricCard}">
|
||
<StackPanel>
|
||
<TextBlock Text="水浴温度显示(℃)" Style="{StaticResource MetricLabel}"/>
|
||
<TextBlock Text="{Binding DisintegrationTemp, StringFormat=F1}" Foreground="#C2185B" Style="{StaticResource MetricValue}"/>
|
||
</StackPanel>
|
||
</Border>
|
||
<Border Style="{StaticResource MetricCard}">
|
||
<StackPanel>
|
||
<TextBlock Text="试验运行时间(秒)" Style="{StaticResource MetricLabel}"/>
|
||
<TextBlock Text="{Binding DisintegrationSeconds}" Style="{StaticResource MetricValue}"/>
|
||
</StackPanel>
|
||
</Border>
|
||
<Border Style="{StaticResource MetricCard}">
|
||
<StackPanel>
|
||
<TextBlock Text="剩余未崩解管数" Style="{StaticResource MetricLabel}"/>
|
||
<TextBlock Text="{Binding RemainingTubes}" Foreground="#C62828" Style="{StaticResource MetricValue}"/>
|
||
</StackPanel>
|
||
</Border>
|
||
</UniformGrid>
|
||
</GroupBox>
|
||
|
||
<WrapPanel Grid.Row="2" Style="{StaticResource CommandBar}">
|
||
<Button Command="{Binding StartDisintegrationCommand}" Content="开始" Style="{StaticResource StartButton}"/>
|
||
<Button Command="{Binding StopDisintegrationCommand}" Content="停止" Style="{StaticResource StopButton}"/>
|
||
<Button Command="{Binding ResetDisintegrationCommand}" Content="复位" Style="{StaticResource ResetButton}"/>
|
||
</WrapPanel>
|
||
</Grid>
|
||
</TabItem>
|
||
</TabControl>
|
||
</Grid>
|
||
</Border>
|
||
</DataTemplate>
|
||
</Window.Resources>
|
||
|
||
<Grid Margin="10">
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="Auto"/>
|
||
<RowDefinition Height="*"/>
|
||
<RowDefinition Height="Auto"/>
|
||
</Grid.RowDefinitions>
|
||
|
||
<Border Background="#0F3D68" CornerRadius="6" Margin="0,0,0,8" Padding="12,10">
|
||
<Grid>
|
||
<TextBlock Text="片剂四用仪 硬度 · 脆碎度 · 溶出 · 崩解"
|
||
FontSize="22"
|
||
FontWeight="Bold"
|
||
Foreground="White"
|
||
VerticalAlignment="Center"/>
|
||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
|
||
<Button Command="{Binding OpenHistoryCommand}" Content="历史记录" Style="{StaticResource ActionButton}"/>
|
||
|
||
<Button Command="{Binding ExportAllCommand}" Content="导出报告" Style="{StaticResource ActionButton}"/>
|
||
</StackPanel>
|
||
</Grid>
|
||
</Border>
|
||
|
||
<ContentControl Grid.Row="1"
|
||
Margin="0,0,0,16"
|
||
HorizontalContentAlignment="Stretch"
|
||
VerticalContentAlignment="Stretch"
|
||
Content="{Binding Tester}"
|
||
ContentTemplate="{StaticResource StationCardTemplate}"/>
|
||
|
||
<Border Grid.Row="2"
|
||
Background="#FFFFFF"
|
||
BorderBrush="#DCE5EE"
|
||
BorderThickness="1"
|
||
CornerRadius="6"
|
||
Padding="8">
|
||
<Grid>
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="Auto"/>
|
||
<ColumnDefinition Width="Auto"/>
|
||
<ColumnDefinition Width="*"/>
|
||
<ColumnDefinition Width="Auto"/>
|
||
</Grid.ColumnDefinitions>
|
||
|
||
<Border Grid.Column="0" Style="{StaticResource FooterItem}" Margin="0,0,8,0">
|
||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||
<Ellipse Width="10"
|
||
Height="10"
|
||
Fill="{Binding PlcStatus, Converter={StaticResource StatusColorConverter}}"
|
||
Margin="0,0,8,0"/>
|
||
<TextBlock Text="PLC" Style="{StaticResource FooterLabel}" Margin="0,0,8,0"/>
|
||
<TextBlock Text="{Binding PlcStatus}" Style="{StaticResource FooterValue}"/>
|
||
</StackPanel>
|
||
</Border>
|
||
|
||
<Border Grid.Column="1" Style="{StaticResource FooterItem}" Margin="0,0,8,0">
|
||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||
<TextBlock Text="当前时间" Style="{StaticResource FooterLabel}" Margin="0,0,8,0"/>
|
||
<TextBlock Text="{Binding CurrentTime}" Style="{StaticResource FooterValue}"/>
|
||
</StackPanel>
|
||
</Border>
|
||
|
||
<Border Grid.Column="2" Style="{StaticResource FooterItem}">
|
||
<Grid>
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="Auto"/>
|
||
<ColumnDefinition Width="*"/>
|
||
</Grid.ColumnDefinitions>
|
||
<TextBlock Text="报警"
|
||
Style="{StaticResource FooterLabel}"
|
||
Foreground="#B33A3A"
|
||
Margin="0,0,8,0"/>
|
||
<TextBlock Grid.Column="1"
|
||
Text="{Binding GlobalAlarm}"
|
||
Foreground="#C62828"
|
||
FontSize="14"
|
||
FontWeight="SemiBold"
|
||
VerticalAlignment="Center"
|
||
TextTrimming="CharacterEllipsis"/>
|
||
</Grid>
|
||
</Border>
|
||
|
||
<Button Grid.Column="3"
|
||
Background="Transparent"
|
||
BorderThickness="0"
|
||
Opacity="0"
|
||
Width="18"
|
||
Height="18"
|
||
Margin="8,0,0,0"
|
||
Command="{Binding ShowDataCommand}"/>
|
||
</Grid>
|
||
</Border>
|
||
</Grid>
|
||
</Window>
|