PySide6.QtPositioning.QNmeaSatelliteInfoSource¶
- class QNmeaSatelliteInfoSource¶
The
QNmeaSatelliteInfoSourceclass provides satellite information using an NMEA data source. More…Synopsis¶
Methods¶
def
__init__()def
device()def
setDevice()def
setError()def
updateMode()
Virtual methods¶
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
NMEA is a commonly used protocol for the specification of one’s global position at a certain point in time. The
QNmeaSatelliteInfoSourceclass reads NMEA data and uses it to provide information about satellites in view and satellites in use in form of lists ofQGeoSatelliteInfoobjects.A
QNmeaSatelliteInfoSourceinstance operates in eitherRealTimeModeorSimulationMode. These modes allow NMEA data to be read from either a live source of data, or replayed for simulation purposes from previously recorded NMEA data.The source of NMEA data is set via
setDevice().Use
startUpdates()to start receiving regular satellite information updates andstopUpdates()to stop these updates. If you only require updates occasionally, you can callrequestUpdate()to request a single update of both satellites in view and satellites in use.The information about satellites in view is received via the
satellitesInViewUpdated()signal.The information about satellites in use is received via the
satellitesInUseUpdated()signal.- class UpdateMode¶
Defines the available update modes.
Constant
Description
QNmeaSatelliteInfoSource.UpdateMode.UpdateMode.RealTimeMode
Satellite information is read and distributed from the data source as it becomes available. Use this mode if you are using a live source of NMEA data (for example a GPS hardware device).
QNmeaSatelliteInfoSource.UpdateMode.UpdateMode.SimulationMode
Satellite information is read and distributed from the data source at the given rate. The rate is determined by the SimulationUpdateInterval parameter. Use this mode if the data source contains previously recorded NMEA data and you want to replay the data for simulation purposes.
- class SatelliteInfoParseStatus¶
Defines the parse status of satellite information. The satellite information can be split into multiple sentences, and we need to parse all of them.
Constant
Description
QNmeaSatelliteInfoSource.SatelliteInfoParseStatus.NotParsed
The data does not contain information about satellites.
QNmeaSatelliteInfoSource.SatelliteInfoParseStatus.PartiallyParsed
A valid satellite information is received and parsed, but it’s not complete, so we need to wait for another NMEA sentence.
QNmeaSatelliteInfoSource.SatelliteInfoParseStatus.FullyParsed
Satellite information was fully collected and parsed.
- PySide6.QtPositioning.QNmeaSatelliteInfoSource.SimulationUpdateInterval¶
- __init__(mode[, parent=None])¶
- Parameters:
mode –
UpdateModeparent –
QObject
Constructs a
QNmeaSatelliteInfoSourceinstance with the givenparentandmode.Returns the NMEA data source.
See also
- parseSatelliteInfoFromNmea(data, infos, system)¶
- Parameters:
data –
QByteArrayViewinfos – .list of QGeoSatelliteInfo
system –
SatelliteSystem
- Return type:
- parseSatelliteInfoFromNmea(data, size, infos, system)
- Parameters:
data – str
size – int
infos – .list of QGeoSatelliteInfo
system –
SatelliteSystem
- Return type:
Parses an NMEA sentence string to extract the information about satellites in view.
The default implementation will parse standard NMEA $GPGSV sentences. This method should be reimplemented in a subclass whenever the need to deal with non-standard NMEA sentences arises.
The parser reads
sizebytes fromdataand uses that information to fillinfoslist.Returns
SatelliteInfoParseStatuswith parse result. Modifiesinfoslist in casePartiallyParsedorFullyParsedis returned. Also sets thesystemto correct satellite system type. This is required to determine the system type in case there are no satellites in view.- parseSatellitesInUseFromNmea(data, pnrsInUse)¶
- Parameters:
data –
QByteArrayViewpnrsInUse – .list of int
- Return type:
- parseSatellitesInUseFromNmea(data, size, pnrsInUse)
- Parameters:
data – str
size – int
pnrsInUse – .list of int
- Return type:
Parses an NMEA sentence string to extract the IDs of satelites in use.
The default implementation will parse standard NMEA $GPGSA sentences. This method should be reimplemented in a subclass whenever the need to deal with non-standard NMEA sentences arises.
The parser reads
sizebytes fromdataand uses that information to fillpnrsInUselist.Returns system type if the sentence was successfully parsed, otherwise returns
Undefinedand should not modifiypnrsInUse.Sets the NMEA data source to
device. If the device is not open, it will be opened in ReadOnly mode.The source device can only be set once and must be set before calling
startUpdates()orrequestUpdate().Note
The
devicemust emit QIODevice::readyRead() for the source to be notified when data is available for reading.QNmeaSatelliteInfoSourcedoes not assume the ownership of the device, and hence does not deallocate it upon destruction.See also
- updateMode()¶
- Return type:
Returns the update mode.