1c4D导入V3版自动导入时间,第一个航点不计算时间
2添加的第一个飞行航点自动和起飞点在一起
This commit is contained in:
parent
c2d26dd62c
commit
b289618a87
@ -505,7 +505,20 @@ namespace Plane.FormationCreator.Formation
|
||||
Tasks.Insert(SelectedTaskIndex+1, newTask);
|
||||
RaiseTaskAdded(lastTask, newTask);
|
||||
SelectTask(selindex);
|
||||
|
||||
|
||||
//第一个航点,回起飞点
|
||||
if (Tasks.Count == 2)
|
||||
{
|
||||
foreach (FlightTaskSingleCopterInfo info in SelectedTask.SingleCopterInfos)
|
||||
{
|
||||
info.TargetLat = info.Copter.Latitude;
|
||||
info.TargetLng = info.Copter.Longitude;
|
||||
}
|
||||
// SelectedTask.TaskCnName = "检查航点";
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
Tasks.Add(newTask);
|
||||
@ -1013,12 +1026,30 @@ namespace Plane.FormationCreator.Formation
|
||||
|
||||
int taskCount = lines.Length / (_copterManager.Copters.Count + 1);
|
||||
int startIndex;
|
||||
int flytime = 10;
|
||||
string line;
|
||||
Dictionary<int, string[]> PointDic;
|
||||
for (int i = 0; i < taskCount; i++)
|
||||
{
|
||||
startIndex = i * (_copterManager.Copters.Count + 1);
|
||||
string taskName = lines[startIndex];
|
||||
if (taskName != "")
|
||||
{
|
||||
//去掉前后的"[]"
|
||||
string taskName_temp = taskName.Substring(1);
|
||||
taskName_temp= taskName_temp.Remove(taskName_temp.Length - 1);
|
||||
//新版用":"分割时间
|
||||
string[] words = taskName_temp.Split(':');
|
||||
if (words.Count()==2)
|
||||
{
|
||||
taskName = words[0];
|
||||
flytime = int.Parse(words[1]);
|
||||
if (flytime == -1) //第一个航点是-1 先设置成0 后面计算时间
|
||||
flytime = 0;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
PointDic = new Dictionary<int, string[]>();
|
||||
for (int j = 0; j < _copterManager.Copters.Count; j++)
|
||||
{
|
||||
@ -1034,7 +1065,7 @@ namespace Plane.FormationCreator.Formation
|
||||
}
|
||||
|
||||
var lastTask = Tasks.LastOrDefault();
|
||||
var newTask = new FlightTask(FlightTaskType.FlyTo) { StaggerRoutes = true, FlytoTime = 10, LoiterTime = 1 };
|
||||
var newTask = new FlightTask(FlightTaskType.FlyTo) { StaggerRoutes = true, FlytoTime = flytime, LoiterTime = 1 };
|
||||
newTask.TaskCnName = taskName;
|
||||
for (int k = 0; k < PointDic.Count; k++)
|
||||
{
|
||||
|
@ -805,8 +805,13 @@ namespace Plane.FormationCreator.ViewModels
|
||||
{
|
||||
var tasksText = File.ReadAllText(dialog.FileName);
|
||||
_flightTaskManager.ImportC4DFlytoTask(tasksText);
|
||||
_flightTaskManager.SetAllTaskFlytime();
|
||||
}else
|
||||
if (_copterManager.FC_VER_NO >= 3)
|
||||
Alert.Show($"导入的第一个航点默认为0,需要重新计算时间", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
else
|
||||
_flightTaskManager.SetAllTaskFlytime();
|
||||
|
||||
}
|
||||
else
|
||||
if ((extname == ".svg")|| (extname == ".obj"))
|
||||
{
|
||||
_flightTaskManager.ImportDlltoTask(dialog.FileName);
|
||||
|
Loading…
Reference in New Issue
Block a user