Files
Sleep-Multi-functionality/Window5.xaml

412 lines
21 KiB
Plaintext
Raw Normal View History

2026-05-04 14:46:58 +08:00
<Window x:Class="ShanghaiEnvironmentalTechnology.Window5"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
2026-05-11 19:06:26 +08:00
Title="{DynamicResource test}" WindowState="Maximized" Height="768" Width="1024"
2026-05-04 14:46:58 +08:00
Loaded="Window_Loaded"
Background="#F5F7FA" WindowStartupLocation="CenterScreen">
<Window.Resources>
<Style x:Key="MyButtonStyle" TargetType="Button">
<Setter Property="Background" Value="#4A90E2"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="Padding" Value="8,4"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="100"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="15">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#3A7BBE"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#2A5E9A"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="MyTextBoxStyle" TargetType="TextBox">
<Setter Property="Background" Value="#FFFFFF"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="BorderBrush" Value="#4A90E2"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="5,5"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="80"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="15">
<ScrollViewer x:Name="PART_ContentHost"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SectionTitleStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="16"/>
<Setter Property="FontWeight" Value="Medium"/>
<Setter Property="Foreground" Value="#333333"/>
<Setter Property="Margin" Value="0,0,0,10"/>
<Setter Property="Padding" Value="5"/>
<Setter Property="Background" Value="#E8F4FF"/>
<!-- 浅蓝背景强化分区 -->
</Style>
<Style x:Key="ParamLabelStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="14"/>
<Setter Property="Foreground" Value="#666666"/>
<Setter Property="VerticalAlignment" Value="Center"/>
2026-05-08 15:37:46 +08:00
<Setter Property="Width" Value="130"/>
2026-05-04 14:46:58 +08:00
<!-- 固定宽度,对齐更整齐 -->
<Setter Property="Margin" Value="5,0"/>
</Style>
<Style x:Key="MonitorLabelStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontWeight" Value="Medium"/>
<Setter Property="Foreground" Value="#333333"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="10,0"/>
</Style>
<!-- 监测数据文本框(区分只读状态) -->
<Style x:Key="MonitorTextBoxStyle" TargetType="TextBox" BasedOn="{StaticResource MyTextBoxStyle}">
<Setter Property="IsReadOnly" Value="True"/>
<Setter Property="Background" Value="#F0F7FF"/>
<!-- 浅蓝背景区分只读数据 -->
<Setter Property="Width" Value="100"/>
<!-- 监测数据框稍宽,更易读 -->
<Setter Property="BorderBrush" Value="#99C2FF"/>
</Style>
</Window.Resources>
<!-- 主布局DockPanel分区避免元素重叠 -->
<DockPanel Margin="15">
<!-- 1. 顶部标题区(突出显示) -->
2026-05-11 19:06:26 +08:00
<!--<Border DockPanel.Dock="Top" Height="60" Background="#4A90E2" CornerRadius="8" Margin="0,0,0,15">
2026-05-08 15:37:46 +08:00
<TextBlock Text="{DynamicResource test}"
2026-05-04 14:46:58 +08:00
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="24"
Foreground="White"
FontWeight="Medium"/>
2026-05-11 19:06:26 +08:00
</Border>-->
<!-- 1. 顶部标题区(突出显示 + 左上角下拉框) -->
<Border DockPanel.Dock="Top" Height="60" Background="#4A90E2" CornerRadius="8" Margin="0,0,0,15">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<!-- 下拉框 -->
<ColumnDefinition Width="*"/>
<!-- 居中标题 -->
<ColumnDefinition Width="Auto"/>
<!-- 右侧留白占位,保持对称 -->
</Grid.ColumnDefinitions>
<!-- 左上角下拉框 -->
<ComboBox Grid.Column="0"
Width="120"
Height="30"
VerticalAlignment="Center"
Margin="15,0,0,0"
Background="White" SelectionChanged="CaptureModeComboBox_SelectionChanged">
<ComboBoxItem Content="YY0671" IsSelected="True"/>
<ComboBoxItem Content="{DynamicResource customize}" />
2026-05-04 14:46:58 +08:00
2026-05-11 19:06:26 +08:00
</ComboBox>
<!-- 标题依然居中 -->
<TextBlock Grid.Column="1"
Text="{DynamicResource test}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="24"
Foreground="White"
FontWeight="Medium"/>
<!-- 右侧留空(保证标题居中视觉效果) -->
<Rectangle Grid.Column="2" Width="120" Visibility="Hidden"/>
</Grid>
</Border>
2026-05-04 14:46:58 +08:00
<!-- 2. 底部操作与导航区(聚合功能按钮) -->
<Border DockPanel.Dock="Bottom" Height="120" Background="White"
BorderBrush="#E0E0E0" BorderThickness="1"
CornerRadius="8" Margin="0,15,0,0">
<StackPanel>
<!-- 测试核心操作按钮(按重要性区分颜色) -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,10,0,5">
2026-05-08 15:37:46 +08:00
<Button Name="ResetBtn" Content="{DynamicResource test19}" Style="{StaticResource MyButtonStyle}"
2026-05-04 14:46:58 +08:00
Background="#F5A623" Click="Button_Click_10"/>
<!-- 橙色:警示性操作 -->
2026-05-08 15:37:46 +08:00
<Button Name="TestStartButton" Content="{DynamicResource test20}" Style="{StaticResource MyButtonStyle}"
2026-05-04 14:46:58 +08:00
Background="#52C41A" Click="Button_Click_11"/>
<!-- 绿色:正向操作 -->
2026-05-08 15:37:46 +08:00
<Button Content="{DynamicResource test21}" Style="{StaticResource MyButtonStyle}"
2026-05-04 14:46:58 +08:00
Background="#FF4D4F" Click="Button_Click_12"/>
2026-05-08 15:37:46 +08:00
<Button Name="addPaBtn" Content="{DynamicResource test22}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_16" Width="109"/>
2026-05-04 14:46:58 +08:00
<!-- 红色:停止操作 -->
2026-05-08 15:37:46 +08:00
<Button Content="{DynamicResource test23}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_13" Width="111"/>
<Button Content="{DynamicResource test24}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_14" Width="138"/>
2026-05-04 14:46:58 +08:00
</StackPanel>
<!-- 导航按钮(统一放置底部) -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,5">
2026-05-08 15:37:46 +08:00
<Button Content="{DynamicResource test25}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_4"/>
<Button Content="{DynamicResource test26}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_6"/>
<Button Content="{DynamicResource test27}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_7" Width="125"/>
<Button Content="{DynamicResource test28}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_8" Width="115"/>
<Button Content="{DynamicResource test29}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_9" Width="127"/>
2026-05-04 14:46:58 +08:00
</StackPanel>
</StackPanel>
</Border>
<!-- 3. 中间内容区:左右分栏(设置+监测) -->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<!-- 左侧:参数设置区 -->
<ColumnDefinition Width="1*"/>
<!-- 右侧:实时监测区 -->
</Grid.ColumnDefinitions>
<!-- 左侧:参数设置区(聚合可配置项) -->
<Border Grid.Column="0" Background="White"
BorderBrush="#E0E0E0" BorderThickness="1"
CornerRadius="8" Margin="0,0,10,0" Padding="15">
<StackPanel>
<!-- 3.1.1 呼吸参数设置(核心配置项) -->
2026-05-08 15:37:46 +08:00
<TextBlock Text="{DynamicResource test111}" Style="{StaticResource SectionTitleStyle}"/>
2026-05-04 14:46:58 +08:00
<StackPanel Margin="0,0,0,20" HorizontalAlignment="Center">
2026-05-08 15:37:46 +08:00
<Grid Width="459">
2026-05-04 14:46:58 +08:00
<Grid.ColumnDefinitions>
2026-05-08 15:37:46 +08:00
<ColumnDefinition Width="142"/>
2026-05-04 14:46:58 +08:00
2026-05-08 15:37:46 +08:00
<ColumnDefinition/>
2026-05-04 14:46:58 +08:00
2026-05-08 15:37:46 +08:00
<ColumnDefinition Width="69"/>
2026-05-04 14:46:58 +08:00
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="60"/>
<RowDefinition Height="60"/>
<RowDefinition Height="60"/>
<RowDefinition Height="60"/>
</Grid.RowDefinitions>
2026-05-08 15:37:46 +08:00
<TextBlock Grid.Column="0"
Text="{DynamicResource test1}"
2026-05-04 14:46:58 +08:00
Style="{StaticResource ParamLabelStyle}"
2026-05-08 15:37:46 +08:00
TextAlignment="Left" Height="18" Margin="10,0,2,0"/>
2026-05-04 14:46:58 +08:00
2026-05-08 15:37:46 +08:00
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" Height="30">
2026-05-04 14:46:58 +08:00
<TextBox Name="OutTxt"
Style="{StaticResource MyTextBoxStyle}"
Width="45"
PreviewTextInput="NumberPreviewTextInput"
IsReadOnly="True"/>
2026-05-09 10:30:14 +08:00
<Button Name="btn1" Content="{DynamicResource test2}"
2026-05-04 14:46:58 +08:00
Style="{StaticResource MyButtonStyle}"
2026-05-08 15:37:46 +08:00
Width="61"
2026-05-04 14:46:58 +08:00
Margin="5,0"
Click="Button_Click_17"/>
<TextBlock Text=": " VerticalAlignment="Center" Margin="5,0"/>
<TextBox Name="InTxt"
Style="{StaticResource MyTextBoxStyle}"
Width="45"
PreviewTextInput="NumberPreviewTextInput"
IsReadOnly="True"/>
2026-05-09 10:30:14 +08:00
<Button Name="btn2" Content="{DynamicResource test2}"
2026-05-04 14:46:58 +08:00
Style="{StaticResource MyButtonStyle}"
2026-05-08 15:37:46 +08:00
Width="57"
2026-05-04 14:46:58 +08:00
Margin="10,0"
Click="Button_Click_18"/>
</StackPanel>
<!-- 2. 潮气量设置 -->
<TextBlock Grid.Row="1" Grid.Column="0"
2026-05-08 15:37:46 +08:00
Text="{DynamicResource test3}"
2026-05-04 14:46:58 +08:00
Style="{StaticResource ParamLabelStyle}"
2026-05-08 15:37:46 +08:00
TextAlignment="Left" Height="18" Margin="10,0,2,0"/>
2026-05-04 14:46:58 +08:00
2026-05-08 15:37:46 +08:00
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" Height="30">
2026-05-04 14:46:58 +08:00
<TextBox Name="moistureTxt"
Style="{StaticResource MyTextBoxStyle}"
Width="80"
PreviewTextInput="NumberPreviewTextInput"
IsReadOnly="True"/>
<TextBlock Text=" L" VerticalAlignment="Center" Margin="5,0"/>
</StackPanel>
2026-05-09 10:30:14 +08:00
<Button Name="btn3" Grid.Row="1" Grid.Column="1"
2026-05-08 15:37:46 +08:00
Content="{DynamicResource test2}"
2026-05-04 14:46:58 +08:00
Style="{StaticResource MyButtonStyle}"
Width="80"
Margin="200,0,8,0"
2026-05-04 14:46:58 +08:00
Click="Button_Click_19"
VerticalAlignment="Center" Height="30" Grid.ColumnSpan="2"/>
2026-05-04 14:46:58 +08:00
<!-- 3. 呼吸频率设置 -->
<TextBlock Grid.Row="2" Grid.Column="0"
2026-05-08 15:37:46 +08:00
Text="{DynamicResource test4}"
2026-05-04 14:46:58 +08:00
Style="{StaticResource ParamLabelStyle}"
2026-05-08 15:37:46 +08:00
TextAlignment="Left" Height="18" Margin="10,0,2,0"/>
2026-05-04 14:46:58 +08:00
2026-05-08 15:37:46 +08:00
<StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" Height="30">
2026-05-04 14:46:58 +08:00
<TextBox Name="respiratoryRateTxt"
Style="{StaticResource MyTextBoxStyle}"
Width="80"
PreviewTextInput="NumberPreviewTextInput"
IsReadOnly="True"/>
2026-05-08 15:37:46 +08:00
<TextBlock Text="{DynamicResource test8}" VerticalAlignment="Center" Margin="5,0"/>
2026-05-04 14:46:58 +08:00
</StackPanel>
2026-05-09 10:30:14 +08:00
<Button Name="btn4" Grid.Row="2" Grid.Column="1"
2026-05-08 15:37:46 +08:00
Content="{DynamicResource test2}"
2026-05-04 14:46:58 +08:00
Style="{StaticResource MyButtonStyle}"
Width="80"
Margin="200,0,11,0"
2026-05-04 14:46:58 +08:00
Click="Button_Click_20"
VerticalAlignment="Center" Height="30" Grid.ColumnSpan="2"/>
2026-05-04 14:46:58 +08:00
<!-- 4. 频率系数设置 -->
<TextBlock Grid.Row="3" Grid.Column="0"
2026-05-08 15:37:46 +08:00
Text="{DynamicResource test5}"
2026-05-04 14:46:58 +08:00
Style="{StaticResource ParamLabelStyle}"
2026-05-08 15:37:46 +08:00
TextAlignment="Left" Height="18" Margin="10,0,2,0"/>
2026-05-04 14:46:58 +08:00
2026-05-08 15:37:46 +08:00
<StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" Height="30">
<TextBox x:Name="frequencyTxt"
2026-05-04 14:46:58 +08:00
Style="{StaticResource MyTextBoxStyle}"
Width="80"
PreviewTextInput="NumberPreviewTextInput"
IsReadOnly="True"/>
</StackPanel>
2026-05-09 10:30:14 +08:00
<Button Name="btn5" Grid.Row="3" Grid.Column="1"
2026-05-08 15:37:46 +08:00
Content="{DynamicResource test2}"
2026-05-04 14:46:58 +08:00
Style="{StaticResource MyButtonStyle}"
Width="80"
Margin="200,0,11,0"
2026-05-04 14:46:58 +08:00
Click="Button_Click_21"
VerticalAlignment="Center" Height="30" Grid.ColumnSpan="2"/>
2026-05-04 14:46:58 +08:00
</Grid>
</StackPanel>
<!-- 3.1.2 测试辅助参数(状态类参数) -->
2026-05-08 15:37:46 +08:00
<TextBlock Text="{DynamicResource test6}" Style="{StaticResource SectionTitleStyle}"/>
2026-05-04 14:46:58 +08:00
<StackPanel Margin="0,0,0,10">
<!-- 呼吸次数 -->
<StackPanel Orientation="Horizontal" Height="40" VerticalAlignment="Center">
2026-05-08 15:37:46 +08:00
<TextBlock Text="{DynamicResource test7}" Style="{StaticResource ParamLabelStyle}" Width="124"/>
2026-05-04 14:46:58 +08:00
<TextBox Name="respiratoryCountTxt" Style="{StaticResource MonitorTextBoxStyle}"/>
2026-05-08 15:37:46 +08:00
<TextBlock Text="{DynamicResource test8}" VerticalAlignment="Center" Margin="5"/>
2026-05-04 14:46:58 +08:00
</StackPanel>
<!-- 呼吸时间计时 -->
<StackPanel Orientation="Horizontal" Height="40" VerticalAlignment="Center">
2026-05-08 15:37:46 +08:00
<TextBlock Text="{DynamicResource test77}" Style="{StaticResource ParamLabelStyle}" Width="124"/>
2026-05-04 14:46:58 +08:00
<TextBox Name="breathTimeBegin" Style="{StaticResource MonitorTextBoxStyle}"/>
2026-05-08 15:37:46 +08:00
<TextBlock Text="{DynamicResource test9}" VerticalAlignment="Center" Margin="5"/>
2026-05-04 14:46:58 +08:00
<TextBox Name="breathTimeEnd" Style="{StaticResource MonitorTextBoxStyle}"/>
2026-05-08 15:37:46 +08:00
<TextBlock Text="{DynamicResource test10}" VerticalAlignment="Center" Margin="5"/>
2026-05-04 14:46:58 +08:00
</StackPanel>
</StackPanel>
</StackPanel>
</Border>
<!-- 右侧:实时监测区(聚合监测数据) -->
<Border Grid.Column="1" Background="White"
BorderBrush="#E0E0E0" BorderThickness="1"
CornerRadius="8" Margin="10,0,0,0" Padding="15">
2026-05-08 15:37:46 +08:00
2026-05-04 14:46:58 +08:00
<StackPanel>
<!-- 3.2.1 实时监测数据(核心监测项) -->
2026-05-08 15:37:46 +08:00
<TextBlock Text="{DynamicResource test11}" Style="{StaticResource SectionTitleStyle}"/>
2026-05-04 14:46:58 +08:00
<StackPanel Margin="0,0,0,20">
<!-- 呼吸类型显示控件 -->
2026-05-08 15:37:46 +08:00
<TextBlock Name="breathType" Text="{DynamicResource test1212}" Style="{StaticResource SectionTitleStyle}"
2026-05-04 14:46:58 +08:00
FontSize="16" Foreground="Gray"/>
2026-05-08 15:37:46 +08:00
2026-05-04 14:46:58 +08:00
<!-- 呼吸管路压力 -->
<StackPanel Orientation="Horizontal" Height="45" VerticalAlignment="Center">
2026-05-08 15:37:46 +08:00
<TextBlock Text="{DynamicResource test13}" Style="{StaticResource MonitorLabelStyle}"/>
2026-05-04 14:46:58 +08:00
<TextBox Name="RespiratoryPressureTxt" Style="{StaticResource MonitorTextBoxStyle}"/>
<TextBlock Text=" Pa" VerticalAlignment="Center"/>
</StackPanel>
<!-- CO₂浓度 -->
<StackPanel Orientation="Horizontal" Height="45" VerticalAlignment="Center">
2026-05-08 15:37:46 +08:00
<TextBlock Text="{DynamicResource test14}" Style="{StaticResource MonitorLabelStyle}"/>
2026-05-04 14:46:58 +08:00
<TextBox Name="CO2PressureTxt" Style="{StaticResource MonitorTextBoxStyle}"/>
<TextBlock Text=" %" VerticalAlignment="Center"/>
</StackPanel>
</StackPanel>
<!-- 3.2.2 CO₂测试结果专项结果 -->
2026-05-08 15:37:46 +08:00
<TextBlock Text="{DynamicResource test15}" Style="{StaticResource SectionTitleStyle}"/>
2026-05-04 14:46:58 +08:00
<StackPanel>
<!-- 开始CO₂浓度 -->
<StackPanel Orientation="Horizontal" Height="45" VerticalAlignment="Center">
2026-05-08 15:37:46 +08:00
<TextBlock Text="{DynamicResource test16}" Style="{StaticResource MonitorLabelStyle}"/>
2026-05-04 14:46:58 +08:00
<TextBox Name="CO2BeginTb" Style="{StaticResource MonitorTextBoxStyle}"/>
<TextBlock Text=" %" VerticalAlignment="Center"/>
</StackPanel>
<!-- 结束CO₂浓度 -->
<StackPanel Orientation="Horizontal" Height="45" VerticalAlignment="Center">
2026-05-08 15:37:46 +08:00
<TextBlock Text="{DynamicResource test17}" Style="{StaticResource MonitorLabelStyle}"/>
2026-05-04 14:46:58 +08:00
<TextBox Name="CO2EndTb" Style="{StaticResource MonitorTextBoxStyle}"/>
<TextBlock Text=" %" VerticalAlignment="Center"/>
</StackPanel>
<!-- CO₂浓度增加值 -->
<StackPanel Orientation="Horizontal" Height="45" VerticalAlignment="Center">
2026-05-08 15:37:46 +08:00
<TextBlock Text="{DynamicResource test18}" Style="{StaticResource MonitorLabelStyle}"/>
2026-05-04 14:46:58 +08:00
<TextBox Name="CO2AddTxt" Style="{StaticResource MonitorTextBoxStyle}"/>
<TextBlock Text=" %" VerticalAlignment="Center"/>
</StackPanel>
</StackPanel>
</StackPanel>
</Border>
</Grid>
</DockPanel>
</Window>