114 lines
6.3 KiB
XML
114 lines
6.3 KiB
XML
<!-- BubblePointView.xaml -->
|
|
<UserControl x:Class="MembranePoreTester.Views.BubblePointView"
|
|
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"/>
|
|
|
|
<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>
|
|
</UserControl.Resources>
|
|
|
|
<Grid Margin="10" Background="#F5F7FA">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- 输入区域 -->
|
|
<StackPanel Grid.Row="0">
|
|
<GroupBox Header="📄 样品信息">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<Label Grid.Row="0" Grid.Column="0" Content="膜类型:"/>
|
|
<ComboBox Grid.Row="0" Grid.Column="1" ItemsSource="{Binding MembraneTypes}" SelectedItem="{Binding Record.SampleType}" Margin="5"/>
|
|
|
|
<!--<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"/>-->
|
|
|
|
<Label Grid.Row="1" Grid.Column="0" Content="浸润时间(h):"/>
|
|
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Record.SoakingTime}" Margin="5"/>
|
|
|
|
<Label Grid.Row="2" Grid.Column="0" Content="加压速率:"/>
|
|
<TextBox Grid.Row="2" Grid.Column="1" IsEnabled="False" Text="{Binding Record.SpeedRate1}" Margin="5"/>
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<GroupBox Header="🧪 测试液体">
|
|
<StackPanel>
|
|
<RadioButton Content="预定义" IsChecked="{Binding IsCustomLiquid, Converter={StaticResource InverseBooleanConverter}}" Margin="5"/>
|
|
<ComboBox ItemsSource="{Binding Liquids}" SelectedItem="{Binding SelectedLiquid}" DisplayMemberPath="Name" IsEnabled="{Binding IsCustomLiquid, Converter={StaticResource InverseBooleanConverter}}" Margin="5,0,5,5"/>
|
|
<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>
|
|
</StackPanel>
|
|
</GroupBox>
|
|
|
|
<GroupBox Header="📊 压力数据">
|
|
<StackPanel>
|
|
<Label Content="当前压力(kPa)" FontWeight="Normal" Margin="5,0,0,0"/>
|
|
<TextBox HorizontalAlignment="Left" Text="{Binding Record.BubbleCurrentPressure}" Width="150" Margin="5,0,5,5"/>
|
|
<Label Content="泡点压力(Pa)" FontWeight="Normal" Margin="5,0,0,0"/>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBox Text="{Binding Record.BubblePointPressure}" Width="150" Margin="5"/>
|
|
<Button Content="出泡" Command="{Binding ReadPlcCommand}" Padding="10,5" Margin="5" Background="#FF9800"/>
|
|
<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>
|
|
</StackPanel>
|
|
</GroupBox>
|
|
</StackPanel>
|
|
|
|
<!-- 结果显示 -->
|
|
<Border Grid.Row="1" Margin="0,10" Background="White" CornerRadius="8" BorderBrush="#E9ECF0" BorderThickness="1">
|
|
<Grid>
|
|
<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"/>
|
|
<!-- 负边距压缩垂直空间 -->
|
|
</GroupBox>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<!-- 底部按钮 -->
|
|
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,0,0">
|
|
<Button Content="⚙ 高压校准" Command="{Binding OpenPressureCalibCommand}" Padding="15,8" Background="#607D8B"/>
|
|
<Button Content="⚙ 低压校准" Command="{Binding OpenPressureCalibCommand2}" Padding="15,8" Background="#607D8B"/>
|
|
<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"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</UserControl> |