QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
QgsNmeaConnection Class Reference

Evaluates NMEA sentences coming from a GPS device. More...

#include <qgsnmeaconnection.h>

Inheritance diagram for QgsNmeaConnection:
Inheritance graph
[legend]

Public Member Functions

 QgsNmeaConnection (QIODevice *device)
 Constructs a QgsNmeaConnection with given device. More...
 
- Public Member Functions inherited from QgsGpsConnection
 QgsGpsConnection (QIODevice *dev)
 Constructor. More...
 
 ~QgsGpsConnection () override
 
bool close ()
 Closes connection to device. More...
 
bool connect ()
 Opens connection to device. More...
 
QgsGpsInformation currentGPSInformation () const
 Returns the current gps information (lat, lon, etc.) More...
 
QgsPoint lastValidLocation () const
 Returns the last valid location obtained by the device. More...
 
void setSource (QIODevice *source)
 Sets the GPS source. The class takes ownership of the device class. More...
 
Status status () const
 Returns the status. Possible state are not connected, connected, data received. More...
 

Protected Slots

void parseData () override
 Parse available data source content. More...
 
- Protected Slots inherited from QgsGpsConnection
virtual void parseData ()=0
 Parse available data source content. More...
 

Protected Member Functions

void processGgaSentence (const char *data, int len)
 process GGA sentence More...
 
void processGsaSentence (const char *data, int len)
 process GSA sentence More...
 
void processGstSentence (const char *data, int len)
 process GST sentence More...
 
void processGsvSentence (const char *data, int len)
 process GSV sentence More...
 
void processHchdgSentence (const char *data, int len)
 process HCHDG sentence More...
 
void processHchdtSentence (const char *data, int len)
 process HCHDT sentence More...
 
void processHdtSentence (const char *data, int len)
 process HDT sentence More...
 
void processRmcSentence (const char *data, int len)
 process RMC sentence More...
 
void processStringBuffer ()
 Splits mStringBuffer into sentences and calls libnmea. More...
 
void processVtgSentence (const char *data, int len)
 process VTG sentence More...
 

Protected Attributes

QString mStringBuffer
 Store data from the device before it is processed. More...
 
- Protected Attributes inherited from QgsGpsConnection
QgsGpsInformation mLastGPSInformation
 Last state of the gps related variables (e.g. position, time, ...) More...
 
std::unique_ptr< QIODevice > mSource
 Data source (e.g. serial device, socket, file,...) More...
 
Status mStatus = NotConnected
 Connection status. More...
 

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. More...
 
void nmeaSentenceReceived (const QString &substring)
 Emitted whenever the GPS device receives a raw NMEA sentence. More...
 
void positionChanged (const QgsPoint &point)
 Emitted when the GPS position changes. More...
 
void stateChanged (const QgsGpsInformation &info)
 Emitted whenever the GPS state is changed. More...
 
- Static Public Attributes inherited from QgsGpsConnection
static const QgsSettingsEntryIntegersettingGpsAcquisitionInterval = new QgsSettingsEntryInteger( QStringLiteral( "acquisition-interval" ), QgsSettingsTree::sTreeGps, 0, QStringLiteral( "GPS track point acquisition interval" ) )
 Settings entry GPS track point acquisition interval. More...
 
static const QgsSettingsEntryBoolsettingGpsApplyLeapSecondsCorrection = 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. More...
 
static const QgsSettingsEntryBoolsettingGpsBearingFromTravelDirection = 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. More...
 
static const QgsSettingsEntryDoublesettingGpsDistanceThreshold = new QgsSettingsEntryDouble( QStringLiteral( "distance-threshold" ), QgsSettingsTree::sTreeGps, 0, QStringLiteral( "GPS track point distance threshold" ) )
 Settings entry GPS track point distance threshold. More...
 
static const QgsSettingsEntryIntegersettingGpsLeapSeconds = new QgsSettingsEntryInteger( QStringLiteral( "leap-seconds" ), QgsSettingsTree::sTreeGps, 18, QStringLiteral( "Leap seconds correction amount (in seconds)" ) )
 Settings entry GPS leap seconds correction amount (in seconds) More...
 
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. More...
 
static const QgsSettingsEntryStringsettingsGpsdDeviceName = new QgsSettingsEntryString( QStringLiteral( "gpsd-device-name" ), QgsSettingsTree::sTreeGps, QString(), QStringLiteral( "GPSD connection device name" ) )
 Settings entry GPSD device name. More...
 
