Skip to content

Commit

Permalink
also fix method capitalization
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jan 15, 2018
1 parent 7a1e4bd commit 51654af
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 24 deletions.
31 changes: 25 additions & 6 deletions python/core/gps/qgsnmeaconnection.sip
Expand Up @@ -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();
Expand All @@ -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
};

/************************************************************************
Expand Down
24 changes: 12 additions & 12 deletions src/core/gps/qgsnmeaconnection.cpp
Expand Up @@ -31,8 +31,8 @@

#define KNOTS_TO_KMH 1.852

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

Expand Down Expand Up @@ -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****************" );
}
Expand All @@ -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 ) )
Expand All @@ -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 ) )
Expand Down Expand Up @@ -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 ) )
Expand Down Expand Up @@ -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 ) )
Expand All @@ -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 ) )
Expand Down
21 changes: 15 additions & 6 deletions src/core/gps/qgsnmeaconnection.h
Expand Up @@ -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
Expand All @@ -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.