<UserControl x:Class="SlnMesnac.WPF.Page.IndexControl"
             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:wfCtrl="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
             xmlns:wfHost="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration" 
             xmlns:local="clr-namespace:SlnMesnac.WPF.Page"
             mc:Ignorable="d" 
             d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="3*"/>
            <RowDefinition Height="5*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="4*"/>
            <ColumnDefinition Width="2*"/>
        </Grid.ColumnDefinitions>
        <!--左上监控画面布局-->
        <Border Grid.Row="0" Grid.Column="0">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <Border Grid.Column="0" Background="#FFFFFF" CornerRadius="5" Margin="0,0,10,0">
                    <wfHost:WindowsFormsHost x:Name="DisplayWindow" Grid.ColumnSpan="2" IsEnabled="True" Background="Black">
                        <wfCtrl:PictureBox x:Name="RealPlayWnd"/>
                    </wfHost:WindowsFormsHost>
                </Border>
                <Border Grid.Column="1" Background="#FFFFFF" CornerRadius="5" Margin="10,0,0,0">
                    <wfHost:WindowsFormsHost x:Name="DisplayWindow2" Grid.ColumnSpan="2" IsEnabled="True" Background="Black">
                        <wfCtrl:PictureBox x:Name="RealPlayWnd2"/>
                    </wfHost:WindowsFormsHost>
                </Border>
            </Grid>
        </Border>
        
        <!--右上云台控制界面-->
        <Border Grid.Row="0" Grid.Column="1" Background="#FFFFFF" CornerRadius="5" Margin="20,0,0,0">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="1*"/>
                    <RowDefinition Height="4*"/>
                </Grid.RowDefinitions>
                <Border Grid.Row="0" BorderBrush="#F4F5FA" BorderThickness="0,0,0,2">
                    <Border BorderBrush="#0050BF" BorderThickness="3,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="20,0,0,0">
                        <TextBlock Text="云台控制" Foreground="Black" FontSize="18" Margin="10,0,0,0"/>
                    </Border>
                </Border>
                <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <Grid>
                        <!-- 外部的圆环 -->
                        <Ellipse Width="160" Height="160" Stroke="#F4F5FA" StrokeThickness="60" Fill="Transparent" />

                        <!-- 内部的圆环，用于创建空心效果 -->
                        <Ellipse Width="80" Height="80" Stroke="White" StrokeThickness="60" Fill="Transparent" />
                        
                        <!--向上-->
                        <Border  Width="120" Height="40"  Background="Transparent" CornerRadius="70,70,0,0" Margin="0,0,0,120" MouseDown="btnUp_MouseDown" MouseUp="btnUp_MouseUp" >
                            <Path Stroke="#0050BF" StrokeThickness="1" Fill="#0050BF"  VerticalAlignment="Center" HorizontalAlignment="Center">
                                <Path.Data>
                                    <PathGeometry>
                                        <PathFigure IsClosed="True" StartPoint="15,5">
                                            <LineSegment Point="5,15"/>
                                            <LineSegment Point="25,15"/>
                                        </PathFigure>
                                    </PathGeometry>
                                </Path.Data>
                            </Path>
                        </Border>
                        <!--向下-->
                        <Border  Width="120" Height="40"  Background="Transparent" CornerRadius="0,0,70,70" Margin="0,120,0,0" MouseDown="btnDown_MouseDown" MouseUp="btnDown_MouseUp">
                            <Path Stroke="#0050BF" StrokeThickness="1" Fill="#0050BF"  VerticalAlignment="Center" HorizontalAlignment="Center">
                                <Path.Data>
                                    <PathGeometry>
                                        <PathFigure IsClosed="True" StartPoint="15,25">
                                            <LineSegment Point="5,15"/>
                                            <LineSegment Point="25,15"/>
                                        </PathFigure>
                                    </PathGeometry>
                                </Path.Data>
                            </Path>
                        </Border>
                        <!--向左-->
                        <Border  Width="40" Height="80"  Background="Transparent" CornerRadius="35,0,0,35" Margin="0,0,120,0" MouseDown="btnLeft_MouseDown" MouseUp="btnLeft_MouseUp">
                            <Path Stroke="#0050BF" StrokeThickness="1" Fill="#0050BF"  VerticalAlignment="Center" HorizontalAlignment="Center">
                                <Path.Data>
                                    <PathGeometry>
                                        <PathFigure IsClosed="True" StartPoint="5,15">
                                            <LineSegment Point="15,5"/>
                                            <LineSegment Point="15,25"/>
                                        </PathFigure>
                                    </PathGeometry>
                                </Path.Data>
                            </Path>
                        </Border>
                        <!--向右-->
                        <Border  Width="40" Height="80"  Background="Transparent" CornerRadius="0,35,35,0" Margin="120,0,0,0" MouseDown="btnRight_MouseDown" MouseUp="btnRight_MouseUp">
                            <Path Stroke="#0050BF" StrokeThickness="1" Fill="#0050BF" VerticalAlignment="Center" HorizontalAlignment="Center">
                                <Path.Data>
                                    <PathGeometry>
                                        <PathFigure IsClosed="True" StartPoint="25,15">
                                            <LineSegment Point="15,5"/>
                                            <LineSegment Point="15,25"/>
                                        </PathFigure>
                                    </PathGeometry>
                                </Path.Data>
                            </Path>
                        </Border>
                        <!--停止-->
                        <Border  Width="80" Height="80"  Background="Transparent" CornerRadius="60" MouseLeftButtonDown="btn_auto_MouseLeftButtonDown">
                            <TextBlock x:Name="btnAuto" Text="{Binding GimbalAutoRunText}" FontSize="20" Foreground="Red" FontWeight="Black" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Border>
                    </Grid>

                    <StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
                        <Button Content="开启预览"  FontWeight="Black" FontSize="16" Width="100" Height="30" Foreground="#0050BF" Background="#E5EDF8" BorderBrush="#0050BF" Margin="50,0,0,0" Click="btn_start_preview_Click"/>
                        <Button Content="关闭预览"  FontWeight="Black" FontSize="16" Width="100" Height="30" Foreground="#0050BF" Background="#E5EDF8" BorderBrush="#0050BF" Margin="50,20,0,0" Click="btn_stop_preview_Click"/>
                        <Button Content="回 零"  FontWeight="Black" FontSize="16" Width="100" Height="30" Foreground="#0050BF" Background="#E5EDF8" BorderBrush="#0050BF" Margin="50,20,0,0" Command="{Binding GimbalOriginCommand}"/>
                    </StackPanel>
                </StackPanel>
            </Grid>
        </Border>
        
        <!--左下轨道、参数监控界面-->
        <Border Grid.Row="1" Grid.Column="0" Margin="0,20,0,0"> 
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Border Grid.Row="0" Background="#FFFFFF" CornerRadius="5" Margin="0,0,0,10">
                    <Canvas x:Name="canvasTrack" Margin="100,20,0,0">
                        <!-- 轨道 -->
                        <!--<Rectangle Width="880" Height="100" Fill="Transparent" Stroke="Black" StrokeThickness="2" RadiusX="50" RadiusY="50"
                       Canvas.Left="10" Canvas.Top="50"/>

                        --><!-- 站点 --><!--
                        <Rectangle x:Name="station1" Width="35" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
                       Canvas.Left="5" Canvas.Top="25" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="1"/>
                            </Rectangle.ToolTip>
                        </Rectangle>

                        <Rectangle x:Name="station2" Width="35" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
