This commit is contained in:
@@ -54,8 +54,8 @@
|
||||
<Label Content="表面张力(mN/m):"/>
|
||||
<TextBox Text="{Binding CustomSurfaceTension}" Width="100" Margin="5"/>
|
||||
</StackPanel>
|
||||
<Label Content="生产厂家:" Margin="5"/>
|
||||
<TextBox Text="{Binding Record.LiquidManufacturer}" Margin="5"/>
|
||||
<!--<Label Content="生产厂家:" Margin="5"/>
|
||||
<TextBox Text="{Binding Record.LiquidManufacturer}" Margin="5"/>-->
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox Text="{Binding Record.BubblePointPressure}" Width="150" Margin="5"/>
|
||||
|
||||
<Button Content="读取PLC" Command="{Binding ReadPlcCommand}" Padding="10,5" Margin="5"/>
|
||||
<Button Content="涨破" Command="{Binding ReadPlcCommand}" Padding="10,5" 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>
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
<Window.DataContext>
|
||||
<viewModels:MainViewModel />
|
||||
</Window.DataContext>
|
||||
|
||||
|
||||
<DockPanel LastChildFill="True">
|
||||
<DockPanel>
|
||||
<!-- 全局历史记录按钮 -->
|
||||
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="5">
|
||||
<Button Content="历史记录" Click="OpenHistory_Click" Padding="10,5" Margin="5"/>
|
||||
</StackPanel>
|
||||
|
||||
<TabControl ItemsSource="{Binding Stations}">
|
||||
<!-- 工位选项卡 -->
|
||||
<TabControl x:Name="stationTabControl" ItemsSource="{Binding Stations}">
|
||||
<TabControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Name}"/>
|
||||
@@ -24,42 +24,43 @@
|
||||
</TabControl.ItemTemplate>
|
||||
<TabControl.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<!-- 每个工位内部再嵌套一个TabControl切换测试类型 -->
|
||||
<TabControl>
|
||||
<TabItem Header="泡点法测试最大孔径">
|
||||
<local:BubblePointView DataContext="{Binding BubblePointVM}"/>
|
||||
</TabItem>
|
||||
<TabItem Header="孔分布测试">
|
||||
<local:PoreDistributionView DataContext="{Binding PoreDistributionVM}"/>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
<DockPanel>
|
||||
<!-- 工位控制栏 -->
|
||||
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="5">
|
||||
<ComboBox SelectedItem="{Binding HighLowPressure}" Width="80" Margin="5">
|
||||
<ComboBoxItem IsSelected="True">低压</ComboBoxItem>
|
||||
<ComboBoxItem>高压</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<Button Content="启动" Command="{Binding StartCommand}" Width="80" Margin="5"/>
|
||||
<Button Content="停止" Command="{Binding StopCommand}" Width="80" Margin="5"/>
|
||||
|
||||
|
||||
<Button Content="{Binding PressButtonText}" Command="{Binding PressCommand}" Width="80" Margin="5"/>
|
||||
<!--<Button Content="涨破" Command="{Binding BurstCommand}" Width="80" Margin="5"/>-->
|
||||
|
||||
<!--<CheckBox Content="使能" IsChecked="{Binding EnableChecked}" Margin="5"/>-->
|
||||
<!-- 原来的复选框 -->
|
||||
<!-- <CheckBox Content="使能" IsChecked="{Binding EnableChecked}" Margin="5"/> -->
|
||||
|
||||
<!-- 替换为状态指示灯 -->
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<Ellipse Width="12" Height="12" Fill="{Binding EnableStatusColor}" Margin="2"/>
|
||||
<TextBlock Text="{Binding EnableStatusText}" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<!-- 测试类型选项卡 -->
|
||||
<TabControl>
|
||||
<TabItem Header="泡点法测试最大孔径">
|
||||
<local:BubblePointView DataContext="{Binding BubblePointVM}"/>
|
||||
</TabItem>
|
||||
<TabItem Header="孔分布测试">
|
||||
<local:PoreDistributionView DataContext="{Binding PoreDistributionVM}"/>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</DockPanel>
|
||||
</DataTemplate>
|
||||
</TabControl.ContentTemplate>
|
||||
</TabControl>
|
||||
</DockPanel>
|
||||
</Window>
|
||||
|
||||
|
||||
|
||||
|
||||
<!--<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>-->
|
||||
|
||||
|
||||
|
||||
|
||||
</Window>
|
||||
@@ -35,8 +35,9 @@ namespace MembranePoreTester.Views
|
||||
var mainVM = DataContext as MainViewModel;
|
||||
if (mainVM == null) return;
|
||||
|
||||
// 获取当前选中的工位(可选)
|
||||
int currentStation = 1; // 可获取当前Tab索引+1
|
||||
// 获取当前选中的工位索引(假设选项卡控件是 TabControl,名称为 stationTabControl)
|
||||
// 需要在 XAML 中为 TabControl 设置 x:Name="stationTabControl"
|
||||
int currentStation = stationTabControl.SelectedIndex + 1; // 假设索引从0开始
|
||||
var historyWin = new HistoryWindow { SelectedStation = currentStation };
|
||||
historyWin.ShowDialog();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user