Class: QgsGpsConnection

class qgis.core.QgsGpsConnection

Bases: PyQt5.QtCore.QObject

Abstract base class for connection to a GPS device

QgsGpsConnection(dev: QIODevice) Constructor

Parameters:

dev

input device for the connection (e.g. serial device). The class takes ownership of the object

Methods

childEvent

close

Closes connection to device

connect

Opens connection to device

connectNotify

currentGPSInformation

Returns the current gps information (lat, lon, etc.)

customEvent

disconnectNotify

isSignalConnected

parseData

Parse available data source content

receivers

sender

senderSignalIndex

setSource

Sets the GPS source.

status

Returns the status.

timerEvent

Signals

nmeaSentenceReceived

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

stateChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

Attributes

Connected

DataReceived

GPSDataReceived

NotConnected

Connected = 1
DataReceived = 2
GPSDataReceived = 3
NotConnected = 0
class Status

Bases: int

childEvent(self, QChildEvent)
close(self) bool

Closes connection to device

Return type:

bool

connect(self) bool

Opens connection to device

Return type:

bool

connectNotify(self, QMetaMethod)
currentGPSInformation(self) QgsGpsInformation

Returns the current gps information (lat, lon, etc.)

Return type:

QgsGpsInformation

customEvent(self, QEvent)
disconnectNotify(self, QMetaMethod)
isSignalConnected(self, QMetaMethod) bool
nmeaSentenceReceived

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

parseData(self)

Parse available data source content

receivers(self, PYQT_SIGNAL) int
sender(self) QObject
senderSignalIndex(self) int
setSource(self, source: QIODevice)

Sets the GPS source. The class takes ownership of the device class

Parameters:

source (QIODevice) –

stateChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

status(self) QgsGpsConnection.Status

Returns the status. Possible state are not connected, connected, data received

Return type:

QgsGpsConnection.Status

timerEvent(self, QTimerEvent)