|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <MapPositionTracker.h>
Inheritance diagram for MapPositionTracker:
Collaboration diagram for MapPositionTracker:Signals | |
| void | centerMap (const QGeoCoordinate &coordinate, bool firstPosition) |
| void | recenterVehicleTo (const QPointF &screenPoint) |
| Consumer moves the map (animated) so the vehicle lands at screenPoint. | |
| void | activeChanged () |
| void | gcsPositionChanged () |
| void | vehicleCoordinateChanged () |
| void | allowGCSLocationCenterChanged () |
| void | allowVehicleLocationCenterChanged () |
| void | centerGCSWhenVehicleValidChanged () |
| void | keepVehicleCenteredChanged () |
| void | userInteractingChanged () |
| void | animatingChanged () |
| void | firstVehiclePositionReceivedChanged () |
Public Member Functions | |
| MapPositionTracker (QObject *parent=nullptr) | |
| bool | active () const |
| void | setActive (bool active) |
| QGeoCoordinate | gcsPosition () const |
| void | setGcsPosition (const QGeoCoordinate &position) |
| QGeoCoordinate | vehicleCoordinate () const |
| void | setVehicleCoordinate (const QGeoCoordinate &coordinate) |
| bool | allowGCSLocationCenter () const |
| void | setAllowGCSLocationCenter (bool allow) |
| bool | allowVehicleLocationCenter () const |
| void | setAllowVehicleLocationCenter (bool allow) |
| bool | centerGCSWhenVehicleValid () const |
| void | setCenterGCSWhenVehicleValid (bool center) |
| bool | keepVehicleCentered () const |
| void | setKeepVehicleCentered (bool keep) |
| bool | userInteracting () const |
| void | setUserInteracting (bool interacting) |
| bool | animating () const |
| Consumer's recenter animation is running: inset evaluation is skipped. | |
| void | setAnimating (bool animating) |
| bool | firstVehiclePositionReceived () const |
| void | setFirstVehiclePositionReceived (bool received) |
| Q_INVOKABLE void | evaluateInsetFollow (const QPointF &vehicleScreenPoint, const QRectF ¢erRect, const QVariantList &cornerRects) |
Static Public Attributes | |
| static constexpr int | kResumeDelayMs = 10000 |
| Following resumes this long after the user stops interacting. | |
Map auto-centering policy shared by the map engines (FlightMap/QtLocation and GeoMap). Owns the decisions of when and where to center:
Definition at line 32 of file MapPositionTracker.h.
|
explicit |
Definition at line 16 of file MapPositionTracker.cc.
|
inline |
Definition at line 59 of file MapPositionTracker.h.
Referenced by setActive().
|
signal |
Referenced by setActive().
|
inline |
Definition at line 71 of file MapPositionTracker.h.
|
signal |
Referenced by setAllowGCSLocationCenter().
|
inline |
Definition at line 75 of file MapPositionTracker.h.
|
signal |
Referenced by setAllowVehicleLocationCenter().
|
inline |
Consumer's recenter animation is running: inset evaluation is skipped.
Definition at line 95 of file MapPositionTracker.h.
Referenced by setAnimating().
|
signal |
Referenced by setAnimating().
|
inline |
One-time GCS centering also fires while a valid vehicle position exists (FlightMap centers on GCS in that case when the map will keep following the vehicle anyway)
Definition at line 82 of file MapPositionTracker.h.
|
signal |
Referenced by setCenterGCSWhenVehicleValid().
|
signal |
Consumer sets its map center. firstPosition: first vehicle position, also apply the initial zoom.
Referenced by setVehicleCoordinate().
| void MapPositionTracker::evaluateInsetFollow | ( | const QPointF & | vehicleScreenPoint, |
| const QRectF & | centerRect, | ||
| const QVariantList & | cornerRects | ||
| ) |
Inset-follow evaluation, called periodically by the consumer with the vehicle's current screen position, the unobstructed center rect and the (possibly empty) list of corner rects covered by UI elements. Emits recenterVehicleTo(centerRect.center()) when the vehicle is outside the center rect or under a corner rect.
Definition at line 178 of file MapPositionTracker.cc.
References recenterVehicleTo().
|
inline |
Writable: consumers set it true to suppress the one-time vehicle centering (e.g. after fitting the view to mission items instead)
Definition at line 101 of file MapPositionTracker.h.
|
signal |
Referenced by setFirstVehiclePositionReceived().
|
inline |
Definition at line 63 of file MapPositionTracker.h.
|
signal |
Referenced by setGcsPosition().
|
inline |
Definition at line 86 of file MapPositionTracker.h.
|
signal |
Referenced by setKeepVehicleCentered().
|
signal |
Consumer moves the map (animated) so the vehicle lands at screenPoint.
Referenced by evaluateInsetFollow().
| void MapPositionTracker::setActive | ( | bool | active | ) |
Definition at line 23 of file MapPositionTracker.cc.
References active(), and activeChanged().
| void MapPositionTracker::setAllowGCSLocationCenter | ( | bool | allow | ) |
Definition at line 64 of file MapPositionTracker.cc.
References allowGCSLocationCenterChanged().
| void MapPositionTracker::setAllowVehicleLocationCenter | ( | bool | allow | ) |
Definition at line 77 of file MapPositionTracker.cc.
References allowVehicleLocationCenterChanged().
| void MapPositionTracker::setAnimating | ( | bool | animating | ) |
Definition at line 123 of file MapPositionTracker.cc.
References animating(), and animatingChanged().
| void MapPositionTracker::setCenterGCSWhenVehicleValid | ( | bool | center | ) |
Definition at line 90 of file MapPositionTracker.cc.
References centerGCSWhenVehicleValidChanged().
| void MapPositionTracker::setFirstVehiclePositionReceived | ( | bool | received | ) |
Definition at line 132 of file MapPositionTracker.cc.
References firstVehiclePositionReceivedChanged().
| void MapPositionTracker::setGcsPosition | ( | const QGeoCoordinate & | position | ) |
Definition at line 38 of file MapPositionTracker.cc.
References gcsPositionChanged().
| void MapPositionTracker::setKeepVehicleCentered | ( | bool | keep | ) |
Definition at line 99 of file MapPositionTracker.cc.
References keepVehicleCenteredChanged().
| void MapPositionTracker::setUserInteracting | ( | bool | interacting | ) |
Definition at line 108 of file MapPositionTracker.cc.
References userInteractingChanged().
| void MapPositionTracker::setVehicleCoordinate | ( | const QGeoCoordinate & | coordinate | ) |
Definition at line 48 of file MapPositionTracker.cc.
References centerMap(), and vehicleCoordinateChanged().
|
inline |
Definition at line 90 of file MapPositionTracker.h.
|
signal |
Referenced by setUserInteracting().
|
inline |
Definition at line 67 of file MapPositionTracker.h.
|
signal |
Referenced by setVehicleCoordinate().
|
staticconstexpr |
Following resumes this long after the user stops interacting.
Definition at line 57 of file MapPositionTracker.h.