Canvas.Left="55" Canvas.Top="25" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="2"/>
                            </Rectangle.ToolTip>
                        </Rectangle>

                        <Rectangle x:Name="station3" Width="35" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
Canvas.Left="105" Canvas.Top="25" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="3"/>
                            </Rectangle.ToolTip>
                        </Rectangle>

                        <Rectangle x:Name="station4" Width="35" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
Canvas.Left="155" Canvas.Top="25" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="4"/>
                            </Rectangle.ToolTip>
                        </Rectangle>

                        <Rectangle x:Name="station5" Width="35" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
Canvas.Left="205" Canvas.Top="25" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="5"/>
                            </Rectangle.ToolTip>
                        </Rectangle>

                        <Rectangle x:Name="station6" Width="35" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
Canvas.Left="255" Canvas.Top="25" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="6"/>
                            </Rectangle.ToolTip>
                        </Rectangle>

                        <Rectangle x:Name="station7" Width="35" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
Canvas.Left="305" Canvas.Top="25" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="7"/>
                            </Rectangle.ToolTip>
                        </Rectangle>

                        <Rectangle x:Name="station8" Width="35" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
Canvas.Left="355" Canvas.Top="25" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="8"/>
                            </Rectangle.ToolTip>
                        </Rectangle>

                        <Rectangle x:Name="station9" Width="35" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
