|
QGIS API Documentation 3.99.0-Master (e9821da5c6b)
|
Abstract base class for connections to a GPS device. More...
#include <qgsgpsconnection.h>

Public Types | |
| enum | Status { NotConnected , Connected , DataReceived , GPSDataReceived } |
Signals | |
| void | fixStatusChanged (Qgis::GpsFixStatus status) |
| Emitted when the GPS device fix status is changed. | |
| void | nmeaSentenceReceived (const QString &substring) |
| Emitted whenever the GPS device receives a raw NMEA sentence. | |
| void | positionChanged (const QgsPoint &point) |
| Emitted when the GPS position changes. | |
| void | stateChanged (const QgsGpsInformation &info) |
| Emitted whenever the GPS state is changed. | |
Public Member Functions | |
| QgsGpsConnection (QIODevice *dev) | |
| Constructor. | |
| ~QgsGpsConnection () override | |
| bool | close () |
| Closes connection to device. | |
| bool | connect () |
| Opens connection to device. | |
| QgsGpsInformation | currentGPSInformation () const |
| Returns the current gps information (lat, lon, etc.). | |
| QgsPoint | lastValidLocation () const |
| Returns the last valid location obtained by the device. | |
| void | setSource (QIODevice *source) |
| Sets the GPS source. The class takes ownership of the device class. | |
| Status | status () const |
| Returns the status. Possible state are not connected, connected, data received. | |
Static Public Attributes | |
| static const QgsSettingsEntryInteger * | settingGpsAcquisitionInterval = new QgsSettingsEntryInteger( u"acquisition-interval"_s, QgsSettingsTree::sTreeGps, 0, u"GPS track point acquisition interval"_s ) |
| Settings entry GPS track point acquisition interval. | |
| static const QgsSettingsEntryBool * | settingGpsApplyLeapSecondsCorrection = new QgsSettingsEntryBool( u"apply-leap-seconds-correction"_s, QgsSettingsTree::sTreeGps, true, u"Whether leap seconds corrections should be applied to GPS timestamps"_s ) |
| Settings entry GPS apply leap seconds correction. | |
| static const QgsSettingsEntryBool * | settingGpsBearingFromTravelDirection = new QgsSettingsEntryBool( u"calculate-bearing-from-travel"_s, QgsSettingsTree::sTreeGps, false, u"Calculate GPS bearing from travel direction"_s ) |
| Settings entry GPS calculate bearing from travel direction. | |
| static const QgsSettingsEntryDouble * | settingGpsDistanceThreshold = new QgsSettingsEntryDouble( u"distance-threshold"_s, QgsSettingsTree::sTreeGps, 0, u"GPS track point distance threshold"_s ) |
| Settings entry GPS track point distance threshold. | |
| static const QgsSettingsEntryInteger * | settingGpsLeapSeconds = new QgsSettingsEntryInteger( u"leap-seconds"_s, QgsSettingsTree::sTreeGps, 18, u"Leap seconds correction amount (in seconds)"_s ) |
| Settings entry GPS leap seconds correction amount (in seconds). | |
| static const QgsSettingsEntryEnumFlag< Qgis::GpsConnectionType > * | settingsGpsConnectionType = new QgsSettingsEntryEnumFlag<Qgis::GpsConnectionType>( u"gps-connection-type"_s, QgsSettingsTree::sTreeGps, Qgis::GpsConnectionType::Automatic, u"GPS connection type"_s ) |
| Settings entry GPS connection type. | |
| static const QgsSettingsEntryString * | settingsGpsdDeviceName = new QgsSettingsEntryString( u"gpsd-device-name"_s, QgsSettingsTree::sTreeGps, QString(), u"GPSD connection device name"_s ) |
| Settings entry GPSD device name. | |
| static const QgsSettingsEntryString * | settingsGpsdHostName = new QgsSettingsEntryString( u"gpsd-host-name"_s, QgsSettingsTree::sTreeGps, QString(), u"GPSD connection host name"_s ) |
| Settings entry GPSD host name. | |
| static const QgsSettingsEntryInteger * | settingsGpsdPortNumber = new QgsSettingsEntryInteger( u"gpsd-port"_s, QgsSettingsTree::sTreeGps, 2947, u"GPSD port number"_s ) |
| Settings entry GPSD port number. | |
| static const QgsSettingsEntryString * | settingsGpsSerialDevice = new QgsSettingsEntryString( u"gpsd-serial-device"_s, QgsSettingsTree::sTreeGps, QString(), u"GPS serial device name"_s ) |
| Settings entry GPS serial device name. | |
| static const QgsSettingsEntryInteger * | settingsGpsTimeStampOffsetFromUtc = new QgsSettingsEntryInteger( u"timestamp-offset-from-utc"_s, QgsSettingsTree::sTreeGps, 0, u"GPS time stamp offset from UTC (in seconds)"_s ) |
| Settings entry GPS time offset from UTC in seconds. | |
| static const QgsSettingsEntryEnumFlag< Qt::TimeSpec > * | settingsGpsTimeStampSpecification = new QgsSettingsEntryEnumFlag<Qt::TimeSpec>( u"timestamp-time-spec"_s, QgsSettingsTree::sTreeGps, Qt::TimeSpec::LocalTime, u"GPS time stamp specification"_s ) |
| Settings entry time specification for GPS time stamps. | |
| static const QgsSettingsEntryString * | settingsGpsTimeStampTimeZone = new QgsSettingsEntryString( u"timestamp-time-zone"_s, QgsSettingsTree::sTreeGps, QString(), u"GPS time stamp time zone"_s ) |
| Settings entry GPS time stamp time zone. | |
Protected Slots | |
| virtual void | parseData ()=0 |
| Parse available data source content. | |
Protected Attributes | |
| QgsGpsInformation | mLastGPSInformation |
| Last state of the gps related variables (e.g. position, time, ...). | |
| std::unique_ptr< QIODevice > | mSource |
| Data source (e.g. serial device, socket, file,...). | |
| Status | mStatus = NotConnected |
| Connection status. | |
Abstract base class for connections to a GPS device.
Definition at line 49 of file qgsgpsconnection.h.
| Enumerator | |
|---|---|
| NotConnected | |
| Connected | |
| DataReceived | |
| GPSDataReceived | |
Definition at line 69 of file qgsgpsconnection.h.
| QgsGpsConnection::QgsGpsConnection | ( | QIODevice * | dev | ) |
Constructor.
| dev | input device for the connection (e.g. serial device). The class takes ownership of the object |
Definition at line 57 of file qgsgpsconnection.cpp.
|
override |
Definition at line 67 of file qgsgpsconnection.cpp.
| bool QgsGpsConnection::close | ( | ) |
Closes connection to device.
Definition at line 87 of file qgsgpsconnection.cpp.
| bool QgsGpsConnection::connect | ( | ) |
Opens connection to device.
Definition at line 72 of file qgsgpsconnection.cpp.
|
inline |
Returns the current gps information (lat, lon, etc.).
Definition at line 136 of file qgsgpsconnection.h.
|
signal |
Emitted when the GPS device fix status is changed.
|
inline |
Returns the last valid location obtained by the device.
Definition at line 143 of file qgsgpsconnection.h.
|
signal |
Emitted whenever the GPS device receives a raw NMEA sentence.
|
protectedpure virtualslot |
Parse available data source content.
|
signal |
Emitted when the GPS position changes.
This signal is only emitted when the new GPS location is considered valid (see QgsGpsInformation::isValid()).
| void QgsGpsConnection::setSource | ( | QIODevice * | source | ) |
Sets the GPS source. The class takes ownership of the device class.
Definition at line 120 of file qgsgpsconnection.cpp.
|
signal |
Emitted whenever the GPS state is changed.
|
inline |
Returns the status. Possible state are not connected, connected, data received.
Definition at line 133 of file qgsgpsconnection.h.
|
protected |
Last state of the gps related variables (e.g. position, time, ...).
Definition at line 179 of file qgsgpsconnection.h.
|
protected |
Data source (e.g. serial device, socket, file,...).
Definition at line 177 of file qgsgpsconnection.h.
|
protected |
Connection status.
Definition at line 181 of file qgsgpsconnection.h.
|
static |
Settings entry GPS track point acquisition interval.
Definition at line 94 of file qgsgpsconnection.h.
|
static |
Settings entry GPS apply leap seconds correction.
Definition at line 103 of file qgsgpsconnection.h.
|
static |
Settings entry GPS calculate bearing from travel direction.
Definition at line 100 of file qgsgpsconnection.h.
|
static |
Settings entry GPS track point distance threshold.
Definition at line 97 of file qgsgpsconnection.h.
|
static |
Settings entry GPS leap seconds correction amount (in seconds).
Definition at line 106 of file qgsgpsconnection.h.
|
static |
Settings entry GPS connection type.
Definition at line 79 of file qgsgpsconnection.h.
|
static |
Settings entry GPSD device name.
Definition at line 88 of file qgsgpsconnection.h.
|
static |
Settings entry GPSD host name.
Definition at line 82 of file qgsgpsconnection.h.
|
static |
Settings entry GPSD port number.
Definition at line 85 of file qgsgpsconnection.h.
|
static |
Settings entry GPS serial device name.
Definition at line 91 of file qgsgpsconnection.h.
|
static |
Settings entry GPS time offset from UTC in seconds.
Definition at line 115 of file qgsgpsconnection.h.
|
static |
Settings entry time specification for GPS time stamps.
Definition at line 109 of file qgsgpsconnection.h.
|
static |
Settings entry GPS time stamp time zone.
Definition at line 112 of file qgsgpsconnection.h.