PySide6.QtPositioning.QNmeaPositionInfoSource¶
- class QNmeaPositionInfoSource¶
- The - QNmeaPositionInfoSourceclass provides positional information using a 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 - QNmeaPositionInfoSourceclass reads NMEA data and uses it to provide positional data in the form of- QGeoPositionInfoobjects.- A - QNmeaPositionInfoSourceinstance operates in either- RealTimeModeor- SimulationMode. These modes allow NMEA data to be read from either a live source of positional data, or replayed for simulation purposes from previously recorded NMEA data.- The source of NMEA data is set with - setDevice().- Use - startUpdates()to start receiving regular position updates and- stopUpdates()to stop these updates. If you only require updates occasionally, you can call- requestUpdate()to request a single update.- In both cases the position information is received via the - positionUpdated()signal and the last known position can be accessed with- lastKnownPosition().- QNmeaPositionInfoSourcesupports reporting the accuracy of the horizontal and vertical position. To enable position accuracy reporting an estimate of the User Equivalent Range Error associated with the NMEA source must be set with- setUserEquivalentRangeError().- class UpdateMode¶
- Defines the available update modes. - Constant - Description - QNmeaPositionInfoSource.RealTimeMode - Positional data is read and distributed from the data source as it becomes available. Use this mode if you are using a live source of positional data (for example, a GPS hardware device). - QNmeaPositionInfoSource.SimulationMode - The data and time information in the NMEA source data is used to provide positional updates at the rate at which the data was originally recorded. Use this mode if the data source contains previously recorded NMEA data and you want to replay the data for simulation purposes. 
 - __init__(updateMode[, parent=None])¶
- Parameters:
- updateMode – - UpdateMode
- parent – - QObject
 
 
 - Constructs a - QNmeaPositionInfoSourceinstance with the given- parentand- updateMode.- Returns the NMEA data source. - See also - parsePosInfoFromNmeaData(data, posInfo, hasFix)¶
- Parameters:
- data – - QByteArrayView
- posInfo – - QGeoPositionInfo
- hasFix – bool 
 
- Return type:
- bool 
 
 - parsePosInfoFromNmeaData(data, size, posInfo, hasFix)
- Parameters:
- data – str 
- size – int 
- posInfo – - QGeoPositionInfo
- hasFix – bool 
 
- Return type:
- bool 
 
 - Parses an NMEA sentence string into a - QGeoPositionInfo.- The default implementation will parse standard NMEA sentences. This method should be reimplemented in a subclass whenever the need to deal with non-standard NMEA sentences arises. - The parser reads - sizebytes from- dataand uses that information to setup- posInfoand- hasFix. If- hasFixis set to false then- posInfomay contain only the time or the date and the time.- Returns true if the sentence was successfully parsed, otherwise returns false and should not modifiy - posInfoor- hasFix.- 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()or- requestUpdate().- Note - The - devicemust emit QIODevice::readyRead() for the source to be notified when data is available for reading.- QNmeaPositionInfoSourcedoes not assume the ownership of the device, and hence does not deallocate it upon destruction.- See also - setUserEquivalentRangeError(uere)¶
- Parameters:
- uere – float 
 
 - Sets the User Equivalent Range Error (UERE) to - uere. The UERE is used in calculating an estimate of the accuracy of the position information reported by the position info source. The UERE should be set to a value appropriate for the GPS device which generated the NMEA stream.- The true UERE value is calculated from multiple error sources including errors introduced by the satellites and signal propogation delays through the atmosphere as well as errors introduced by the receiving GPS equipment. For details on GPS accuracy see Sam J. Wormley, GPS Errors & Estimating Your Reveiver’s Accuracy . - A typical value for UERE is approximately 5.1. - See also - updateMode()¶
- Return type:
 
 - Returns the update mode. - userEquivalentRangeError()¶
- Return type:
- float 
 
 - Returns the current User Equivalent Range Error (UERE). The UERE is used in calculating an estimate of the accuracy of the position information reported by the position info source. The default value is NaN which means no accuracy information will be provided. - See also