<Page x:Class="头罩视野.Views.VisiData"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:头罩视野.Views"
      mc:Ignorable="d" 
      d:DesignHeight="769" d:DesignWidth="1024"
       Background="#F5F7FA"
      Title="VisiData" Loaded="Page_Loaded"  Unloaded="Page_Unloaded" >
    <Page.Resources>
        <!-- 标题样式 -->
        <Style x:Key="MainTitleStyle" TargetType="TextBlock">
            <Setter Property="FontSize" Value="28"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="Foreground" Value="#2C3E50"/>
            <Setter Property="HorizontalAlignment" Value="Center"/>
            <Setter Property="Margin" Value="2"/>
        </Style>

        <Style x:Key="LabelStyle" TargetType="TextBlock">
            <Setter Property="FontSize" Value="16"/>
            <Setter Property="Foreground" Value="#5D6D7E"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Margin" Value="0,0,10,0"/>
            <Setter Property="Margin" Value="0,0,10,0"/>
            <Setter Property="Width" Value="105"/>
        </Style>
        <Style x:Key="TextBoxStyle" TargetType="TextBox">
            <Setter Property="Height" Value="40"/>
            <Setter Property="Width" Value="150"/>
            <Setter Property="FontSize" Value="18"/>
            <Setter Property="TextAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="BorderBrush" Value="#D5D8DC"/>
            <Setter Property="BorderThickness" Value="2"/>
            <Setter Property="Background" Value="#FFFFFF"/>
            <Setter Property="Foreground" Value="#2C3E50"/>
            <Setter Property="Padding" Value="10,5"/>
            <Style.Triggers>
                <Trigger Property="IsFocused" Value="True">
                    <Setter Property="BorderBrush" Value="#3498DB"/>
                </Trigger>
            </Style.Triggers>
        </Style>
        <Style x:Key="TabButtonStyle" TargetType="Button">
            <Setter Property="Background" Value="#3498DB"/>
            <Setter Property="FontSize" Value="20"/>
            <Setter Property="Foreground" Value="#fff"/>
            <Setter Property="Height" Value="70"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="BorderBrush" Value="#fff"/>
        </Style>
        <!--<Style x:Key="ActButtonStyle" TargetType="Button">
            <Setter Property="Background" Value="#8AB1EB"/>
            <Setter Property="FontSize" Value="18"/>
            <Setter Property="Foreground" Value="#fff"/>
            <Setter Property="Height" Value="60"/>
            <Setter Property="Width" Value="120"/>
        </Style>-->
    </Page.Resources>
    <Grid Margin="10">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <!-- 顶部标题栏 -->
        <Grid Grid.Row="0" Margin="0 0 0 10">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="122*"/>
                <ColumnDefinition Width="129*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <!-- 测试界面标题 -->
            <TextBlock Grid.Column="2" Style="{StaticResource MainTitleStyle}" Text="隐藏数据" VerticalAlignment="Center" Grid.ColumnSpan="2" RenderTransformOrigin="0.5,0.5">
                <TextBlock.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform AngleX="2.439"/>
                        <RotateTransform/>
                        <TranslateTransform X="-0.757"/>
                    </TransformGroup>
                </TextBlock.RenderTransform>
            </TextBlock>

        </Grid>

        <!-- 第二行：参数显示区 -->
        <Grid Grid.Row="1" Margin="0 0 0 0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Border Grid.Row="0" Grid.Column="0"  Background="#FFFFFF" CornerRadius="10" 
                        BorderBrush="#E5E8E8" BorderThickness="1" 
                        Padding="25,20" Margin="0,1,20,14"    >
                <StackPanel Cursor="" Grid.Column="0">
                    <StackPanel Orientation="Horizontal" Margin="0,0,0,15">
                        <TextBlock Text="上灯条数据1：" Style="{StaticResource LabelStyle}"/>
                        <TextBox Name="sdtsj1"  Text="" Style="{StaticResource TextBoxStyle}"/>
                    </StackPanel>

                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="上灯条数据2：" Style="{StaticResource LabelStyle}"/>
                        <TextBox  Name="sdtsj2" Text="" Style="{StaticResource TextBoxStyle}"/>

                    </StackPanel>

                    <StackPanel Orientation="Horizontal" Margin="0,15,0,0">
                        <TextBlock Text="上灯条数据3：" Style="{StaticResource LabelStyle}"/>
                        <TextBox  Name="sdtsj3" Text="" Style="{StaticResource TextBoxStyle}"/>

                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="0,15,0,15">
                        <TextBlock Text="上灯条数据4：" Style="{StaticResource LabelStyle}"/>
                        <TextBox Name="sdtsj4"   Text="" Style="{StaticResource TextBoxStyle}" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="上灯条数据5：" Style="{StaticResource LabelStyle}"/>
                        <TextBox Name="sdtsj5"  Text="" Style="{StaticResource TextBoxStyle}"/>
                    </StackPanel>
                </StackPanel>
            </Border>
            <Border Grid.Column="1"  Background="#FFFFFF" CornerRadius="10" 
            BorderBrush="#E5E8E8" BorderThickness="1" 
            Padding="20,20" Margin="0,0,20,15"   >
                <StackPanel Cursor="" Grid.Column="0">
                    <StackPanel Orientation="Horizontal" Margin="0,0,0,15">
                        <TextBlock Text="下灯条数据1：" Style="{StaticResource LabelStyle}"/>
                        <TextBox Name="xdtsj1"  Text="" Style="{StaticResource TextBoxStyle}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="下灯条数据2：" Style="{StaticResource LabelStyle}"/>
                        <TextBox Name="xdtsj2" Text="" Style="{StaticResource TextBoxStyle}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="0,15,0,0">
                        <TextBlock Text="下灯条数据3：" Style="{StaticResource LabelStyle}"/>
                        <TextBox Name="xdtsj3" Text="" Style="{StaticResource TextBoxStyle}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="0,15,0,0">
                        <TextBlock Text="下灯条数据4：" Style="{StaticResource LabelStyle}"/>
                        <TextBox Name="xdtsj4"  Text="" Style="{StaticResource TextBoxStyle}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="0,15,0,0">
                        <TextBlock Text="下灯条数据5：" Style="{StaticResource LabelStyle}"/>
                        <TextBox Name="xdtsj5" Text="" Style="{StaticResource TextBoxStyle}"/>
                    </StackPanel>
                </StackPanel>

            </Border>
            <Border Grid.Column="2"  Background="#FFFFFF" CornerRadius="10" 
 BorderBrush="#E5E8E8" BorderThickness="1" 
  Padding="20,20" Margin="0,0,0,15"    >
                <StackPanel Cursor="" Grid.Column="0">
                    <StackPanel Orientation="Horizontal" Margin="0,0,0,15">
                        <TextBlock Text="左眼面积系数：" Style="{StaticResource LabelStyle}"/>
                        <TextBox Name="zymjxs"   Text="" Style="{StaticResource TextBoxStyle}" Width="156"/>

                    </StackPanel>

                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="右眼面积系数：" Style="{StaticResource LabelStyle}"/>
                        <TextBox Name="yymjxs" Text="" Style="{StaticResource TextBoxStyle}" Width="156"/>
                    </StackPanel>

                    <StackPanel Orientation="Horizontal" Margin="0,15,0,0">
                        <TextBlock Text="保存矫正系数：" Style="{StaticResource LabelStyle}"/>
                        <TextBox Name="bcjzxs" Text="" Style="{StaticResource TextBoxStyle}" Width="158"/>

                    </StackPanel>

                </StackPanel>

            </Border>
        </Grid>

        <!-- 第三行：视野数据区 -->
        <Grid Grid.Row="2" Margin="0 0 0 10">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Border Grid.Row="0" Grid.Column="0" Background="#FFFFFF" CornerRadius="10" 
                BorderBrush="#E5E8E8" BorderThickness="1" 
                Padding="25,20" Margin="0,0,0,0"  >
                <StackPanel Cursor="">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="中灯条数据1：" Style="{StaticResource LabelStyle}"/>
                        <TextBox Name="zdtsj1"  Text="" Style="{StaticResource TextBoxStyle}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="0,15,0,0">
                        <TextBlock Text="中灯条数据2：" Style="{StaticResource LabelStyle}"/>
                        <TextBox  Name="zdtsj2"  Text="" Style="{StaticResource TextBoxStyle}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="0,15,0,0">
                        <TextBlock Text="中灯条数据3：" Style="{StaticResource LabelStyle}"/>
                        <TextBox Name="zdtsj3"   Text="" Style="{StaticResource TextBoxStyle}"/>
                    </StackPanel>
                </StackPanel>
            </Border>
            <Border Grid.Row="1" Grid.Column="1" Background="#FFFFFF" CornerRadius="10" 
