增加过度航点属性,通过颜色区分
加入起飞检测额外时间,默认4秒,加入参数控制时间和高度 加入自动计算航线碰撞检测间距参数 加入2D计算返航
This commit is contained in:
parent
17e4c8bd97
commit
2614dc2f59
@ -75,6 +75,9 @@
|
|||||||
<lcnv:HeartbeatCountToBrushConverter x:Key="HeartbeatCountToBrushConverter" />
|
<lcnv:HeartbeatCountToBrushConverter x:Key="HeartbeatCountToBrushConverter" />
|
||||||
<lcnv:AppModeToVisibilityConverter x:Key="AppModeToVisibilityConverter" />
|
<lcnv:AppModeToVisibilityConverter x:Key="AppModeToVisibilityConverter" />
|
||||||
<lcnv:FlightTaskStatusToFillConverter x:Key="FlightTaskStatusToFillConverter" />
|
<lcnv:FlightTaskStatusToFillConverter x:Key="FlightTaskStatusToFillConverter" />
|
||||||
|
|
||||||
|
<lcnv:FlightTaskStatusAndTransitionToFillConverter x:Key="FlightTaskStatusAndTransitionToFillConverter" />
|
||||||
|
|
||||||
<lcnv:FlightTaskIsSelectedToEffectConverter x:Key="FlightTaskIsSelectedToEffectConverter" />
|
<lcnv:FlightTaskIsSelectedToEffectConverter x:Key="FlightTaskIsSelectedToEffectConverter" />
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
</Application>
|
</Application>
|
@ -122,6 +122,21 @@ namespace Plane.FormationCreator.Formation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool _IsTransition=false;
|
||||||
|
public bool IsTransition
|
||||||
|
{
|
||||||
|
get { return _IsTransition; }
|
||||||
|
set {
|
||||||
|
|
||||||
|
Set(nameof(IsTransition), ref _IsTransition, value);
|
||||||
|
if ((value)&& (TaskCnName == "航点"))
|
||||||
|
TaskCnName = "过度";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private bool _IsSelected;
|
private bool _IsSelected;
|
||||||
public bool IsSelected
|
public bool IsSelected
|
||||||
{
|
{
|
||||||
|
@ -375,9 +375,32 @@ namespace Plane.FormationCreator.Formation
|
|||||||
set { Set(nameof(FC_defvel_down), ref _FC_defvel_down, value); }
|
set { Set(nameof(FC_defvel_down), ref _FC_defvel_down, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//起飞检测额外时间,默认4秒
|
||||||
|
private float _FC_takeoff_ct = 4000;
|
||||||
|
public float FC_takeoff_ct
|
||||||
|
{
|
||||||
|
get { return _FC_takeoff_ct; }
|
||||||
|
set { Set(nameof(FC_takeoff_ct), ref _FC_takeoff_ct, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
//起飞检测高度cm
|
||||||
|
private float _FC_takeoff_calt = 100;
|
||||||
|
public float FC_takeoff_calt
|
||||||
|
{
|
||||||
|
get { return _FC_takeoff_calt; }
|
||||||
|
set { Set(nameof(FC_takeoff_calt), ref _FC_takeoff_calt, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//自动计算航线,碰撞检测间距,航线小于1.8米再检测前后距离是否大于_FC_SpaceBetween (cm)
|
||||||
|
private float _FC_SpaceBetween = 250;
|
||||||
|
public float FC_SpaceBetween
|
||||||
|
{
|
||||||
|
get { return _FC_SpaceBetween;}
|
||||||
|
set { Set(nameof(FC_SpaceBetween), ref _FC_SpaceBetween, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private TasksStatus _TaskState = TasksStatus.Stop;
|
private TasksStatus _TaskState = TasksStatus.Stop;
|
||||||
public TasksStatus TaskState
|
public TasksStatus TaskState
|
||||||
@ -1196,7 +1219,7 @@ namespace Plane.FormationCreator.Formation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RestoreFlyToTask(bool staggerRoutes, int flytoTime, int loiterTime, string taskName, dynamic singleCopterInfos, bool isMeter)
|
public void RestoreFlyToTask(bool staggerRoutes, int flytoTime, int loiterTime, string taskName, dynamic singleCopterInfos, bool isMeter, bool istrans)
|
||||||
{
|
{
|
||||||
var copters = _copterManager.Copters;
|
var copters = _copterManager.Copters;
|
||||||
float tagalt = 15;
|
float tagalt = 15;
|
||||||
@ -1206,7 +1229,7 @@ namespace Plane.FormationCreator.Formation
|
|||||||
var nullableCenter = copters.GetCenter();
|
var nullableCenter = copters.GetCenter();
|
||||||
if (nullableCenter == null) return;
|
if (nullableCenter == null) return;
|
||||||
var center = nullableCenter.Value;
|
var center = nullableCenter.Value;
|
||||||
var newTask = new FlightTask(FlightTaskType.FlyTo) { StaggerRoutes = staggerRoutes, FlytoTime = flytoTime, LoiterTime = loiterTime };
|
var newTask = new FlightTask(FlightTaskType.FlyTo) { StaggerRoutes = staggerRoutes, FlytoTime = flytoTime, LoiterTime = loiterTime,IsTransition= istrans };
|
||||||
if (taskName != null) newTask.TaskCnName = taskName;
|
if (taskName != null) newTask.TaskCnName = taskName;
|
||||||
// TODO: 王海, 20150801, 处理实际飞行器数目与记录中数目不一致的情况。
|
// TODO: 王海, 20150801, 处理实际飞行器数目与记录中数目不一致的情况。
|
||||||
for (int i = 0; i < copters.Count; i++)
|
for (int i = 0; i < copters.Count; i++)
|
||||||
@ -1341,6 +1364,7 @@ namespace Plane.FormationCreator.Formation
|
|||||||
flytoTime = task.FlytoTime,
|
flytoTime = task.FlytoTime,
|
||||||
loiterTime = task.LoiterTime,
|
loiterTime = task.LoiterTime,
|
||||||
taskname = task.TaskCnName,
|
taskname = task.TaskCnName,
|
||||||
|
istransition = task.IsTransition,
|
||||||
singleCopterInfos = task.SingleCopterInfos.Select(info =>
|
singleCopterInfos = task.SingleCopterInfos.Select(info =>
|
||||||
{
|
{
|
||||||
var offset = info.LatLngOffset;
|
var offset = info.LatLngOffset;
|
||||||
@ -1570,7 +1594,10 @@ namespace Plane.FormationCreator.Formation
|
|||||||
RestoreTakeOffTask((byte)task.takeoffTime, task.singleCopterInfos);
|
RestoreTakeOffTask((byte)task.takeoffTime, task.singleCopterInfos);
|
||||||
break;
|
break;
|
||||||
case FlightTaskType.FlyTo:
|
case FlightTaskType.FlyTo:
|
||||||
RestoreFlyToTask((bool)task.staggerRoutes, (int)task.flytoTime, (int)task.loiterTime, (string)task.taskname, task.singleCopterInfos, isMeter);
|
bool isTransition = false;
|
||||||
|
if (task.istransition != null)
|
||||||
|
isTransition = (bool)task.istransition;
|
||||||
|
RestoreFlyToTask((bool)task.staggerRoutes, (int)task.flytoTime, (int)task.loiterTime, (string)task.taskname, task.singleCopterInfos, isMeter, isTransition);
|
||||||
break;
|
break;
|
||||||
case FlightTaskType.Land:
|
case FlightTaskType.Land:
|
||||||
RestoreLandTask(task.singleCopterInfos);
|
RestoreLandTask(task.singleCopterInfos);
|
||||||
@ -1772,20 +1799,28 @@ namespace Plane.FormationCreator.Formation
|
|||||||
var curWaypoint = Tasks[taskIndex].SingleCopterInfos.FirstOrDefault(c => c.Copter == copter);
|
var curWaypoint = Tasks[taskIndex].SingleCopterInfos.FirstOrDefault(c => c.Copter == copter);
|
||||||
|
|
||||||
double copter_maxDistance_up = nextWaypoint.TargetAlt;
|
double copter_maxDistance_up = nextWaypoint.TargetAlt;
|
||||||
|
double copter_maxDistance_show = copter_maxDistance_up;
|
||||||
|
//减去测试起飞高度
|
||||||
|
if (FC_takeoff_ct > 0)
|
||||||
|
copter_maxDistance_up -= FC_takeoff_calt / 100.0f;
|
||||||
double time_up = getMinfligthtime((float)copter_maxDistance_up, acc_z, defvel_up, flytimetype);
|
double time_up = getMinfligthtime((float)copter_maxDistance_up, acc_z, defvel_up, flytimetype);
|
||||||
double copter_tasktime = curWaypoint.TakeOffWaitTime + time_up;
|
double copter_tasktime = curWaypoint.TakeOffWaitTime + time_up;
|
||||||
|
|
||||||
if (copter_tasktime > tasktime)
|
if (copter_tasktime > tasktime)
|
||||||
{
|
{
|
||||||
tasktime = copter_tasktime;
|
tasktime = copter_tasktime;
|
||||||
maxDistance_up = copter_maxDistance_up;
|
maxDistance_up = copter_maxDistance_show;
|
||||||
copterName = copter.Name;
|
copterName = copter.Name;
|
||||||
waittime = curWaypoint.TakeOffWaitTime;
|
waittime = curWaypoint.TakeOffWaitTime;
|
||||||
upflytime = time_up;
|
upflytime = time_up;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//加入起飞测试时间
|
||||||
|
tasktime += FC_takeoff_ct / 1000.0f;
|
||||||
|
Message.Show($"起飞任务{taskIndex + 1}参数:检测起飞高度:{Math.Round(FC_takeoff_calt / 100.0f, 2)}米,检测时间:{Math.Round( FC_takeoff_ct / 1000.0f, 2)}秒"
|
||||||
|
);
|
||||||
Message.Show($"起飞任务{taskIndex + 1}起飞高度:{Math.Round(maxDistance_up, 2)}米 " +
|
Message.Show($"起飞任务{taskIndex + 1}起飞高度:{Math.Round(maxDistance_up, 2)}米 " +
|
||||||
$"最长耗时:{Math.Round(tasktime, 2)}秒({Math.Round(upflytime, 2)},{Math.Round(waittime, 2)}),编号:{copterName}"
|
$"最长耗时:{Math.Round(tasktime, 2)}秒(飞{Math.Round(upflytime, 2)},等待{Math.Round(waittime, 2)}),编号:{copterName}"
|
||||||
);
|
);
|
||||||
if (settime)
|
if (settime)
|
||||||
{
|
{
|
||||||
@ -2275,7 +2310,8 @@ namespace Plane.FormationCreator.Formation
|
|||||||
//选中前一个任务,插入错层
|
//选中前一个任务,插入错层
|
||||||
SelectTask(SelectedTaskIndex - 1);
|
SelectTask(SelectedTaskIndex - 1);
|
||||||
AddTask();
|
AddTask();
|
||||||
|
//设置为过度航点
|
||||||
|
SelectedTask.IsTransition = true;
|
||||||
//第一个错层
|
//第一个错层
|
||||||
RouteRes = (FlightRoute.Vector3[])resarray[0];
|
RouteRes = (FlightRoute.Vector3[])resarray[0];
|
||||||
|
|
||||||
@ -2290,7 +2326,7 @@ namespace Plane.FormationCreator.Formation
|
|||||||
|
|
||||||
//第二个错层
|
//第二个错层
|
||||||
AddTask();
|
AddTask();
|
||||||
|
SelectedTask.IsTransition = true;
|
||||||
RouteRes = (FlightRoute.Vector3[])resarray[1];
|
RouteRes = (FlightRoute.Vector3[])resarray[1];
|
||||||
|
|
||||||
for (int i = 0; i < _copterManager.Copters.Count; i++)
|
for (int i = 0; i < _copterManager.Copters.Count; i++)
|
||||||
@ -2357,6 +2393,7 @@ namespace Plane.FormationCreator.Formation
|
|||||||
//设置随机数种子
|
//设置随机数种子
|
||||||
FlyVecFun.RandomSeed = (int)DateTime.Now.Ticks;
|
FlyVecFun.RandomSeed = (int)DateTime.Now.Ticks;
|
||||||
Message.Show($"开始自动生成任务,种子数:{FlyVecFun.RandomSeed}");
|
Message.Show($"开始自动生成任务,种子数:{FlyVecFun.RandomSeed}");
|
||||||
|
FlyVecFun.SpaceBetweenSquare=FC_SpaceBetween* FC_SpaceBetween; //这是个平方值
|
||||||
|
|
||||||
//获取当前航点与前一航点所有经纬高
|
//获取当前航点与前一航点所有经纬高
|
||||||
for (int i = 0; i < _copterManager.Copters.Count; i++)
|
for (int i = 0; i < _copterManager.Copters.Count; i++)
|
||||||
@ -2422,6 +2459,7 @@ namespace Plane.FormationCreator.Formation
|
|||||||
//插入错层航点
|
//插入错层航点
|
||||||
SelectTask(SelectedTaskIndex - 1);
|
SelectTask(SelectedTaskIndex - 1);
|
||||||
AddTask();
|
AddTask();
|
||||||
|
SelectedTask.IsTransition = true;
|
||||||
SelectedTask.LoiterTime = 0;
|
SelectedTask.LoiterTime = 0;
|
||||||
for (int i = 0; i < _copterManager.Copters.Count; i++)
|
for (int i = 0; i < _copterManager.Copters.Count; i++)
|
||||||
{
|
{
|
||||||
@ -2445,6 +2483,7 @@ namespace Plane.FormationCreator.Formation
|
|||||||
//插入错层航点
|
//插入错层航点
|
||||||
SelectTask(SelectedTaskIndex - 1);
|
SelectTask(SelectedTaskIndex - 1);
|
||||||
AddTask();
|
AddTask();
|
||||||
|
SelectedTask.IsTransition = true;
|
||||||
SelectedTask.LoiterTime = 0;
|
SelectedTask.LoiterTime = 0;
|
||||||
for (int i = 0; i < _copterManager.Copters.Count; i++)
|
for (int i = 0; i < _copterManager.Copters.Count; i++)
|
||||||
{
|
{
|
||||||
@ -2464,6 +2503,7 @@ namespace Plane.FormationCreator.Formation
|
|||||||
//选中前一个任务,插入错层
|
//选中前一个任务,插入错层
|
||||||
SelectTask(SelectedTaskIndex - 1);
|
SelectTask(SelectedTaskIndex - 1);
|
||||||
AddTask();
|
AddTask();
|
||||||
|
SelectedTask.IsTransition = true;
|
||||||
SelectedTask.LoiterTime = 0;
|
SelectedTask.LoiterTime = 0;
|
||||||
//第一个中间航点
|
//第一个中间航点
|
||||||
|
|
||||||
@ -2481,6 +2521,7 @@ namespace Plane.FormationCreator.Formation
|
|||||||
//选中前一个任务,插入错层
|
//选中前一个任务,插入错层
|
||||||
SelectTask(SelectedTaskIndex - 1);
|
SelectTask(SelectedTaskIndex - 1);
|
||||||
AddTask();
|
AddTask();
|
||||||
|
SelectedTask.IsTransition = true;
|
||||||
SelectedTask.LoiterTime = 0;
|
SelectedTask.LoiterTime = 0;
|
||||||
//第一个中间航点
|
//第一个中间航点
|
||||||
|
|
||||||
@ -2494,6 +2535,7 @@ namespace Plane.FormationCreator.Formation
|
|||||||
|
|
||||||
//第二个中间航点
|
//第二个中间航点
|
||||||
AddTask();
|
AddTask();
|
||||||
|
SelectedTask.IsTransition = true;
|
||||||
SelectedTask.LoiterTime = 0;
|
SelectedTask.LoiterTime = 0;
|
||||||
for (int i = 0; i < _copterManager.Copters.Count; i++)
|
for (int i = 0; i < _copterManager.Copters.Count; i++)
|
||||||
{
|
{
|
||||||
@ -2510,6 +2552,7 @@ namespace Plane.FormationCreator.Formation
|
|||||||
//选中前一个任务,插入错层
|
//选中前一个任务,插入错层
|
||||||
SelectTask(SelectedTaskIndex - 1);
|
SelectTask(SelectedTaskIndex - 1);
|
||||||
AddTask();
|
AddTask();
|
||||||
|
SelectedTask.IsTransition = true;
|
||||||
SelectedTask.LoiterTime = 0;
|
SelectedTask.LoiterTime = 0;
|
||||||
//第一个中间航点
|
//第一个中间航点
|
||||||
|
|
||||||
@ -2523,6 +2566,7 @@ namespace Plane.FormationCreator.Formation
|
|||||||
|
|
||||||
//第二个中间航点
|
//第二个中间航点
|
||||||
AddTask();
|
AddTask();
|
||||||
|
SelectedTask.IsTransition = true;
|
||||||
SelectedTask.LoiterTime = 0;
|
SelectedTask.LoiterTime = 0;
|
||||||
for (int i = 0; i < _copterManager.Copters.Count; i++)
|
for (int i = 0; i < _copterManager.Copters.Count; i++)
|
||||||
{
|
{
|
||||||
@ -2534,6 +2578,7 @@ namespace Plane.FormationCreator.Formation
|
|||||||
|
|
||||||
//第三个中间航点
|
//第三个中间航点
|
||||||
AddTask();
|
AddTask();
|
||||||
|
SelectedTask.IsTransition = true;
|
||||||
SelectedTask.LoiterTime = 0;
|
SelectedTask.LoiterTime = 0;
|
||||||
for (int i = 0; i < _copterManager.Copters.Count; i++)
|
for (int i = 0; i < _copterManager.Copters.Count; i++)
|
||||||
{
|
{
|
||||||
@ -2565,6 +2610,7 @@ namespace Plane.FormationCreator.Formation
|
|||||||
|
|
||||||
//第一个中间航点
|
//第一个中间航点
|
||||||
AddTask();
|
AddTask();
|
||||||
|
SelectedTask.IsTransition = true;
|
||||||
SelectedTask.LoiterTime = 0;
|
SelectedTask.LoiterTime = 0;
|
||||||
for (int i = 0; i < _copterManager.Copters.Count; i++)
|
for (int i = 0; i < _copterManager.Copters.Count; i++)
|
||||||
{
|
{
|
||||||
@ -2575,6 +2621,7 @@ namespace Plane.FormationCreator.Formation
|
|||||||
SetTaskFlytime(SelectedTaskIndex);
|
SetTaskFlytime(SelectedTaskIndex);
|
||||||
//第二个中间航点
|
//第二个中间航点
|
||||||
AddTask();
|
AddTask();
|
||||||
|
SelectedTask.IsTransition = true;
|
||||||
SelectedTask.LoiterTime = 0;
|
SelectedTask.LoiterTime = 0;
|
||||||
for (int i = 0; i < _copterManager.Copters.Count; i++)
|
for (int i = 0; i < _copterManager.Copters.Count; i++)
|
||||||
{
|
{
|
||||||
@ -3026,7 +3073,10 @@ namespace Plane.FormationCreator.Formation
|
|||||||
RestoreTakeOffTask((byte)task.takeoffTime, task.singleCopterInfos);
|
RestoreTakeOffTask((byte)task.takeoffTime, task.singleCopterInfos);
|
||||||
break;
|
break;
|
||||||
case FlightTaskType.FlyTo:
|
case FlightTaskType.FlyTo:
|
||||||
RestoreFlyToTask((bool)task.staggerRoutes, (int)task.flytoTime, (int)task.loiterTime, (string)task.taskname, task.singleCopterInfos, isMeter);
|
bool isTransition = false;
|
||||||
|
if (task.istransition != null)
|
||||||
|
isTransition = (bool)task.istransition;
|
||||||
|
RestoreFlyToTask((bool)task.staggerRoutes, (int)task.flytoTime, (int)task.loiterTime, (string)task.taskname, task.singleCopterInfos, isMeter, isTransition);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FlightTaskType.Land:
|
case FlightTaskType.Land:
|
||||||
@ -3377,6 +3427,17 @@ namespace Plane.FormationCreator.Formation
|
|||||||
if (readvalue != "" && float.TryParse(readvalue, out floatTemp))
|
if (readvalue != "" && float.TryParse(readvalue, out floatTemp))
|
||||||
FC_defvel_down = float.Parse(readvalue);
|
FC_defvel_down = float.Parse(readvalue);
|
||||||
|
|
||||||
|
readvalue = inifilse.IniReadvalue("Default", "FC_takeoff_ct");
|
||||||
|
if (readvalue != "" && int.TryParse(readvalue, out intTemp))
|
||||||
|
FC_takeoff_ct = int.Parse(readvalue);
|
||||||
|
|
||||||
|
readvalue = inifilse.IniReadvalue("Default", "FC_takeoff_calt");
|
||||||
|
if (readvalue != "" && int.TryParse(readvalue, out intTemp))
|
||||||
|
FC_takeoff_calt = int.Parse(readvalue);
|
||||||
|
|
||||||
|
readvalue = inifilse.IniReadvalue("Default", "FC_spacbetween");
|
||||||
|
if (readvalue != "" && int.TryParse(readvalue, out intTemp))
|
||||||
|
FC_SpaceBetween = int.Parse(readvalue);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -167,6 +167,7 @@
|
|||||||
<Compile Include="AppConfig.cs" />
|
<Compile Include="AppConfig.cs" />
|
||||||
<Compile Include="Converters\AppModeToVisibilityConverter.cs" />
|
<Compile Include="Converters\AppModeToVisibilityConverter.cs" />
|
||||||
<Compile Include="Converters\FlightTaskIsSelectedToEffectConverter.cs" />
|
<Compile Include="Converters\FlightTaskIsSelectedToEffectConverter.cs" />
|
||||||
|
<Compile Include="Converters\FlightTaskStatusAndTransitionToFillConverter.cs" />
|
||||||
<Compile Include="Converters\FlightTaskStatusToFillConverter.cs" />
|
<Compile Include="Converters\FlightTaskStatusToFillConverter.cs" />
|
||||||
<Compile Include="Converters\HeartbeatCountToBrushConverter.cs" />
|
<Compile Include="Converters\HeartbeatCountToBrushConverter.cs" />
|
||||||
<Compile Include="Formation\AppMode.cs" />
|
<Compile Include="Formation\AppMode.cs" />
|
||||||
|
@ -950,7 +950,7 @@ namespace Plane.FormationCreator.ViewModels
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//2D计算,不改变ID,拉开层
|
||||||
private ICommand _OptimizeRouteCommandRet;
|
private ICommand _OptimizeRouteCommandRet;
|
||||||
public ICommand OptimizeRouteCommandRet
|
public ICommand OptimizeRouteCommandRet
|
||||||
{
|
{
|
||||||
@ -960,7 +960,7 @@ namespace Plane.FormationCreator.ViewModels
|
|||||||
{
|
{
|
||||||
if (_copterManager.FC_VER_NO >= 3)
|
if (_copterManager.FC_VER_NO >= 3)
|
||||||
//3D计算,不改变ID,可以错层
|
//3D计算,不改变ID,可以错层
|
||||||
_flightTaskManager.OptimizeRouteMeter(true, false, true); //采用米计算逻辑,用3D生成,不改变ID,可拉开层(2D回起飞矩阵专用)
|
_flightTaskManager.OptimizeRouteMeter(false, false, true); //采用米计算逻辑,用3D生成,不改变ID,可拉开层(2D回起飞矩阵专用)
|
||||||
else
|
else
|
||||||
_flightTaskManager.OptimizeRouteMeter(false, false); //采用米计算逻辑,用2D生成,不改变ID,不拉开层
|
_flightTaskManager.OptimizeRouteMeter(false, false); //采用米计算逻辑,用2D生成,不改变ID,不拉开层
|
||||||
|
|
||||||
@ -968,6 +968,23 @@ namespace Plane.FormationCreator.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//3D计算,不改变ID,不拉开层
|
||||||
|
private ICommand _OptimizeRouteCommandRet3D;
|
||||||
|
public ICommand OptimizeRouteCommandRet3D
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _OptimizeRouteCommandRet3D ?? (_OptimizeRouteCommandRet3D = new RelayCommand<int>(async =>
|
||||||
|
{
|
||||||
|
if (_copterManager.FC_VER_NO >= 3)
|
||||||
|
//3D计算,不改变ID,可以错层
|
||||||
|
_flightTaskManager.OptimizeRouteMeter(true, false, false); //采用米计算逻辑,用3D生成,不改变ID,不拉开层(3D回起飞矩阵专用)
|
||||||
|
else
|
||||||
|
_flightTaskManager.OptimizeRouteMeter(false, false); //采用米计算逻辑,用2D生成,不改变ID,不拉开层
|
||||||
|
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private ICommand _OptimizeRouteCommand3D;
|
private ICommand _OptimizeRouteCommand3D;
|
||||||
public ICommand OptimizeRouteCommand3D
|
public ICommand OptimizeRouteCommand3D
|
||||||
|
@ -70,12 +70,15 @@
|
|||||||
<TextBlock Margin="0,5,5,0" Text="所有:" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Margin="0,5,5,0" Text="所有:" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<Button Margin="0,5,5,0" Content="导入航点" Command="{Binding ImportWayPointCommand}"
|
<Button Margin="0,5,5,0" Content="导入航点" Command="{Binding ImportWayPointCommand}"
|
||||||
Visibility="Collapsed"/>
|
Visibility="Collapsed"/>
|
||||||
<Button Margin="0,5,5,0" Content="计算航线2D" Width="105" Command="{Binding OptimizeRouteCommand}"
|
<Button Margin="0,5,5,0" Content="2D航线" Width="82" Command="{Binding OptimizeRouteCommand}"
|
||||||
/>
|
/>
|
||||||
<Button Margin="0,5,5,0" Content="计算航线3D" Width="105" Command="{Binding OptimizeRouteCommand3D}"
|
<Button Margin="0,5,5,0" Content="3D航线" Width="82" Command="{Binding OptimizeRouteCommand3D}"
|
||||||
/>
|
/>
|
||||||
<Button Margin="0,5,5,0" Content="计算返航" Width="105" Command="{Binding OptimizeRouteCommandRet}"
|
<Button Margin="0,5,5,0" Content="2D返航" Width="82" Command="{Binding OptimizeRouteCommandRet}"
|
||||||
/>
|
/>
|
||||||
|
<Button Margin="0,5,5,0" Content="3D返航" Width="82" Command="{Binding OptimizeRouteCommandRet3D}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
<Button Margin="0,5,5,0" Content="导出到C4D" Width="105" Command="{Binding ExportWayPointCommand}"/>
|
<Button Margin="0,5,5,0" Content="导出到C4D" Width="105" Command="{Binding ExportWayPointCommand}"/>
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@
|
|||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Border Background="{Binding Status, Converter={StaticResource FlightTaskStatusToFillConverter}}"
|
<Border
|
||||||
Width="88"
|
Width="88"
|
||||||
Height="19"
|
Height="19"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
@ -99,6 +99,12 @@
|
|||||||
MouseLeftButtonDown="TaskLeftButtonDown"
|
MouseLeftButtonDown="TaskLeftButtonDown"
|
||||||
MouseLeftButtonUp="SelectTask"
|
MouseLeftButtonUp="SelectTask"
|
||||||
MouseRightButtonUp="HideTask">
|
MouseRightButtonUp="HideTask">
|
||||||
|
<Border.Background>
|
||||||
|
<MultiBinding Converter="{StaticResource FlightTaskStatusAndTransitionToFillConverter}">
|
||||||
|
<Binding Path="Status" />
|
||||||
|
<Binding Path="IsTransition" />
|
||||||
|
</MultiBinding>
|
||||||
|
</Border.Background>
|
||||||
|
|
||||||
<WrapPanel VerticalAlignment="Center"
|
<WrapPanel VerticalAlignment="Center"
|
||||||
HorizontalAlignment="Center" >
|
HorizontalAlignment="Center" >
|
||||||
@ -125,7 +131,7 @@
|
|||||||
<RowDefinition/>
|
<RowDefinition/>
|
||||||
<RowDefinition Height="28"/>
|
<RowDefinition Height="28"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<StackPanel Height="100" Background="#FF2D2D2D" VerticalAlignment="Bottom">
|
<StackPanel Height="120" Background="#FF2D2D2D" VerticalAlignment="Bottom">
|
||||||
|
|
||||||
<TextBlock x:Name="hintaddtask" Margin="0,25,0,0" Text="请添加或选择飞行任务" Visibility="Collapsed" FontSize="18" TextAlignment="Center"/>
|
<TextBlock x:Name="hintaddtask" Margin="0,25,0,0" Text="请添加或选择飞行任务" Visibility="Collapsed" FontSize="18" TextAlignment="Center"/>
|
||||||
|
|
||||||
@ -151,7 +157,7 @@
|
|||||||
|
|
||||||
<TabItem.Header>
|
<TabItem.Header>
|
||||||
<Label x:Name="flytoLabel" Content="航点" HorizontalAlignment="Stretch" MouseLeftButtonDown="TaskLabelLeftButtonDown"
|
<Label x:Name="flytoLabel" Content="航点" HorizontalAlignment="Stretch" MouseLeftButtonDown="TaskLabelLeftButtonDown"
|
||||||
ToolTip="双击修改名称" />
|
ToolTip="双击修改名称" />
|
||||||
</TabItem.Header>
|
</TabItem.Header>
|
||||||
|
|
||||||
|
|
||||||
@ -159,6 +165,7 @@
|
|||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition />
|
<RowDefinition />
|
||||||
<RowDefinition />
|
<RowDefinition />
|
||||||
|
<RowDefinition />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
@ -172,6 +179,9 @@
|
|||||||
<TextBox Grid.Row="1" Grid.Column="1" Margin="2" VerticalAlignment="Center"
|
<TextBox Grid.Row="1" Grid.Column="1" Margin="2" VerticalAlignment="Center"
|
||||||
MaxLength="4"
|
MaxLength="4"
|
||||||
Text="{Binding LoiterTime, UpdateSourceTrigger=PropertyChanged}" />
|
Text="{Binding LoiterTime, UpdateSourceTrigger=PropertyChanged}" />
|
||||||
|
<CheckBox Grid.Row="2" Grid.Column="2" x:Name="tranBox" Content="过度航点" HorizontalAlignment="Left" Width="75.353"
|
||||||
|
IsChecked="{Binding IsTransition}"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user