2026-02-27 16:03:49 +08:00
|
|
|
|
<UserControl x:Class="MembranePoreTester.Views.PoreDistributionView"
|
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
|
xmlns:conv="clr-namespace:MembranePoreTester.Converters">
|
|
|
|
|
|
<UserControl.Resources>
|
|
|
|
|
|
<conv:InverseBooleanConverter x:Key="InverseBooleanConverter"/>
|
|
|
|
|
|
</UserControl.Resources>
|
|
|
|
|
|
<Grid Margin="10">
|
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
|
<RowDefinition Height="*"/>
|
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
|
|
|
|
|
|
<GroupBox Grid.Row="0" Header="样品信息" Margin="0,0,0,10">
|
|
|
|
|
|
<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"/>
|
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
|
<!-- 新增第4行 -->
|
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 第0行 -->
|
|
|
|
|
|
<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"/>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 第1行 -->
|
|
|
|
|
|
<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="2" Content="浸润时间(h):"/>
|
|
|
|
|
|
<TextBox Grid.Row="1" Grid.Column="3" Text="{Binding Record.SoakingTime}" Margin="5"/>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 第2行 -->
|
|
|
|
|
|
<Label Grid.Row="2" Grid.Column="0" Content="测试液体:"/>
|
|
|
|
|
|
<ComboBox Grid.Row="2" Grid.Column="1" ItemsSource="{Binding Liquids}"
|
|
|
|
|
|
SelectedItem="{Binding SelectedLiquid}" DisplayMemberPath="Name" Margin="5"/>
|
|
|
|
|
|
<Label Grid.Row="2" Grid.Column="2" Content="生产厂家:"/>
|
|
|
|
|
|
<TextBox Grid.Row="2" Grid.Column="3" Text="{Binding Record.LiquidManufacturer}" Margin="5"/>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 第3行:压力单位 -->
|
|
|
|
|
|
<Label Grid.Row="3" Grid.Column="0" Content="压力单位:"/>
|
|
|
|
|
|
<ComboBox Grid.Row="3" Grid.Column="1" ItemsSource="{Binding PressureUnits}"
|
|
|
|
|
|
SelectedItem="{Binding Record.PressureUnit}" Margin="5"/>
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
</GroupBox>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 数据表格和简单图表(此处用ListView代替图表) -->
|
|
|
|
|
|
<Grid Grid.Row="1">
|
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 左侧数据输入表格 -->
|
|
|
|
|
|
<GroupBox Grid.Column="0" Header="压力-流量数据" Margin="0,0,5,0">
|
|
|
|
|
|
<DockPanel>
|
|
|
|
|
|
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="0,0,0,5">
|
|
|
|
|
|
<Button Content="添加行" Command="{Binding AddDataPointCommand}" Padding="10,5" Margin="5"/>
|
|
|
|
|
|
<Button Content="删除行" Command="{Binding RemoveDataPointCommand}" Padding="10,5" Margin="5"/>
|
2026-03-11 20:37:53 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 新增:模式选择 -->
|
|
|
|
|
|
<ComboBox SelectedItem="{Binding TestMode}" Width="80" Margin="5">
|
|
|
|
|
|
<ComboBoxItem Content="湿膜" IsSelected="True"/>
|
|
|
|
|
|
<ComboBoxItem Content="干膜"/>
|
|
|
|
|
|
</ComboBox>
|
2026-02-27 16:58:02 +08:00
|
|
|
|
<Button Content="读取PLC" Command="{Binding ReadPlcCommand}" Padding="10,5" Margin="5"/>
|
2026-02-27 16:03:49 +08:00
|
|
|
|
</StackPanel>
|
|
|
|
|
|
<DataGrid ItemsSource="{Binding Record.DataPoints}" AutoGenerateColumns="False" CanUserAddRows="False">
|
|
|
|
|
|
<DataGrid.Columns>
|
|
|
|
|
|
<DataGridTextColumn Header="压力" Binding="{Binding Pressure, UpdateSourceTrigger=PropertyChanged}" Width="*"/>
|
|
|
|
|
|
<DataGridTextColumn Header="湿膜流量(L/min)" Binding="{Binding WetFlow, UpdateSourceTrigger=PropertyChanged}" Width="*"/>
|
|
|
|
|
|
<DataGridTextColumn Header="干膜流量(L/min)" Binding="{Binding DryFlow, UpdateSourceTrigger=PropertyChanged}" Width="*"/>
|
|
|
|
|
|
</DataGrid.Columns>
|
|
|
|
|
|
</DataGrid>
|
|
|
|
|
|
</DockPanel>
|
|
|
|
|
|
</GroupBox>
|
|
|
|
|
|
|
|
|
|
|
|
<GridSplitter Grid.Column="1" Width="5" HorizontalAlignment="Center"/>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 右侧简易数据展示(可用图表库,此处仅用ListBox预览) -->
|
|
|
|
|
|
<GroupBox Grid.Column="2" Header="数据预览" Margin="5,0,0,0">
|
|
|
|
|
|
<ListBox ItemsSource="{Binding Record.DataPoints}">
|
|
|
|
|
|
<ListBox.ItemTemplate>
|
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
|
|
<TextBlock Text="{Binding Pressure, StringFormat=P:{0:F2}}"/>
|
|
|
|
|
|
<TextBlock Text=" "/>
|
|
|
|
|
|
<TextBlock Text="{Binding WetFlow, StringFormat=W:{0:F3}}"/>
|
|
|
|
|
|
<TextBlock Text=" "/>
|
|
|
|
|
|
<TextBlock Text="{Binding DryFlow, StringFormat=D:{0:F3}}"/>
|
|
|
|
|
|
</StackPanel>
|
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
</ListBox.ItemTemplate>
|
|
|
|
|
|
</ListBox>
|
|
|
|
|
|
</GroupBox>
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 计算结果区域 -->
|
|
|
|
|
|
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="0,10,0,0">
|
|
|
|
|
|
<GroupBox Header="平均孔径" Margin="5">
|
|
|
|
|
|
<TextBlock Text="{Binding AveragePoreSize, StringFormat={}{0:F3} μm}" FontSize="16"/>
|
|
|
|
|
|
</GroupBox>
|
|
|
|
|
|
<GroupBox Header="孔分布区间计算" Margin="5">
|
|
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
|
|
<TextBox Text="{Binding LowerPore}" Width="60" Margin="5"/>
|
|
|
|
|
|
<TextBlock Text="~" VerticalAlignment="Center"/>
|
|
|
|
|
|
<TextBox Text="{Binding UpperPore}" Width="60" Margin="5"/>
|
|
|
|
|
|
<TextBlock Text="μm" VerticalAlignment="Center"/>
|
|
|
|
|
|
<Button Content="计算" Command="{Binding CalculateCommand}" Margin="10,0" Padding="10,5"/>
|
|
|
|
|
|
<TextBlock Text="{Binding RangePercentage, StringFormat={}{0:F1}%}" FontSize="16" VerticalAlignment="Center" Margin="10,0"/>
|
|
|
|
|
|
</StackPanel>
|
|
|
|
|
|
</GroupBox>
|
|
|
|
|
|
<Button Content="生成报告" Command="{Binding GenerateReportCommand}" Padding="15,8" Margin="5"/>
|
2026-03-02 18:50:30 +08:00
|
|
|
|
<Button Content="保存到历史" Command="{Binding SaveCommand}" Padding="15,8" Margin="5"/>
|
|
|
|
|
|
<Button Content="导出Excel" Command="{Binding ExportCommand}" Padding="15,8" Margin="5"/>
|
2026-02-27 16:03:49 +08:00
|
|
|
|
</StackPanel>
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
</UserControl>
|