QGIS API Documentation 3.41.0-Master (3c143d501a8)
|
Evaluates NMEA sentences coming from a GPS device. More...
#include <qgsnmeaconnection.h>
Public Member Functions | |
QgsNmeaConnection (QIODevice *device) | |
Constructs a QgsNmeaConnection with given device. | |
Public Member Functions inherited from QgsGpsConnection | |
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. | |
Protected Slots | |
void | parseData () override |
Parse available data source content. | |
Protected Slots inherited from QgsGpsConnection | |
virtual void | parseData ()=0 |
Parse available data source content. | |
Protected Member Functions | |
void | processGgaSentence (const char *data, int len) |
process GGA sentence | |
void | processGsaSentence (const char *data, int len) |
process GSA sentence | |
void | processGstSentence (const char *data, int len) |
process GST sentence | |
void | processGsvSentence (const char *data, int len) |
process GSV sentence | |
void | processHchdgSentence (const char *data, int len) |
process HCHDG sentence | |
void | processHdtSentence (const char *data, int len) |
process HDT sentence | |
void | processRmcSentence (const char *data, int len) |
process RMC sentence | |
void | processStringBuffer () |
Splits mStringBuffer into sentences and calls libnmea. | |
void | processVtgSentence (const char *data, int len) |
process VTG sentence | |
Protected Attributes | |
QString | mStringBuffer |
Store data from the device before it is processed. | |
Protected Attributes inherited from QgsGpsConnection | |
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. | |
Additional Inherited Members | |
Public Types inherited from QgsGpsConnection | |
enum | Status { NotConnected , Connected , DataReceived , GPSDataReceived } |
Signals inherited from QgsGpsConnection | |
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. | |
Static Public Attributes inherited from QgsGpsConnection | |
static const QgsSettingsEntryInteger * | settingGpsAcquisitionInterval = new QgsSettingsEntryInteger( QStringLiteral( "acquisition-interval" ), QgsSettingsTree::sTreeGps, 0, QStringLiteral( "GPS track point acquisition interval" ) ) |
Settings entry GPS track point acquisition interval. | |
static const QgsSettingsEntryBool * | settingGpsApplyLeapSecondsCorrection = new QgsSettingsEntryBool( QStringLiteral( "apply-leap-seconds-correction" ), QgsSettingsTree::sTreeGps, true, QStringLiteral( "Whether leap seconds corrections should be applied to GPS timestamps" ) ) |
Settings entry GPS apply leap seconds correction. | |
static const QgsSettingsEntryBool * | settingGpsBearingFromTravelDirection = new QgsSettingsEntryBool( QStringLiteral( "calculate-bearing-from-travel" ), QgsSettingsTree::sTreeGps, false, QStringLiteral( "Calculate GPS bearing from travel direction" ) ) |
Settings entry GPS calculate bearing from travel direction. | |
static const QgsSettingsEntryDouble * | settingGpsDistanceThreshold = new QgsSettingsEntryDouble( QStringLiteral( "distance-threshold" ), QgsSettingsTree::sTreeGps, 0, QStringLiteral( "GPS track point distance threshold" ) ) |
Settings entry GPS track point distance threshold. | |
static const QgsSettingsEntryInteger * | settingGpsLeapSeconds = new QgsSettingsEntryInteger( QStringLiteral( "leap-seconds" ), QgsSettingsTree::sTreeGps, 18, QStringLiteral( "Leap seconds correction amount (in seconds)" ) ) |
Settings entry GPS leap seconds correction amount (in seconds) | |
static const QgsSettingsEntryEnumFlag< Qgis::GpsConnectionType > * | settingsGpsConnectionType = new QgsSettingsEntryEnumFlag<Qgis::GpsConnectionType>( QStringLiteral( "gps-connection-type" ), QgsSettingsTree::sTreeGps, Qgis::GpsConnectionType::Automatic, QStringLiteral( "GPS connection type" ) ) |
Settings entry GPS connection type. | |
static const QgsSettingsEntryString * | settingsGpsdDeviceName = new QgsSettingsEntryString( QStringLiteral( "gpsd-device-name" ), QgsSettingsTree::sTreeGps, QString(), QStringLiteral( "GPSD connection device name" ) ) |
Settings entry GPSD device name. | |
static const QgsSettingsEntryString * | settingsGpsdHostName = new QgsSettingsEntryString( QStringLiteral( "gpsd-host-name" ), QgsSettingsTree::sTreeGps, QString(), QStringLiteral( "GPSD connection host name" ) ) |
Settings entry GPSD host name. | |
static const QgsSettingsEntryInteger * | settingsGpsdPortNumber = new QgsSettingsEntryInteger( QStringLiteral( "gpsd-port" ), QgsSettingsTree::sTreeGps, 2947, QStringLiteral( "GPSD port number" ) ) |
Settings entry GPSD port number. | |
static const QgsSettingsEntryString * | settingsGpsSerialDevice = new QgsSettingsEntryString( QStringLiteral( "gpsd-serial-device" ), QgsSettingsTree::sTreeGps, QString(), QStringLiteral( "GPS serial device name" ) ) |
Settings entry GPS serial device name. | |
static const QgsSettingsEntryInteger * | settingsGpsTimeStampOffsetFromUtc = new QgsSettingsEntryInteger( QStringLiteral( "timestamp-offset-from-utc" ), QgsSettingsTree::sTreeGps, 0, QStringLiteral( "GPS time stamp offset from UTC (in seconds)" ) ) |
Settings entry GPS time offset from UTC in seconds. | |
static const QgsSettingsEntryEnumFlag< Qt::TimeSpec > * | settingsGpsTimeStampSpecification = new QgsSettingsEntryEnumFlag<Qt::TimeSpec>( QStringLiteral( "timestamp-time-spec" ), QgsSettingsTree::sTreeGps, Qt::TimeSpec::LocalTime, QStringLiteral( "GPS time stamp specification" ) ) |
Settings entry time specification for GPS time stamps. | |
static const QgsSettingsEntryString * | settingsGpsTimeStampTimeZone = new QgsSettingsEntryString( QStringLiteral( "timestamp-time-zone" ), QgsSettingsTree::sTreeGps, QString(), QStringLiteral( "GPS time stamp time zone" ) ) |
Settings entry GPS time stamp time zone. | |
Evaluates NMEA sentences coming from a GPS device.
Definition at line 28 of file qgsnmeaconnection.h.
QgsNmeaConnection::QgsNmeaConnection | ( | QIODevice * | device | ) |
Constructs a QgsNmeaConnection with given device.
Ownership of device is transferred to the connection.
Definition at line 38 of file qgsnmeaconnection.cpp.
|
overrideprotectedslot |
Parse available data source content.
Definition at line 43 of file qgsnmeaconnection.cpp.
|
protected |
process GGA sentence
Definition at line 185 of file qgsnmeaconnection.cpp.
|
protected |
process GSA sentence
Definition at line 474 of file qgsnmeaconnection.cpp.
|
protected |
process GST sentence
Definition at line 234 of file qgsnmeaconnection.cpp.
|
protected |
process GSV sentence
Definition at line 386 of file qgsnmeaconnection.cpp.
|
protected |
process HCHDG sentence
Definition at line 262 of file qgsnmeaconnection.cpp.
|
protected |
process HDT sentence
Definition at line 253 of file qgsnmeaconnection.cpp.
|
protected |
process RMC sentence
Definition at line 275 of file qgsnmeaconnection.cpp.
|
protected |
Splits mStringBuffer into sentences and calls libnmea.
Definition at line 86 of file qgsnmeaconnection.cpp.
|
protected |
process VTG sentence
Definition at line 463 of file qgsnmeaconnection.cpp.
|
protected |
Store data from the device before it is processed.
Definition at line 46 of file qgsnmeaconnection.h.