QGIS API Documentation 3.41.0-Master (181b2f43d8e)
Loading...
Searching...
No Matches
Public Member Functions | Protected Slots | List of all members
QgsQtLocationConnection Class Reference

A GPS connection subclass based on the Qt Location libraries. More...

#include <qgsqtlocationconnection.h>

Inheritance diagram for QgsQtLocationConnection:
Inheritance graph
[legend]

Public Member Functions

 QgsQtLocationConnection ()
 
- 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 broadcastConnectionAvailable ()
 Needed to make QtLocation detected.
 
void parseData () override
 Parse available data source content.
 
void positionUpdated (const QGeoPositionInfo &info)
 Called when the position updated.
 
void satellitesInUseUpdated (const QList< QGeoSatelliteInfo > &satellites)
 Called when the number of satellites in use is updated.
 
void satellitesInViewUpdated (const QList< QGeoSatelliteInfo > &satellites)
 Called when the number of satellites in view is updated.
 
- Protected Slots inherited from QgsGpsConnection
virtual void parseData ()=0
 Parse available data source content.
 

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 QgsSettingsEntryIntegersettingGpsAcquisitionInterval = new QgsSettingsEntryInteger( QStringLiteral( "acquisition-interval" ), QgsSettingsTree::sTreeGps, 0, QStringLiteral( "GPS track point acquisition interval" ) )
 Settings entry GPS track point acquisition interval.
 
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.
 
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.
 
static const QgsSettingsEntryDoublesettingGpsDistanceThreshold = new QgsSettingsEntryDouble( QStringLiteral( "distance-threshold" ), QgsSettingsTree::sTreeGps, 0, QStringLiteral( "GPS track point distance threshold" ) )
 Settings entry GPS track point distance threshold.
 
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)
 
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 QgsSettingsEntryStringsettingsGpsdDeviceName = new QgsSettingsEntryString( QStringLiteral( "gpsd-device-name" ), QgsSettingsTree::sTreeGps, QString(), QStringLiteral( "GPSD connection device name" ) )
 Settings entry GPSD device name.
 
static const QgsSettingsEntryStringsettingsGpsdHostName = new QgsSettingsEntryString( QStringLiteral( "gpsd-host-name" ), QgsSettingsTree::sTreeGps, QString(), QStringLiteral( "GPSD connection host name" ) )
 Settings entry GPSD host name.
 
static const QgsSettingsEntryIntegersettingsGpsdPortNumber = new QgsSettingsEntryInteger( QStringLiteral( "gpsd-port" ), QgsSettingsTree::sTreeGps, 2947, QStringLiteral( "GPSD port number" ) )
 Settings entry GPSD port number.
 
static const QgsSettingsEntryStringsettingsGpsSerialDevice = new QgsSettingsEntryString( QStringLiteral( "gpsd-serial-device" ), QgsSettingsTree::sTreeGps, QString(), QStringLiteral( "GPS serial device name" ) )
 Settings entry GPS serial device name.
 
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.
 
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 QgsSettingsEntryStringsettingsGpsTimeStampTimeZone = new QgsSettingsEntryString( QStringLiteral( "timestamp-time-zone" ), QgsSettingsTree::sTreeGps, QString(), QStringLiteral( "GPS time stamp time zone" ) )
 Settings entry GPS time stamp time zone.
 
- 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.
 

Detailed Description

A GPS connection subclass based on the Qt Location libraries.

Note
may not be available in Python bindings on all platforms

Definition at line 37 of file qgsqtlocationconnection.h.

Constructor & Destructor Documentation

◆ QgsQtLocationConnection()

QgsQtLocationConnection::QgsQtLocationConnection ( )

Definition at line 26 of file qgsqtlocationconnection.cpp.

Member Function Documentation

◆ broadcastConnectionAvailable

void QgsQtLocationConnection::broadcastConnectionAvailable ( )
protectedslot

Needed to make QtLocation detected.

Definition at line 42 of file qgsqtlocationconnection.cpp.

◆ parseData

void QgsQtLocationConnection::parseData ( )
overrideprotectedslot

Parse available data source content.

Definition at line 58 of file qgsqtlocationconnection.cpp.

◆ positionUpdated

void QgsQtLocationConnection::positionUpdated ( const QGeoPositionInfo &  info)
protectedslot

Called when the position updated.

Note
not available in Python bindings

Definition at line 52 of file qgsqtlocationconnection.cpp.

◆ satellitesInUseUpdated

void QgsQtLocationConnection::satellitesInUseUpdated ( const QList< QGeoSatelliteInfo > &  satellites)
protectedslot

Called when the number of satellites in use is updated.

Note
not available in Python bindings on android

Definition at line 131 of file qgsqtlocationconnection.cpp.

◆ satellitesInViewUpdated

void QgsQtLocationConnection::satellitesInViewUpdated ( const QList< QGeoSatelliteInfo > &  satellites)
protectedslot

Called when the number of satellites in view is updated.

Note
not available in Python bindings on android

Definition at line 111 of file qgsqtlocationconnection.cpp.


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