|
|
|
@ -14,6 +14,7 @@
@@ -14,6 +14,7 @@
|
|
|
|
|
QGCPositionManager::QGCPositionManager(QGCApplication* app, QGCToolbox* toolbox) |
|
|
|
|
: QGCTool (app, toolbox) |
|
|
|
|
, _updateInterval (0) |
|
|
|
|
, _gcsHeading (NAN) |
|
|
|
|
, _currentSource (NULL) |
|
|
|
|
, _defaultSource (NULL) |
|
|
|
|
, _nmeaSource (NULL) |
|
|
|
@ -60,6 +61,7 @@ void QGCPositionManager::setNmeaSourceDevice(QIODevice* device)
@@ -60,6 +61,7 @@ void QGCPositionManager::setNmeaSourceDevice(QIODevice* device)
|
|
|
|
|
void QGCPositionManager::_positionUpdated(const QGeoPositionInfo &update) |
|
|
|
|
{ |
|
|
|
|
QGeoCoordinate newGCSPosition = QGeoCoordinate(); |
|
|
|
|
qreal newGCSHeading = update.attribute(QGeoPositionInfo::Direction); |
|
|
|
|
|
|
|
|
|
if (update.isValid()) { |
|
|
|
|
// Note that gcsPosition filters out possible crap values
|
|
|
|
@ -71,6 +73,10 @@ void QGCPositionManager::_positionUpdated(const QGeoPositionInfo &update)
@@ -71,6 +73,10 @@ void QGCPositionManager::_positionUpdated(const QGeoPositionInfo &update)
|
|
|
|
|
_gcsPosition = newGCSPosition; |
|
|
|
|
emit gcsPositionChanged(_gcsPosition); |
|
|
|
|
} |
|
|
|
|
if (newGCSHeading != _gcsHeading) { |
|
|
|
|
_gcsHeading = newGCSHeading; |
|
|
|
|
emit gcsHeadingChanged(_gcsHeading); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
emit positionInfoUpdated(update); |
|
|
|
|
} |
|
|
|
|