246 lines
13 KiB
Plaintext
246 lines
13 KiB
Plaintext
|
|
<Window x:Class="MembranePoreTester.TestView"
|
||
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||
|
|
Title="测试界面"
|
||
|
|
Width="1024" MinHeight="768" WindowState="Maximized"
|
||
|
|
WindowStartupLocation="CenterOwner"
|
||
|
|
Background="#F5F7FA" FontFamily="Segoe UI" KeyDown="Window_KeyDown">
|
||
|
|
|
||
|
|
<Window.Resources>
|
||
|
|
<!-- 统一按钮样式(与 MainWindow 一致) -->
|
||
|
|
<Style TargetType="Button">
|
||
|
|
<Setter Property="Background" Value="#2196F3"/>
|
||
|
|
<Setter Property="Foreground" Value="White"/>
|
||
|
|
<Setter Property="BorderThickness" Value="0"/>
|
||
|
|
<Setter Property="Padding" Value="12,6"/>
|
||
|
|
<Setter Property="Margin" Value="5"/>
|
||
|
|
<Setter Property="FontSize" Value="12"/>
|
||
|
|
<Setter Property="Cursor" Value="Hand"/>
|
||
|
|
<Setter Property="Template">
|
||
|
|
<Setter.Value>
|
||
|
|
<ControlTemplate TargetType="Button">
|
||
|
|
<Border Background="{TemplateBinding Background}" CornerRadius="4" Padding="{TemplateBinding Padding}">
|
||
|
|
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||
|
|
</Border>
|
||
|
|
</ControlTemplate>
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
<Style.Triggers>
|
||
|
|
<Trigger Property="IsMouseOver" Value="True">
|
||
|
|
<Setter Property="Background" Value="#1976D2"/>
|
||
|
|
</Trigger>
|
||
|
|
<Trigger Property="IsPressed" Value="True">
|
||
|
|
<Setter Property="Background" Value="#0D47A1"/>
|
||
|
|
</Trigger>
|
||
|
|
</Style.Triggers>
|
||
|
|
</Style>
|
||
|
|
|
||
|
|
<!-- 统一文本框样式 -->
|
||
|
|
<Style TargetType="TextBox">
|
||
|
|
<Setter Property="Height" Value="28"/>
|
||
|
|
<Setter Property="Margin" Value="5"/>
|
||
|
|
<Setter Property="FontSize" Value="12"/>
|
||
|
|
<Setter Property="Background" Value="White"/>
|
||
|
|
<Setter Property="BorderBrush" Value="#D0D3D9"/>
|
||
|
|
<Setter Property="BorderThickness" Value="1"/>
|
||
|
|
<Setter Property="Padding" Value="5,2"/>
|
||
|
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||
|
|
</Style>
|
||
|
|
|
||
|
|
<!-- 只读文本框样式 -->
|
||
|
|
<Style x:Key="ReadOnlyTextBox" TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
|
||
|
|
<Setter Property="IsReadOnly" Value="True"/>
|
||
|
|
<Setter Property="Background" Value="#F5F5F5"/>
|
||
|
|
<Setter Property="Foreground" Value="#2196F3"/>
|
||
|
|
<Setter Property="FontWeight" Value="Bold"/>
|
||
|
|
</Style>
|
||
|
|
|
||
|
|
<!-- 统一标签样式 -->
|
||
|
|
<Style TargetType="Label">
|
||
|
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||
|
|
<Setter Property="FontSize" Value="12"/>
|
||
|
|
<Setter Property="Foreground" Value="#2C3E50"/>
|
||
|
|
<Setter Property="Margin" Value="5"/>
|
||
|
|
</Style>
|
||
|
|
|
||
|
|
<!-- 统一GroupBox样式 -->
|
||
|
|
<Style TargetType="GroupBox">
|
||
|
|
<Setter Property="Background" Value="White"/>
|
||
|
|
<Setter Property="BorderBrush" Value="#E9ECF0"/>
|
||
|
|
<Setter Property="BorderThickness" Value="1"/>
|
||
|
|
<Setter Property="Margin" Value="0,0,0,12"/>
|
||
|
|
<Setter Property="Padding" Value="12"/>
|
||
|
|
<Setter Property="Template">
|
||
|
|
<Setter.Value>
|
||
|
|
<ControlTemplate TargetType="GroupBox">
|
||
|
|
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="6">
|
||
|
|
<Grid Margin="10">
|
||
|
|
<Grid.RowDefinitions>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
<RowDefinition Height="*"/>
|
||
|
|
</Grid.RowDefinitions>
|
||
|
|
<TextBlock Grid.Row="0" Text="{TemplateBinding Header}" FontWeight="SemiBold" FontSize="14" Margin="0,0,0,12"/>
|
||
|
|
<ContentPresenter Grid.Row="1" Content="{TemplateBinding Content}"/>
|
||
|
|
</Grid>
|
||
|
|
</Border>
|
||
|
|
</ControlTemplate>
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
</Style>
|
||
|
|
|
||
|
|
<!-- 统一 RadioButton 样式 -->
|
||
|
|
<Style TargetType="RadioButton">
|
||
|
|
<Setter Property="FontSize" Value="12"/>
|
||
|
|
<Setter Property="Foreground" Value="White"/>
|
||
|
|
<Setter Property="Margin" Value="5"/>
|
||
|
|
</Style>
|
||
|
|
</Window.Resources>
|
||
|
|
|
||
|
|
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||
|
|
<Grid Margin="12">
|
||
|
|
<Grid.RowDefinitions>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
</Grid.RowDefinitions>
|
||
|
|
|
||
|
|
<!-- 标题栏(蓝底卡片) -->
|
||
|
|
<Border Grid.Row="0" Background="#2196F3" CornerRadius="6" Padding="12" Margin="0,0,0,12">
|
||
|
|
<Grid VerticalAlignment="Center">
|
||
|
|
<Grid.ColumnDefinitions>
|
||
|
|
<ColumnDefinition Width="Auto"/>
|
||
|
|
<ColumnDefinition Width="*"/>
|
||
|
|
<ColumnDefinition Width="Auto"/>
|
||
|
|
</Grid.ColumnDefinitions>
|
||
|
|
|
||
|
|
<TextBlock Text="测试界面" FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center"/>
|
||
|
|
|
||
|
|
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center">
|
||
|
|
<TextBlock Text="当前模式:" Foreground="White" FontSize="14" VerticalAlignment="Center" Margin="0,0,10,0"/>
|
||
|
|
<Border Background="White" CornerRadius="20" Padding="12,4">
|
||
|
|
<TextBlock Text="{Binding CurrentMode}" Foreground="#2196F3" FontSize="14" FontWeight="Bold"/>
|
||
|
|
</Border>
|
||
|
|
</StackPanel>
|
||
|
|
|
||
|
|
<StackPanel Grid.Column="2" Orientation="Horizontal" >
|
||
|
|
<RadioButton Content="空白模式" IsChecked="{Binding IsBlankMode}" GroupName="TestMode" Foreground="White" FontSize="13"/>
|
||
|
|
<RadioButton Content="试样测试" IsChecked="{Binding IsSampleMode}" GroupName="TestMode" Foreground="White" FontSize="13" Margin="10,5,0,0"/>
|
||
|
|
</StackPanel>
|
||
|
|
</Grid>
|
||
|
|
</Border>
|
||
|
|
|
||
|
|
<!-- 参数设置区域 -->
|
||
|
|
<GroupBox Grid.Row="1" Header="⚙️ 参数设置" Margin="0,0,0,12">
|
||
|
|
<Grid Margin="5">
|
||
|
|
<Grid.ColumnDefinitions>
|
||
|
|
<ColumnDefinition Width="*"/>
|
||
|
|
<ColumnDefinition Width="*"/>
|
||
|
|
<ColumnDefinition Width="*"/>
|
||
|
|
</Grid.ColumnDefinitions>
|
||
|
|
|
||
|
|
<StackPanel Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Center">
|
||
|
|
<Label Content="分辨角度:" Margin="0,0,5,0"/>
|
||
|
|
<TextBox Text="{Binding ResolutionAngle, UpdateSourceTrigger=PropertyChanged}" Width="80"/>
|
||
|
|
<Label Content="°" Margin="5,0,0,0"/>
|
||
|
|
</StackPanel>
|
||
|
|
|
||
|
|
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center">
|
||
|
|
<Label Content="转动速度:" Margin="0,0,5,0"/>
|
||
|
|
<TextBox Text="{Binding RotationSpeed, UpdateSourceTrigger=PropertyChanged}" Width="80"/>
|
||
|
|
<Label Content="°/s" Margin="5,0,0,0"/>
|
||
|
|
</StackPanel>
|
||
|
|
|
||
|
|
<StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Center">
|
||
|
|
<Label Content="当前角度:" Margin="0,0,5,0"/>
|
||
|
|
<TextBox Text="{Binding CurrentAngle, UpdateSourceTrigger=PropertyChanged}" Width="80" Background="#F5F5F5" Foreground="#2196F3" FontWeight="Bold"/>
|
||
|
|
<Label Content="°" Margin="5,0,0,0"/>
|
||
|
|
</StackPanel>
|
||
|
|
</Grid>
|
||
|
|
</GroupBox>
|
||
|
|
|
||
|
|
<!-- 视野面积数据区域 -->
|
||
|
|
<GroupBox Grid.Row="2" Header="👁️ 视野面积数据" Margin="0,0,0,12">
|
||
|
|
<Grid Margin="5">
|
||
|
|
<Grid.ColumnDefinitions>
|
||
|
|
<ColumnDefinition Width="*"/>
|
||
|
|
<ColumnDefinition Width="*"/>
|
||
|
|
</Grid.ColumnDefinitions>
|
||
|
|
<Grid.RowDefinitions>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
</Grid.RowDefinitions>
|
||
|
|
|
||
|
|
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" Margin="5">
|
||
|
|
<Label Content="左目视野面积:" Width="110"/>
|
||
|
|
<TextBox Text="{Binding LeftEyeArea}" Width="100" IsReadOnly="True" Background="#F5F5F5" Foreground="#2196F3" FontWeight="Bold"/>
|
||
|
|
<Label Content="cm²" Margin="5,0,0,0"/>
|
||
|
|
</StackPanel>
|
||
|
|
|
||
|
|
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal" Margin="5">
|
||
|
|
<Label Content="右目视野面积:" Width="110"/>
|
||
|
|
<TextBox Text="{Binding RightEyeArea}" Width="100" IsReadOnly="True" Background="#F5F5F5" Foreground="#2196F3" FontWeight="Bold"/>
|
||
|
|
<Label Content="cm²" Margin="5,0,0,0"/>
|
||
|
|
</StackPanel>
|
||
|
|
|
||
|
|
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal" Margin="5">
|
||
|
|
<Label Content="双目视野面积:" Width="110"/>
|
||
|
|
<TextBox Text="{Binding BinocularArea}" Width="100" IsReadOnly="True" Background="#F5F5F5" Foreground="#2196F3" FontWeight="Bold"/>
|
||
|
|
<Label Content="cm²" Margin="5,0,0,0"/>
|
||
|
|
</StackPanel>
|
||
|
|
|
||
|
|
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" Margin="5">
|
||
|
|
<Label Content="下方视野:" Width="110"/>
|
||
|
|
<TextBox Text="{Binding LowerField}" Width="100" IsReadOnly="True" Background="#F5F5F5" Foreground="#2196F3" FontWeight="Bold"/>
|
||
|
|
<Label Content="°" Margin="5,0,0,0"/>
|
||
|
|
</StackPanel>
|
||
|
|
|
||
|
|
<StackPanel Grid.Row="2" Grid.Column="0" Orientation="Horizontal" Margin="5">
|
||
|
|
<Label Content="空白视野面积:" Width="110"/>
|
||
|
|
<TextBox Text="{Binding BlankArea}" Width="100" IsReadOnly="True" Background="#F5F5F5" Foreground="#2196F3" FontWeight="Bold"/>
|
||
|
|
<Label Content="cm²" Margin="5,0,0,0"/>
|
||
|
|
</StackPanel>
|
||
|
|
|
||
|
|
<StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal" Margin="5">
|
||
|
|
<Label Content="视野保存率:" Width="110"/>
|
||
|
|
<TextBox Text="{Binding FieldRetentionRate}" Width="100" IsReadOnly="True" Background="#F5F5F5" Foreground="#2196F3" FontWeight="Bold"/>
|
||
|
|
<Label Content="%" Margin="5,0,0,0"/>
|
||
|
|
</StackPanel>
|
||
|
|
</Grid>
|
||
|
|
</GroupBox>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<!-- 控制按钮区域 -->
|
||
|
|
<GroupBox Grid.Row="3" Header="🎮 设备控制" Margin="0,0,0,12">
|
||
|
|
<WrapPanel HorizontalAlignment="Center" Margin="5">
|
||
|
|
<Button Content="🔄 复位" Command="{Binding ResetCommand}" Background="#607D8B"/>
|
||
|
|
<Button Content="👁️ 左眼开" Command="{Binding OpenLeftEyeCommand}" Background="#4CAF50"/>
|
||
|
|
<Button Content="↩️ 反转" Command="{Binding ReverseCommand}" Background="#FF9800"/>
|
||
|
|
<Button Content="👁️ 右眼开" Command="{Binding OpenRightEyeCommand}" Background="#4CAF50"/>
|
||
|
|
<Button Content="↪️ 正转" Command="{Binding ForwardCommand}" Background="#FF9800"/>
|
||
|
|
<Button Content="▶️ 测试" Command="{Binding StartTestCommand}" Background="#2196F3"/>
|
||
|
|
<Button Content="⏹️ 停止" Command="{Binding StopTestCommand}" Background="#F44336"/>
|
||
|
|
</WrapPanel>
|
||
|
|
</GroupBox>
|
||
|
|
|
||
|
|
<!-- 底部导航栏 -->
|
||
|
|
<Border Grid.Row="4" Background="White" CornerRadius="6" Padding="10" Margin="0,12,0,0" BorderBrush="#E9ECF0" BorderThickness="1">
|
||
|
|
<WrapPanel HorizontalAlignment="Center">
|
||
|
|
<Button Content="🏠 主页" Command="{Binding NavigateHomeCommand}" Width="100" Background="#607D8B"/>
|
||
|
|
<Button Content="🧪 测试界面" Command="{Binding NavigateTestCommand}" Width="100" Background="#2196F3"/>
|
||
|
|
<Button Content="📊 数据记录" Command="{Binding NavigateDataRecordCommand}" Width="100" Background="#4CAF50"/>
|
||
|
|
<Button Content="📸 记录画面" Command="{Binding NavigateRecordScreenCommand}" Width="100" Background="#FF9800"/>
|
||
|
|
</WrapPanel>
|
||
|
|
</Border>
|
||
|
|
</Grid>
|
||
|
|
</ScrollViewer>
|
||
|
|
</Window>
|