添加项目文件。
This commit is contained in:
206
Window3.xaml
Normal file
206
Window3.xaml
Normal file
@@ -0,0 +1,206 @@
|
||||
<Window x:Class="ShanghaiEnvironmentalTechnology.Window3"
|
||||
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>
|
||||
|
||||
<Style x:Key="MyComboBoxStyle" TargetType="ComboBox">
|
||||
<Setter Property="Background" Value="#FFFFFF"/>
|
||||
<Setter Property="Foreground" Value="Black"/>
|
||||
<Setter Property="BorderBrush" Value="#4A90E2"/>
|
||||
<Setter Property="BorderThickness" Value="2"/>
|
||||
<Setter Property="FontSize" Value="16"/>
|
||||
<Setter Property="Height" Value="40"/>
|
||||
<Setter Property="Width" Value="150"/>
|
||||
<Setter Property="Margin" Value="10"/>
|
||||
<Setter Property="Padding" Value="5"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ComboBox">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="5">
|
||||
<Grid>
|
||||
<ToggleButton IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Focusable="False"
|
||||
ClickMode="Press">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="20"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ContentPresenter HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,0,0"
|
||||
Content="{TemplateBinding SelectionBoxItem}"
|
||||
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
|
||||
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"/>
|
||||
<Path Grid.Column="1"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Data="M 0 0 L 4 4 L 8 0 Z"
|
||||
Fill="Black"/>
|
||||
</Grid>
|
||||
</ToggleButton>
|
||||
<Popup IsOpen="{TemplateBinding IsDropDownOpen}"
|
||||
Placement="Bottom"
|
||||
AllowsTransparency="True"
|
||||
Focusable="False"
|
||||
PopupAnimation="Slide">
|
||||
<Grid MinWidth="{TemplateBinding ActualWidth}"
|
||||
MaxHeight="{TemplateBinding MaxDropDownHeight}">
|
||||
<Border Background="White"
|
||||
BorderBrush="#4A90E2"
|
||||
BorderThickness="2"
|
||||
CornerRadius="5"/>
|
||||
<ScrollViewer Margin="1">
|
||||
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Popup>
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</Window.Resources>
|
||||
|
||||
<Grid Margin="20">
|
||||
<StackPanel VerticalAlignment="Top" HorizontalAlignment="Center">
|
||||
<TextBlock Text="防室息阀压力测试" FontSize="24" FontWeight="Bold" HorizontalAlignment="Center" Margin="0,0,0,20"/>
|
||||
|
||||
<ComboBox x:Name="CaptureModeComboBox"
|
||||
Style="{StaticResource MyComboBoxStyle}"
|
||||
HorizontalAlignment="Center"
|
||||
SelectionChanged="CaptureModeComboBox_SelectionChanged">
|
||||
<ComboBoxItem Content="开关阀选择" IsEnabled="False"/>
|
||||
<ComboBoxItem Content="开阀捕捉" IsSelected="True"/>
|
||||
<ComboBoxItem Content="关阀捕捉"/>
|
||||
</ComboBox>
|
||||
|
||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" Margin="0,10">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,5">
|
||||
<TextBlock Text="设置开阀压力判别" FontWeight="Bold" Margin="0,10,10,0"/>
|
||||
<TextBox Name="SettingPaTextBox" Style="{StaticResource MyTextBoxStyle}"
|
||||
|
||||
IsReadOnly="True"
|
||||
InputScope="Number"
|
||||
PreviewTextInput="SettingPaTextBox_PreviewTextInput"/>
|
||||
<TextBlock Text=" pa" VerticalAlignment="Center"/>
|
||||
<Button Content="设置" Style="{StaticResource MyButtonStyle}" Margin="10" Click="Button_Click_10"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,5">
|
||||
<TextBlock Text="设置关阀压力判别" FontWeight="Bold" Margin="0,10,10,0"/>
|
||||
<TextBox Name="clostTxt" Style="{StaticResource MyTextBoxStyle}"
|
||||
IsReadOnly="True"
|
||||
PreviewTextInput="ClostTxt_PreviewTextInput"
|
||||
|
||||
/>
|
||||
<TextBlock Text=" pa" VerticalAlignment="Center"/>
|
||||
<Button Content="设置" Style="{StaticResource MyButtonStyle}" Margin="10" Click="Button_Click_11"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" Margin="0,20">
|
||||
<StackPanel Orientation="Horizontal" Width="300" HorizontalAlignment="Center">
|
||||
<TextBlock Text="开阀压力" FontWeight="Bold" Width="100" TextAlignment="Right"/>
|
||||
<TextBlock x:Name="recordOpenTxt" Text="???" FontSize="20" Foreground="Red" VerticalAlignment="Center" Margin="10,0" Width="80" TextAlignment="Center"/>
|
||||
<TextBlock Text=" pa" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Width="300" HorizontalAlignment="Center">
|
||||
<TextBlock Text="关阀压力" FontWeight="Bold" Width="100" TextAlignment="Right"/>
|
||||
<TextBlock Name="recordCloseTxt" Text="???" FontSize="20" Foreground="Red" VerticalAlignment="Center" Margin="10,0" Width="80" TextAlignment="Center"/>
|
||||
<TextBlock Text=" pa" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,10">
|
||||
<Button Content="记录开阀" Style="{StaticResource MyButtonStyle}" Margin="10" Click="Button_Click_3"/>
|
||||
<Button Content="记录关阀" Style="{StaticResource MyButtonStyle}" Margin="10" Click="Button_Click_9"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Margin="0,10,0,0">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,5">
|
||||
<TextBlock Text="实时压力" FontWeight="Bold"/>
|
||||
<TextBlock x:Name="TimerPressTxt" Text="???" FontSize="20" Foreground="Red"/>
|
||||
<TextBlock Text=" pa" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
<Button Content="校准" Style="{StaticResource MyButtonStyle}" Margin="10,0" Click="Button_Click_4"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,30">
|
||||
<Button Content="主页" Style="{StaticResource MyButtonStyle}" Click="Button_Click_5"/>
|
||||
<Button Name="TestStartButton" Content="测试启动" Style="{StaticResource MyButtonStyle}" Click="Button_Click_7"/>
|
||||
<Button Content="测试停止" Style="{StaticResource MyButtonStyle}" Click="Button_Click_8"/>
|
||||
<Button Content="记录画面" Style="{StaticResource MyButtonStyle}" Click="Button_Click_6"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
Reference in New Issue
Block a user