Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QNmeaPositionInfoSource Class Reference

The QNmeaPositionInfoSource class provides positional information using a NMEA data source. More...

 #include <QNmeaPositionInfoSource>

Inherits: QGeoPositionInfoSource.

This class was introduced in Qt Mobility 1.0.

Public Types

enum UpdateMode { RealTimeMode, SimulationMode }

Public Functions

QNmeaPositionInfoSource ( UpdateMode updateMode, QObject * parent = 0 )
~QNmeaPositionInfoSource ()
QIODevice * device () const
void setDevice ( QIODevice * device )
UpdateMode updateMode () const

Reimplemented Public Functions

virtual QGeoPositionInfo lastKnownPosition ( bool fromSatellitePositioningMethodsOnly = false ) const
virtual int minimumUpdateInterval () const
virtual void setUpdateInterval ( int msec )
virtual PositioningMethods supportedPositioningMethods () const

Public Slots

virtual void requestUpdate ( int msec = 0 )
virtual void startUpdates ()
virtual void stopUpdates ()

Protected Functions

virtual bool parsePosInfoFromNmeaData ( const char * data, int size, QGeoPositionInfo * posInfo, bool * hasFix )
  • 7 protected functions inherited from QObject

Additional Inherited Members

Detailed Description

The QNmeaPositionInfoSource 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 QNmeaPositionInfoSource class reads NMEA data and uses it to provide positional data in the form of QGeoPositionInfo objects.

A QNmeaPositionInfoSource 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.

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().

Member Type Documentation

enum QNmeaPositionInfoSource::UpdateMode

Defines the available update modes.

ConstantValueDescription
QNmeaPositionInfoSource::RealTimeMode1Positional 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::SimulationMode2The 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.

Member Function Documentation

QNmeaPositionInfoSource::QNmeaPositionInfoSource ( UpdateMode updateMode, QObject * parent = 0 )

Constructs a QNmeaPositionInfoSource instance with the given parent and updateMode.

This function was introduced in Qt Mobility 1.0.

QNmeaPositionInfoSource::~QNmeaPositionInfoSource ()

Destroys the position source.

QIODevice * QNmeaPositionInfoSource::device () const

Returns the NMEA data source.

This function was introduced in Qt Mobility 1.0.

See also setDevice().

QGeoPositionInfo QNmeaPositionInfoSource::lastKnownPosition ( bool fromSatellitePositioningMethodsOnly = false ) const [virtual]

Reimplemented from QGeoPositionInfoSource::lastKnownPosition().

This function was introduced in Qt Mobility 1.0.

int QNmeaPositionInfoSource::minimumUpdateInterval () const [virtual]

Reimplemented from QGeoPositionInfoSource::minimumUpdateInterval().

This function was introduced in Qt Mobility 1.0.

bool QNmeaPositionInfoSource::parsePosInfoFromNmeaData ( const char * data, int size, QGeoPositionInfo * posInfo, bool * hasFix ) [virtual protected]

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 size bytes from data and uses that information to setup posInfo and hasFix. If hasFix is set to false then posInfo may contain only the time or the date and the time.

Returns true if the sentence was succsesfully parsed, otherwise returns false and should not modifiy posInfo or hasFix.

This function was introduced in Qt Mobility 1.0.

void QNmeaPositionInfoSource::requestUpdate ( int msec = 0 ) [virtual slot]

Reimplemented from QGeoPositionInfoSource::requestUpdate().

This function was introduced in Qt Mobility 1.0.

void QNmeaPositionInfoSource::setDevice ( QIODevice * device )

Sets the NMEA data source to device. 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: The device must emit QIODevice::readyRead() for the source to be notified when data is available for reading. QNmeaPositionInfoSource does not assume the ownership of the device, and hence does not deallocate it upon destruction.

This function was introduced in Qt Mobility 1.0.

See also device().

void QNmeaPositionInfoSource::setUpdateInterval ( int msec ) [virtual]

Reimplemented from QGeoPositionInfoSource::setUpdateInterval().

This function was introduced in Qt Mobility 1.0.

void QNmeaPositionInfoSource::startUpdates () [virtual slot]

Reimplemented from QGeoPositionInfoSource::startUpdates().

This function was introduced in Qt Mobility 1.0.

void QNmeaPositionInfoSource::stopUpdates () [virtual slot]

Reimplemented from QGeoPositionInfoSource::stopUpdates().

This function was introduced in Qt Mobility 1.0.

PositioningMethods QNmeaPositionInfoSource::supportedPositioningMethods () const [virtual]

Reimplemented from QGeoPositionInfoSource::supportedPositioningMethods().

This function was introduced in Qt Mobility 1.0.

UpdateMode QNmeaPositionInfoSource::updateMode () const

Returns the update mode.

This function was introduced in Qt Mobility 1.0.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 94
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 43
  4. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Qt Commercial : Digia organise un webinar gratuit le 27 mars sur la conception d'interfaces utilisateur et d'applications avec le framework 0
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 9
Page suivante

Le blog Digia au hasard

Logo

Déploiement d'applications Qt Commercial sur les tablettes Windows 8

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtmobility-1.2
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web