161 lines
8.3 KiB
XML
161 lines
8.3 KiB
XML
<Window x:Class="ShanghaiEnvironmentalTechnology.Window2"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
Title="气阻测试" Height="768" Width="1024"
|
|
Loaded="Window_Loaded" WindowStartupLocation="CenterScreen">
|
|
|
|
<Window.Resources>
|
|
|
|
<Style x:Key="MyButtonStyle" TargetType="Button">
|
|
<Setter Property="Background" Value="#4A90E2"/>
|
|
<Setter Property="Foreground" Value="White"/>
|
|
<Setter Property="FontSize" Value="16"/>
|
|
<Setter Property="Margin" Value="10"/>
|
|
<Setter Property="Padding" Value="10,5"/>
|
|
<Setter Property="BorderBrush" Value="Transparent"/>
|
|
<Setter Property="BorderThickness" Value="0"/>
|
|
<Setter Property="Cursor" Value="Hand"/>
|
|
<Setter Property="Height" Value="40"/>
|
|
<Setter Property="Width" Value="120"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="Button">
|
|
<Border Background="{TemplateBinding Background}" CornerRadius="20">
|
|
<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="2"/>
|
|
<Setter Property="Padding" Value="10,10"/>
|
|
<Setter Property="FontSize" Value="18"/>
|
|
<Setter Property="Height" Value="50"/>
|
|
<!-- 增加高度 -->
|
|
<Setter Property="Width" Value="120"/>
|
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
<!-- 垂直居中 -->
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="TextBox">
|
|
<Border Background="{TemplateBinding Background}"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
CornerRadius="20">
|
|
<ScrollViewer x:Name="PART_ContentHost"/>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="FontSize" Value="18"/>
|
|
<Setter Property="Foreground" Value="Black"/>
|
|
<Setter Property="Margin" Value="5"/>
|
|
</Style>
|
|
|
|
</Window.Resources>
|
|
|
|
<Grid Margin="20">
|
|
<TextBlock Text="测100L/min和50L/min流量下的气阻" FontSize="18" HorizontalAlignment="Left" Margin="0,0,0,0" Foreground="Black"/>
|
|
<StackPanel VerticalAlignment="Top" HorizontalAlignment="Center" Width="1366">
|
|
|
|
<TextBlock Text="气阻测试" FontSize="24" FontWeight="Bold" HorizontalAlignment="Center" Margin="0,0,0,20" Foreground="Black"/>
|
|
|
|
<StackPanel Orientation="Vertical" Margin="0,10" HorizontalAlignment="Center">
|
|
|
|
<Grid Margin="0,10" HorizontalAlignment="Center" Width="400">
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="120"/>
|
|
<!-- 标签列 -->
|
|
<ColumnDefinition Width="120"/>
|
|
<!-- 输入框+单位列 -->
|
|
<ColumnDefinition Width="*"/>
|
|
<!-- 按钮列 -->
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<TextBlock Text="连接口压力:" VerticalAlignment="Center" Foreground="Black"/>
|
|
|
|
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
|
|
<TextBox Name="RealTimePressureTextBox" Width="80" Style="{StaticResource MyTextBoxStyle}" IsEnabled="false"/>
|
|
<TextBlock Text="pa" VerticalAlignment="Center" Foreground="Black" Margin="5,0,0,0"/>
|
|
</StackPanel>
|
|
|
|
<Button Grid.Column="2" Content="连接口校准" Style="{StaticResource MyButtonStyle}" Click="Button_Click" HorizontalAlignment="Left"/>
|
|
</Grid>
|
|
|
|
<!-- 鼻口压力行 -->
|
|
<Grid Margin="0,10" HorizontalAlignment="Center" Width="400">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="120"/>
|
|
<ColumnDefinition Width="120"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<TextBlock Text="鼻口压力:" VerticalAlignment="Center" Foreground="Black"/>
|
|
|
|
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
|
|
<TextBox Name="NoseTxt" Width="80" Style="{StaticResource MyTextBoxStyle}" Foreground="Black" IsEnabled="false"/>
|
|
<TextBlock Text="pa" VerticalAlignment="Center" Foreground="Black" Margin="5,0,0,0"/>
|
|
</StackPanel>
|
|
|
|
<Button Grid.Column="2" Content="校准" Style="{StaticResource MyButtonStyle}" Click="Button_Click_1" HorizontalAlignment="Left"/>
|
|
</Grid>
|
|
|
|
<!-- 设定流量行 -->
|
|
<Grid Margin="0,10" HorizontalAlignment="Center" Width="400">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="120"/>
|
|
<ColumnDefinition Width="120"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<TextBlock Text="设定流量:" VerticalAlignment="Center" Foreground="Black"/>
|
|
|
|
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
|
|
<TextBox Name="FowlTxt1" Width="80" Style="{StaticResource MyTextBoxStyle}" Foreground="Black" IsReadOnly="True"/>
|
|
<TextBlock Text="L/min" VerticalAlignment="Center" Foreground="Black" Margin="5,0,0,0"/>
|
|
</StackPanel>
|
|
|
|
<Button Grid.Column="2" Content="设置" Style="{StaticResource MyButtonStyle}" Click="Button_Click_7" HorizontalAlignment="Left"/>
|
|
</Grid>
|
|
</StackPanel>
|
|
|
|
<TextBlock Text="实时流量:" FontSize="20" HorizontalAlignment="Center" Margin="0,20" Foreground="Black"/>
|
|
<TextBlock x:Name="flowTxt" Text="???" FontSize="24" Foreground="Red" HorizontalAlignment="Center"/>
|
|
<TextBlock Text="L/min" HorizontalAlignment="Center" Foreground="Black"/>
|
|
|
|
<StackPanel Orientation="Horizontal" Margin="0,20" HorizontalAlignment="Center">
|
|
|
|
<Button Content="记录气阻" Style="{StaticResource MyButtonStyle}" Click="Button_Click_2" />
|
|
|
|
|
|
<TextBox Name="AirTxt" Width="80" Margin="10,0" Style="{StaticResource MyTextBoxStyle}" IsEnabled="False"/>
|
|
<TextBlock Text="hpa" VerticalAlignment="Center" Foreground="Black"/>
|
|
</StackPanel>
|
|
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,30">
|
|
<Button Content="主页" Style="{StaticResource MyButtonStyle}" Click="Button_Click_3"/>
|
|
<Button Name="TestStartButton" Content="测试启动" Style="{StaticResource MyButtonStyle}" Click="Button_Click_4"/>
|
|
<Button Content="测试停止" Style="{StaticResource MyButtonStyle}" Click="Button_Click_5" />
|
|
<Button Content="记录画面" Style="{StaticResource MyButtonStyle}" Click="Button_Click_6"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Window>
|