This commit is contained in:
@@ -22,14 +22,14 @@
|
||||
<Setter Property="Margin" Value="0,15,0,15"/>
|
||||
</Style>
|
||||
|
||||
<!-- 标签样式 -->
|
||||
<!-- 标签样式(宽度减少) -->
|
||||
<Style x:Key="LabelStyle" TargetType="TextBlock">
|
||||
<Setter Property="FontFamily" Value="{StaticResource DefaultFont}"/>
|
||||
<Setter Property="FontSize" Value="15"/>
|
||||
<Setter Property="Foreground" Value="#5D6D7E"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="Margin" Value="0,0,12,0"/>
|
||||
<Setter Property="Width" Value="110"/>
|
||||
<Setter Property="Margin" Value="0,0,8,0"/>
|
||||
<Setter Property="Width" Value="90"/>
|
||||
</Style>
|
||||
|
||||
<!-- 单位样式 -->
|
||||
@@ -38,22 +38,22 @@
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="Foreground" Value="#7F8C8D"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="Margin" Value="8,0,0,0"/>
|
||||
<Setter Property="Margin" Value="5,0,0,0"/>
|
||||
<Setter Property="FontStyle" Value="Italic"/>
|
||||
</Style>
|
||||
|
||||
<!-- 文本框样式 -->
|
||||
<!-- 文本框样式(宽度减少) -->
|
||||
<Style x:Key="TextBoxStyle" TargetType="TextBox">
|
||||
<Setter Property="Height" Value="34"/>
|
||||
<Setter Property="Width" Value="160"/>
|
||||
<Setter Property="FontSize" Value="16"/>
|
||||
<Setter Property="Height" Value="32"/>
|
||||
<Setter Property="Width" Value="140"/>
|
||||
<Setter Property="FontSize" Value="15"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="BorderBrush" Value="#BDC3C7"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Background" Value="#FFFFFF"/>
|
||||
<Setter Property="Foreground" Value="#2C3E50"/>
|
||||
<Setter Property="Padding" Value="6,2"/>
|
||||
<Setter Property="Padding" Value="5,2"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsFocused" Value="True">
|
||||
<Setter Property="BorderBrush" Value="#3498DB"/>
|
||||
@@ -61,7 +61,7 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<!-- 卡片样式(带阴影) -->
|
||||
<!-- 卡片样式 -->
|
||||
<Style x:Key="CardStyle" TargetType="Border">
|
||||
<Setter Property="Background" Value="#FFFFFF"/>
|
||||
<Setter Property="CornerRadius" Value="8"/>
|
||||
@@ -76,9 +76,9 @@
|
||||
<Style x:Key="TabButtonStyle" TargetType="Button">
|
||||
<Setter Property="Background" Value="#2C3E50"/>
|
||||
<Setter Property="FontFamily" Value="{StaticResource DefaultFont}"/>
|
||||
<Setter Property="FontSize" Value="18"/>
|
||||
<Setter Property="FontSize" Value="16"/>
|
||||
<Setter Property="Foreground" Value="#ECF0F1"/>
|
||||
<Setter Property="Height" Value="52"/>
|
||||
<Setter Property="Height" Value="48"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Setter Property="BorderBrush" Value="#34495E"/>
|
||||
<Setter Property="BorderThickness" Value="0,1,0,0"/>
|
||||
@@ -94,8 +94,8 @@
|
||||
<!-- 控制按钮样式 -->
|
||||
<Style x:Key="CtrlButtonStyle" TargetType="Button">
|
||||
<Setter Property="Height" Value="36"/>
|
||||
<Setter Property="Width" Value="110"/>
|
||||
<Setter Property="FontSize" Value="15"/>
|
||||
<Setter Property="Width" Value="100"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
@@ -111,57 +111,56 @@
|
||||
<Grid Margin="20,0,20,10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<!-- 0: 标题 -->
|
||||
<RowDefinition Height="Auto"/>
|
||||
<!-- 1: 参数区 -->
|
||||
<RowDefinition Height="Auto"/>
|
||||
<!-- 2: 数据区 -->
|
||||
<RowDefinition Height="Auto"/>
|
||||
<!-- 3: 控制按钮区 -->
|
||||
<RowDefinition Height="*"/>
|
||||
<!-- 4: 弹性空间(将导航栏推到底部) -->
|
||||
<RowDefinition Height="Auto"/>
|
||||
<!-- 5: 底部导航栏 -->
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 顶部标题栏 -->
|
||||
<!-- 顶部标题 -->
|
||||
<Grid Grid.Row="0" Margin="0,0,0,10">
|
||||
<TextBlock Style="{StaticResource MainTitleStyle}" Text="头罩视野测试系统" HorizontalAlignment="Center"/>
|
||||
</Grid>
|
||||
|
||||
<!-- 第二行:参数显示区(卡片式) -->
|
||||
<Border Grid.Row="1" Style="{StaticResource CardStyle}" Padding="20,15" Margin="0,0,0,20">
|
||||
<!-- 参数区:使用两行布局,避免过宽 -->
|
||||
<Border Grid.Row="1" Style="{StaticResource CardStyle}" Padding="15,12" Margin="0,0,0,20">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 左侧参数组 -->
|
||||
<StackPanel Orientation="Horizontal" Grid.Column="0">
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,30,0">
|
||||
<!-- 第一行参数:分辨角度、当前角度 -->
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" Margin="0,5,0,5">
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,20,0">
|
||||
<TextBlock Text="分辨角度:" Style="{StaticResource LabelStyle}"/>
|
||||
<TextBox Name="fbspeed" Text="" Style="{StaticResource TextBoxStyle}" GotFocus="fbspeed_GotFocus"/>
|
||||
<TextBlock Text="°" Style="{StaticResource UnitStyle}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,30,0">
|
||||
<TextBlock Text="当前角度:" Style="{StaticResource LabelStyle}"/>
|
||||
<TextBox Name="dqangle" Text="" Style="{StaticResource TextBoxStyle}" GotFocus="dqangle_GotFocus"/>
|
||||
<TextBox Name="fbspeed" Style="{StaticResource TextBoxStyle}" GotFocus="fbspeed_GotFocus"/>
|
||||
<TextBlock Text="°" Style="{StaticResource UnitStyle}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="转动速度:" Style="{StaticResource LabelStyle}"/>
|
||||
<TextBox Name="zdangle" Text="" Style="{StaticResource TextBoxStyle}" GotFocus="zdangle_GotFocus"/>
|
||||
<TextBlock Text="°/s" Style="{StaticResource UnitStyle}"/>
|
||||
<TextBlock Text="当前角度:" Style="{StaticResource LabelStyle}"/>
|
||||
<TextBox Name="dqangle" Style="{StaticResource TextBoxStyle}" GotFocus="dqangle_GotFocus"/>
|
||||
<TextBlock Text="°" Style="{StaticResource UnitStyle}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<!-- 右侧:模式切换 + 指示灯 -->
|
||||
<StackPanel Grid.Column="3" Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<ToggleButton x:Name="tbTest" FontSize="14" Width="100" Height="30"
|
||||
Background="#E0E0E0" Margin="0,0,15,0"
|
||||
<!-- 第二行参数:转动速度(单独一行) -->
|
||||
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal" Margin="0,5,0,5">
|
||||
<TextBlock Text="转动速度:" Style="{StaticResource LabelStyle}"/>
|
||||
<TextBox Name="zdangle" Style="{StaticResource TextBoxStyle}" GotFocus="zdangle_GotFocus"/>
|
||||
<TextBlock Text="°/s" Style="{StaticResource UnitStyle}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- 右侧:模式切换和指示灯,垂直居中 -->
|
||||
<StackPanel Grid.Row="0" Grid.RowSpan="2" Grid.Column="1"
|
||||
Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="10,0,0,0">
|
||||
<ToggleButton x:Name="tbTest" FontSize="13" Width="90" Height="28"
|
||||
Background="#E0E0E0" Margin="0,0,12,0"
|
||||
Checked="TbTest_Checked" Unchecked="TbTest_Unchecked">
|
||||
<ToggleButton.Template>
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
@@ -178,72 +177,72 @@
|
||||
</ToggleButton.Template>
|
||||
空白测试
|
||||
</ToggleButton>
|
||||
<TextBlock Text="当前模式:" VerticalAlignment="Center" Margin="0,0,8,0" FontSize="14" Foreground="#5D6D7E"/>
|
||||
<TextBlock x:Name="当前模式" Text="空白测试" VerticalAlignment="Center" FontSize="14" FontWeight="Bold" Foreground="#3A6B4B"/>
|
||||
<StackPanel Orientation="Horizontal" Margin="20,0,0,0">
|
||||
<Ellipse x:Name="led0" Width="20" Height="20" Fill="LightGray" Stroke="#BDC3C7" Margin="5"/>
|
||||
<Ellipse x:Name="led1" Width="20" Height="20" Fill="LightGray" Stroke="#BDC3C7" Margin="5"/>
|
||||
<TextBlock Text="当前模式:" VerticalAlignment="Center" Margin="0,0,6,0" FontSize="13" Foreground="#5D6D7E"/>
|
||||
<TextBlock x:Name="当前模式" Text="空白测试" VerticalAlignment="Center" FontSize="13" FontWeight="Bold" Foreground="#3A6B4B" Margin="0,0,15,0"/>
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<Ellipse x:Name="led0" Width="18" Height="18" Fill="LightGray" Stroke="#BDC3C7" Margin="3,0"/>
|
||||
<Ellipse x:Name="led1" Width="18" Height="18" Fill="LightGray" Stroke="#BDC3C7" Margin="3,0"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- 第三行:视野数据区(两列卡片) -->
|
||||
<!-- 数据区:两列卡片 -->
|
||||
<Grid Grid.Row="2" Margin="0,0,0,20">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 左眼及综合数据卡片 -->
|
||||
<Border Grid.Column="0" Style="{StaticResource CardStyle}" Padding="25,20" Margin="0,0,10,0">
|
||||
<!-- 左侧卡片 -->
|
||||
<Border Grid.Column="0" Style="{StaticResource CardStyle}" Padding="20,15" Margin="0,0,10,0">
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,18">
|
||||
<TextBlock Text="左目视野面积:" Style="{StaticResource LabelStyle}" Width="120"/>
|
||||
<TextBox Name="zmsyarea" Text="" Style="{StaticResource TextBoxStyle}"/>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,15">
|
||||
<TextBlock Text="左目视野面积:" Style="{StaticResource LabelStyle}" Width="110"/>
|
||||
<TextBox Name="zmsyarea" Style="{StaticResource TextBoxStyle}" Width="150"/>
|
||||
<TextBlock Text="cm²" Style="{StaticResource UnitStyle}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,18">
|
||||
<TextBlock Text="双目视野面积:" Style="{StaticResource LabelStyle}" Width="120"/>
|
||||
<TextBox Name="smsyarea" Text="" Style="{StaticResource TextBoxStyle}"/>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,15">
|
||||
<TextBlock Text="双目视野面积:" Style="{StaticResource LabelStyle}" Width="110"/>
|
||||
<TextBox Name="smsyarea" Style="{StaticResource TextBoxStyle}" Width="150"/>
|
||||
<TextBlock Text="cm²" Style="{StaticResource UnitStyle}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="总视野面积:" Style="{StaticResource LabelStyle}" Width="120"/>
|
||||
<TextBox Name="zsyareaNum" Text="" Style="{StaticResource TextBoxStyle}"/>
|
||||
<TextBlock Text="总视野面积:" Style="{StaticResource LabelStyle}" Width="110"/>
|
||||
<TextBox Name="zsyareaNum" Style="{StaticResource TextBoxStyle}" Width="150"/>
|
||||
<TextBlock Text="cm²" Style="{StaticResource UnitStyle}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 右眼及保存率卡片 -->
|
||||
<Border Grid.Column="1" Style="{StaticResource CardStyle}" Padding="25,20" Margin="10,0,0,0">
|
||||
<!-- 右侧卡片 -->
|
||||
<Border Grid.Column="1" Style="{StaticResource CardStyle}" Padding="20,15" Margin="10,0,0,0">
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,18">
|
||||
<TextBlock Text="右目视野面积:" Style="{StaticResource LabelStyle}" Width="120"/>
|
||||
<TextBox Name="ymsyarea" Text="" Style="{StaticResource TextBoxStyle}"/>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,15">
|
||||
<TextBlock Text="右目视野面积:" Style="{StaticResource LabelStyle}" Width="110"/>
|
||||
<TextBox Name="ymsyarea" Style="{StaticResource TextBoxStyle}" Width="150"/>
|
||||
<TextBlock Text="cm²" Style="{StaticResource UnitStyle}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,18">
|
||||
<TextBlock Text="下方视野:" Style="{StaticResource LabelStyle}" Width="120"/>
|
||||
<TextBox Name="xfsyarea" Text="" Style="{StaticResource TextBoxStyle}"/>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,15">
|
||||
<TextBlock Text="下方视野:" Style="{StaticResource LabelStyle}" Width="110"/>
|
||||
<TextBox Name="xfsyarea" Style="{StaticResource TextBoxStyle}" Width="150"/>
|
||||
<TextBlock Text="°" Style="{StaticResource UnitStyle}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,18">
|
||||
<TextBlock Text="双目视野保存率:" Style="{StaticResource LabelStyle}" Width="120"/>
|
||||
<TextBox Name="sybhl" Text="" Style="{StaticResource TextBoxStyle}"/>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,15">
|
||||
<TextBlock Text="双目视野保存率:" Style="{StaticResource LabelStyle}" Width="110"/>
|
||||
<TextBox Name="sybhl" Style="{StaticResource TextBoxStyle}" Width="150"/>
|
||||
<TextBlock Text="%" Style="{StaticResource UnitStyle}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="总视野保存率:" Style="{StaticResource LabelStyle}" Width="120"/>
|
||||
<TextBox Name="zsysaveSum" Text="" Style="{StaticResource TextBoxStyle}"/>
|
||||
<TextBlock Text="总视野保存率:" Style="{StaticResource LabelStyle}" Width="110"/>
|
||||
<TextBox Name="zsysaveSum" Style="{StaticResource TextBoxStyle}" Width="150"/>
|
||||
<TextBlock Text="%" Style="{StaticResource UnitStyle}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<!-- 第四行:控制按钮区 -->
|
||||
<!-- 控制按钮区 -->
|
||||
<Grid Grid.Row="3" Margin="0,0,0,20">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
@@ -258,50 +257,36 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 复位 -->
|
||||
<Button Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Content="复位"
|
||||
Style="{StaticResource CtrlButtonStyle}" Background="#4A6D8C" Margin="5" Click="Button_Click_Reset"/>
|
||||
|
||||
<!-- 左眼开 -->
|
||||
<Button Grid.Row="0" Name="btnLeft" Grid.Column="1" Content="左眼开"
|
||||
Style="{StaticResource CtrlButtonStyle}" Background="#4A6D8C" Margin="5" Click="Button_Click_left"/>
|
||||
|
||||
<!-- 反转(按下/弹起) -->
|
||||
<Button Grid.Row="0" Grid.Column="2" Content="反转"
|
||||
Style="{StaticResource CtrlButtonStyle}" Background="#4A6D8C" Margin="5"
|
||||
PreviewMouseLeftButtonDown="Button_Click_ResDown" PreviewMouseLeftButtonUp="Button_Click_ResUp"/>
|
||||
|
||||
<!-- 右眼开 -->
|
||||
<Button Grid.Row="1" Name="btnRight" Grid.Column="1" Content="右眼开"
|
||||
Style="{StaticResource CtrlButtonStyle}" Background="#4A6D8C" Margin="5" Click="Button_Click_Right"/>
|
||||
|
||||
<!-- 正转(按下/弹起) -->
|
||||
<Button Grid.Row="1" Grid.Column="2" Content="正转"
|
||||
Style="{StaticResource CtrlButtonStyle}" Background="#4A6D8C" Margin="5"
|
||||
PreviewMouseLeftButtonDown="Button_Click_ForDown" PreviewMouseLeftButtonUp="Button_Click_ForUp"/>
|
||||
|
||||
<!-- 测试 -->
|
||||
<Button Grid.Row="0" Grid.Column="4" Name="ButtonTest" Grid.RowSpan="2" Content="测试"
|
||||
Style="{StaticResource CtrlButtonStyle}" Background="#27AE60" Margin="5" Click="Button_Click_Test"/>
|
||||
|
||||
<!-- 停止 -->
|
||||
<Button Grid.Row="0" Grid.Column="5" Grid.RowSpan="2" Content="停止"
|
||||
Style="{StaticResource CtrlButtonStyle}" Background="#E74C3C" Margin="5" Click="Button_Click_Stop"/>
|
||||
</Grid>
|
||||
|
||||
<!-- 第五行:弹性空间(占据剩余高度,将底部导航栏推到窗口底部) -->
|
||||
<!-- 弹性空间 -->
|
||||
<Grid Grid.Row="4" Background="Transparent"/>
|
||||
|
||||
<!-- 底部导航栏(固定在窗口最底部) -->
|
||||
<!-- 底部导航栏 -->
|
||||
<Grid Grid.Row="5" VerticalAlignment="Bottom">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button x:Name="btnNavHome" Style="{StaticResource TabButtonStyle}" Grid.Column="0" Content="主页" Click="GoHome"/>
|
||||
<Button x:Name="btnNavTest" Style="{StaticResource TabButtonStyle}" Grid.Column="1" Content="测试界面" Click="GoTest"/>
|
||||
<Button x:Name="btnNavTest" Style="{StaticResource TabButtonStyle}" Grid.Column="1" Content="测试界面" Click="GoTest"/>
|
||||
<Button x:Name="btnNavRecord" Style="{StaticResource TabButtonStyle}" Grid.Column="2" Content="记录画面" Click="GoView"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
Reference in New Issue
Block a user