Canvas.Left="405" Canvas.Top="25" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="9"/>
                            </Rectangle.ToolTip>
                        </Rectangle>

                        <Rectangle x:Name="station10" Width="35" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
Canvas.Left="455" Canvas.Top="25" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="10"/>
                            </Rectangle.ToolTip>
                        </Rectangle>

                        <Rectangle x:Name="station11" Width="35" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
Canvas.Left="505" Canvas.Top="25" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="11"/>
                            </Rectangle.ToolTip>
                        </Rectangle>

                        <Rectangle x:Name="station12" Width="35" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
Canvas.Left="555" Canvas.Top="25" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="12"/>
                            </Rectangle.ToolTip>
                        </Rectangle>

                        <Rectangle x:Name="station13" Width="35" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
Canvas.Left="605" Canvas.Top="25" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="13"/>
                            </Rectangle.ToolTip>
                        </Rectangle>

                        <Rectangle x:Name="station14" Width="35" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
Canvas.Left="655" Canvas.Top="25" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="14"/>
                            </Rectangle.ToolTip>
                        </Rectangle>

                        <Rectangle x:Name="station15" Width="35" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
Canvas.Left="705" Canvas.Top="25" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="15"/>
                            </Rectangle.ToolTip>
                        </Rectangle>

                        <Rectangle x:Name="station16" Width="35" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
Canvas.Left="755" Canvas.Top="25" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="16"/>
                            </Rectangle.ToolTip>
                        </Rectangle>

                        <Rectangle x:Name="station17" Width="35" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
Canvas.Left="805" Canvas.Top="25" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="17"/>
                            </Rectangle.ToolTip>
                        </Rectangle>

                        <Rectangle x:Name="station18" Width="35" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
Canvas.Left="855" Canvas.Top="25" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="18"/>
                            </Rectangle.ToolTip>
                        </Rectangle>

                        <Rectangle x:Name="station19" Width="35" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
Canvas.Left="905" Canvas.Top="25" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="19"/>
                            </Rectangle.ToolTip>
                        </Rectangle>-->

                        <!--<Rectangle x:Name="station10" Width="50" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
           Canvas.Left="105" Canvas.Top="155" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="10"/>
                            </Rectangle.ToolTip>
                        </Rectangle>

                        <Rectangle x:Name="station11" Width="50" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
Canvas.Left="175" Canvas.Top="155" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="11"/>
                            </Rectangle.ToolTip>
                        </Rectangle>

                        <Rectangle x:Name="station12" Width="50" Height="20" Fill="Gray" RadiusX="5" RadiusY="5"
