Plane.FormationCreator/Plane.FormationCreator/Views/CopterInfoView.xaml

168 lines
7.4 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<UserControl x:Class="Plane.FormationCreator.Views.CopterInfoView"
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:Plane.FormationCreator.Views"
xmlns:ec="clr-namespace:Plane.Copters;assembly=PlaneGcsSdk_Private_NET46"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="300"
d:DataContext="{d:DesignInstance Type=ec:FakeCopter, IsDesignTimeCreatable=True}">
<StackPanel>
<TextBlock Text="飞行信息" />
<Grid>
<Grid.Resources>
<Style x:Key="CopterInfo_ComboBox"
TargetType="ComboBox"
BasedOn="{StaticResource {x:Type ComboBox}}">
<Setter Property="MinWidth"
Value="120" />
<Setter Property="VerticalAlignment"
Value="Center" />
</Style>
<Style x:Key="CopterInfo_StackPanel"
TargetType="StackPanel">
<Setter Property="Orientation"
Value="Horizontal" />
<Setter Property="Margin"
Value="0,2" />
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical">
<StackPanel.Resources>
<Style TargetType="ComboBox"
BasedOn="{StaticResource CopterInfo_ComboBox}" />
<Style TargetType="StackPanel"
BasedOn="{StaticResource CopterInfo_StackPanel}" />
</StackPanel.Resources>
<StackPanel>
<TextBlock Text="ID" />
<TextBlock Text="{Binding Path=Id}" />
</StackPanel>
<StackPanel>
<TextBlock Text="已连接:" />
<ContentPresenter Content="{Binding IsConnected, Converter={StaticResource CheckSignConverter}, Mode=OneWay}" />
</StackPanel>
<StackPanel>
<TextBlock Text="已解锁:" />
<ContentPresenter Content="{Binding IsUnlocked, Converter={StaticResource CheckSignConverter}, Mode=OneWay}" />
</StackPanel>
<StackPanel>
<TextBlock Text="心跳数:" />
<TextBlock Text="{Binding Path=HeartbeatCount}" />
</StackPanel>
<StackPanel>
<TextBlock Text="卫星数:" />
<TextBlock Text="{Binding Path=SatCount}" />
</StackPanel>
<StackPanel>
<TextBlock Text="方向:" />
<TextBlock Text="{Binding Path=Heading}" />
</StackPanel>
<!--<StackPanel>
<TextBlock Text="Yaw" />
<TextBlock Text="{Binding Path=Yaw, StringFormat=0.##}" />
</StackPanel>
<StackPanel>
<TextBlock Text="纬度:" />
<TextBlock Text="{Binding Path=Latitude}" />
</StackPanel>
<StackPanel>
<TextBlock Text="经度:" />
<TextBlock Text="{Binding Path=Longitude}" />
</StackPanel>-->
<StackPanel>
<TextBlock Text="高度:" />
<TextBlock Text="{Binding Altitude, StringFormat=0.##}" />
</StackPanel>
<StackPanel>
<TextBlock Text="距离:" />
<TextBlock Text="{Binding FlightDistance, StringFormat=0.##}" />
</StackPanel>
<StackPanel>
<TextBlock Text="锁定类型:" />
<TextBlock Text="{Binding GpsFixType}" />
</StackPanel>
<!--
<StackPanel>
<TextBlock Text="固件版本:" />
<TextBlock Text="{Binding FirmwareVersionText}" />
</StackPanel>-->
</StackPanel>
<StackPanel Grid.Row="1"
Grid.Column="1"
Orientation="Vertical">
<StackPanel.Resources>
<Style TargetType="ComboBox"
BasedOn="{StaticResource CopterInfo_ComboBox}" />
<Style TargetType="StackPanel"
BasedOn="{StaticResource CopterInfo_StackPanel}" />
</StackPanel.Resources>
<StackPanel>
<Slider x:Name="sldChannel3"
Width="100"
Minimum="1100"
Maximum="1900"
Value="{Binding Channel3, Mode=OneWay}"
ValueChanged="sldChannel3_ValueChanged">
<Slider.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Slider.Resources>
</Slider>
</StackPanel>
<StackPanel>
<TextBlock Text="电压:" />
<TextBlock Text="{Binding Path=Voltage}" />
</StackPanel>
<StackPanel>
<TextBlock Text="剩余电量:" />
<TextBlock Text="{Binding Path=BatteryPer}" />
<TextBlock Text="%" />
</StackPanel>
<StackPanel>
<TextBlock Text="状态:" />
<TextBlock Text="{Binding Path=State}" />
</StackPanel>
<StackPanel>
<TextBlock Text="通道1" />
<TextBlock Text="{Binding Channel1}" />
</StackPanel>
<StackPanel>
<TextBlock Text="通道2" />
<TextBlock Text="{Binding Channel2}" />
</StackPanel>
<StackPanel>
<TextBlock Text="通道3" />
<TextBlock Text="{Binding Channel3}" />
</StackPanel>
<StackPanel>
<TextBlock Text="通道4" />
<TextBlock Text="{Binding Channel4}" />
</StackPanel>
<StackPanel>
<TextBlock Text="定位精度:" />
<TextBlock Text="{Binding GpsHdop, StringFormat=0.##}" />
</StackPanel>
</StackPanel>
</Grid>
</StackPanel>
</UserControl>