Skip to content
Permalink
Browse files

also fix method capitalization

  • Loading branch information
3nids committed Jan 15, 2018
1 parent 7a1e4bd commit 51654afc0665159d9f01bc3ebbaa7c372e5bd11e
Showing with 52 additions and 24 deletions.
  1. +25 −6 python/core/gps/qgsnmeaconnection.sip
  2. +12 −12 src/core/gps/qgsnmeaconnection.cpp
  3. +15 −6 src/core/gps/qgsnmeaconnection.h
@@ -21,7 +21,11 @@ Evaluates NMEA sentences coming from a GPS device
#include "qgsnmeaconnection.h"
%End
public:
QgsNmeaConnection( QIODevice *dev );

QgsNmeaConnection( QIODevice *device );
%Docstring
Constructs a QgsNmeaConnection with given ``device``.
%End

protected slots:
virtual void parseData();
@@ -35,11 +39,26 @@ Parse available data source content
%Docstring
Splits mStringBuffer into sentences and calls libnmea
%End
void processGGASentence( const char *data, int len );
void processRMCSentence( const char *data, int len );
void processGSVSentence( const char *data, int len );
void processVTGSentence( const char *data, int len );
void processGSASentence( const char *data, int len );
void processGgaSentence( const char *data, int len );
%Docstring
process GGA sentence
%End
void processRmcSentence( const char *data, int len );
%Docstring
process RMC sentence
%End
void processGsvSentence( const char *data, int len );
%Docstring
process GSV sentence
%End
void processVtgSentence( const char *data, int len );
%Docstring
process VTG sentence
%End
void processGsaSentence( const char *data, int len );
%Docstring
process GSA sentence
%End
};

/************************************************************************
@@ -31,8 +31,8 @@

#define KNOTS_TO_KMH 1.852

QgsNmeaConnection::QgsNmeaConnection( QIODevice *dev )
: QgsGpsConnection( dev )
QgsNmeaConnection::QgsNmeaConnection( QIODevice *device )
: QgsGpsConnection( device )
{
}

@@ -95,35 +95,35 @@ void QgsNmeaConnection::processStringBuffer()
if ( substring.startsWith( QLatin1String( "$GPGGA" ) ) )
{
QgsDebugMsg( substring );
processGGASentence( ba.data(), ba.length() );
processGgaSentence( ba.data(), ba.length() );
mStatus = GPSDataReceived;
QgsDebugMsg( "*******************GPS data received****************" );
}
else if ( substring.startsWith( QLatin1String( "$GPRMC" ) ) || substring.startsWith( QLatin1String( "$GNRMC" ) ) )
{
QgsDebugMsg( substring );
processRMCSentence( ba.data(), ba.length() );
processRmcSentence( ba.data(), ba.length() );
mStatus = GPSDataReceived;
QgsDebugMsg( "*******************GPS data received****************" );
}
else if ( substring.startsWith( QLatin1String( "$GPGSV" ) ) )
{
QgsDebugMsg( substring );
processGSVSentence( ba.data(), ba.length() );
processGsvSentence( ba.data(), ba.length() );
mStatus = GPSDataReceived;
QgsDebugMsg( "*******************GPS data received****************" );
}
else if ( substring.startsWith( QLatin1String( "$GPVTG" ) ) )
{
QgsDebugMsg( substring );
processVTGSentence( ba.data(), ba.length() );
processVtgSentence( ba.data(), ba.length() );
mStatus = GPSDataReceived;
QgsDebugMsg( "*******************GPS data received****************" );
}
else if ( substring.startsWith( QLatin1String( "$GPGSA" ) ) )
{
QgsDebugMsg( substring );
processGSASentence( ba.data(), ba.length() );
processGsaSentence( ba.data(), ba.length() );
mStatus = GPSDataReceived;
QgsDebugMsg( "*******************GPS data received****************" );
}
@@ -134,7 +134,7 @@ void QgsNmeaConnection::processStringBuffer()
}
}

void QgsNmeaConnection::processGGASentence( const char *data, int len )
void QgsNmeaConnection::processGgaSentence( const char *data, int len )
{
nmeaGPGGA result;
if ( nmea_parse_GPGGA( data, len, &result ) )
@@ -159,7 +159,7 @@ void QgsNmeaConnection::processGGASentence( const char *data, int len )
}
}

void QgsNmeaConnection::processRMCSentence( const char *data, int len )
void QgsNmeaConnection::processRmcSentence( const char *data, int len )
{
nmeaGPRMC result;
if ( nmea_parse_GPRMC( data, len, &result ) )
@@ -196,7 +196,7 @@ void QgsNmeaConnection::processRMCSentence( const char *data, int len )
}
}

void QgsNmeaConnection::processGSVSentence( const char *data, int len )
void QgsNmeaConnection::processGsvSentence( const char *data, int len )
{
nmeaGPGSV result;
if ( nmea_parse_GPGSV( data, len, &result ) )
@@ -225,7 +225,7 @@ void QgsNmeaConnection::processGSVSentence( const char *data, int len )
}
}

void QgsNmeaConnection::processVTGSentence( const char *data, int len )
void QgsNmeaConnection::processVtgSentence( const char *data, int len )
{
nmeaGPVTG result;
if ( nmea_parse_GPVTG( data, len, &result ) )
@@ -234,7 +234,7 @@ void QgsNmeaConnection::processVTGSentence( const char *data, int len )
}
}

void QgsNmeaConnection::processGSASentence( const char *data, int len )
void QgsNmeaConnection::processGsaSentence( const char *data, int len )
{
nmeaGPGSA result;
if ( nmea_parse_GPGSA( data, len, &result ) )
@@ -30,7 +30,11 @@ class CORE_EXPORT QgsNmeaConnection: public QgsGpsConnection
{
Q_OBJECT
public:
QgsNmeaConnection( QIODevice *dev );

/**
* @brief Constructs a QgsNmeaConnection with given \a device.
*/
QgsNmeaConnection( QIODevice *device );

protected slots:
//! Parse available data source content
@@ -42,11 +46,16 @@ class CORE_EXPORT QgsNmeaConnection: public QgsGpsConnection
//! Splits mStringBuffer into sentences and calls libnmea
void processStringBuffer();
//handle the different sentence type
void processGGASentence( const char *data, int len );
void processRMCSentence( const char *data, int len );
void processGSVSentence( const char *data, int len );
void processVTGSentence( const char *data, int len );
void processGSASentence( const char *data, int len );
//! process GGA sentence
void processGgaSentence( const char *data, int len );
//! process RMC sentence
void processRmcSentence( const char *data, int len );
//! process GSV sentence
void processGsvSentence( const char *data, int len );
//! process VTG sentence
void processVtgSentence( const char *data, int len );
//! process GSA sentence
void processGsaSentence( const char *data, int len );
};

#endif // QGSNMEACONNECTION_H

0 comments on commit 51654af

Please sign in to comment.
You can’t perform that action at this time.