准备增加多航线功能
This commit is contained in:
@@ -1397,6 +1397,7 @@ void OPMapWidget::WPotherPoint(int number)
|
||||
{
|
||||
int position = 0;
|
||||
|
||||
|
||||
foreach(QGraphicsItem * i, map->childItems()) {
|
||||
WayPointItem *w = qgraphicsitem_cast<WayPointItem *>(i);
|
||||
|
||||
@@ -1412,6 +1413,9 @@ void OPMapWidget::WPotherPoint(int number)
|
||||
position = number;
|
||||
}
|
||||
|
||||
|
||||
//position = number;
|
||||
|
||||
WayPointItem *wp = WPFind(position);
|
||||
|
||||
if(wp)
|
||||
@@ -1799,13 +1803,13 @@ void OPMapWidget::WPLoad(QString path)//带文件目录参数
|
||||
|
||||
//Item->setParent(map);
|
||||
|
||||
qDebug() << "autocontinue" << autocontinue;
|
||||
//qDebug() << "autocontinue" << autocontinue;
|
||||
|
||||
|
||||
emit setWPProperty(param1,param2,param3,param4,
|
||||
x,y,z,
|
||||
seq,
|
||||
0,
|
||||
currentGroup,//当前组
|
||||
command,
|
||||
0,
|
||||
0,
|
||||
@@ -1896,7 +1900,7 @@ void OPMapWidget::WPSave(QString path)//带文件目录参数
|
||||
item.insert("doJumpId",w->Number());
|
||||
item.insert("frame",w->Frame());
|
||||
item.insert("params",params);
|
||||
item.insert("type","SimpleItem");
|
||||
item.insert("type",w->MissionType());
|
||||
|
||||
//这里有问题
|
||||
items.append(item);
|
||||
@@ -1912,58 +1916,6 @@ void OPMapWidget::WPSave(QString path)//带文件目录参数
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
foreach(QGraphicsItem * i, map->childItems()) {
|
||||
WayPointItem *w = qgraphicsitem_cast<WayPointItem *>(i);
|
||||
if (w) {//逐渐往下增加
|
||||
|
||||
if(w->Number()>0)
|
||||
{
|
||||
|
||||
//存到items
|
||||
QJsonArray params;
|
||||
params.append(w->Param1());
|
||||
params.append(w->Param2());
|
||||
params.append(w->Param3());
|
||||
params.append(w->Param4());
|
||||
params.append(w->Coord().Lat());
|
||||
params.append(w->Coord().Lng());
|
||||
params.append(w->Alt());
|
||||
|
||||
//可能有点问题
|
||||
QJsonObject item;
|
||||
|
||||
//如果这个点是指令,那么不会有高度信息
|
||||
|
||||
if(w->Command() < MAV_CMD::MAV_CMD_NAV_LAST) {
|
||||
|
||||
item.insert("AMSLAltAboveTerrain",w->Alt());
|
||||
item.insert("Altitude",w->Alt());
|
||||
item.insert("AltitudeMode",2);
|
||||
}
|
||||
|
||||
item.insert("autoContinue",w->AutoContinue()?true:false);
|
||||
item.insert("command",w->Command());
|
||||
item.insert("doJumpId",w->Number());
|
||||
item.insert("frame",w->Frame());
|
||||
item.insert("params",params);
|
||||
item.insert("type","SimpleItem");
|
||||
|
||||
//这里有问题
|
||||
items.append(item);
|
||||
}
|
||||
|
||||
if(w->Number() == 1)
|
||||
{
|
||||
plannedHomePosition.append(w->Coord().Lat());
|
||||
plannedHomePosition.append(w->Coord().Lng());
|
||||
plannedHomePosition.append(w->Alt());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2092,6 +2044,20 @@ void OPMapWidget::WPUpload(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OPMapWidget::WPGroup(int value)
|
||||
{
|
||||
currentGroup = value;
|
||||
|
||||
qDebug() << "group" << value;
|
||||
|
||||
//切换当前航线
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user