diff --git a/App/MissionUI/propertyui.cpp b/App/MissionUI/propertyui.cpp index 3a80b68..5f16468 100644 --- a/App/MissionUI/propertyui.cpp +++ b/App/MissionUI/propertyui.cpp @@ -771,20 +771,26 @@ void propertyui::WayPointPropertyUpdate(bool flag) << m_frame << m_current << m_autocontinue - << missionGroups; - //<< m_mission_type ; -/* + //<< missionGroups; + << m_mission_type ; + emit WayPointPropertyChanged(m_param1,m_param2,m_param3,m_param4, m_x,m_y,m_z, m_seq,m_group,m_command, m_target_system,m_target_component, m_frame,m_current,m_autocontinue,m_mission_type); - */ + + /* emit WayPointPropertyChanged(m_param1,m_param2,m_param3,m_param4, m_x,m_y,m_z, m_seq,m_group,m_command, m_target_system,m_target_component, m_frame,m_current,m_autocontinue,missionGroups); + */ + + //在这里设置了类型,不允许设置类型 + + } void propertyui::setWayPointProperty(float param1,float param2,float param3,float param4, @@ -814,7 +820,8 @@ void propertyui::setWayPointProperty(float param1,float param2,float param3,floa m_frame = frame; m_current = current; m_autocontinue = autocontinue; - missionGroups = mission_type; + //missionGroups = mission_type; + m_mission_type = mission_type; for(QJsonValue info: MAV_CMD_infoArray) { if (!info.isObject()) { @@ -827,6 +834,25 @@ void propertyui::setWayPointProperty(float param1,float param2,float param3,floa } } + qDebug() << "propertyUI set:" + << m_param1 + << m_param2 + << m_param3 + << m_param4 + << m_x + << m_y + << m_z + << m_seq + << m_group + << m_command + << m_target_system + << m_target_component + << m_frame + << m_current + << m_autocontinue + << m_mission_type ; + + /* qDebug() << "propertyUI set:" << m_param1 << m_param2 @@ -844,6 +870,7 @@ void propertyui::setWayPointProperty(float param1,float param2,float param3,floa << m_current << m_autocontinue << missionGroups ; + */ } @@ -1959,7 +1986,9 @@ void propertyui::setGroup(QVariant value) { ui->pushButton_Group->setText(value.toString()); //然后重置一下参数 - WayPointPropertyUpdate(false); + //WayPointPropertyUpdate(false); + + missionGroups = value.toInt() + 2; emit WPGroup(missionGroups); diff --git a/opmap/mapwidget/opmapwidget.cpp b/opmap/mapwidget/opmapwidget.cpp index 1ffb215..7c04efb 100644 --- a/opmap/mapwidget/opmapwidget.cpp +++ b/opmap/mapwidget/opmapwidget.cpp @@ -154,6 +154,10 @@ OPMapWidget::OPMapWidget(QWidget *parent, Configuration *config) : QGraphicsView this,SLOT(NOPTimeout())); NoOperationTimer->start(20000);//20s不操作 + + + currentGroup = 3; + } void OPMapWidget::dragEnterEvent(QDragEnterEvent *event) @@ -178,11 +182,7 @@ void OPMapWidget::dropEvent(QDropEvent *event) if(fileName.right(5) == ".plan") { - //setCommandFile(fileName); - //loadCommandJson(fileName); - WPLoad(fileName); - } } @@ -372,13 +372,13 @@ void OPMapWidget::setUAVPos(int sysid,int compid,double x,double y,double z) void OPMapWidget::setUAVHeading(int sysid,int compid,float Heading) { + Q_UNUSED(compid) foreach(QGraphicsItem * i, map->childItems()) { UAVItem *u = qgraphicsitem_cast(i); if (u) { if(u->SysID() == sysid) { u->SetUAVHeading(Heading); - //qDebug() << Heading; } } } @@ -427,6 +427,7 @@ WayPointLine *OPMapWidget::WPLineCreate(WayPointItem *from, WayPointItem *to, QC ret->setOpacity(overlayOpacity); return ret; } + WayPointLine *OPMapWidget::WPLineCreate(HomeItem *from, WayPointItem *to, QColor color, bool dashed, int width) { if (!from | !to) { @@ -437,6 +438,11 @@ WayPointLine *OPMapWidget::WPLineCreate(HomeItem *from, WayPointItem *to, QColor return ret; } +void OPMapWidget::WPLineUpdate(int group)//调用这个,刷新连接线 +{ + +} + void OPMapWidget::WPLineDelete(WayPointItem *from, WayPointItem *to) { do @@ -456,11 +462,12 @@ void OPMapWidget::WPLineDelete(WayPointItem *from, WayPointItem *to) WayPointLine *OPMapWidget::WPLineFind(WayPointItem *from, WayPointItem *to) { foreach(QGraphicsItem * i, map->childItems()) { - WayPointLine *w = qgraphicsitem_cast(i); + WayPointLine *l = qgraphicsitem_cast(i); - if (w) { - if (w->WPLineFrom() == from) { - return w; + if (l) { + if ((l->WPLineFrom() == from) && (l->WPLineTo() == to) ) + { + return l; } } } @@ -496,8 +503,6 @@ void OPMapWidget::SetShowHome(const bool &value) void OPMapWidget::resizeEvent(QResizeEvent *event) { - - if (scene()) { scene()->setSceneRect( QRect(QPoint(0,0), event->size())); @@ -763,6 +768,7 @@ void OPMapWidget::mouseDoubleClickEvent(QMouseEvent *event) isLNOP = false; //生成一个列表 + //如果是点击生成,那么就获取当前的编辑组,使用当前编辑组的编号 if(isWPCreate == true) { if(event->button() == Qt::LeftButton) @@ -773,11 +779,19 @@ void OPMapWidget::mouseDoubleClickEvent(QMouseEvent *event) LatLng = map->FromLocalToLatLng(p.x(), p.y()); WayPointItem *Item = WPCreate(LatLng,50); - WPLineCreate(WPFind(Item->Number() - 1),Item,Qt::green,false,2); + foreach(QGraphicsItem * i, map->childItems()) { + WayPointItem *w = qgraphicsitem_cast(i); - qDebug() << "WPCreate Point" - << QThread::currentThreadId(); + if (w) { + if (w->MissionType() == Item->MissionType()) { + if(w->Number() == (Item->Number() - 1)) + { + WPLineCreate(w,Item,Qt::green,false,2); + } + } + } + } } } emit MouseDoubleClickEvent(event); @@ -789,7 +803,10 @@ void OPMapWidget::mouseDoubleClickEvent(QMouseEvent *event) ////////////////WAYPOINT//////////////////////// WayPointItem *OPMapWidget::WPCreate() { - WayPointItem *item = new WayPointItem(this->CurrentPosition(), 0,1, map); + //获取当前组下面的seq最大值 + int seq = getWaypointSize(currentGroup); + + WayPointItem *item = new WayPointItem(this->CurrentPosition(), 0,seq,currentGroup, map); ConnectWP(item); item->setParentItem(map); @@ -800,7 +817,10 @@ WayPointItem *OPMapWidget::WPCreate() } WayPointItem *OPMapWidget::magicWPCreate() { - WayPointItem *item = new WayPointItem(1,map, true); + //获取当前组下面的seq最大值 + int seq = getWaypointSize(currentGroup); + + WayPointItem *item = new WayPointItem(seq,currentGroup,map, true); item->SetShowNumber(false); item->setParentItem(map); @@ -818,7 +838,10 @@ void OPMapWidget::WPCreate(WayPointItem *item) } WayPointItem *OPMapWidget::WPCreate(internals::PointLatLng const & coord, int const & altitude) { - WayPointItem *item = new WayPointItem(coord, altitude,1, map); + //获取当前组下面的seq最大值 + int seq = getWaypointSize(currentGroup); + + WayPointItem *item = new WayPointItem(coord, altitude,seq,currentGroup, map); ConnectWP(item); item->setParentItem(map); @@ -830,7 +853,10 @@ WayPointItem *OPMapWidget::WPCreate(internals::PointLatLng const & coord, int co } WayPointItem *OPMapWidget::WPCreate(internals::PointLatLng const & coord, int const & altitude, QString const & description) { - WayPointItem *item = new WayPointItem(coord, altitude,1, description, map); + //获取当前组下面的seq最大值 + int seq = getWaypointSize(currentGroup); + + WayPointItem *item = new WayPointItem(coord, altitude,seq,currentGroup, description, map); ConnectWP(item); item->setParentItem(map); @@ -842,7 +868,10 @@ WayPointItem *OPMapWidget::WPCreate(internals::PointLatLng const & coord, int co } WayPointItem *OPMapWidget::WPCreate(const distBearingAltitude &relativeCoord, const QString &description) { - WayPointItem *item = new WayPointItem(relativeCoord,1, description, map); + //获取当前组下面的seq最大值 + int seq = getWaypointSize(currentGroup); + + WayPointItem *item = new WayPointItem(relativeCoord,seq,currentGroup, description, map); ConnectWP(item); item->setParentItem(map); @@ -853,6 +882,23 @@ WayPointItem *OPMapWidget::WPCreate(const distBearingAltitude &relativeCoord, co return item; } +int OPMapWidget::getWaypointSize(int group) +{ + QList list; + list.clear(); + + foreach(QGraphicsItem * i, map->childItems()) { + WayPointItem *w = qgraphicsitem_cast(i); + + if (w) { + if (w->MissionType() == group) { + list.append(w); + } + } + } + + return list.size(); +} void OPMapWidget::WPInsert() { @@ -880,15 +926,11 @@ void OPMapWidget::WPInsert() if((item_old1)&&(item_old2)) { WPLineDelete(item_old1,item_old2); - //WPLineDelete(item_old1,item_old2); - //WPLineDelete(item_old1,item_old2); } //删除连线 if((item_old1)&&(item_old0)) { WPLineDelete(item_old0,item_old1); - //WPLineDelete(item_old0,item_old1); - //WPLineDelete(item_old0,item_old1); internals::PointLatLng latlng1 = item_old0->Coord(); internals::PointLatLng latlng2 = item_old1->Coord(); @@ -907,7 +949,7 @@ void OPMapWidget::WPInsert() if(item_old1)//如果指定的点存在,那么就可以在这之前插入一个点 { - WayPointItem *item = new WayPointItem(latlng, item_old1->Altitude(), 1,map); + WayPointItem *item = new WayPointItem(latlng, item_old1->Altitude(), position,currentGroup,map); ConnectWP(item); item->SetNumber(position); @@ -949,21 +991,6 @@ void OPMapWidget::WPInsert() } } - /* - WayPointItem *w_last = WPFind(item->Number() - 1); - if(w_last) - { - WPLineCreate(w_last,item,Qt::green,false,2); - - WayPointItem *w_last2 = WPFind(item->Number() - 2); - if(w_last2) - { - WPLineCreate(w_last2,w_last,Qt::green,false,2); - } - - } - */ - } @@ -971,9 +998,6 @@ void OPMapWidget::WPInsert() foreach(QGraphicsItem * i, map->childItems()) { WayPointItem *w = qgraphicsitem_cast(i); if (w) { - //qDebug() << "all number" << w->Number() << w->snumber; - - WPFollowPrevious(w->FollowPrevious(),w); } } @@ -990,7 +1014,7 @@ void OPMapWidget::WPInsert(WayPointItem *item, const int &position) } WayPointItem *OPMapWidget::WPInsert(internals::PointLatLng const & coord, int const & altitude, const int &position) { - WayPointItem *item = new WayPointItem(coord, altitude,1, map); + WayPointItem *item = new WayPointItem(coord, altitude,position,currentGroup, map); item->SetNumber(position); ConnectWP(item); @@ -1011,7 +1035,7 @@ WayPointItem *OPMapWidget::WPInsert(internals::PointLatLng const & coord, int co } else { mcoord = coord; } - WayPointItem *item = new WayPointItem(mcoord, altitude,1, description, map); + WayPointItem *item = new WayPointItem(mcoord, altitude,position,currentGroup, description, map); item->SetNumber(position); ConnectWP(item); item->setParentItem(map); @@ -1025,7 +1049,7 @@ WayPointItem *OPMapWidget::WPInsert(internals::PointLatLng const & coord, int co } WayPointItem *OPMapWidget::WPInsert(distBearingAltitude const & relative, QString const & description, const int &position) { - WayPointItem *item = new WayPointItem(relative,1, description, map); + WayPointItem *item = new WayPointItem(relative,position,currentGroup, description, map); item->SetNumber(position); ConnectWP(item); @@ -1050,10 +1074,18 @@ void OPMapWidget::WPDelete(WayPointItem *item) setSelectedWP(w); w->emitWPProperty(); - WayPointItem *w_next = WPFind(w->Number() + 1); - if(w_next) - { - WPLineCreate(w,w_next,Qt::green,false,2); + + foreach(QGraphicsItem * i, map->childItems()) { + WayPointItem *w_next = qgraphicsitem_cast(i); + + if (w_next) { + if (w->MissionType() == w_next->MissionType()) { + if(w->Number() == (w_next->Number() + 1)) + { + WPLineCreate(w,w_next,Qt::green,false,2); + } + } + } } } else @@ -1102,14 +1134,18 @@ void OPMapWidget::WPDelete(void) setSelectedWP(item); item->emitWPProperty(); - WayPointItem *item_next = WPFind(item->Number() + 1); - if(item_next) - { - WPLineCreate(item,item_next,Qt::green,false,2); - } - else - { - qDebug() << "can not find next fine"; + + foreach(QGraphicsItem * i, map->childItems()) { + WayPointItem *item_next = qgraphicsitem_cast(i); + + if (item_next) { + if (item->MissionType() == item_next->MissionType()) { + if(item->Number() == (item_next->Number() + 1)) + { + WPLineCreate(item,item_next,Qt::green,false,2); + } + } + } } } else @@ -1265,6 +1301,8 @@ void OPMapWidget::ConnectWP(WayPointItem *item) this,SLOT(setCurrentPoint(int)), Qt::DirectConnection); + connect(item,SIGNAL(currentMissiontype(int)), + this,SLOT(WPGroup(int)), Qt::DirectConnection); //生成后立即选中,并且把信息发给ui界面 @@ -1756,7 +1794,10 @@ void OPMapWidget::WPLoad(QString path)//带文件目录参数 QJsonObject json = doc.object(); - //解码 + //安全区解码 + + + //任务解码 QJsonArray itemsArray = json.value("mission").toObject().value("items").toArray(); for(QJsonValue item: itemsArray) { @@ -1902,7 +1943,6 @@ void OPMapWidget::WPSave(QString path)//带文件目录参数 item.insert("params",params); item.insert("type",w->MissionType()); - //这里有问题 items.append(item); } @@ -1915,10 +1955,6 @@ void OPMapWidget::WPSave(QString path)//带文件目录参数 } } - - - - mission.insert("cruiseSpeed",2); mission.insert("firmwareType",0); mission.insert("hoverSpeed",2); @@ -2029,7 +2065,7 @@ void OPMapWidget::WPUpload(void) } } - +//飞行界面收到的当前航点的消息 void OPMapWidget::groupchanged(int value) { //如果当前是在飞行界面,那么就下载,否则不动 @@ -2040,6 +2076,7 @@ void OPMapWidget::groupchanged(int value) } else//飞行界面 { + /* WPDeleteAll(); int sysid = 0; @@ -2057,6 +2094,7 @@ void OPMapWidget::groupchanged(int value) } } } + */ } @@ -2064,6 +2102,7 @@ void OPMapWidget::groupchanged(int value) update(); } +//编辑界面收到的组切换的消息 void OPMapWidget::WPGroup(int value) { currentGroup = value; @@ -2072,34 +2111,35 @@ void OPMapWidget::WPGroup(int value) //切换当前航线,其他都隐藏,或者高亮当前 - /* + //将不是当前的全部变成灰色,当前的显示 foreach(QGraphicsItem * i, map->childItems()) { WayPointItem *w = qgraphicsitem_cast(i); if (w) { - - if(w->MissionType() != currentGroup) + qDebug() << "missiontype" << w->MissionType(); + if(w->MissionType() == currentGroup) { - w->setVisible(false); + w->setisActive(true); } else { - w->setVisible(true); + w->setisActive(false); } } } - + //将不是当前的先全部变成灰色,当前的显示 foreach(QGraphicsItem * i, map->childItems()) { WayPointLine *l = qgraphicsitem_cast(i); if (l) { - + /* if(l->MissionType() != currentGroup) { l->setVisible(false); } + */ } } - */ + //按照当前的组生成新的航点和航线 /* @@ -2111,23 +2151,8 @@ void OPMapWidget::WPGroup(int value) */ - WPDeleteAll(); - int sysid = 0; - int compid = 0; - foreach(QGraphicsItem * i, map->childItems()) { - UAVItem *u = qgraphicsitem_cast(i); - if (u) { - if(u->Select() == true) - { - sysid = u->SysID(); - compid = u->CompID(); - - emit signal_WPDownload(sysid,compid,currentGroup); - } - } - } update(); diff --git a/opmap/mapwidget/opmapwidget.h b/opmap/mapwidget/opmapwidget.h index cf70bfb..4919fee 100644 --- a/opmap/mapwidget/opmapwidget.h +++ b/opmap/mapwidget/opmapwidget.h @@ -377,6 +377,7 @@ public: WayPointItem *WPCreate(internals::PointLatLng const & coord, int const & altitude, QString const & description); WayPointItem *WPCreate(const distBearingAltitude &relativeCoord, const QString &description); + int getWaypointSize(int group); void WPRenumber(WayPointItem *item, int const & newnumber); void SetShowCompass(bool const & value); @@ -394,8 +395,8 @@ public: MeasureLine *measureline = nullptr; - int currentGroup = 0;//编辑情况 - int currentMissionType = 0; + int currentGroup = 3;//编辑情况 + int currentMissionType = 0;//显示情况 QMap> waypointgroups;//group index point @@ -414,6 +415,9 @@ public: void SetUavPic(QString UAVPic); WayPointLine *WPLineCreate(WayPointItem *from, WayPointItem *to, QColor color, bool dashed = false, int width = -1); WayPointLine *WPLineCreate(HomeItem *from, WayPointItem *to, QColor color, bool dashed = false, int width = -1); + void WPLineUpdate(int group); + + WayPointCircle *WPCircleCreate(WayPointItem *center, double radius, bool clockwise, QColor color, bool dashed = false, int width = -1); WayPointCircle *WPCircleCreate(HomeItem *center, double radius, bool clockwise, QColor color, bool dashed = false, int width = -1); void deleteAllOverlays(); diff --git a/opmap/mapwidget/waypointitem.cpp b/opmap/mapwidget/waypointitem.cpp index 6152d9f..7b89e6e 100644 --- a/opmap/mapwidget/waypointitem.cpp +++ b/opmap/mapwidget/waypointitem.cpp @@ -35,7 +35,7 @@ namespace mapcontrol { -WayPointItem::WayPointItem(const internals::PointLatLng &coord, int const & altitude,int seq, MapGraphicItem *map, wptype type) : coord(coord), reached(false), description(""), shownumber(true), isDragging(false), altitude(altitude), map(map), myType(type) +WayPointItem::WayPointItem(const internals::PointLatLng &coord, int const & altitude,int seq, int missiontype, MapGraphicItem *map, wptype type) : coord(coord), reached(false), description(""), shownumber(true), isDragging(false), altitude(altitude), map(map), myType(type) { numberI = 0; isEdit = true; @@ -48,7 +48,7 @@ WayPointItem::WayPointItem(const internals::PointLatLng &coord, int const & alti SetShowNumber(shownumber); RefreshPos(); - SetDefault(coord.Lat(),coord.Lng(),altitude,property.seq); + SetDefault(coord.Lat(),coord.Lng(),altitude,property.seq,missiontype); myHome = NULL; QList list = map->childItems(); @@ -74,7 +74,7 @@ WayPointItem::WayPointItem(const internals::PointLatLng &coord, int const & alti } -WayPointItem::WayPointItem(int seq, MapGraphicItem *map, bool magicwaypoint) : reached(false), description(""), shownumber(true), isDragging(false), altitude(0), map(map) +WayPointItem::WayPointItem(int seq,int missiontype, MapGraphicItem *map, bool magicwaypoint) : reached(false), description(""), shownumber(true), isDragging(false), altitude(0), map(map) { isEdit = true; relativeCoord.bearing = 0; @@ -96,7 +96,7 @@ WayPointItem::WayPointItem(int seq, MapGraphicItem *map, bool magicwaypoint) : r SetShowNumber(shownumber); RefreshPos(); - SetDefault(coord.Lat(),coord.Lng(),altitude,property.seq); + SetDefault(coord.Lat(),coord.Lng(),altitude,property.seq,missiontype); myHome = NULL; QList list = map->childItems(); @@ -120,7 +120,7 @@ WayPointItem::WayPointItem(int seq, MapGraphicItem *map, bool magicwaypoint) : r this->setZValue(3); } -WayPointItem::WayPointItem(const internals::PointLatLng &coord, int const & altitude,int seq, const QString &description, MapGraphicItem *map, wptype type) : coord(coord), reached(false), description(description), shownumber(true), isDragging(false), altitude(altitude), map(map), myType(type) +WayPointItem::WayPointItem(const internals::PointLatLng &coord, int const & altitude,int seq, int missiontype, const QString &description, MapGraphicItem *map, wptype type) : coord(coord), reached(false), description(description), shownumber(true), isDragging(false), altitude(altitude), map(map), myType(type) { isEdit = true; numberI = 0; @@ -134,7 +134,7 @@ WayPointItem::WayPointItem(const internals::PointLatLng &coord, int const & alti SetShowNumber(shownumber); RefreshPos(); - SetDefault(coord.Lat(),coord.Lng(),altitude,property.seq); + SetDefault(coord.Lat(),coord.Lng(),altitude,property.seq,missiontype); myHome = NULL; QList list = map->childItems(); @@ -158,7 +158,7 @@ WayPointItem::WayPointItem(const internals::PointLatLng &coord, int const & alti this->setZValue(3); } -WayPointItem::WayPointItem(const distBearingAltitude &relativeCoordenate,int seq, const QString &description, MapGraphicItem *map) : relativeCoord(relativeCoordenate), reached(false), description(description), shownumber(true), isDragging(false), map(map) +WayPointItem::WayPointItem(const distBearingAltitude &relativeCoordenate,int seq,int missiontype, const QString &description, MapGraphicItem *map) : relativeCoord(relativeCoordenate), reached(false), description(description), shownumber(true), isDragging(false), map(map) { isEdit = true; myHome = NULL; @@ -186,7 +186,7 @@ WayPointItem::WayPointItem(const distBearingAltitude &relativeCoordenate,int seq SetShowNumber(shownumber); RefreshPos(); - SetDefault(coord.Lat(),coord.Lng(),altitude,property.seq); + SetDefault(coord.Lat(),coord.Lng(),altitude,property.seq,missiontype); connect(this, SIGNAL(waypointdoubleclick(WayPointItem *)), map, SIGNAL(wpdoubleclicked(WayPointItem *))); emit manualCoordChange(this); @@ -318,8 +318,6 @@ void WayPointItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti } - - painter->setPen(ePen); painter->drawEllipse(boundingRect()); @@ -361,6 +359,10 @@ void WayPointItem::mousePressEvent(QGraphicsSceneMouseEvent *event) isDragging = true; qDebug() << "PressEvent isEdit" <parent(); + if(isEdit == true) + { + emit currentMissiontype(property.mission_type); + } } @@ -760,12 +762,9 @@ void WayPointItem::emitWPProperty(void) } -void WayPointItem::SetDefault(double lat,double lng,float alt,uint16_t seq) +void WayPointItem::SetDefault(double lat,double lng,float alt,uint16_t seq,int missiontype) { //读取一下json - - - property.param1 = 0; property.param2 = 0; property.param3 = 0; @@ -774,14 +773,14 @@ void WayPointItem::SetDefault(double lat,double lng,float alt,uint16_t seq) property.y = lng * 10e6; property.z = alt; property.seq = seq; - property.group = 3; + property.group = missiontype; property.command = MAV_CMD::MAV_CMD_NAV_WAYPOINT; property.target_system = 0; property.target_component = 0; property.frame = MAV_FRAME::MAV_FRAME_GLOBAL; property.current = 0; property.autocontinue = true; - property.mission_type = 3; + property.mission_type = missiontype; qDebug() << "waypoint item set default" << property.mission_type; @@ -876,6 +875,7 @@ void WayPointItem::SetGroup(uint16_t value) void WayPointItem::SetMissionType(uint8_t value) { property.mission_type = value; + update(); } diff --git a/opmap/mapwidget/waypointitem.h b/opmap/mapwidget/waypointitem.h index a2be27f..d039ada 100644 --- a/opmap/mapwidget/waypointitem.h +++ b/opmap/mapwidget/waypointitem.h @@ -106,10 +106,10 @@ public: - WayPointItem(internals::PointLatLng const & coord, int const & altitude,int seq, MapGraphicItem *map, wptype type = absolute); - WayPointItem(int seq, MapGraphicItem *map, bool magicwaypoint); - WayPointItem(internals::PointLatLng const & coord, int const & altitude, int seq, QString const & description, MapGraphicItem *map, wptype type = absolute); - WayPointItem(distBearingAltitude const & relativeCoord,int seq, QString const & description, MapGraphicItem *map); + WayPointItem(internals::PointLatLng const & coord, int const & altitude,int seq, int missiontype, MapGraphicItem *map, wptype type = absolute); + WayPointItem(int seq,int missiontype, MapGraphicItem *map, bool magicwaypoint); + WayPointItem(internals::PointLatLng const & coord, int const & altitude, int seq,int missiontype, QString const & description, MapGraphicItem *map, wptype type = absolute); + WayPointItem(distBearingAltitude const & relativeCoord,int seq, int missiontype, QString const & description, MapGraphicItem *map); QString Description() { @@ -189,7 +189,7 @@ public: //=============属性================= - void SetDefault(double lat, double lng, float alt, uint16_t seq);//默认属性 + void SetDefault(double lat, double lng, float alt, uint16_t seq,int missiontype);//默认属性 void SetParam1(float value); void SetParam2(float value); @@ -281,7 +281,8 @@ public: return Elevation; } - void setActive(bool flag) + + void setisActive(bool flag) { isactive = flag; update(); @@ -386,6 +387,7 @@ public slots: signals: + void currentMissiontype(int group); void SetCurrent(int seq); void WPFollowPrevious(bool flag,WayPointItem *waypoint);