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 @@ - + +