From 57fc99c4349bac6107e95dfb70c940d7741e248a Mon Sep 17 00:00:00 2001 From: xu Date: Mon, 2 Mar 2020 17:05:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=B5=B7=E9=A3=9E=E6=95=B0?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Formation/FlightTaskManager.cs | 27 ++---------- .../Formation/FlightTask_TakeOff.cs | 10 ----- Plane.FormationCreator/MainWindow.xaml | 2 +- .../ViewModels/ConnectViewModel.cs | 2 +- .../Views/ModifyTaskView.xaml | 42 ++++++++++--------- 5 files changed, 29 insertions(+), 54 deletions(-) diff --git a/Plane.FormationCreator/Formation/FlightTaskManager.cs b/Plane.FormationCreator/Formation/FlightTaskManager.cs index 75f853e..f1ecf43 100644 --- a/Plane.FormationCreator/Formation/FlightTaskManager.cs +++ b/Plane.FormationCreator/Formation/FlightTaskManager.cs @@ -89,25 +89,7 @@ namespace Plane.FormationCreator.Formation private CopterManager _copterManager; - private int _TakeOffNumAttr = 1; - public int TakeOffNumAttr - { - get { return _TakeOffNumAttr; } - set - { - Set(nameof(TakeOffNumAttr), ref _TakeOffNumAttr, value); - bool takeOffTaskExisted = Tasks.Count >= 1; - FlightTask takeOffTask; - if (takeOffTaskExisted) - { - takeOffTask = Tasks[0]; - takeOffTask.TakeOffNumAttr = TakeOffNumAttr; - } - - - } - } private string _MessageText="test"; public string MessageText @@ -149,7 +131,6 @@ namespace Plane.FormationCreator.Formation else { takeOffTask = new FlightTask(FlightTaskType.TakeOff); - takeOffTask.TakeOffNumAttr = TakeOffNumAttr; Tasks.Add(takeOffTask); RaiseTaskAdded(null, takeOffTask); //TaskAdded?.Invoke(this, new FlightTaskAddedEventArgs { AddedTask = takeOffTask }); @@ -935,7 +916,7 @@ namespace Plane.FormationCreator.Formation case FlightTaskType.TakeOff: return new { type = type, - takeoffnumber = TakeOffNumAttr, + takeoffnumber = 1,// TakeOffNumAttr, takeoffTime = task.TakeOffTime, singleCopterInfos = task.SingleCopterInfos.Select(info => { @@ -1098,7 +1079,7 @@ namespace Plane.FormationCreator.Formation case FlightTaskType.TakeOff: return new { type = type, - takeoffnumber = TakeOffNumAttr, + takeoffnumber = 1,//TakeOffNumAttr, takeoffTime = task.TakeOffTime, singleCopterInfos = task.SingleCopterInfos.Select(info => { @@ -1179,7 +1160,7 @@ namespace Plane.FormationCreator.Formation case FlightTaskType.TakeOff: // AddTakeOffTask(copters); // added by ZJF // TakeOffNumAttr = task.takeoffnumber; - TakeOffNumAttr = task.takeoffnumber; + // TakeOffNumAttr= task.takeoffnumber; RestoreTakeOffTask((byte)task.takeoffTime, task.singleCopterInfos); break; case FlightTaskType.FlyTo: @@ -1516,7 +1497,7 @@ namespace Plane.FormationCreator.Formation { case FlightTaskType.TakeOff: // AddTakeOffTask(copters); // added by ZJF - TakeOffNumAttr = task.takeoffnumber; + // TakeOffNumAttr = task.takeoffnumber; RestoreTakeOffTask((byte)task.takeoffTime, task.singleCopterInfos); break; case FlightTaskType.FlyTo: diff --git a/Plane.FormationCreator/Formation/FlightTask_TakeOff.cs b/Plane.FormationCreator/Formation/FlightTask_TakeOff.cs index c73cd90..6a82928 100644 --- a/Plane.FormationCreator/Formation/FlightTask_TakeOff.cs +++ b/Plane.FormationCreator/Formation/FlightTask_TakeOff.cs @@ -13,16 +13,6 @@ namespace Plane.FormationCreator.Formation { - private int _TakeOffNumAttr = 1; - public int TakeOffNumAttr - { - get { return _TakeOffNumAttr; } - set - { - Set(nameof(TakeOffNumAttr), ref _TakeOffNumAttr, value); - } - } - //起飞到第一个航点高度的飞行时间 private byte _TakeOffTime = 10; public byte TakeOffTime diff --git a/Plane.FormationCreator/MainWindow.xaml b/Plane.FormationCreator/MainWindow.xaml index a320ac8..93ac2a9 100644 --- a/Plane.FormationCreator/MainWindow.xaml +++ b/Plane.FormationCreator/MainWindow.xaml @@ -230,7 +230,7 @@ + Text="{Binding Message}" Width="400" MouseUp="LogShowHide"/> diff --git a/Plane.FormationCreator/ViewModels/ConnectViewModel.cs b/Plane.FormationCreator/ViewModels/ConnectViewModel.cs index fa48d54..fd98549 100644 --- a/Plane.FormationCreator/ViewModels/ConnectViewModel.cs +++ b/Plane.FormationCreator/ViewModels/ConnectViewModel.cs @@ -142,7 +142,7 @@ namespace Plane.FormationCreator.ViewModels get { return _CopterSum; } set { Set(nameof(CopterSum), ref _CopterSum, value); } } - private string _CopterColor = "FFFFFF"; + private string _CopterColor = "330033"; public string CopterColor { get { return _CopterColor; } diff --git a/Plane.FormationCreator/Views/ModifyTaskView.xaml b/Plane.FormationCreator/Views/ModifyTaskView.xaml index fde6900..c144508 100644 --- a/Plane.FormationCreator/Views/ModifyTaskView.xaml +++ b/Plane.FormationCreator/Views/ModifyTaskView.xaml @@ -26,17 +26,8 @@ Value="Horizontal" /> - - - + - - - @@ -76,15 +67,14 @@ - -