diff --git a/Plane.FormationCreator/Formation/FlightTaskManager.cs b/Plane.FormationCreator/Formation/FlightTaskManager.cs
index ce98b8f..1b14345 100644
--- a/Plane.FormationCreator/Formation/FlightTaskManager.cs
+++ b/Plane.FormationCreator/Formation/FlightTaskManager.cs
@@ -29,6 +29,10 @@ namespace Plane.FormationCreator.Formation
_copterManager.SelectedCoptersChanged += (sender, e) =>
{
+ foreach (ICopter copter in _copterManager.SelectedCopters)
+ {
+ copter.LEDAsync();
+ }
// TODO: 林俊清, 20150803, 处理选中多个飞行器的情况。
if (_copterManager.SelectedCopters.Count() > 1)
{
@@ -49,6 +53,9 @@ namespace Plane.FormationCreator.Formation
}
if (selectedCopter!=null)
selectedCopter.SetShowLEDFlashAsync(1, 100);
+
+ if (selectedCopter != null)
+ selectedCopter.LEDAsync();
};
TaskAdded += (sender, e) =>
diff --git a/Plane.FormationCreator/ViewModels/ControlPanelViewModel.cs b/Plane.FormationCreator/ViewModels/ControlPanelViewModel.cs
index 420a3b3..31b678f 100644
--- a/Plane.FormationCreator/ViewModels/ControlPanelViewModel.cs
+++ b/Plane.FormationCreator/ViewModels/ControlPanelViewModel.cs
@@ -91,6 +91,30 @@ namespace Plane.FormationCreator.ViewModels
}
}
+ private const string NTF_GROUPLED_OFF = "NTF_GROUPLED_OFF";
+ private ICommand _LEDOnOffCommand;
+ public ICommand LEDOnOffCommand
+ {
+ get
+ {
+ return _LEDOnOffCommand ?? (_LEDOnOffCommand = new RelayCommand(async () =>
+ {
+ string paramstr = NTF_GROUPLED_OFF;
+ float paramvalue = 0;
+ await Task.WhenAll(
+ _copterManager.AcceptingControlCopters.Select(async copter =>
+ {
+ paramvalue = await copter.GetParamAsync(paramstr);
+ }));
+
+ float newParamvalue = paramvalue == 0 ? 1 : 0;
+
+ await Task.WhenAll(_copterManager.AcceptingControlCopters.Select
+ (copter => copter.SetParamAsync(paramstr, newParamvalue)));
+ }));
+ }
+ }
+
private ICommand _UnlockCommand;
public ICommand UnlockCommand
{
diff --git a/Plane.FormationCreator/Views/ControlPanelView.xaml b/Plane.FormationCreator/Views/ControlPanelView.xaml
index 352967e..b9655fe 100644
--- a/Plane.FormationCreator/Views/ControlPanelView.xaml
+++ b/Plane.FormationCreator/Views/ControlPanelView.xaml
@@ -56,10 +56,11 @@
+
diff --git a/Plane.FormationCreator/Views/MapView_CopterDrawing.cs b/Plane.FormationCreator/Views/MapView_CopterDrawing.cs
index 00e2881..54388b8 100644
--- a/Plane.FormationCreator/Views/MapView_CopterDrawing.cs
+++ b/Plane.FormationCreator/Views/MapView_CopterDrawing.cs
@@ -364,12 +364,20 @@ namespace Plane.FormationCreator.Views
{
Point curPoint = new Point(kv.Value.X + offsetX, kv.Value.Y + offsetY);
var curLoc = _map.ViewportPointToLocation(curPoint);
- var routePoint = this.Route.Locations[taskIndex];
+
var modifyingSingleCopterInfo = _flightTaskManager.SelectedTask.SingleCopterInfos.Find(i => i.Copter == kv.Key);
- modifyingSingleCopterInfo.TargetLat = routePoint.Latitude = curLoc.Latitude;
- modifyingSingleCopterInfo.TargetLng = routePoint.Longitude = curLoc.Longitude;
+ //modifyingSingleCopterInfo.TargetLat = routePoint.Latitude = curLoc.Latitude;
+ //modifyingSingleCopterInfo.TargetLng = routePoint.Longitude = curLoc.Longitude;
+ modifyingSingleCopterInfo.TargetLat = curLoc.Latitude;
+ modifyingSingleCopterInfo.TargetLng = curLoc.Longitude;
+
}
+
+ var routePoint = this.Route.Locations[taskIndex];
var leftTopPos = new Point(eventPos.X - wpOffsetX, eventPos.Y - wpOffsetY);
+ var newRoutePoint = new Point(leftTopPos.X + WAYPOINT_RADIUS, leftTopPos.Y + WAYPOINT_RADIUS);
+ routePoint.Latitude = _map.ViewportPointToLocation(newRoutePoint).Latitude;
+ routePoint.Longitude = _map.ViewportPointToLocation(newRoutePoint).Longitude;
MapLayer.SetPosition(wp, _map.ViewportPointToLocation(leftTopPos));
}
};
diff --git a/Plane.FormationCreator/Views/ModifyTaskView.xaml b/Plane.FormationCreator/Views/ModifyTaskView.xaml
index 4a3a15a..5e43a42 100644
--- a/Plane.FormationCreator/Views/ModifyTaskView.xaml
+++ b/Plane.FormationCreator/Views/ModifyTaskView.xaml
@@ -242,9 +242,16 @@
-
-
-
+
+
+
+
+
+
+
+