Canvas.Left="245" Canvas.Top="155" Stroke="Transparent" StrokeThickness="1">
                            <Rectangle.ToolTip>
                                <TextBlock Text="12"/>
                            </Rectangle.ToolTip>
                        </Rectangle>-->



                    </Canvas>
                </Border>
                <Border Grid.Row="1" Margin="0,10,0,0">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="2*"/>
                            <ColumnDefinition Width="5*"/>
                        </Grid.ColumnDefinitions>
                        <Border Grid.Column="0" Background="#FFFFFF" CornerRadius="5" Margin="0,0,10,0">
                            <Grid Margin="20">
                                <Grid.RowDefinitions>
                                    <RowDefinition/>
                                    <RowDefinition/>
                                </Grid.RowDefinitions>
                                <Border Grid.Row="0" Background="#F4F5FA" CornerRadius="5">
                                    <Image Source="/Templates/image/machine.png"  Margin="10"/>
                                </Border>
                                <Border Grid.Row="1">
                                    <Grid Margin="5">
                                        <Grid.RowDefinitions>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="1*"/>
                                            <ColumnDefinition Width="2*"/>
                                            <ColumnDefinition Width="2*"/>
                                        </Grid.ColumnDefinitions>
                                        <Border Grid.Row="0" Grid.Column="0">
                                            <Image Source="/Templates/image/device.png"  Margin="10"/>
                                        </Border>
                                        <Border Grid.Row="0" Grid.Column="1">
                                            <TextBlock Text="设备状态" Foreground="Gray" FontSize="16" FontWeight="Black" VerticalAlignment="Center"/>
                                        </Border>
                                        <Border Grid.Row="0" Grid.Column="2">
                                            <TextBlock Text="{Binding RealDeviceStatus}" FontSize="16" Foreground="Red" FontWeight="Black" VerticalAlignment="Center"/>
                                        </Border>
                                        <Border Grid.Row="1" Grid.Column="0">
                                            <Image Source="/Templates/image/speed.png"  Margin="10"/>
                                        </Border>
                                        <Border Grid.Row="1" Grid.Column="1">
                                            <TextBlock Text="运行速度" Foreground="Gray" FontSize="16" FontWeight="Black" VerticalAlignment="Center"/>
                                        </Border>
                                        <StackPanel Grid.Row="1" Grid.Column="2" Orientation="Horizontal">
                                            <TextBlock Text="{Binding RealDeviceSpeed}" FontSize="16" Foreground="Gray" FontWeight="Black" VerticalAlignment="Center"/>
                                            <TextBlock Text="mm/s" FontSize="16" Foreground="Gray" FontWeight="Black" Margin="20,0,0,0" VerticalAlignment="Center"/>
                                        </StackPanel>


                                    </Grid>
                                </Border>
                            </Grid>
                        </Border>
                        <Border Grid.Column="1" Background="#FFFFFF" CornerRadius="5" Margin="10,0,0,0">
                            <Grid Margin="20">
                                <Grid.RowDefinitions>
                                    <RowDefinition/>
                                    <RowDefinition/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Row="0" Grid.Column="0" Background="#F4F5FA" CornerRadius="5" Margin="0,0,10,10">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="3*"/>
                                            <ColumnDefinition Width="5*"/>
                                        </Grid.ColumnDefinitions>
                                        <Border Grid.Column="0" Background="#F7E4D3" CornerRadius="5" Margin="10" >
                                            <Image Source="/Templates/image/addr.png"  Margin="10"/>
                                        </Border>
                                        <Border Grid.Column="1" Margin="0,10,0,10">
                                            <Grid>
                                                <Grid.RowDefinitions>
                                                    <RowDefinition/>
                                                    <RowDefinition/>
                                                </Grid.RowDefinitions>
                                                <Border Grid.Row="0" >
                                                    <TextBlock Text="实时位置" Foreground="Gray" FontSize="16" FontWeight="Black" VerticalAlignment="Center"/>
                                                </Border>
                                                <Border Grid.Row="1" >
                                                    <TextBlock Text="{Binding RealPlcAddress}" Foreground="Black" FontSize="24" FontWeight="Black" VerticalAlignment="Center"/>
                                                </Border>
                                            </Grid>
                                        </Border>
                                    </Grid>
                                </Border>
                                <Border Grid.Row="0" Grid.Column="1" Background="#F4F5FA" CornerRadius="5" Margin="10,0,10,10">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="3*"/>
                                            <ColumnDefinition Width="5*"/>
                                        </Grid.ColumnDefinitions>
                                        <Border Grid.Column="0" Background="#D2E5CD" CornerRadius="5" Margin="10" >
                                            <Image Source="/Templates/image/avg_t.png"  Margin="10"/>
                                        </Border>
                                        <Border Grid.Column="1" Margin="0,10,0,10">
                                            <Grid>
                                                <Grid.RowDefinitions>
                                                    <RowDefinition/>
                                                    <RowDefinition/>
                                                </Grid.RowDefinitions>
                                                <Border Grid.Row="0" >
                                                    <TextBlock Text="平均温度 ℃" Foreground="Gray" FontSize="16" FontWeight="Black" VerticalAlignment="Center"/>
                                                </Border>
                                                <Border Grid.Row="1" >
                                                    <TextBlock Text="{Binding RealTemperature.fAverageTemperature}" Foreground="Black" FontSize="24" FontWeight="Black" VerticalAlignment="Center"/>
                                                </Border>
                                            </Grid>
                                        </Border>
                                    </Grid>
                                </Border>
                                <Border Grid.Row="0" Grid.Column="2" Background="#F4F5FA" CornerRadius="5" Margin="10,0,0,10">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="3*"/>
                                            <ColumnDefinition Width="5*"/>
                                        </Grid.ColumnDefinitions>
                                        <Border Grid.Column="0" Background="#F3D2D6" CornerRadius="5" Margin="10" >
                                            <Image Source="/Templates/image/max_t.png"  Margin="10"/>
                                        </Border>
                                        <Border Grid.Column="1" Margin="0,10,0,10">
                                            <Grid>
                                                <Grid.RowDefinitions>
                                                    <RowDefinition/>
                                                    <RowDefinition/>
                                                </Grid.RowDefinitions>
                                                <Border Grid.Row="0" >
                                                    <TextBlock Text="最高温度 ℃" Foreground="Gray" FontSize="16" FontWeight="Black" VerticalAlignment="Center"/>
                                                </Border>
                                                <Border Grid.Row="1" >
                                                    <TextBlock Text="{Binding RealTemperature.fMaxTemperature}" Foreground="#ED4F31" FontSize="24" FontWeight="Black" VerticalAlignment="Center"/>
                                                </Border>
                                            </Grid>
                                        </Border>
                                    </Grid>
                                </Border>


                                <Border Grid.Row="1" Grid.Column="0" Background="#F4F5FA" CornerRadius="5" Margin="0,10,10,0">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="3*"/>
                                            <ColumnDefinition Width="5*"/>
                                        </Grid.ColumnDefinitions>
                                        <Border Grid.Column="0" Background="#CEDCF9" CornerRadius="5" Margin="10" >
                                            <Image Source="/Templates/image/min_t.png"  Margin="10"/>
                                        </Border>
                                        <Border Grid.Column="1" Margin="0,10,0,10">
                                            <Grid>
                                                <Grid.RowDefinitions>
                                                    <RowDefinition/>
                                                    <RowDefinition/>
                                                </Grid.RowDefinitions>
                                                <Border Grid.Row="0" >
                                                    <TextBlock Text="最低温度 ℃" Foreground="Gray" FontSize="16" FontWeight="Black" VerticalAlignment="Center"/>
                                                </Border>
                                                <Border Grid.Row="1" >
                                                    <TextBlock Text="{Binding RealTemperature.fMinTemperature}" Foreground="Black" FontSize="24" FontWeight="Black" VerticalAlignment="Center"/>
                                                </Border>
                                            </Grid>
                                        </Border>
                                    </Grid>
                                </Border>
                                <Border Grid.Row="1" Grid.Column="1" Background="#F4F5FA" CornerRadius="5" Margin="10,10,10,0">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="3*"/>
                                            <ColumnDefinition Width="5*"/>
                                        </Grid.ColumnDefinitions>
                                        <Border Grid.Column="0" Background="#F7E4D3" CornerRadius="5" Margin="10" >
                                            <Image Source="/Templates/image/status.png"  Margin="10"/>
                                        </Border>
                                        <Border Grid.Column="1" Margin="0,10,0,10">
                                            <Grid>
                                                <Grid.RowDefinitions>
                                                    <RowDefinition/>
                                                    <RowDefinition/>
                                                </Grid.RowDefinitions>
                                                <Border Grid.Row="0" >
                                                    <TextBlock Text="升降机状态" Foreground="Gray" FontSize="16" FontWeight="Black" VerticalAlignment="Center"/>
                                                </Border>
                                                <Border Grid.Row="1" >
                                                    <TextBlock Text="正常" Foreground="Black" FontSize="24" FontWeight="Black" VerticalAlignment="Center"/>
                                                </Border>
                                            </Grid>
                                        </Border>
                                    </Grid>
                                </Border>
                            </Grid>
                        </Border>
                    </Grid>
                </Border>
            </Grid>
        </Border>
        
        <!--右下机器人控制界面-->
        <Border Grid.Row="1" Grid.Column="1" Margin="20,20,0,0">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <Border Grid.Column="0" Background="#FFFFFF" CornerRadius="5" Margin="0,0,10,0">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="1*"/>
                            <RowDefinition Height="8*"/>
                        </Grid.RowDefinitions>
                        <Border Grid.Row="0" BorderBrush="#F4F5FA" BorderThickness="0,0,0,2">
                            <Border BorderBrush="#0050BF" BorderThickness="3,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="20,0,0,0">
                                <TextBlock Text="机器人控制" Foreground="Black" FontSize="18" Margin="10,0,0,0"/>
                            </Border>
                        </Border>
                        <StackPanel Grid.Row="1" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
                            <Grid>
                                <!-- 外部的圆环 -->
                                <Ellipse Width="160" Height="160" Stroke="#F4F5FA" StrokeThickness="60" Fill="Transparent" />

                                <!-- 内部的圆环，用于创建空心效果 -->
                                <Ellipse Width="80" Height="80" Stroke="White" StrokeThickness="60" Fill="Transparent" />

                                <!--向上-->
                                <Border  Width="120" Height="40"  Background="Transparent" CornerRadius="70,70,0,0" Margin="0,0,0,120" >
                                    <Path Stroke="#0050BF" StrokeThickness="1" Fill="#0050BF"  VerticalAlignment="Center" HorizontalAlignment="Center">
                                        <Path.Data>
                                            <PathGeometry>
                                                <PathFigure IsClosed="True" StartPoint="15,5">
                                                    <LineSegment Point="5,15"/>
                                                    <LineSegment Point="25,15"/>
                                                </PathFigure>
                                            </PathGeometry>
                                        </Path.Data>
                                    </Path>
                                </Border>
                                <!--向下-->
                                <Border  Width="120" Height="40"  Background="Transparent" CornerRadius="0,0,70,70" Margin="0,120,0,0">
                                    <Path Stroke="#0050BF" StrokeThickness="1" Fill="#0050BF"  VerticalAlignment="Center" HorizontalAlignment="Center">
                                        <Path.Data>
                                            <PathGeometry>
                                                <PathFigure IsClosed="True" StartPoint="15,25">
                                                    <LineSegment Point="5,15"/>
                                                    <LineSegment Point="25,15"/>
                                                </PathFigure>
                                            </PathGeometry>
                                        </Path.Data>
                                    </Path>
                                </Border>
                                <!--向左-->
                                <Border  Width="40" Height="80"  Background="Transparent" CornerRadius="35,0,0,35" Margin="0,0,120,0">
                                    <Path Stroke="#0050BF" StrokeThickness="1" Fill="#0050BF"  VerticalAlignment="Center" HorizontalAlignment="Center">
                                        <Path.Data>
                                            <PathGeometry>
                                                <PathFigure IsClosed="True" StartPoint="5,15">
                                                    <LineSegment Point="15,5"/>
                                                    <LineSegment Point="15,25"/>
                                                </PathFigure>
                                            </PathGeometry>
                                        </Path.Data>
                                    </Path>
                                </Border>
                                <!--向右-->
                                <Border  Width="40" Height="80"  Background="Transparent" CornerRadius="0,35,35,0" Margin="120,0,0,0">
                                    <Path Stroke="#0050BF" StrokeThickness="1" Fill="#0050BF" VerticalAlignment="Center" HorizontalAlignment="Center">
                                        <Path.Data>
                                            <PathGeometry>
                                                <PathFigure IsClosed="True" StartPoint="25,15">
                                                    <LineSegment Point="15,5"/>
                                                    <LineSegment Point="15,25"/>
                                                </PathFigure>
                                            </PathGeometry>
                                        </Path.Data>
                                    </Path>
                                </Border>
                                <!--停止-->
                                <Border  Width="80" Height="80"  Background="Transparent" CornerRadius="60">
                                    <TextBlock Text="停止" FontSize="20" Foreground="Red" FontWeight="Black" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                </Border>
                            </Grid>

                            <Button Content="回 零"  Command="{Binding ControlOnClickCommand}" CommandParameter="{Binding Name,ElementName=Index}"  FontWeight="Black" FontSize="16" Width="100" Height="30" Foreground="#0050BF" Background="#E5EDF8" BorderBrush="#0050BF" Margin="0,50,0,0"/>
                        </StackPanel>
                    </Grid>
                </Border>
                <Border Grid.Column="1" Background="#FFFFFF" CornerRadius="5" Margin="10,0,0,0">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="1*"/>
                            <RowDefinition Height="8*"/>
                        </Grid.RowDefinitions>
                        <Border Grid.Row="0" BorderBrush="#F4F5FA" BorderThickness="0,0,0,2">
                            <Border BorderBrush="#0050BF" BorderThickness="3,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="20,0,0,0">
                                <TextBlock Text="工作模式" Foreground="Black" FontSize="18" Margin="10,0,0,0"/>
                            </Border>
                        </Border>
                        <Border Grid.Row="1" BorderBrush="Green" BorderThickness="0">
                            <Grid Margin="20">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="1*"/>
                                    <RowDefinition Height="1*"/>
                                    <RowDefinition Height="4*"/>
                                </Grid.RowDefinitions>
                                <Border Grid.Row="0"  Margin="0,10">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="2*"/>
                                            <ColumnDefinition Width="4*"/>
                                            <ColumnDefinition Width="2*"/>
                                        </Grid.ColumnDefinitions>
                                        <Border Grid.Column="0" Background="#F4F5FA" CornerRadius="5,0,0,5" MouseDown="btnZoomOut_MouseDown" MouseUp="btnZoomOut_MouseUp"> 
                                            <TextBlock Text="—" FontSize="16" FontWeight="Black" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                        </Border>
                                        <Border Grid.Column="1" Background="#F4F5FA" Margin="5,0,5,0">
                                            <TextBlock Text="变 倍" FontSize="16" FontWeight="Black" Foreground="Gray" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                        </Border>
                                        <Border Grid.Column="2" Background="#F4F5FA" CornerRadius="0,5,5,0" MouseDown="btnZoomIn_MouseDown" MouseUp="btnZoomIn_MouseUp">
                                            <TextBlock Text="+" FontSize="22" FontWeight="Black" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                        </Border>
                                    </Grid>
                                </Border>
                                <Border Grid.Row="1" Margin="0,10">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="2*"/>
                                            <ColumnDefinition Width="4*"/>
                                            <ColumnDefinition Width="2*"/>
                                        </Grid.ColumnDefinitions>
                                        <Border Grid.Column="0" Background="#F4F5FA" CornerRadius="5,0,0,5" MouseDown="btnFocusNear_MouseDown" MouseUp="btnFocusNear_MouseUp">
                                            <TextBlock Text="—" FontSize="16" FontWeight="Black" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                        </Border>
                                        <Border Grid.Column="1" Background="#F4F5FA" Margin="5,0,5,0">
                                            <TextBlock Text="焦 距" FontSize="16" FontWeight="Black" Foreground="Gray" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                        </Border>
                                        <Border Grid.Column="2" Background="#F4F5FA" CornerRadius="0,5,5,0" MouseDown="btnFocusFar_MouseDown" MouseUp="btnFocusFar_MouseUp">
                                            <TextBlock Text="+" FontSize="22" FontWeight="Black" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                        </Border>
                                    </Grid>
                                </Border>
                                <Border Grid.Row="2" Background="#F4F5FA" Margin="0,10,0,0">
                                    <Grid Margin="20">
                                        <Grid.RowDefinitions>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                        </Grid.RowDefinitions>
                                        <Border x:Name="btn_autotask" Grid.Row="0" Background="Transparent" BorderBrush="#0050BF" BorderThickness="2" CornerRadius="5" Margin="0,5" MouseDown="btn_automode_MouseDown">
                                            <TextBlock Text="自动模式" FontSize="16" FontWeight="Black" Foreground="DimGray" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                        </Border>

                                        <Border x:Name="btn_automatic" Grid.Row="1" Background="Transparent" BorderBrush="#0050BF" BorderThickness="2" CornerRadius="5" Margin="0,5" MouseDown="btn_inspmode_MouseDown" >
                                            <TextBlock Text="巡检模式" FontSize="16" FontWeight="Black" Foreground="DimGray" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                        </Border>

                                        <Border x:Name="btn_fixedmode" Grid.Row="2" Background="Transparent" BorderBrush="#0050BF" BorderThickness="2" CornerRadius="5" Margin="0,5" MouseDown="btn_fixedmode_MouseDown" >
                                            <TextBlock Text="定点巡检" FontSize="16" FontWeight="Black" Foreground="DimGray" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                        </Border>
                                    </Grid>
                                </Border>
                            </Grid>
                        </Border>
                    </Grid>
                </Border>
            </Grid>
        </Border>
    </Grid>
</UserControl>
