Browse Source

Merge remote-tracking branch 'upstream/master' into fgfsrate

QGC4.4
Thomas Gubler 11 years ago
parent
commit
2ad852b55c
  1. 4
      src/Waypoint.h
  2. 15
      src/ui/map/QGCMapWidget.cc
  3. 3
      src/ui/map/Waypoint2DIcon.cc

4
src/Waypoint.h

@ -123,6 +123,7 @@ public: @@ -123,6 +123,7 @@ public:
const QString& getDescription() const {
return description;
}
/** @brief Returns true if x, y, z contain reasonable navigation data */
bool isNavigationType();
@ -185,6 +186,9 @@ public slots: @@ -185,6 +186,9 @@ public slots:
bool isReached() { return (reachedTime > 0); }
/** @brief Get the time this waypoint was reached */
quint64 getReachedTime() { return reachedTime; }
void setChanged() {
emit changed(this);
}
signals:
/** @brief Announces a change to the waypoint data */

15
src/ui/map/QGCMapWidget.cc

@ -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 (firingWaypointChange) {
firingWaypointChange->setChanged();
firingWaypointChange = NULL;
}
}
@ -638,13 +639,6 @@ void QGCMapWidget::handleMapWaypointEdit(mapcontrol::WayPointItem* waypoint) @@ -638,13 +639,6 @@ void QGCMapWidget::handleMapWaypointEdit(mapcontrol::WayPointItem* waypoint)
if (!wp)
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
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);
// 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);
}

3
src/ui/map/Waypoint2DIcon.cc

@ -303,7 +303,8 @@ void Waypoint2DIcon::paint(QPainter *painter, const QStyleOptionGraphicsItem *op @@ -303,7 +303,8 @@ void Waypoint2DIcon::paint(QPainter *painter, const QStyleOptionGraphicsItem *op
QPen penDash(color);
penDash.setWidth(1);
//penDash.setStyle(Qt::DotLine);
const int loiter = map->metersToPixels(waypoint->getLoiterOrbit(), Coord());
// A negative radius indicates counter-clockwise rotation, but we still want to draw it positive
const int loiter = map->metersToPixels(fabsf(waypoint->getLoiterOrbit()), Coord());
if (loiter > picture.width()/2)
{
painter->setPen(penBlack);

Loading…
Cancel
Save