Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QNmeaWhereabouts class provides positional information using a NMEA data source. More...
#include <QNmeaWhereabouts>
Inherits QWhereabouts.
The QNmeaWhereabouts class provides positional information using a NMEA data source.
NMEA is a commonly used protocol for the specification of one's global position at a certain point in time. The QNmeaWhereabouts class reads NMEA data and uses it to provide positional data in the form of QWhereaboutsUpdate objects.
A QNmeaWhereabouts instance operates in either RealTimeMode or 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.
Use setUpdateMode() to define the update mode, and setSourceDevice() to set the source of NMEA data.
Use startUpdates() to receive regular position updates through the updated() signal, and stopUpdates() to stop these updates. If you only require updates occasionally, you can call requestUpdate() as required, instead of startUpdates() and stopUpdates().
Defines the available update modes.
Constant | Value | Description |
---|---|---|
QNmeaWhereabouts::InvalidMode | 0 | Updates cannot be provided in this mode. This is the default mode. |
QNmeaWhereabouts::RealTimeMode | 1 | 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). |
QNmeaWhereabouts::SimulationMode | 2 | 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. if the data source contains previously recorded NMEA data and you want to replay the data for simulation purposes. |
Constructs a QNmeaWhereabouts instance with the given parent with the update mode set to QNmeaWhereabouts::InvalidMode.
Constructs a QNmeaWhereabouts instance with the given parent and updateMode.
Destroys the whereabouts instance.
Notifies the object that new data is available for reading from the source device.
Usually you do not need to call this function. It is only necessary if the source device does not emit QIODevice::readyRead().
See also setSourceDevice() and QSocketNotifier.
Requests that updated() be emitted with the current whereabouts if possible. This can be called regardless of whether startUpdates() has already been called.
This is useful if you need to retrieve the current whereabouts but you do not need the periodic updates offered by startUpdates(). Calling this method will result in only a single updated() signal.
If the state is currently QWhereabouts::NotAvailable, the object will first be initialized and will then provide an update when it is in the QWhereabouts::PositionFixAcquired state.
Reimplemented from QWhereabouts.
See also startUpdates() and lastUpdate().
Sets the NMEA data source to source. If the device is not open, it will be opened in QIODevice::ReadOnly mode.
The source device can only be set once and must be set before calling startUpdates() or requestUpdate().
Note: If source does not emit QIODevice::readyRead() — for example, if it is a QFile object — you must call newDataAvailable() when data is available for reading.
See also sourceDevice().
Sets the update mode to mode.
The update mode can only be set once and must be set before calling startUpdates() or requestUpdate().
See also updateMode().
Returns the NMEA data source.
See also setSourceDevice().
Starts emitting updated() with the interval specified by updateInterval(), or less frequently if updates are not available at a particular time. If updateInterval() is 0, updated() is emitted as soon as a valid update becomes available.
If startUpdates() has already been called, this restarts with updateInterval() as the new update interval.
If the state is currently QWhereabouts::NotAvailable, the object will first be initialized and will begin to provide updates once it is in the QWhereabouts::PositionFixAcquired state.
Reimplemented from QWhereabouts.
Stops emitting updated() at regular intervals.
Reimplemented from QWhereabouts.
See also startUpdates().
Returns the update mode. The default mode is QNmeaWhereabouts::InvalidMode.
See also setUpdateMode().
Copyright © 2009 Nokia | Trademarks | Qt Extended 4.4.3 |