加入计算返航的功能,可以完整计算整个2d飞行任务
This commit is contained in:
parent
d547c7ab5c
commit
62cde39a91
@ -1427,7 +1427,13 @@ namespace Plane.FormationCreator.Formation
|
|||||||
|
|
||||||
return t;
|
return t;
|
||||||
} //计算优化线路,采用米计算
|
} //计算优化线路,采用米计算
|
||||||
public void OptimizeRouteMeter(bool Is3d=false)
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Is3d">3D计算</param>
|
||||||
|
/// <param name="Ischange">是否改变线路的结束点顺序--返回起飞点航线不能交换</param>
|
||||||
|
public void OptimizeRouteMeter(bool Is3d=false,bool Ischange=true)
|
||||||
{
|
{
|
||||||
Dictionary<int, Point3D> curTaskPoint = new Dictionary<int, Point3D>();
|
Dictionary<int, Point3D> curTaskPoint = new Dictionary<int, Point3D>();
|
||||||
Dictionary<int, Point3D> prevTaskPoint = new Dictionary<int, Point3D>();
|
Dictionary<int, Point3D> prevTaskPoint = new Dictionary<int, Point3D>();
|
||||||
@ -1467,7 +1473,7 @@ namespace Plane.FormationCreator.Formation
|
|||||||
}
|
}
|
||||||
else
|
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;
|
Vector3[] RouteRes;
|
||||||
//有错层,需要插入2个错层任务
|
//有错层,需要插入2个错层任务
|
||||||
if (resarray.Count == 3)
|
if (resarray.Count == 3)
|
||||||
|
@ -773,6 +773,19 @@ namespace Plane.FormationCreator.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private ICommand _OptimizeRouteCommandRet;
|
||||||
|
public ICommand OptimizeRouteCommandRet
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _OptimizeRouteCommandRet ?? (_OptimizeRouteCommandRet = new RelayCommand<int>(async =>
|
||||||
|
{
|
||||||
|
_flightTaskManager.OptimizeRouteMeter(false,false); //采用米计算逻辑和OptimizeRouteNew一样
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private ICommand _OptimizeRouteCommand3D;
|
private ICommand _OptimizeRouteCommand3D;
|
||||||
public ICommand OptimizeRouteCommand3D
|
public ICommand OptimizeRouteCommand3D
|
||||||
|
@ -74,9 +74,11 @@
|
|||||||
/>
|
/>
|
||||||
<Button Margin="0,5,5,0" Content="计算航线3D" Width="105" Command="{Binding OptimizeRouteCommand3D}"
|
<Button Margin="0,5,5,0" Content="计算航线3D" Width="105" Command="{Binding OptimizeRouteCommand3D}"
|
||||||
/>
|
/>
|
||||||
<Button Margin="0,5,5,0" Content="导出到C4D" Width="105" Command="{Binding ExportWayPointCommand}"/>
|
<Button Margin="0,5,5,0" Content="计算返航" Width="105" Command="{Binding OptimizeRouteCommandRet}"
|
||||||
<Button Margin="0,5,5,0" Content="估计时间" Width="105" Command="{Binding AutoWayPointTmCommand}"/>
|
/>
|
||||||
|
|
||||||
|
<Button Margin="0,5,5,0" Content="导出到C4D" Width="105" Command="{Binding ExportWayPointCommand}"/>
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
|
|
||||||
@ -92,6 +94,7 @@
|
|||||||
Margin="0,5,5,0" Width="105"
|
Margin="0,5,5,0" Width="105"
|
||||||
Command="{Binding BackTakeOffPointCommand}" />
|
Command="{Binding BackTakeOffPointCommand}" />
|
||||||
|
|
||||||
|
<Button Margin="0,5,5,0" Content="估计时间" Width="105" Command="{Binding AutoWayPointTmCommand}"/>
|
||||||
|
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
Loading…
Reference in New Issue
Block a user