Newer
Older
/****************************************************************************
*
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#include <QVariant>
#include "QGCToolbox.h"
#include "SimulatedPosition.h"
class QGCPositionManager : public QGCTool {
Q_OBJECT
public:
QGCPositionManager(QGCApplication* app, QGCToolbox* toolbox);
Q_PROPERTY(QGeoCoordinate gcsPosition READ gcsPosition NOTIFY gcsPositionChanged)
Q_PROPERTY(qreal gcsHeading READ gcsHeading NOTIFY gcsHeadingChanged)
QGeoCoordinate gcsPosition (void) { return _gcsPosition; }
qreal gcsHeading (void) { return _gcsHeading; }
QGeoPositionInfo geoPositionInfo (void) const { return _geoPositionInfo; }
void setPositionSource (QGCPositionSource source);
int updateInterval (void) const;
void setNmeaSourceDevice (QIODevice* device);
void _positionUpdated(const QGeoPositionInfo &update);
void _error(QGeoPositionInfoSource::Error positioningError);
void gcsHeadingChanged(qreal gcsHeading);
void positionInfoUpdated(QGeoPositionInfo update);
private:
QGeoPositionInfoSource* _currentSource = nullptr;
QGeoPositionInfoSource* _defaultSource = nullptr;
QNmeaPositionInfoSource* _nmeaSource = nullptr;
QGeoPositionInfoSource* _simulatedSource = nullptr;
bool _usingPluginSource = false;