BorderBrush="#E5E8E8" BorderThickness="1" 
Padding="20" Margin="20,0,0,0"  >
                <StackPanel Cursor="">
                    <StackPanel Orientation="Horizontal" Margin="0,15,0,0">
                        <TextBlock  Text="中灯条数据4：" Style="{StaticResource LabelStyle}"/>
                        <TextBox  Name="zdtsj4"  Text="" Style="{StaticResource TextBoxStyle}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="0,15,0,0">
                        <TextBlock  Text="中灯条数据5：" Style="{StaticResource LabelStyle}"/>
                        <TextBox  Name="zdtsj5"  Text="" Style="{StaticResource TextBoxStyle}"/>
                    </StackPanel>
                </StackPanel>
            </Border>
            <Border Grid.Row="2" Grid.Column="2" Background="#FFFFFF" CornerRadius="10" 
                BorderBrush="#E5E8E8" BorderThickness="1" 
                Padding="25,20" Margin="20,0,0,0"  >
                <StackPanel Cursor="">

                    <StackPanel Orientation="Horizontal" Margin="0,15,0,0">
                        <TextBlock Text="复位补偿：" Style="{StaticResource LabelStyle}"/>
                        <TextBox Name="fwbc" Text="" Style="{StaticResource TextBoxStyle}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="0,15,0,0">
                        <TextBlock Text="电机限位：" Style="{StaticResource LabelStyle}"/>
                        <TextBox  Name="djxw" Text="" Style="{StaticResource TextBoxStyle}"/>
                    </StackPanel>

                </StackPanel>
            </Border>
        </Grid>

        <!-- 第四行：控制按钮区 -->
        <Grid Grid.Row="3" Margin="0 10 0 10">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <!-- 复位 -->
            <Button Grid.Row="0"  Grid.Column="0" Content="复位" FontSize="18"
                    Width="120" Height="40" Background="red"  Foreground="White"  Margin="5" Click="Button_Click_Reset" />

            <!-- 左眼开 -->
            <Button Grid.Row="0"  Name="btnLeft" Grid.Column="1" Content="左眼开" FontSize="18"
                    Width="120" Height="40" Background="#FF87CEFA"  Foreground="White"   Margin="5" Click="Button_Click_left"/>

            <!-- 反转 -->
            <Button Grid.Row="0" Grid.Column="2" Content="反转" FontSize="18"
                    Width="120" Height="40" Background="#FF87CEFA"  Foreground="White"   Margin="5"  PreviewMouseLeftButtonDown="Button_Click_ResDown" 
    PreviewMouseLeftButtonUp="Button_Click_ResUp" />

            <!-- 右眼开 -->
            <Button Grid.Column="3" Name="btnRight" Content="右眼开" FontSize="18"
                    Width="120" Height="40" Background="#FF87CEFA"  Foreground="White"   Margin="6,0,0,0"  Click="Button_Click_Right"
                    HorizontalAlignment="Left"/>

            <!-- 正转 -->
            <Button Grid.Column="3" Content="正转" FontSize="18"
                    Width="120" Height="40" Background="#FF87CEFA"  Foreground="White" 
                     PreviewMouseLeftButtonDown="Button_Click_ForDown" 
    PreviewMouseLeftButtonUp="Button_Click_ForUp"
                       Margin="135,0,0,0" HorizontalAlignment="Left"/>


        </Grid>

        <!-- 底部导航栏 -->
        <Grid Grid.Row="4"  VerticalAlignment="Bottom">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <Button Style="{StaticResource TabButtonStyle}" Grid.Column="0" Content="主页" 
       Click="GoHome" />
            <Button Style="{StaticResource TabButtonStyle}" Grid.Column="1" Content="测试界面"
      Click="GoTest" />
            <Button Style="{StaticResource TabButtonStyle}" Grid.Column="2" Content="数据记录"
      Click="GoRecord" />
            <Button Style="{StaticResource TabButtonStyle}"  Grid.Column="3" Content="记录画面" 
    Click="GoView" />
        </Grid>
    </Grid>
</Page>
