164 lines
7.4 KiB
XML
164 lines
7.4 KiB
XML
<c:MetroWindow x:Class="Plane.FormationCreator.Views.ConnectWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:local="clr-namespace:Plane.FormationCreator.Views"
|
|
xmlns:c="http://metro.mahapps.com/winfx/xaml/controls"
|
|
xmlns:ec="clr-namespace:Plane.Windows.Controls;assembly=Plane.Windows"
|
|
mc:Ignorable="d"
|
|
Title="连接"
|
|
Width="432.175"
|
|
Height="300.371"
|
|
|
|
WindowStartupLocation="CenterScreen"
|
|
FontFamily="Microsoft YaHei"
|
|
ResizeMode="NoResize">
|
|
|
|
<Grid HorizontalAlignment="Center"
|
|
VerticalAlignment="Center">
|
|
|
|
<Grid.Resources>
|
|
<Style TargetType="Label"
|
|
BasedOn="{StaticResource {x:Type Label}}">
|
|
<Setter Property="HorizontalAlignment"
|
|
Value="Right" />
|
|
<Setter Property="VerticalAlignment"
|
|
Value="Center" />
|
|
</Style>
|
|
<Style TargetType="ComboBox"
|
|
BasedOn="{StaticResource {x:Type ComboBox}}">
|
|
<Setter Property="HorizontalAlignment"
|
|
Value="Left" />
|
|
<Setter Property="VerticalAlignment"
|
|
Value="Center" />
|
|
<Setter Property="Width"
|
|
Value="150" />
|
|
</Style>
|
|
<Style TargetType="TextBox"
|
|
BasedOn="{StaticResource {x:Type TextBox}}">
|
|
<Setter Property="HorizontalAlignment"
|
|
Value="Left" />
|
|
<Setter Property="VerticalAlignment"
|
|
Value="Center" />
|
|
<Setter Property="Width"
|
|
Value="150" />
|
|
</Style>
|
|
<Style TargetType="PasswordBox"
|
|
BasedOn="{StaticResource {x:Type PasswordBox}}">
|
|
<Setter Property="HorizontalAlignment"
|
|
Value="Left" />
|
|
<Setter Property="VerticalAlignment"
|
|
Value="Center" />
|
|
<Setter Property="MinWidth"
|
|
Value="150" />
|
|
</Style>
|
|
<Style TargetType="Button"
|
|
BasedOn="{StaticResource {x:Type Button}}">
|
|
<Setter Property="HorizontalAlignment"
|
|
Value="Center" />
|
|
<Setter Property="VerticalAlignment"
|
|
Value="Center" />
|
|
</Style>
|
|
</Grid.Resources>
|
|
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="10" />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Label Target="{Binding ElementName=txtIPs}" Visibility="Collapsed"
|
|
Content="IP" />
|
|
<TextBox Name="txtIPs"
|
|
Grid.Column="2"
|
|
AcceptsReturn="True"
|
|
MinHeight="200"
|
|
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
|
Visibility="Collapsed"
|
|
Text="{Binding IPs, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
<StackPanel Orientation="Horizontal"
|
|
HorizontalAlignment="Center"
|
|
Grid.Row="1"
|
|
Grid.ColumnSpan="3"
|
|
Name="panel1">
|
|
|
|
<ec:ProgressButton HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Margin="10"
|
|
Content="连接 _TCP"
|
|
IsDefault="True"
|
|
IsProcessing="{Binding IsProcessing}"
|
|
Command="{Binding Path=ConnectCommand}" />
|
|
<ec:ProgressButton HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Margin="10"
|
|
Content="连接 _UDP"
|
|
IsDefault="True"
|
|
IsProcessing="{Binding IsProcessing}"
|
|
Command="{Binding Path=ConnectCommand}"
|
|
CommandParameter="UDP"/>
|
|
<ec:ProgressButton HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Margin="10"
|
|
Content="连接串口"
|
|
IsProcessing="{Binding IsProcessing}"
|
|
Command="{Binding Path=ConnectCommand}"
|
|
CommandParameter="SerialPort" />
|
|
|
|
<!--<ec:ProgressButton Name="btnConnectUdp"
|
|
Grid.Row="1"
|
|
Grid.ColumnSpan="3"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Margin="10"
|
|
Content="连接 _UDP"
|
|
IsDefault="True"
|
|
IsProcessing="{Binding IsProcessing}"
|
|
Command="{Binding Path=ConnectCommand}"
|
|
CommandParameter="UDP" />-->
|
|
<Button Content="关闭TCP" Margin="5" Command="{Binding CloseCommand}"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal"
|
|
HorizontalAlignment="Center"
|
|
Grid.Row="2"
|
|
Grid.ColumnSpan="3"
|
|
Name="panel2">
|
|
<Button Content="通信模块状态" Margin="5" Command="{Binding Path=StateInquireCommand}"/>
|
|
<Button Content="设置总数" Margin="5" Command="{Binding Path=SendCommand}" />
|
|
<Button Content="切换写航点" Margin="5" Command="{Binding Path=ChangeWriteMissionCommand}" />
|
|
|
|
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal"
|
|
HorizontalAlignment="Center"
|
|
Grid.Row="3"
|
|
Grid.ColumnSpan="3">
|
|
<TextBox Margin="2,5,5,5" Width="30" Text="{Binding CopterNum}"></TextBox>
|
|
<Button Content=" 对频 " Margin="5,5,0,5" Command="{Binding Path=WriteIdCommand}" />
|
|
<Button Content="闪灯" Margin="5" Command="{Binding CommDataAsync}"/>
|
|
<Button Content="拉烟" Margin="5" Command="{Binding TestFireCommandAsync}"/>
|
|
<TextBox Width="80" Text="{Binding CopterColor}"/>
|
|
|
|
</StackPanel>
|
|
|
|
<StackPanel Orientation="Horizontal"
|
|
HorizontalAlignment="Center"
|
|
Grid.Row="4"
|
|
Grid.ColumnSpan="3"
|
|
Name="panel3">
|
|
<Button Content="空中升级" Margin="5" Command="{Binding UpdateAllCopterCommand}"></Button>
|
|
<Button Content="搜索飞机" Margin="5" Command="{Binding QueryAllCopterCommand}"/>
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
</c:MetroWindow>
|