From 2614dc2f59e36630cde975e2a10f613ece41221c Mon Sep 17 00:00:00 2001 From: pxzleo Date: Tue, 16 Jan 2024 21:43:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BF=87=E5=BA=A6=E8=88=AA?= =?UTF-8?q?=E7=82=B9=E5=B1=9E=E6=80=A7=EF=BC=8C=E9=80=9A=E8=BF=87=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E5=8C=BA=E5=88=86=20=E5=8A=A0=E5=85=A5=E8=B5=B7?= =?UTF-8?q?=E9=A3=9E=E6=A3=80=E6=B5=8B=E9=A2=9D=E5=A4=96=E6=97=B6=E9=97=B4?= =?UTF-8?q?=EF=BC=8C=E9=BB=98=E8=AE=A44=E7=A7=92,=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=8E=A7=E5=88=B6=E6=97=B6=E9=97=B4=E5=92=8C?= =?UTF-8?q?=E9=AB=98=E5=BA=A6=20=E5=8A=A0=E5=85=A5=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E8=88=AA=E7=BA=BF=E7=A2=B0=E6=92=9E=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E9=97=B4=E8=B7=9D=E5=8F=82=E6=95=B0=20=E5=8A=A0?= =?UTF-8?q?=E5=85=A52D=E8=AE=A1=E7=AE=97=E8=BF=94=E8=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Plane.FormationCreator/App.xaml | 161 +- .../Formation/FlightTask.cs | 373 ++--- .../Formation/FlightTaskManager.cs | 77 +- .../Plane.FormationCreator.csproj | 1 + .../ViewModels/ModifyTaskViewModel.cs | 21 +- .../Views/ModifyTaskView.xaml | 1369 +++++++++-------- Plane.FormationCreator/Views/TaskBarView.xaml | 458 +++--- 7 files changed, 1285 insertions(+), 1175 deletions(-) diff --git a/Plane.FormationCreator/App.xaml b/Plane.FormationCreator/App.xaml index b3c077f..bfd11e6 100644 --- a/Plane.FormationCreator/App.xaml +++ b/Plane.FormationCreator/App.xaml @@ -1,80 +1,83 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Plane.FormationCreator/Formation/FlightTask.cs b/Plane.FormationCreator/Formation/FlightTask.cs index be75f76..5e90ca2 100644 --- a/Plane.FormationCreator/Formation/FlightTask.cs +++ b/Plane.FormationCreator/Formation/FlightTask.cs @@ -1,179 +1,194 @@ -using Plane.Copters; -using Plane.Logging; -using GalaSoft.MvvmLight; -using Microsoft.Practices.ServiceLocation; -using System; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Plane.FormationCreator.Formation -{ - public partial class FlightTask : ObservableObject - { - public FlightTask(FlightTaskType type) - { - TaskType = type; - } - - private FlightTaskManager _flightTaskManager = ServiceLocator.Current.GetInstance(); - - private ILogger _logger = ServiceLocator.Current.GetInstance(); - - private FlightTaskStatus _Status = FlightTaskStatus.Stop; - public FlightTaskStatus Status - { - get { return _Status; } - set { Set(nameof(Status), ref _Status, value); } - } - - private FlightTaskType _TaskType; - public FlightTaskType TaskType - { - get { return _TaskType; } - set - { - Set(nameof(TaskType), ref _TaskType, value); - RaisePropertyChanged(nameof(TaskTypeIndex)); - RaisePropertyChanged(nameof(TaskCnName)); - - } - } - - - /* - public int TaskTypeIndex - { - get { return (int)TaskType; } - set - { - TaskType = (FlightTaskType)value; - VerticalLift = false; - if ( (value == (int)FlightTaskType.Loiter) || (value == (int)FlightTaskType.Circle) ) - { - VerticalLift = true; - } - } - } - */ - private string _TaskName = ""; - public string TaskCnName - { - get - { - string name = ""; - switch (TaskType) - { - case FlightTaskType.TakeOff: name = "起飞"; break; - case FlightTaskType.FlyTo: name = _TaskName == "" ? "航点" : _TaskName; break; - case FlightTaskType.Land: name = "降落"; break; - } - //name = (TaskIndex + 1).ToString() + "." + name; - return name; - } - set { - - Set(nameof(TaskCnName), ref _TaskName, value); - RaisePropertyChanged(nameof(TaskCnName)); - - - } - } - - public int TaskTypeIndex - { - get { - int index = 1; - switch (TaskType) - { - case FlightTaskType.TakeOff:index = 0; break; - case FlightTaskType.FlyTo: index = 1; break; - case FlightTaskType.Land: index = 2; break; - } - return index; - } - set - { - switch (value) - { - case 0: TaskType = FlightTaskType.TakeOff; break; - case 1: TaskType = FlightTaskType.FlyTo; break; - case 2: TaskType = FlightTaskType.Land; break; - } - } - } - - //task在所以任务中的index - public int TaskIndex - { - get - { - return _flightTaskManager.Tasks.IndexOf(this); - } - } - - public int TaskNum - { - get - { - return TaskIndex + 1; - } - } - - private bool _IsSelected; - public bool IsSelected - { - get { return _IsSelected; } - set { Set(nameof(IsSelected), ref _IsSelected, value); } - } - - // 右键单击任务,用于隐藏任务图标, added by ZJF - private bool _IsRightSelected; - public bool IsRightSelected - { - get { return _IsRightSelected; } - set { Set(nameof(IsRightSelected), ref _IsRightSelected, value); } - } - - - - - public List SingleCopterInfos { get; set; } = new List(); - - private FlightTaskSingleCopterInfo _ModifyingSingleCopterInfo; - public FlightTaskSingleCopterInfo ModifyingSingleCopterInfo - { - get { return _ModifyingSingleCopterInfo; } - set { Set(nameof(ModifyingSingleCopterInfo), ref _ModifyingSingleCopterInfo, value); } - } - - public async Task RunAsync() - { - switch (TaskType) - { - case FlightTaskType.FlyTo: - await RunFlyToTaskAsync().ConfigureAwait(false); - break; - case FlightTaskType.TakeOff: - //多架同时起飞 - //await MutilRunTakeOffTaskAsync().ConfigureAwait(false); - await NewMutilRunTakeOffTaskAsync().ConfigureAwait(false); - break; - case FlightTaskType.Land: - await MutilLandTaskAsync().ConfigureAwait(false); - break; - default: - throw new InvalidOperationException(); - } - } - } - - public enum FlightTaskType - { - FlyTo = 0, - Land = 6, - TakeOff = 100 - } -} +using Plane.Copters; +using Plane.Logging; +using GalaSoft.MvvmLight; +using Microsoft.Practices.ServiceLocation; +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Plane.FormationCreator.Formation +{ + public partial class FlightTask : ObservableObject + { + public FlightTask(FlightTaskType type) + { + TaskType = type; + } + + private FlightTaskManager _flightTaskManager = ServiceLocator.Current.GetInstance(); + + private ILogger _logger = ServiceLocator.Current.GetInstance(); + + private FlightTaskStatus _Status = FlightTaskStatus.Stop; + public FlightTaskStatus Status + { + get { return _Status; } + set { Set(nameof(Status), ref _Status, value); } + } + + private FlightTaskType _TaskType; + public FlightTaskType TaskType + { + get { return _TaskType; } + set + { + Set(nameof(TaskType), ref _TaskType, value); + RaisePropertyChanged(nameof(TaskTypeIndex)); + RaisePropertyChanged(nameof(TaskCnName)); + + } + } + + + /* + public int TaskTypeIndex + { + get { return (int)TaskType; } + set + { + TaskType = (FlightTaskType)value; + VerticalLift = false; + if ( (value == (int)FlightTaskType.Loiter) || (value == (int)FlightTaskType.Circle) ) + { + VerticalLift = true; + } + } + } + */ + private string _TaskName = ""; + public string TaskCnName + { + get + { + string name = ""; + switch (TaskType) + { + case FlightTaskType.TakeOff: name = "起飞"; break; + case FlightTaskType.FlyTo: name = _TaskName == "" ? "航点" : _TaskName; break; + case FlightTaskType.Land: name = "降落"; break; + } + //name = (TaskIndex + 1).ToString() + "." + name; + return name; + } + set { + + Set(nameof(TaskCnName), ref _TaskName, value); + RaisePropertyChanged(nameof(TaskCnName)); + + + } + } + + public int TaskTypeIndex + { + get { + int index = 1; + switch (TaskType) + { + case FlightTaskType.TakeOff:index = 0; break; + case FlightTaskType.FlyTo: index = 1; break; + case FlightTaskType.Land: index = 2; break; + } + return index; + } + set + { + switch (value) + { + case 0: TaskType = FlightTaskType.TakeOff; break; + case 1: TaskType = FlightTaskType.FlyTo; break; + case 2: TaskType = FlightTaskType.Land; break; + } + } + } + + //task在所以任务中的index + public int TaskIndex + { + get + { + return _flightTaskManager.Tasks.IndexOf(this); + } + } + + public int TaskNum + { + get + { + return TaskIndex + 1; + } + } + + private bool _IsTransition=false; + public bool IsTransition + { + get { return _IsTransition; } + set { + + Set(nameof(IsTransition), ref _IsTransition, value); + if ((value)&& (TaskCnName == "航点")) + TaskCnName = "过度"; + + } + } + + + + private bool _IsSelected; + public bool IsSelected + { + get { return _IsSelected; } + set { Set(nameof(IsSelected), ref _IsSelected, value); } + } + + // 右键单击任务,用于隐藏任务图标, added by ZJF + private bool _IsRightSelected; + public bool IsRightSelected + { + get { return _IsRightSelected; } + set { Set(nameof(IsRightSelected), ref _IsRightSelected, value); } + } + + + + + public List SingleCopterInfos { get; set; } = new List(); + + private FlightTaskSingleCopterInfo _ModifyingSingleCopterInfo; + public FlightTaskSingleCopterInfo ModifyingSingleCopterInfo + { + get { return _ModifyingSingleCopterInfo; } + set { Set(nameof(ModifyingSingleCopterInfo), ref _ModifyingSingleCopterInfo, value); } + } + + public async Task RunAsync() + { + switch (TaskType) + { + case FlightTaskType.FlyTo: + await RunFlyToTaskAsync().ConfigureAwait(false); + break; + case FlightTaskType.TakeOff: + //多架同时起飞 + //await MutilRunTakeOffTaskAsync().ConfigureAwait(false); + await NewMutilRunTakeOffTaskAsync().ConfigureAwait(false); + break; + case FlightTaskType.Land: + await MutilLandTaskAsync().ConfigureAwait(false); + break; + default: + throw new InvalidOperationException(); + } + } + } + + public enum FlightTaskType + { + FlyTo = 0, + Land = 6, + TakeOff = 100 + } +} diff --git a/Plane.FormationCreator/Formation/FlightTaskManager.cs b/Plane.FormationCreator/Formation/FlightTaskManager.cs index b1082f4..f039dd8 100644 --- a/Plane.FormationCreator/Formation/FlightTaskManager.cs +++ b/Plane.FormationCreator/Formation/FlightTaskManager.cs @@ -375,9 +375,32 @@ namespace Plane.FormationCreator.Formation set { Set(nameof(FC_defvel_down), ref _FC_defvel_down, value); } } + //起飞检测额外时间,默认4秒 + private float _FC_takeoff_ct = 4000; + public float FC_takeoff_ct + { + get { return _FC_takeoff_ct; } + set { Set(nameof(FC_takeoff_ct), ref _FC_takeoff_ct, value); } + } + + //起飞检测高度cm + private float _FC_takeoff_calt = 100; + public float FC_takeoff_calt + { + get { return _FC_takeoff_calt; } + set { Set(nameof(FC_takeoff_calt), ref _FC_takeoff_calt, value); } + } + //自动计算航线,碰撞检测间距,航线小于1.8米再检测前后距离是否大于_FC_SpaceBetween (cm) + private float _FC_SpaceBetween = 250; + public float FC_SpaceBetween + { + get { return _FC_SpaceBetween;} + set { Set(nameof(FC_SpaceBetween), ref _FC_SpaceBetween, value); } + } + private TasksStatus _TaskState = TasksStatus.Stop; public TasksStatus TaskState @@ -1196,7 +1219,7 @@ namespace Plane.FormationCreator.Formation } } - public void RestoreFlyToTask(bool staggerRoutes, int flytoTime, int loiterTime, string taskName, dynamic singleCopterInfos, bool isMeter) + public void RestoreFlyToTask(bool staggerRoutes, int flytoTime, int loiterTime, string taskName, dynamic singleCopterInfos, bool isMeter, bool istrans) { var copters = _copterManager.Copters; float tagalt = 15; @@ -1206,7 +1229,7 @@ namespace Plane.FormationCreator.Formation var nullableCenter = copters.GetCenter(); if (nullableCenter == null) return; var center = nullableCenter.Value; - var newTask = new FlightTask(FlightTaskType.FlyTo) { StaggerRoutes = staggerRoutes, FlytoTime = flytoTime, LoiterTime = loiterTime }; + var newTask = new FlightTask(FlightTaskType.FlyTo) { StaggerRoutes = staggerRoutes, FlytoTime = flytoTime, LoiterTime = loiterTime,IsTransition= istrans }; if (taskName != null) newTask.TaskCnName = taskName; // TODO: 王海, 20150801, 处理实际飞行器数目与记录中数目不一致的情况。 for (int i = 0; i < copters.Count; i++) @@ -1341,6 +1364,7 @@ namespace Plane.FormationCreator.Formation flytoTime = task.FlytoTime, loiterTime = task.LoiterTime, taskname = task.TaskCnName, + istransition = task.IsTransition, singleCopterInfos = task.SingleCopterInfos.Select(info => { var offset = info.LatLngOffset; @@ -1570,7 +1594,10 @@ namespace Plane.FormationCreator.Formation RestoreTakeOffTask((byte)task.takeoffTime, task.singleCopterInfos); break; case FlightTaskType.FlyTo: - RestoreFlyToTask((bool)task.staggerRoutes, (int)task.flytoTime, (int)task.loiterTime, (string)task.taskname, task.singleCopterInfos, isMeter); + bool isTransition = false; + if (task.istransition != null) + isTransition = (bool)task.istransition; + RestoreFlyToTask((bool)task.staggerRoutes, (int)task.flytoTime, (int)task.loiterTime, (string)task.taskname, task.singleCopterInfos, isMeter, isTransition); break; case FlightTaskType.Land: RestoreLandTask(task.singleCopterInfos); @@ -1772,20 +1799,28 @@ namespace Plane.FormationCreator.Formation var curWaypoint = Tasks[taskIndex].SingleCopterInfos.FirstOrDefault(c => c.Copter == copter); double copter_maxDistance_up = nextWaypoint.TargetAlt; + double copter_maxDistance_show = copter_maxDistance_up; + //减去测试起飞高度 + if (FC_takeoff_ct > 0) + copter_maxDistance_up -= FC_takeoff_calt / 100.0f; double time_up = getMinfligthtime((float)copter_maxDistance_up, acc_z, defvel_up, flytimetype); double copter_tasktime = curWaypoint.TakeOffWaitTime + time_up; if (copter_tasktime > tasktime) { tasktime = copter_tasktime; - maxDistance_up = copter_maxDistance_up; + maxDistance_up = copter_maxDistance_show; copterName = copter.Name; waittime = curWaypoint.TakeOffWaitTime; upflytime = time_up; } } + //加入起飞测试时间 + tasktime += FC_takeoff_ct / 1000.0f; + Message.Show($"起飞任务{taskIndex + 1}参数:检测起飞高度:{Math.Round(FC_takeoff_calt / 100.0f, 2)}米,检测时间:{Math.Round( FC_takeoff_ct / 1000.0f, 2)}秒" + ); Message.Show($"起飞任务{taskIndex + 1}起飞高度:{Math.Round(maxDistance_up, 2)}米 " + - $"最长耗时:{Math.Round(tasktime, 2)}秒({Math.Round(upflytime, 2)},{Math.Round(waittime, 2)}),编号:{copterName}" + $"最长耗时:{Math.Round(tasktime, 2)}秒(飞{Math.Round(upflytime, 2)},等待{Math.Round(waittime, 2)}),编号:{copterName}" ); if (settime) { @@ -2275,7 +2310,8 @@ namespace Plane.FormationCreator.Formation //选中前一个任务,插入错层 SelectTask(SelectedTaskIndex - 1); AddTask(); - + //设置为过度航点 + SelectedTask.IsTransition = true; //第一个错层 RouteRes = (FlightRoute.Vector3[])resarray[0]; @@ -2290,7 +2326,7 @@ namespace Plane.FormationCreator.Formation //第二个错层 AddTask(); - + SelectedTask.IsTransition = true; RouteRes = (FlightRoute.Vector3[])resarray[1]; for (int i = 0; i < _copterManager.Copters.Count; i++) @@ -2357,6 +2393,7 @@ namespace Plane.FormationCreator.Formation //设置随机数种子 FlyVecFun.RandomSeed = (int)DateTime.Now.Ticks; Message.Show($"开始自动生成任务,种子数:{FlyVecFun.RandomSeed}"); + FlyVecFun.SpaceBetweenSquare=FC_SpaceBetween* FC_SpaceBetween; //这是个平方值 //获取当前航点与前一航点所有经纬高 for (int i = 0; i < _copterManager.Copters.Count; i++) @@ -2422,6 +2459,7 @@ namespace Plane.FormationCreator.Formation //插入错层航点 SelectTask(SelectedTaskIndex - 1); AddTask(); + SelectedTask.IsTransition = true; SelectedTask.LoiterTime = 0; for (int i = 0; i < _copterManager.Copters.Count; i++) { @@ -2445,6 +2483,7 @@ namespace Plane.FormationCreator.Formation //插入错层航点 SelectTask(SelectedTaskIndex - 1); AddTask(); + SelectedTask.IsTransition = true; SelectedTask.LoiterTime = 0; for (int i = 0; i < _copterManager.Copters.Count; i++) { @@ -2464,6 +2503,7 @@ namespace Plane.FormationCreator.Formation //选中前一个任务,插入错层 SelectTask(SelectedTaskIndex - 1); AddTask(); + SelectedTask.IsTransition = true; SelectedTask.LoiterTime = 0; //第一个中间航点 @@ -2481,6 +2521,7 @@ namespace Plane.FormationCreator.Formation //选中前一个任务,插入错层 SelectTask(SelectedTaskIndex - 1); AddTask(); + SelectedTask.IsTransition = true; SelectedTask.LoiterTime = 0; //第一个中间航点 @@ -2494,6 +2535,7 @@ namespace Plane.FormationCreator.Formation //第二个中间航点 AddTask(); + SelectedTask.IsTransition = true; SelectedTask.LoiterTime = 0; for (int i = 0; i < _copterManager.Copters.Count; i++) { @@ -2510,6 +2552,7 @@ namespace Plane.FormationCreator.Formation //选中前一个任务,插入错层 SelectTask(SelectedTaskIndex - 1); AddTask(); + SelectedTask.IsTransition = true; SelectedTask.LoiterTime = 0; //第一个中间航点 @@ -2523,6 +2566,7 @@ namespace Plane.FormationCreator.Formation //第二个中间航点 AddTask(); + SelectedTask.IsTransition = true; SelectedTask.LoiterTime = 0; for (int i = 0; i < _copterManager.Copters.Count; i++) { @@ -2534,6 +2578,7 @@ namespace Plane.FormationCreator.Formation //第三个中间航点 AddTask(); + SelectedTask.IsTransition = true; SelectedTask.LoiterTime = 0; for (int i = 0; i < _copterManager.Copters.Count; i++) { @@ -2565,6 +2610,7 @@ namespace Plane.FormationCreator.Formation //第一个中间航点 AddTask(); + SelectedTask.IsTransition = true; SelectedTask.LoiterTime = 0; for (int i = 0; i < _copterManager.Copters.Count; i++) { @@ -2575,6 +2621,7 @@ namespace Plane.FormationCreator.Formation SetTaskFlytime(SelectedTaskIndex); //第二个中间航点 AddTask(); + SelectedTask.IsTransition = true; SelectedTask.LoiterTime = 0; for (int i = 0; i < _copterManager.Copters.Count; i++) { @@ -3026,7 +3073,10 @@ namespace Plane.FormationCreator.Formation RestoreTakeOffTask((byte)task.takeoffTime, task.singleCopterInfos); break; case FlightTaskType.FlyTo: - RestoreFlyToTask((bool)task.staggerRoutes, (int)task.flytoTime, (int)task.loiterTime, (string)task.taskname, task.singleCopterInfos, isMeter); + bool isTransition = false; + if (task.istransition != null) + isTransition = (bool)task.istransition; + RestoreFlyToTask((bool)task.staggerRoutes, (int)task.flytoTime, (int)task.loiterTime, (string)task.taskname, task.singleCopterInfos, isMeter, isTransition); break; case FlightTaskType.Land: @@ -3377,6 +3427,17 @@ namespace Plane.FormationCreator.Formation if (readvalue != "" && float.TryParse(readvalue, out floatTemp)) FC_defvel_down = float.Parse(readvalue); + readvalue = inifilse.IniReadvalue("Default", "FC_takeoff_ct"); + if (readvalue != "" && int.TryParse(readvalue, out intTemp)) + FC_takeoff_ct = int.Parse(readvalue); + + readvalue = inifilse.IniReadvalue("Default", "FC_takeoff_calt"); + if (readvalue != "" && int.TryParse(readvalue, out intTemp)) + FC_takeoff_calt = int.Parse(readvalue); + + readvalue = inifilse.IniReadvalue("Default", "FC_spacbetween"); + if (readvalue != "" && int.TryParse(readvalue, out intTemp)) + FC_SpaceBetween = int.Parse(readvalue); } diff --git a/Plane.FormationCreator/Plane.FormationCreator.csproj b/Plane.FormationCreator/Plane.FormationCreator.csproj index f189981..e1de434 100644 --- a/Plane.FormationCreator/Plane.FormationCreator.csproj +++ b/Plane.FormationCreator/Plane.FormationCreator.csproj @@ -167,6 +167,7 @@ + diff --git a/Plane.FormationCreator/ViewModels/ModifyTaskViewModel.cs b/Plane.FormationCreator/ViewModels/ModifyTaskViewModel.cs index ef03365..2d3d103 100644 --- a/Plane.FormationCreator/ViewModels/ModifyTaskViewModel.cs +++ b/Plane.FormationCreator/ViewModels/ModifyTaskViewModel.cs @@ -950,7 +950,7 @@ namespace Plane.FormationCreator.ViewModels })); } } - + //2D计算,不改变ID,拉开层 private ICommand _OptimizeRouteCommandRet; public ICommand OptimizeRouteCommandRet { @@ -960,7 +960,7 @@ namespace Plane.FormationCreator.ViewModels { if (_copterManager.FC_VER_NO >= 3) //3D计算,不改变ID,可以错层 - _flightTaskManager.OptimizeRouteMeter(true, false, true); //采用米计算逻辑,用3D生成,不改变ID,可拉开层(2D回起飞矩阵专用) + _flightTaskManager.OptimizeRouteMeter(false, false, true); //采用米计算逻辑,用3D生成,不改变ID,可拉开层(2D回起飞矩阵专用) else _flightTaskManager.OptimizeRouteMeter(false, false); //采用米计算逻辑,用2D生成,不改变ID,不拉开层 @@ -968,6 +968,23 @@ namespace Plane.FormationCreator.ViewModels } } + //3D计算,不改变ID,不拉开层 + private ICommand _OptimizeRouteCommandRet3D; + public ICommand OptimizeRouteCommandRet3D + { + get + { + return _OptimizeRouteCommandRet3D ?? (_OptimizeRouteCommandRet3D = new RelayCommand(async => + { + if (_copterManager.FC_VER_NO >= 3) + //3D计算,不改变ID,可以错层 + _flightTaskManager.OptimizeRouteMeter(true, false, false); //采用米计算逻辑,用3D生成,不改变ID,不拉开层(3D回起飞矩阵专用) + else + _flightTaskManager.OptimizeRouteMeter(false, false); //采用米计算逻辑,用2D生成,不改变ID,不拉开层 + + })); + } + } private ICommand _OptimizeRouteCommand3D; public ICommand OptimizeRouteCommand3D diff --git a/Plane.FormationCreator/Views/ModifyTaskView.xaml b/Plane.FormationCreator/Views/ModifyTaskView.xaml index d3a9bb3..8d71dd4 100644 --- a/Plane.FormationCreator/Views/ModifyTaskView.xaml +++ b/Plane.FormationCreator/Views/ModifyTaskView.xaml @@ -1,683 +1,686 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +