253 lines
12 KiB
XML
253 lines
12 KiB
XML
<c:MetroWindow x:Class="Plane.FormationCreator.MainWindow"
|
|
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"
|
|
xmlns:c="http://metro.mahapps.com/winfx/xaml/controls"
|
|
xmlns:m="clr-namespace:Plane.FormationCreator.Formation"
|
|
xmlns:v="clr-namespace:Plane.FormationCreator.Views"
|
|
xmlns:vm="clr-namespace:Plane.FormationCreator.ViewModels"
|
|
xmlns:fc="clr-namespace:Plane.FormationCreator"
|
|
mc:Ignorable="d"
|
|
WindowTransitionsEnabled="False"
|
|
FontFamily="Microsoft YaHei"
|
|
WindowState="Maximized"
|
|
Title="无人机编队控制中心"
|
|
PreviewKeyDown="MetroWindow_PreviewKeyDown"
|
|
PreviewKeyUp="MetroWindow_PreviewKeyUp"
|
|
Style="{StaticResource VSWindowStyleKey}"
|
|
Width="800"
|
|
Height="600">
|
|
|
|
<c:MetroWindow.Resources>
|
|
<Style TargetType="Separator"
|
|
BasedOn="{StaticResource {x:Type Separator}}">
|
|
<Setter Property="Background"
|
|
Value="#555" />
|
|
<Setter Property="Margin"
|
|
Value="0,10" />
|
|
</Style>
|
|
|
|
|
|
<ContextMenu x:Key="LogMenu" >
|
|
<MenuItem Header="清除"
|
|
Command="{Binding ClearLogs}" Foreground="White"/>
|
|
</ContextMenu>
|
|
|
|
|
|
</c:MetroWindow.Resources>
|
|
|
|
|
|
|
|
<c:MetroWindow.RightWindowCommands>
|
|
<c:WindowCommands>
|
|
|
|
<Button Content="{Binding AppEx.ShowModifyTaskView, Converter={StaticResource ShowModifyTaskViewButtonContentConverter}}"
|
|
Command="{Binding ShowOrHideModifyTaskViewCommand}" />
|
|
<Button Content="切换地图"
|
|
Command="{Binding ChangeMapModeCommand}"/>
|
|
<Button Content="重启监听"
|
|
Visibility="Collapsed"
|
|
Command="{Binding RestartListeningCommand}" />
|
|
<Button Content="{Binding SwitchVelocityModeButtonContent}"
|
|
Command="{Binding SwitchVelocityModeCommand}"
|
|
Visibility="Collapsed"/>
|
|
<!--// 林俊清, 20150930, 不分这些模式了。
|
|
<Button Content="进入任务模式"
|
|
Command="{Binding SwitchAppModeCommand}"
|
|
CommandParameter="{x:Static m:AppMode.PreparedForRunningTasks}"
|
|
Visibility="{Binding Source={x:Static local:AppEx.Current}, Path=AppMode, Converter={StaticResource AppModeToVisibilityConverter}, ConverterParameter=SwitchToPreparedForRunningTasksModeButton}" />
|
|
<Button Content="进入控制模式"
|
|
Command="{Binding SwitchAppModeCommand}"
|
|
CommandParameter="{x:Static m:AppMode.ControllingCopters}"
|
|
Visibility="{Binding Source={x:Static local:AppEx.Current}, Path=AppMode, Converter={StaticResource AppModeToVisibilityConverter}, ConverterParameter=SwitchToControllingCoptersModeButton}" />-->
|
|
<Button Name="btnGoHome"
|
|
Content="回家"
|
|
Click="btnGoHome_Click"
|
|
Visibility="Collapsed"/>
|
|
<Button Name="btnRefreshMap"
|
|
Content="刷新地图"
|
|
Visibility="Collapsed"
|
|
Click="btnRefreshMap_Click" />
|
|
<Button Name="btnConnect"
|
|
Content="连接"
|
|
Click="btnConnect_Click" />
|
|
<Menu Name="menuTask" Background="Transparent" VerticalAlignment="Center" >
|
|
|
|
<MenuItem Header="导入导出" Margin="0,2,0,0" Foreground="#969696">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition/>
|
|
<ColumnDefinition/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
|
|
<Button BorderThickness="1" Content="导出任务" Margin="0,8,0,8"
|
|
Command="{Binding ExportTasksCommand}"/>
|
|
<CheckBox Content="只导出航点" Grid.Column="1" Margin="0,8,0,8" Foreground="#969696"
|
|
IsChecked="{Binding OnlyImpotWaypointS}" Visibility="Collapsed"/>
|
|
<Button BorderThickness="1" BorderBrush="#FFFFFF" Content="导入任务" Margin="0,8,0,8" Grid.Row="1"
|
|
Command="{Binding ImportTasksCommand}"/>
|
|
<StackPanel VerticalAlignment="Center" Margin="0,8,0,8" Grid.Row="1" Grid.Column="1" Orientation="Horizontal">
|
|
<TextBlock Foreground="#969696" VerticalAlignment="Center" Text="起始步骤:"/>
|
|
<TextBox VerticalAlignment="Bottom" Width="40"
|
|
Text="{Binding txtStarindex, UpdateSourceTrigger=PropertyChanged}"/>
|
|
<TextBlock Foreground="#969696" VerticalAlignment="Center" Text="截止:"/>
|
|
<TextBox VerticalAlignment="Bottom" Width="40"
|
|
Text="{Binding txtendindex, UpdateSourceTrigger=PropertyChanged}"/>
|
|
</StackPanel>
|
|
<Button BorderThickness="1" BorderBrush="#FFFFFF" Content="导入分组信息" Margin="25,8,0,8" Grid.Row="2"
|
|
Command="{Binding ImportGroupCommand}"/>
|
|
<Button BorderThickness="1" BorderBrush="#FFFFFF" Content="导出任务时间" Margin="25,8,0,8" Grid.Row="3"
|
|
Command="{Binding ImportTaskTimeCommand}"/>
|
|
</Grid>
|
|
</MenuItem>
|
|
</Menu>
|
|
|
|
<Menu Name="otherWindows" Background="Transparent" VerticalAlignment="Center">
|
|
<MenuItem Header="窗口" Margin="0,2,0,0" Foreground="#969696">
|
|
<CheckBox Content="属性设置" Margin="0,8,0,8" IsChecked="False" Click="btnAttribute_Click"/>
|
|
<CheckBox Content="分组设置" Margin="0,8,0,8" IsChecked="False" Click="btnGroup_Click"/>
|
|
<CheckBox Content="自动编号" Margin="0,8,0,8" IsChecked="False" Click="btnVirtualId_Click"/>
|
|
</MenuItem>
|
|
</Menu>
|
|
</c:WindowCommands>
|
|
</c:MetroWindow.RightWindowCommands>
|
|
|
|
<Grid>
|
|
<Grid.Background>
|
|
<ImageBrush ImageSource=".\bg.jpg" />
|
|
</Grid.Background>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid Margin="1">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="73*" />
|
|
<ColumnDefinition Width="27*" MinWidth="360" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Grid Margin="0,0,10,0"
|
|
Width="Auto" >
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<TabControl SelectedIndex="{Binding MapMode,UpdateSourceTrigger=PropertyChanged}" Grid.RowSpan="3">
|
|
<TabItem Visibility="Collapsed">
|
|
<v:MapView x:Name="map"/>
|
|
</TabItem >
|
|
<TabItem Visibility="Collapsed">
|
|
<v:View3D/>
|
|
</TabItem>
|
|
</TabControl>
|
|
|
|
<Grid Grid.Row="1" HorizontalAlignment="Right">
|
|
<WrapPanel Orientation="Vertical">
|
|
<v:CopterAttributeView
|
|
x:Name="attributeView"
|
|
Visibility="Collapsed"
|
|
DataContext="{Binding Path=CopterListViewModel}">
|
|
</v:CopterAttributeView>
|
|
<v:CopterGroupsView
|
|
x:Name="groupsView"
|
|
Visibility="Collapsed">
|
|
</v:CopterGroupsView>
|
|
<v:ConfigVirtualIdView
|
|
x:Name="configVirtualView"
|
|
Visibility="Collapsed">
|
|
</v:ConfigVirtualIdView>
|
|
</WrapPanel>
|
|
|
|
</Grid>
|
|
|
|
|
|
<!--
|
|
<v:MapView x:Name="map"/>
|
|
-->
|
|
|
|
<v:TaskBarView
|
|
Grid.Row="2"
|
|
x:Name="TaskbarControl"
|
|
VerticalAlignment="Bottom"
|
|
Visibility="{Binding Source={x:Static local:AppEx.Current}, Path=AppMode, Converter={StaticResource AppModeToVisibilityConverter}, ConverterParameter=TaskBarView}" />
|
|
</Grid>
|
|
|
|
|
|
<Grid Margin="0,0,0,0"
|
|
|
|
Grid.Column="1">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<v:CopterListView />
|
|
|
|
<StackPanel Grid.Row="1">
|
|
<StackPanel Grid.Row="2"
|
|
Visibility="{Binding AppEx.ShowModifyTaskView, Converter={StaticResource InversiveBooleanToVisibilityConverter}}">
|
|
<Separator Grid.ColumnSpan="2" />
|
|
<v:ControlPanelView />
|
|
</StackPanel>
|
|
|
|
<StackPanel Visibility="{Binding AppEx.ShowModifyTaskView, Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<Separator />
|
|
<v:ModifyTaskView />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="2"
|
|
Visibility="{Binding AppEx.ShowModifyTaskView, Converter={StaticResource InversiveBooleanToVisibilityConverter}}">
|
|
|
|
<Separator Grid.ColumnSpan="2" />
|
|
<v:CopterInfoView DataContext="{Binding Path=CopterListViewModel.SelectedCopter}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
<Border Grid.Row="1"
|
|
Background="{StaticResource WhiteBrush}">
|
|
<Grid>
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
|
<TextBlock Margin="4"
|
|
Text="{Binding Message}" MouseUp="LogShowHide"/>
|
|
<TextBlock Margin="4"
|
|
Text="{Binding CopterListViewModel.SelectedCopter.StatusText}" />
|
|
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
|
<TextBlock Text="通信连接:" Margin="4"/>
|
|
<ContentPresenter Content="{Binding CommunicationModuleConnected, Converter={StaticResource CheckSignConverter}, Mode=OneWay}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
</Border>
|
|
<TextBox Name="logTextBox" Height="700" Width="600" Background="#FF2D2D2D"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Top"
|
|
Visibility="Hidden"
|
|
Text="{Binding Logs}"
|
|
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
|
TextChanged="LogTextChange"
|
|
IsReadOnly="True"
|
|
TextWrapping="Wrap"
|
|
ContextMenu="{StaticResource LogMenu}"/>
|
|
</Grid>
|
|
|
|
</c:MetroWindow>
|