static const QgsSettingsEntryStringsettingsGpsdHostName = new QgsSettingsEntryString( QStringLiteral( "gpsd-host-name" ), QgsSettingsTree::sTreeGps, QString(), QStringLiteral( "GPSD connection host name" ) )
 Settings entry GPSD host name. More...
 
static const QgsSettingsEntryIntegersettingsGpsdPortNumber = new QgsSettingsEntryInteger( QStringLiteral( "gpsd-port" ), QgsSettingsTree::sTreeGps, 2947, QStringLiteral( "GPSD port number" ) )
 Settings entry GPSD port number. More...
 
static const QgsSettingsEntryStringsettingsGpsSerialDevice = new QgsSettingsEntryString( QStringLiteral( "gpsd-serial-device" ), QgsSettingsTree::sTreeGps, QString(), QStringLiteral( "GPS serial device name" ) )
 Settings entry GPS serial device name. More...
 
static const QgsSettingsEntryIntegersettingsGpsTimeStampOffsetFromUtc = 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. More...
 
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. More...
 
static const QgsSettingsEntryStringsettingsGpsTimeStampTimeZone = new QgsSettingsEntryString( QStringLiteral( "timestamp-time-zone" ), QgsSettingsTree::sTreeGps, QString(), QStringLiteral( "GPS time stamp time zone" ) )
 Settings entry GPS time stamp time zone. More...
 

Detailed Description

Evaluates NMEA sentences coming from a GPS device.

Since
QGIS 1.4

Definition at line 29 of file qgsnmeaconnection.h.

Constructor & Destructor Documentation

◆ QgsNmeaConnection()

QgsNmeaConnection::QgsNmeaConnection ( QIODevice *  device)

Constructs a QgsNmeaConnection with given device.

Ownership of device is transferred to the connection.

Definition at line 36 of file qgsnmeaconnection.cpp.

Member Function Documentation

◆ parseData

void QgsNmeaConnection::parseData ( )
overrideprotectedslot

Parse available data source content.

Definition at line 41 of file qgsnmeaconnection.cpp.

◆ processGgaSentence()

void QgsNmeaConnection::processGgaSentence ( const char *  data,
int  len 
)
protected

process GGA sentence

Definition at line 180 of file qgsnmeaconnection.cpp.

◆ processGsaSentence()

void QgsNmeaConnection::processGsaSentence ( const char *  data,
int  len 
)
protected

process GSA sentence

Definition at line 458 of file qgsnmeaconnection.cpp.

◆ processGstSentence()

void QgsNmeaConnection::processGstSentence ( const char *  data,
int  len 
)
protected

process GST sentence

Definition at line 229 of file qgsnmeaconnection.cpp.

◆ processGsvSentence()

void QgsNmeaConnection::processGsvSentence ( const char *  data,
int  len 
)
protected

process GSV sentence

Definition at line 373 of file qgsnmeaconnection.cpp.

◆ processHchdgSentence()

void QgsNmeaConnection::processHchdgSentence ( const char *  data,
int  len 
)
protected

process HCHDG sentence

Definition at line 257 of file qgsnmeaconnection.cpp.

◆ processHchdtSentence()

void QgsNmeaConnection::processHchdtSentence ( const char *  data,
int  len 
)
protected

process HCHDT sentence

Definition at line 270 of file qgsnmeaconnection.cpp.

◆ processHdtSentence()

void QgsNmeaConnection::processHdtSentence ( const char *  data,
int  len 
)
protected

process HDT sentence

Definition at line 248 of file qgsnmeaconnection.cpp.

◆ processRmcSentence()

void QgsNmeaConnection::processRmcSentence ( const char *  data,
int  len 
)
protected

process RMC sentence

Definition at line 279 of file qgsnmeaconnection.cpp.

◆ processStringBuffer()

void QgsNmeaConnection::processStringBuffer ( )
protected

Splits mStringBuffer into sentences and calls libnmea.

Definition at line 75 of file qgsnmeaconnection.cpp.

◆ processVtgSentence()

void QgsNmeaConnection::processVtgSentence ( const char *  data,
int  len 
)
protected

process VTG sentence

Definition at line 447 of file qgsnmeaconnection.cpp.

Member Data Documentation

◆ mStringBuffer

QString QgsNmeaConnection::mStringBuffer
protected

Store data from the device before it is processed.

Definition at line 47 of file qgsnmeaconnection.h.


The documentation for this class was generated from the following files: