diff --git a/ground/openpilotgcs/src/plugins/opmap/opmapgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/opmap/opmapgadgetwidget.cpp index 52ab71ae9..568f5c5b8 100644 --- a/ground/openpilotgcs/src/plugins/opmap/opmapgadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/opmap/opmapgadgetwidget.cpp @@ -2541,12 +2541,14 @@ void OPMapGadgetWidget::doVisualizationChanged(QList way WayPointItem * wayPointItem = m_map->WPCreate(position, 0, QString(index)); Q_ASSERT(wayPointItem); if(wayPointItem) { + wayPointItem->SetNumber(index); wayPointItem->setFlag(QGraphicsItem::ItemIsMovable, true); wayPointItem->picture.load(QString::fromUtf8(":/opmap/images/waypoint_marker1.png")); index++; } connect(wayPointItem, SIGNAL(WPDropped(WayPointItem*)), this, SLOT(WPDropped(WayPointItem*))); } + } /** diff --git a/ground/openpilotgcs/src/plugins/opmap/pathcompiler.cpp b/ground/openpilotgcs/src/plugins/opmap/pathcompiler.cpp index eb5892281..59ac2e200 100644 --- a/ground/openpilotgcs/src/plugins/opmap/pathcompiler.cpp +++ b/ground/openpilotgcs/src/plugins/opmap/pathcompiler.cpp @@ -213,7 +213,6 @@ void PathCompiler::doDelWaypoint(int index) int numWaypoints = objManager->getNumInstances(waypoint->getObjID()); for (int i = index; i < numWaypoints - 1; i++) { - qDebug() << "Copying from" << i+1 << "to" << i; Waypoint *waypointDest = Waypoint::GetInstance(objManager, i); Q_ASSERT(waypointDest); @@ -232,7 +231,6 @@ void PathCompiler::doDelWaypoint(int index) // Set the second to last waypoint to stop (and last for safety) // the functional equivalent to deleting for (int i = numWaypoints - 2; i < numWaypoints; i++) { - qDebug() << "Stopping" << i; waypoint = Waypoint::GetInstance(objManager, i); Q_ASSERT(waypoint); if (waypoint) { @@ -274,8 +272,6 @@ void PathCompiler::doDelAllWaypoints() */ void PathCompiler::doUpdateFromUAV(UAVObject *obj) { - static QList previousWaypoints; - UAVObjectManager *objManager = getObjectManager(); if (!objManager) return; diff --git a/ground/openpilotgcs/src/plugins/opmap/pathcompiler.h b/ground/openpilotgcs/src/plugins/opmap/pathcompiler.h index f3bdc95c4..2fb615195 100644 --- a/ground/openpilotgcs/src/plugins/opmap/pathcompiler.h +++ b/ground/openpilotgcs/src/plugins/opmap/pathcompiler.h @@ -88,6 +88,7 @@ private: //! Convert a UAVO waypoint to the local structure Waypoint::DataFields InternalToUavo(waypoint); + QList previousWaypoints; signals: /** * Indicates something changed the waypoints and the map should