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