This commit is contained in:
xyy
2026-04-02 14:34:29 +08:00
parent e25f4b0e2f
commit 2b3da1e2e5
10 changed files with 245 additions and 92 deletions

View File

@@ -24,6 +24,7 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- 输入区域 -->
@@ -39,19 +40,23 @@
<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="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="室温(°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"/>
<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>
@@ -74,7 +79,7 @@
<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"/>
<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>

View File

@@ -90,83 +90,86 @@
</Style.Triggers>
</Style>
</Window.Resources>
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
<DockPanel>
<DockPanel>
<!-- 顶部历史记录栏 -->
<Border DockPanel.Dock="Top" Background="White" BorderBrush="#E9ECF0" BorderThickness="0,0,0,1" Padding="10,5">
<StackPanel Orientation="Horizontal">
<Button Content="📋 历史记录" Click="OpenHistory_Click" Width="100" HorizontalAlignment="Left" Background="#607D8B"/>
<Button Content="阀门控制" Click="OpenValveControl_Click" Padding="10,5" Margin="5"/>
</StackPanel>
</Border>
<!-- 顶部历史记录栏 -->
<Border DockPanel.Dock="Top" Background="White" BorderBrush="#E9ECF0" BorderThickness="0,0,0,1" Padding="10,5">
<StackPanel Orientation="Horizontal">
<Button Content="📋 历史记录" Click="OpenHistory_Click" Width="100" HorizontalAlignment="Left" Background="#607D8B"/>
<Button Content="阀门控制" Click="OpenValveControl_Click" Padding="10,5" Margin="5"/>
</StackPanel>
</Border>
<!-- 工位选项卡 -->
<TabControl x:Name="stationTabControl" ItemsSource="{Binding Stations}" Background="White" Margin="10,10,10,10">
<TabControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" FontSize="14" FontWeight="Medium"/>
</DataTemplate>
</TabControl.ItemTemplate>
<TabControl.ContentTemplate>
<DataTemplate>
<DockPanel Margin="0,10,0,0">
<!-- 工位控制栏 -->
<Border DockPanel.Dock="Top" Background="White" CornerRadius="6" Padding="10" Margin="0,0,0,10" BorderBrush="#E9ECF0" BorderThickness="1">
<StackPanel Orientation="Horizontal">
<ComboBox ItemsSource="{Binding PressureModeList}" SelectedItem="{Binding SelectedPressureMode}" Width="80"/>
<Button Content="▶ 启动" Command="{Binding StartCommand}" Width="80" Background="#4CAF50"/>
<Button Content="⏹ 停止" Command="{Binding StopCommand}" Width="80" Background="#F44336"/>
<Button Content="{Binding PressButtonText}" Command="{Binding PressCommand}" Width="80" Background="#FF9800"/>
<!-- 工位选项卡 -->
<TabControl x:Name="stationTabControl" ItemsSource="{Binding Stations}" Background="White" Margin="10,10,10,10">
<TabControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" FontSize="14" FontWeight="Medium"/>
</DataTemplate>
</TabControl.ItemTemplate>
<TabControl.ContentTemplate>
<DataTemplate>
<DockPanel Margin="0,10,0,0">
<!-- 工位控制栏 -->
<Border DockPanel.Dock="Top" Background="White" CornerRadius="6" Padding="10" Margin="0,0,0,10" BorderBrush="#E9ECF0" BorderThickness="1">
<StackPanel Orientation="Horizontal">
<ComboBox ItemsSource="{Binding PressureModeList}" SelectedItem="{Binding SelectedPressureMode}" Width="80"/>
<Button Content="▶ 启动" Command="{Binding StartCommand}" Width="80" Background="#4CAF50"/>
<Button Content="⏹ 停止" Command="{Binding StopCommand}" Width="80" Background="#F44336"/>
<Button Content="{Binding PressButtonText}" Command="{Binding PressCommand}" Width="80" Background="#FF9800"/>
<!-- 状态指示灯 -->
<StackPanel Orientation="Horizontal" Margin="15,0,0,0">
<Grid Width="18" Height="18" Margin="2">
<Ellipse Fill="{Binding EnableStatusColor}">
<Ellipse.Effect>
<DropShadowEffect BlurRadius="3" ShadowDepth="0" Opacity="0.3"/>
</Ellipse.Effect>
</Ellipse>
<Ellipse Margin="2" Opacity="0.6">
<Ellipse.Fill>
<RadialGradientBrush>
<GradientStop Color="White" Offset="0.2"/>
<GradientStop Color="Transparent" Offset="1"/>
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse>
</Grid>
<TextBlock Text="{Binding EnableStatusText}" VerticalAlignment="Center" Margin="5,0,0,0" FontSize="12"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="15,0,0,0">
<StackPanel Orientation="Horizontal" Margin="0,0,10,0">
<Label Content="加压上限:" VerticalAlignment="Center" Margin="0,0,5,0"/>
<TextBox x:Name="txtPressureUpper" Width="120" FontSize="16" Height="32" VerticalAlignment="Center" Text="{Binding PressureUpperLimit, UpdateSourceTrigger=LostFocus, StringFormat=F3}" />
<!-- 状态指示灯 -->
<StackPanel Orientation="Horizontal" Margin="15,0,0,0">
<Grid Width="18" Height="18" Margin="2">
<Ellipse Fill="{Binding EnableStatusColor}">
<Ellipse.Effect>
<DropShadowEffect BlurRadius="3" ShadowDepth="0" Opacity="0.3"/>
</Ellipse.Effect>
</Ellipse>
<Ellipse Margin="2" Opacity="0.6">
<Ellipse.Fill>
<RadialGradientBrush>
<GradientStop Color="White" Offset="0.2"/>
<GradientStop Color="Transparent" Offset="1"/>
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse>
</Grid>
<TextBlock Text="{Binding EnableStatusText}" VerticalAlignment="Center" Margin="5,0,0,0" FontSize="12"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="加压速率:" VerticalAlignment="Center" Margin="0,0,5,0"/>
<TextBox x:Name="txtPressureRate" Width="120" FontSize="16" Height="32" VerticalAlignment="Center" Text="{Binding PressureRate, UpdateSourceTrigger=LostFocus, StringFormat=F3}" />
<StackPanel Orientation="Horizontal" Margin="15,0,0,0">
<StackPanel Orientation="Horizontal" Margin="0,0,10,0">
<Label Content="加压上限:" VerticalAlignment="Center" Margin="0,0,5,0"/>
<TextBox x:Name="txtPressureUpper" Width="120" FontSize="16" Height="32" VerticalAlignment="Center" Text="{Binding PressureUpperLimit, UpdateSourceTrigger=LostFocus, StringFormat=F3}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="加压速率:" VerticalAlignment="Center" Margin="0,0,5,0"/>
<TextBox x:Name="txtPressureRate" Width="120" FontSize="16" Height="32" VerticalAlignment="Center" Text="{Binding PressureRate, UpdateSourceTrigger=LostFocus, StringFormat=F3}" />
</StackPanel>
</StackPanel>
</StackPanel>
</Border>
<!-- 测试类型选项卡修复嵌套绑定直接定义两个TabItem -->
<TabControl SelectionChanged="TabControl_SelectionChanged">
<TabItem Header="泡点法测试最大孔径">
<local:BubblePointView DataContext="{Binding BubblePointVM}"/>
</TabItem>
<TabItem Header="孔分布测试">
<local:PoreDistributionView DataContext="{Binding PoreDistributionVM}"/>
</TabItem>
</TabControl>
</DockPanel>
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl>
</StackPanel>
</Border>
</DockPanel>
</ScrollViewer>
<!-- 测试类型选项卡修复嵌套绑定直接定义两个TabItem -->
<TabControl SelectionChanged="TabControl_SelectionChanged">
<TabItem Header="泡点法测试最大孔径">
<local:BubblePointView DataContext="{Binding BubblePointVM}"/>
</TabItem>
<TabItem Header="孔分布测试">
<local:PoreDistributionView DataContext="{Binding PoreDistributionVM}"/>
</TabItem>
</TabControl>
</DockPanel>
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl>
</DockPanel>
</Window>

View File

@@ -5,7 +5,34 @@
WindowStartupLocation="CenterOwner">
<ScrollViewer>
<StackPanel Margin="10">
<!--<GroupBox Header="加压速率">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="*"/>
--><!-- 预留空白 --><!--
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" FontWeight="Bold">工位</Label>
<Label Grid.Row="0" Grid.Column="1" FontWeight="Bold">加压速率</Label>
<Label Grid.Row="1" Grid.Column="0">工位1</Label>
<TextBox x:Name="txtHPCoeff11" Grid.Row="1" Grid.Column="1" Width="80" HorizontalAlignment="Left"/>
</Grid>
</GroupBox>-->
<GroupBox Header="高压/低压系数">
<Grid>

View File

@@ -32,6 +32,7 @@ namespace MembranePoreTester.Views
//[txtPressureRate] = (_config.PressureRate, "加压速率"),
//[txtPressureCoeff] = (_config.PressureCoeff, "加压系数"),
//[txtHPCoeff11] = (_config.HPCoeff11, "工位1加压速率"),
[txtHPCoeff1] = (_config.HPCoeff1, "工位1高压系数"),
[txtLPCoeff1] = (_config.LPCoeff1, "工位1低压系数"),
[txtHPCoeff2] = (_config.HPCoeff2, "工位2高压系数"),

View File

@@ -124,16 +124,17 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<!-- 新增第5行 -->
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="膜类型:"/>
<ComboBox Grid.Row="0" Grid.Column="1" ItemsSource="{Binding MembraneTypes}"
SelectedItem="{Binding Record.SampleType}"/>
<!--<Label Grid.Row="0" Grid.Column="2" Content="规格:"/>
<TextBox Grid.Row="0" Grid.Column="3" Text="{Binding Record.SampleSpec}"/>-->
<Label Grid.Row="0" Grid.Column="2" Content="室温(°C):"/>
<TextBox Grid.Row="0" Grid.Column="3" Text="{Binding Record.RoomTemperature}"/>
<!--<Label Grid.Row="0" Grid.Column="2" Content="室温(°C):"/>
<TextBox Grid.Row="0" Grid.Column="3" Text="{Binding Record.RoomTemperature}"/>-->
<Label Grid.Row="1" Grid.Column="2" Content="浸润时间(h):"/>
<TextBox Grid.Row="1" Grid.Column="3" Text="{Binding Record.SoakingTime}"/>
@@ -162,6 +163,25 @@
Width="90"
HorizontalAlignment="Center"
Margin="0,5,5,5"/>
<!--<StackPanel Orientation="Horizontal" Grid.Row="4">
<TextBlock Text="实时流量:" VerticalAlignment="Center" Margin="0,0,5,0"/>
<TextBox Text="{Binding CurrentFlow, StringFormat=F2}"
IsReadOnly="True"
Width="70"
Background="Transparent"
BorderThickness="0"
FontWeight="Bold"
Foreground="#2196F3"/>
<TextBlock Text="L/min" VerticalAlignment="Center" Margin="5,0,0,0"/>
</StackPanel>-->
<Label Grid.Row="4" Grid.Column="0" Content="实时流量(L/min):"/>
<TextBox Grid.Row="4" Grid.Column="1" IsEnabled="False" Text="{Binding CurrentFlow, StringFormat=F2}"/>
</Grid>
</GroupBox>