diff --git a/Plane.FormationCreator/MainWindow.xaml b/Plane.FormationCreator/MainWindow.xaml index 99688e1..db381be 100644 --- a/Plane.FormationCreator/MainWindow.xaml +++ b/Plane.FormationCreator/MainWindow.xaml @@ -109,7 +109,7 @@ - + diff --git a/Plane.FormationCreator/ViewModels/ControlPanelViewModel.cs b/Plane.FormationCreator/ViewModels/ControlPanelViewModel.cs index eaeab2b..73579a3 100644 --- a/Plane.FormationCreator/ViewModels/ControlPanelViewModel.cs +++ b/Plane.FormationCreator/ViewModels/ControlPanelViewModel.cs @@ -366,7 +366,7 @@ namespace Plane.FormationCreator.ViewModels return _GuidAsyncCommand ?? (_GuidAsyncCommand = new RelayCommand(async () => { if (_copterManager.AcceptingControlCopters != null && _copterManager.AcceptingControlCopters.Count() > 0) - await _commModuleManager.TakeOffAsync(1, _copterManager.AcceptingControlCopters); + await _commModuleManager.TakeOffAsync(10, _copterManager.AcceptingControlCopters); /* await Task.WhenAll(_copterManager.AcceptingControlCopters.Select(async c => { diff --git a/Plane.FormationCreator/ViewModels/ModifyTaskViewModel.cs b/Plane.FormationCreator/ViewModels/ModifyTaskViewModel.cs index 0d9a8e7..eb7008f 100644 --- a/Plane.FormationCreator/ViewModels/ModifyTaskViewModel.cs +++ b/Plane.FormationCreator/ViewModels/ModifyTaskViewModel.cs @@ -214,6 +214,13 @@ namespace Plane.FormationCreator.ViewModels set { Set(nameof(StaggerRoutes), ref _StaggerRoutes, value); } } + private bool _OnlySelected = false; + public bool OnlySelected + { + get { return _OnlySelected; } + set { Set(nameof(OnlySelected), ref _OnlySelected, value); } + } + //调整所有任务经度 private ICommand _ModiAllPosCommand; public ICommand ModiAllPosCommand @@ -1188,6 +1195,61 @@ public ICommand VerticlAlignmentCommand } } + //当前任务选中的飞机修改高度 + private ICommand _ModiSelectedAltCommand; + public ICommand ModiSelectedAltCommand + { + get + { + return _ModiSelectedAltCommand ?? (_ModiSelectedAltCommand = new RelayCommand(async => + { + if (_flightTaskManager.Tasks.Count < 2) return; + if (_flightTaskManager.SelectedTask.TaskType != FlightTaskType.FlyTo) return; + for (int i = 0; i < _flightTaskManager.SelectedTask.SingleCopterInfos.Count; i++) + { + var info = _flightTaskManager.SelectedTask.SingleCopterInfos[i]; + if (_copterManager.SelectedCopters.Contains(info.Copter)) + { + info.TargetAlt += Modialtvalue; + } + } + + })); + } + } + //当前任务选中的飞机水平移动 + private ICommand _ModiSelectedPosCommand; + public ICommand ModiSelectedPosCommand + { + get + { + return _ModiSelectedPosCommand ?? (_ModiSelectedPosCommand = new RelayCommand(async => + { + if (_flightTaskManager.Tasks.Count < 2) return; + if (_flightTaskManager.SelectedTask.TaskType != FlightTaskType.FlyTo) return; + for (int i = 0; i < _flightTaskManager.SelectedTask.SingleCopterInfos.Count; i++) + { + var info = _flightTaskManager.SelectedTask.SingleCopterInfos[i]; + if (_copterManager.SelectedCopters.Contains(info.Copter)) + { + Tuple targetLatLng = new Tuple(0, 0); + + targetLatLng = GeographyUtils.CalcLatLngSomeMetersAway2D( + info.TargetLat, + info.TargetLng, + directionvalue, + Modialtvalue + ); + info.TargetLat = targetLatLng.Item1; + info.TargetLng = targetLatLng.Item2; + } + } + + })); + } + } + + //调整所有任务高度 private ICommand _ModiAltCommand; public ICommand ModiAltCommand diff --git a/Plane.FormationCreator/Views/ControlPanelView.xaml b/Plane.FormationCreator/Views/ControlPanelView.xaml index 95b20b5..ff8ad9f 100644 --- a/Plane.FormationCreator/Views/ControlPanelView.xaml +++ b/Plane.FormationCreator/Views/ControlPanelView.xaml @@ -87,7 +87,8 @@