From 1e69baaf9dad343348181dcd5c7b7c75a9affc63 Mon Sep 17 00:00:00 2001 From: zxd Date: Thu, 3 Jan 2019 14:30:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E8=B5=B7=E9=A3=9E?= =?UTF-8?q?=E7=9A=84bug=20=E6=B7=BB=E5=8A=A0=E4=BA=86=E8=BF=94=E8=88=AA?= =?UTF-8?q?=E7=94=B5=E5=8E=8B=20=E6=B7=BB=E5=8A=A0=E4=BA=86=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E6=8E=A7=E5=88=B6=E4=B8=AD=E9=A3=9E=E6=9C=BA=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/CopterManager.cs | 25 ++++++++++--------- .../Formation/FlightTask_TakeOff.cs | 3 --- Plane.FormationCreator/MainWindow.xaml | 11 +++++--- Plane.FormationCreator/ModifyParam.xaml | 12 ++++++--- Plane.FormationCreator/ModifyParam.xaml.cs | 4 +++ Plane.FormationCreator/Util/VersionControl.cs | 17 ++++++++++++- .../ViewModels/ControlPanelViewModel.cs | 17 +++++++++++-- .../ViewModels/CopterListViewModel.cs | 9 ++++--- .../Views/ConnectWindow.xaml | 13 +++++++--- .../Views/ConnectWindow.xaml.cs | 8 ++++++ .../Views/ControlPanelView.xaml | 6 +++-- .../Views/ModifyTaskView.xaml | 2 +- .../Views/ModifyTaskView.xaml.cs | 5 ++++ 13 files changed, 96 insertions(+), 36 deletions(-) diff --git a/Plane.FormationCreator/Formation/CopterManager.cs b/Plane.FormationCreator/Formation/CopterManager.cs index 0811f6e..8b8d26c 100644 --- a/Plane.FormationCreator/Formation/CopterManager.cs +++ b/Plane.FormationCreator/Formation/CopterManager.cs @@ -7,6 +7,7 @@ using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; +using Plane.FormationCreator.Util; namespace Plane.FormationCreator.Formation { @@ -21,18 +22,18 @@ namespace Plane.FormationCreator.Formation { ////给第三方时候限制数量和时间用 -// DateTime dateTime2019 = DateTime.Parse("2019-06-20"); -// -// if (DateTime.UtcNow > dateTime2019) -// { -// throw new NotImplementedException(); -// } -// -// -// if (this.Count >= 50) -// { -// return 0; -// } + DateTime dateTime2019 = DateTime.Parse("2019-06-20"); + + if (DateTime.UtcNow > dateTime2019) + { + throw new NotImplementedException(); + } + + + if (this.Count >= VersionControl.CopterUpperLimit) + { + return 0; + } int _index = 0; if (this.Count == 0) diff --git a/Plane.FormationCreator/Formation/FlightTask_TakeOff.cs b/Plane.FormationCreator/Formation/FlightTask_TakeOff.cs index 0f44e08..b56dacf 100644 --- a/Plane.FormationCreator/Formation/FlightTask_TakeOff.cs +++ b/Plane.FormationCreator/Formation/FlightTask_TakeOff.cs @@ -100,7 +100,6 @@ namespace Plane.FormationCreator.Formation var copter = info.Copter; //等待起飞时间 - Windows.Messages.Message.Show($"{copter.Name}:等待起飞 = {info.TakeOffWaitTime}"); while ((int)ts.TotalMilliseconds < (int)info.TakeOffWaitTime * 1000) { if (_flightTaskManager.IsPaused == true) @@ -138,12 +137,10 @@ namespace Plane.FormationCreator.Formation ts = dtNow - dtLastTime; FlightTask task = _flightTaskManager.CurrentRunningTask; - Windows.Messages.Message.Show($"{copter.Name}:等待到达飞行时间 = {task.TakeOffTime}"); while (ts.TotalMilliseconds < task.TakeOffTime * 1000) { if (_flightTaskManager.IsPaused == true) { - //Windows.Messages.Message.Show($"{copter.Name}:悬停"); await info.Copter.HoverAsync(); return; } diff --git a/Plane.FormationCreator/MainWindow.xaml b/Plane.FormationCreator/MainWindow.xaml index 6ea6386..094666f 100644 --- a/Plane.FormationCreator/MainWindow.xaml +++ b/Plane.FormationCreator/MainWindow.xaml @@ -42,15 +42,17 @@ - + +