This commit is contained in:
82
Views/BubblePointView.xaml
Normal file
82
Views/BubblePointView.xaml
Normal file
@@ -0,0 +1,82 @@
|
||||
<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"/>
|
||||
</UserControl.Resources>
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 输入区域 -->
|
||||
<StackPanel Grid.Row="0">
|
||||
<GroupBox 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"/>
|
||||
</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="2" Content="浸润时间(h):"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="3" Text="{Binding Record.SoakingTime}" Margin="5"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="测试液体" Margin="0,0,0,10">
|
||||
<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>
|
||||
<Label Content="生产厂家:" Margin="5"/>
|
||||
<TextBox Text="{Binding Record.LiquidManufacturer}" Margin="5"/>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="泡点压力" Margin="0,0,0,10">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox Text="{Binding Record.BubblePointPressure}" Width="150" Margin="5"/>
|
||||
<ComboBox ItemsSource="{Binding PressureUnits}" SelectedItem="{Binding Record.PressureUnit}" Width="80" Margin="5"/>
|
||||
<Button Content="计算最大孔径" Command="{Binding CalculateCommand}" Padding="10,5" Margin="5"/>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
|
||||
<!-- 结果显示 -->
|
||||
<GroupBox Grid.Row="1" Header="测试结果" VerticalAlignment="Center">
|
||||
<TextBlock FontSize="36" TextAlignment="Center"
|
||||
Text="{Binding MaxPoreSize, StringFormat={}{0:F3} μm}"/>
|
||||
</GroupBox>
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Content="生成报告" Command="{Binding GenerateReportCommand}" Padding="15,8" Margin="5"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
13
Views/BubblePointView.xaml.cs
Normal file
13
Views/BubblePointView.xaml.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MembranePoreTester.Views
|
||||
{
|
||||
public partial class BubblePointView : UserControl
|
||||
{
|
||||
public BubblePointView()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new ViewModels.BubblePointViewModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
17
Views/MainWindow.xaml
Normal file
17
Views/MainWindow.xaml
Normal file
@@ -0,0 +1,17 @@
|
||||
<Window x:Class="MembranePoreTester.Views.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:MembranePoreTester.Views"
|
||||
Title="膜孔径测试系统 (GB/T 32361-2015)"
|
||||
Width="1024" Height="768"
|
||||
WindowStartupLocation="CenterScreen">
|
||||
<TabControl>
|
||||
<TabItem Header="泡点法测试最大孔径">
|
||||
<local:BubblePointView/>
|
||||
|
||||
</TabItem>
|
||||
<TabItem Header="孔分布测试">
|
||||
<local:PoreDistributionView/>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Window>
|
||||
12
Views/MainWindow.xaml.cs
Normal file
12
Views/MainWindow.xaml.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace MembranePoreTester.Views
|
||||
{
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
121
Views/PoreDistributionView.xaml
Normal file
121
Views/PoreDistributionView.xaml
Normal file
@@ -0,0 +1,121 @@
|
||||
<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"/>
|
||||
</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"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
13
Views/PoreDistributionView.xaml.cs
Normal file
13
Views/PoreDistributionView.xaml.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MembranePoreTester.Views
|
||||
{
|
||||
public partial class PoreDistributionView : UserControl
|
||||
{
|
||||
public PoreDistributionView()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new ViewModels.PoreDistributionViewModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user