Files
VacuumPressureMembranePoreS…/Views/BubblePointView.xaml

115 lines
6.5 KiB
Plaintext
Raw Normal View History

2026-03-27 21:35:32 +08:00
<!-- BubblePointView.xaml -->
<UserControl x:Class="MembranePoreTester.Views.BubblePointView"
2026-02-27 16:03:49 +08:00
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:MembranePoreTester.ViewModels"
xmlns:conv="clr-namespace:MembranePoreTester.Converters">
<UserControl.Resources>
<conv:InverseBooleanConverter x:Key="InverseBooleanConverter"/>
2026-04-02 20:10:08 +08:00
<conv:DoubleStringConverter x:Key="DoubleStringConverter"/>
2026-03-27 21:35:32 +08:00
<Style TargetType="RadioButton">
<Setter Property="Margin" Value="5,2"/>
<Setter Property="FontSize" Value="12"/>
</Style>
<Style TargetType="Label">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Foreground" Value="#2C3E50"/>
</Style>
2026-02-27 16:03:49 +08:00
</UserControl.Resources>
2026-03-27 21:35:32 +08:00
<Grid Margin="10" Background="#F5F7FA">
2026-02-27 16:03:49 +08:00
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
2026-04-02 14:34:29 +08:00
2026-02-27 16:03:49 +08:00
</Grid.RowDefinitions>
<!-- 输入区域 -->
<StackPanel Grid.Row="0">
2026-03-27 21:35:32 +08:00
<GroupBox Header="📄 样品信息">
2026-02-27 16:03:49 +08:00
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
2026-04-02 14:34:29 +08:00
<RowDefinition Height="Auto"/>
2026-02-27 16:03:49 +08:00
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="膜类型:"/>
2026-03-27 21:35:32 +08:00
<ComboBox Grid.Row="0" Grid.Column="1" ItemsSource="{Binding MembraneTypes}" SelectedItem="{Binding Record.SampleType}" Margin="5"/>
2026-02-27 16:03:49 +08:00
2026-04-02 14:34:29 +08:00
<!--<Label Grid.Row="0" Grid.Column="2" Content="规格:"/>
<TextBox Grid.Row="0" Grid.Column="3" Text="{Binding Record.SampleSpec}" Margin="5"/>-->
<!--<Label Grid.Row="1" Grid.Column="0" Content="室温(°C):"/>
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Record.RoomTemperature}" Margin="5"/>-->
2026-02-27 16:03:49 +08:00
2026-04-02 14:34:29 +08:00
<Label Grid.Row="1" Grid.Column="0" Content="浸润时间(h):"/>
2026-04-02 20:10:08 +08:00
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Record.SoakingTime, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource DoubleStringConverter}}" Margin="5"/>
2026-02-27 16:03:49 +08:00
2026-04-02 14:34:29 +08:00
<Label Grid.Row="2" Grid.Column="0" Content="加压速率:"/>
<TextBox Grid.Row="2" Grid.Column="1" IsEnabled="False" Text="{Binding Record.SpeedRate1}" Margin="5"/>
2026-02-27 16:03:49 +08:00
</Grid>
</GroupBox>
2026-03-27 21:35:32 +08:00
<GroupBox Header="🧪 测试液体">
2026-02-27 16:03:49 +08:00
<StackPanel>
<RadioButton Content="预定义" IsChecked="{Binding IsCustomLiquid, Converter={StaticResource InverseBooleanConverter}}" Margin="5"/>
2026-03-27 21:35:32 +08:00
<ComboBox ItemsSource="{Binding Liquids}" SelectedItem="{Binding SelectedLiquid}" DisplayMemberPath="Name" IsEnabled="{Binding IsCustomLiquid, Converter={StaticResource InverseBooleanConverter}}" Margin="5,0,5,5"/>
2026-02-27 16:03:49 +08:00
<RadioButton Content="自定义" IsChecked="{Binding IsCustomLiquid}" Margin="5"/>
<StackPanel Orientation="Horizontal" Margin="20,0,0,0" IsEnabled="{Binding IsCustomLiquid}">
<Label Content="表面张力(mN/m):"/>
<TextBox Text="{Binding CustomSurfaceTension}" Width="100" Margin="5"/>
</StackPanel>
2026-03-26 19:43:52 +08:00
</StackPanel>
</GroupBox>
2026-02-27 16:58:02 +08:00
2026-03-27 21:35:32 +08:00
<GroupBox Header="📊 压力数据">
<StackPanel>
<Label Content="当前压力(kPa)" FontWeight="Normal" Margin="5,0,0,0"/>
2026-03-31 20:17:17 +08:00
<TextBox HorizontalAlignment="Left" Text="{Binding Record.BubbleCurrentPressure}" Width="150" Margin="5,0,5,5"/>
<Label Content="泡点压力(Pa)" FontWeight="Normal" Margin="5,0,0,0"/>
2026-03-27 21:35:32 +08:00
<StackPanel Orientation="Horizontal">
<TextBox Text="{Binding Record.BubblePointPressure}" Width="150" Margin="5"/>
2026-04-02 14:34:29 +08:00
<Button Content="出泡" Command="{Binding ReadPlcCommand}" Padding="10,5" Margin="5" Background="#FF9800"/>
2026-03-27 21:35:32 +08:00
<ComboBox ItemsSource="{Binding PressureUnits}" SelectedItem="{Binding Record.PressureUnit}" Width="80" Margin="5"/>
<Button Content="计算最大孔径" Command="{Binding CalculateCommand}" Padding="10,5" Margin="5" Background="#2196F3"/>
</StackPanel>
2026-02-27 16:03:49 +08:00
</StackPanel>
</GroupBox>
</StackPanel>
<!-- 结果显示 -->
2026-03-31 20:17:17 +08:00
<Border Grid.Row="1" Margin="0,10" Background="White" CornerRadius="8" BorderBrush="#E9ECF0" BorderThickness="1">
2026-03-27 21:35:32 +08:00
<Grid>
2026-03-31 20:17:17 +08:00
<GroupBox Header="✨ 测试结果" BorderThickness="0"
Margin="0" Padding="5,0">
<!-- 减少内边距 -->
<TextBlock FontSize="40" FontWeight="Bold" TextAlignment="Center"
Text="{Binding MaxPoreSize, StringFormat={}{0:F3} μm}"
Foreground="#2196F3"
Margin="0,-30,0,-10"/>
<!-- 负边距压缩垂直空间 -->
2026-03-27 21:35:32 +08:00
</GroupBox>
</Grid>
</Border>
2026-02-27 16:03:49 +08:00
<!-- 底部按钮 -->
2026-03-27 21:35:32 +08:00
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,0,0">
2026-03-28 16:48:41 +08:00
<Button Content="⚙ 高压校准" Command="{Binding OpenPressureCalibCommand}" Padding="15,8" Background="#607D8B"/>
<Button Content="⚙ 低压校准" Command="{Binding OpenPressureCalibCommand2}" Padding="15,8" Background="#607D8B"/>
2026-03-27 21:35:32 +08:00
<Button Content="💾 保存到历史" Command="{Binding SaveCommand}" Padding="15,8" Background="#4CAF50"/>
<Button Content="📄 生成报告" Command="{Binding GenerateReportCommand}" Padding="15,8" Background="#2196F3"/>
<Button Content="📊 导出Excel" Command="{Binding ExportCommand}" Padding="15,8" Background="#FF9800"/>
2026-02-27 16:03:49 +08:00
</StackPanel>
</Grid>
</UserControl>