修复航点下载bug
This commit is contained in:
@@ -517,6 +517,26 @@ void OPMapWidget::DeleteTrail(void)
|
||||
}
|
||||
}
|
||||
|
||||
void OPMapWidget::cleanGroupWayPoint(int group)
|
||||
{
|
||||
QList<QGraphicsItem *> lists = map->childItems();
|
||||
emit deleteGroupAllPoint(group);
|
||||
foreach(QGraphicsItem * i, lists)
|
||||
{
|
||||
WayPointItem *w = qgraphicsitem_cast<WayPointItem *>(i);
|
||||
|
||||
if (w)
|
||||
{
|
||||
if(w->MissionType() == group)
|
||||
{
|
||||
emit WPDeleted(w->Number(), w);
|
||||
delete w;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3280,14 +3300,94 @@ void OPMapWidget::receivedPoint(float param1,float param2,float param3,float par
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
emit showMessage(tr("recieve way point group:%1 seq:%2").arg(mission_type - 2).arg(seq + 1));
|
||||
|
||||
|
||||
qDebug() << "数据更新";
|
||||
qDebug() << u8"seq的值: " << seq;
|
||||
qDebug() << u8"需要更新的组:" << mission_type;
|
||||
|
||||
|
||||
if(seq == 0)
|
||||
{
|
||||
cleanGroupWayPoint(mission_type); //清空需要更新组中所有的航点
|
||||
}
|
||||
|
||||
|
||||
|
||||
internals::PointLatLng LatLng;
|
||||
|
||||
LatLng.SetLat(x * 10e-8);
|
||||
LatLng.SetLng(y * 10e-8);
|
||||
|
||||
//获取当前组下面的seq最大值
|
||||
WayPointItem *Item = new WayPointItem(LatLng, z,seq+1,mission_type, map);
|
||||
|
||||
if(mission_type != currentGroup)
|
||||
{
|
||||
Item->setisActive(false);
|
||||
Item->update();
|
||||
}
|
||||
|
||||
|
||||
ConnectWP(Item);
|
||||
Item->setParentItem(map);
|
||||
Item->SetMissionType(mission_type);
|
||||
int position = Item->Number();
|
||||
emit WPCreated(position, Item);
|
||||
setOverlayOpacity(overlayOpacity);
|
||||
|
||||
|
||||
emit setWPProperty(param1,param2,param3,param4,
|
||||
x,y,z,
|
||||
seq+1,
|
||||
group,
|
||||
command,
|
||||
target_system,
|
||||
target_component,
|
||||
frame,
|
||||
current,
|
||||
autocontinue,
|
||||
mission_type);
|
||||
|
||||
|
||||
Item->emitWPProperty();
|
||||
Item->setisShowTip(isShowTip);
|
||||
|
||||
qDebug() << "waypoint not exist:" << Item->Number() << seq+1 <<currentGroup << mission_type;
|
||||
|
||||
//===========连线
|
||||
|
||||
|
||||
WayPointItem *w_last = WPFind(Item->MissionType(),Item->Number() - 1);
|
||||
|
||||
if(w_last)
|
||||
{
|
||||
if(currentGroup == mission_type)
|
||||
{
|
||||
WPLineCreate(w_last,Item,Qt::green,false,2);
|
||||
}
|
||||
else
|
||||
{
|
||||
WPLineCreate(w_last,Item,Qt::gray,false,2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
mission_type -= 2;
|
||||
|
||||
bool isExist = false;
|
||||
foreach(QGraphicsItem * i, map->childItems()) {
|
||||
WayPointItem *w = qgraphicsitem_cast<WayPointItem *>(i);
|
||||
if (w) {
|
||||
if (w)
|
||||
{
|
||||
|
||||
if(w->MissionType() == mission_type)//如果组别一样,那么就赋值
|
||||
{
|
||||
qDebug() << u8"航点的组: " << w->MissionType();
|
||||
if(w->Number() == (seq+1))
|
||||
{
|
||||
qDebug() << "waypoint exist:" << w->Number() << seq+1;
|
||||
@@ -3373,8 +3473,15 @@ void OPMapWidget::receivedPoint(float param1,float param2,float param3,float par
|
||||
}
|
||||
|
||||
qDebug() << "Exist" << isExist;
|
||||
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -489,6 +489,12 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief 删除指定组中的所有航点
|
||||
* @param group 需要删除航点的组
|
||||
*/
|
||||
void cleanGroupWayPoint(int group);
|
||||
|
||||
internals::Core *core;
|
||||
MapGraphicItem *map;
|
||||
QGraphicsScene mscene;
|
||||
@@ -555,6 +561,11 @@ protected:
|
||||
|
||||
// private slots:
|
||||
signals:
|
||||
/**
|
||||
* @brief 删除指定组的所有航点
|
||||
* @param group 指定组
|
||||
*/
|
||||
void deleteGroupAllPoint(int group);
|
||||
void cmd_long( float param1,float param2,float param3,float param4,float param5,float param6,float param7,uint16_t command,uint8_t confirmation);
|
||||
void cancelRequest();
|
||||
void percentageChanged(int const & perc);
|
||||
|
||||
Reference in New Issue
Block a user