Commit e869bac6 authored by lm's avatar lm

Minor tweaks on waypoint interaction. Suspected bug in OPMapControl mouse position handling.

parent 0b0fbe87
......@@ -362,13 +362,13 @@ void QGCMapWidget::setUpdateRateLimit(float seconds)
void QGCMapWidget::handleMapWaypointEdit(mapcontrol::WayPointItem* waypoint)
{
qDebug() << "UPDATING WP FROM MAP";
// Block circle updates
Waypoint* wp = iconsToWaypoints.value(waypoint, NULL);
// Protect from vicious double update cycle
if (firingWaypointChange == wp || !wp) return;
if (firingWaypointChange == wp) return;
// Not in cycle, block now from entering it
firingWaypointChange = wp;
qDebug() << "UPDATING WP FROM MAP";
// Update WP values
internals::PointLatLng pos = waypoint->Coord();
......@@ -376,6 +376,8 @@ void QGCMapWidget::handleMapWaypointEdit(mapcontrol::WayPointItem* waypoint)
wp->setLongitude(pos.Lng());
wp->setAltitude(waypoint->Altitude());
qDebug() << "WP: LAT:" << pos.Lat() << "LON:" << pos.Lng();
emit waypointChanged(wp);
firingWaypointChange = NULL;
}
......
......@@ -35,7 +35,7 @@ Waypoint2DIcon::Waypoint2DIcon(mapcontrol::MapGraphicItem* map, mapcontrol::OPMa
// drawIcon(mypen);
this->setFlag(QGraphicsItem::ItemIgnoresTransformations,true);
picture = QPixmap(radius+1, radius+1);
drawIcon();
updateWaypoint();
}
Waypoint2DIcon::~Waypoint2DIcon()
......@@ -63,6 +63,9 @@ void Waypoint2DIcon::updateWaypoint()
SetHeading(waypoint->getYaw());
SetCoord(internals::PointLatLng(waypoint->getLatitude(), waypoint->getLongitude()));
qDebug() << "UPDATING WP:" << waypoint->getId() << "LAT:" << waypoint->getLatitude() << "LON:" << waypoint->getLongitude();
SetDescription(waypoint->getDescription());
SetAltitude(waypoint->getAltitude());
// FIXME Add SetNumber (currently needs a separate call)
......
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