diff --git a/Plane.FormationCreator/Formation/FlightTaskManager.cs b/Plane.FormationCreator/Formation/FlightTaskManager.cs
index 10007a2..79dbf83 100644
--- a/Plane.FormationCreator/Formation/FlightTaskManager.cs
+++ b/Plane.FormationCreator/Formation/FlightTaskManager.cs
@@ -1427,7 +1427,13 @@ namespace Plane.FormationCreator.Formation
return t;
} //计算优化线路,采用米计算
- public void OptimizeRouteMeter(bool Is3d=false)
+
+ ///
+ ///
+ ///
+ /// 3D计算
+ /// 是否改变线路的结束点顺序--返回起飞点航线不能交换
+ public void OptimizeRouteMeter(bool Is3d=false,bool Ischange=true)
{
Dictionary curTaskPoint = new Dictionary();
Dictionary prevTaskPoint = new Dictionary();
@@ -1467,7 +1473,7 @@ namespace Plane.FormationCreator.Formation
}
else
{
- ArrayList resarray = Util.OptimizeRoute.Gen2DRoute(curTaskPoint.Values.ToArray(), prevTaskPoint.Values.ToArray());
+ ArrayList resarray = Util.OptimizeRoute.Gen2DRoute(curTaskPoint.Values.ToArray(), prevTaskPoint.Values.ToArray(), Ischange);
Vector3[] RouteRes;
//有错层,需要插入2个错层任务
if (resarray.Count == 3)
diff --git a/Plane.FormationCreator/ViewModels/ModifyTaskViewModel.cs b/Plane.FormationCreator/ViewModels/ModifyTaskViewModel.cs
index dda75fb..a40750a 100644
--- a/Plane.FormationCreator/ViewModels/ModifyTaskViewModel.cs
+++ b/Plane.FormationCreator/ViewModels/ModifyTaskViewModel.cs
@@ -773,6 +773,19 @@ namespace Plane.FormationCreator.ViewModels
}
}
+
+ private ICommand _OptimizeRouteCommandRet;
+ public ICommand OptimizeRouteCommandRet
+ {
+ get
+ {
+ return _OptimizeRouteCommandRet ?? (_OptimizeRouteCommandRet = new RelayCommand(async =>
+ {
+ _flightTaskManager.OptimizeRouteMeter(false,false); //采用米计算逻辑和OptimizeRouteNew一样
+ }));
+ }
+ }
+
private ICommand _OptimizeRouteCommand3D;
public ICommand OptimizeRouteCommand3D
diff --git a/Plane.FormationCreator/Views/ModifyTaskView.xaml b/Plane.FormationCreator/Views/ModifyTaskView.xaml
index 8209560..594894e 100644
--- a/Plane.FormationCreator/Views/ModifyTaskView.xaml
+++ b/Plane.FormationCreator/Views/ModifyTaskView.xaml
@@ -74,9 +74,11 @@
/>
-
-
+
+
+
@@ -92,6 +94,7 @@
Margin="0,5,5,0" Width="105"
Command="{Binding BackTakeOffPointCommand}" />
+