Commit 2f5c158d authored by Lorenz Meier's avatar Lorenz Meier

Hotfix: Always update waypoint values, fire setchanged signal on edit stop

parent a059c113
...@@ -123,6 +123,7 @@ public: ...@@ -123,6 +123,7 @@ public:
const QString& getDescription() const { const QString& getDescription() const {
return description; return description;
} }
/** @brief Returns true if x, y, z contain reasonable navigation data */ /** @brief Returns true if x, y, z contain reasonable navigation data */
bool isNavigationType(); bool isNavigationType();
...@@ -185,6 +186,9 @@ public slots: ...@@ -185,6 +186,9 @@ public slots:
bool isReached() { return (reachedTime > 0); } bool isReached() { return (reachedTime > 0); }
/** @brief Get the time this waypoint was reached */ /** @brief Get the time this waypoint was reached */
quint64 getReachedTime() { return reachedTime; } quint64 getReachedTime() { return reachedTime; }
void setChanged() {
emit changed(this);
}
signals: signals:
/** @brief Announces a change to the waypoint data */ /** @brief Announces a change to the waypoint data */
......
...@@ -173,6 +173,7 @@ void QGCMapWidget::mouseReleaseEvent(QMouseEvent *event) ...@@ -173,6 +173,7 @@ void QGCMapWidget::mouseReleaseEvent(QMouseEvent *event)
// If the mouse is released, we can't be dragging // If the mouse is released, we can't be dragging
if (firingWaypointChange) { if (firingWaypointChange) {
firingWaypointChange->setChanged();
firingWaypointChange = NULL; firingWaypointChange = NULL;
} }
} }
...@@ -638,13 +639,6 @@ void QGCMapWidget::handleMapWaypointEdit(mapcontrol::WayPointItem* waypoint) ...@@ -638,13 +639,6 @@ void QGCMapWidget::handleMapWaypointEdit(mapcontrol::WayPointItem* waypoint)
if (!wp) if (!wp)
WPDelete(waypoint); WPDelete(waypoint);
// Protect from vicious double update cycle
if (firingWaypointChange == wp) {
return;
}
// Not in cycle, block now from entering it
firingWaypointChange = wp;
// Update WP values // Update WP values
internals::PointLatLng pos = waypoint->Coord(); internals::PointLatLng pos = waypoint->Coord();
...@@ -661,6 +655,13 @@ void QGCMapWidget::handleMapWaypointEdit(mapcontrol::WayPointItem* waypoint) ...@@ -661,6 +655,13 @@ void QGCMapWidget::handleMapWaypointEdit(mapcontrol::WayPointItem* waypoint)
// QString wp_str = QString::number(wp->getLatitude(), 'f', 6) + " " + QString::number(wp->getLongitude(), 'f', 6); // QString wp_str = QString::number(wp->getLatitude(), 'f', 6) + " " + QString::number(wp->getLongitude(), 'f', 6);
// qDebug() << "MAP WP COORD (WP):" << wp_str << __FILE__ << __LINE__; // qDebug() << "MAP WP COORD (WP):" << wp_str << __FILE__ << __LINE__;
// Protect from vicious double update cycle
if (firingWaypointChange == wp) {
return;
}
// Not in cycle, block now from entering it
firingWaypointChange = wp;
emit waypointChanged(wp); emit waypointChanged(wp);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment