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
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ Evaluates NMEA sentences coming from a GPS device
#include "qgsnmeaconnection.h" #include "qgsnmeaconnection.h"
%End %End
public: public:
QgsNmeaConnection( QIODevice *dev );
QgsNmeaConnection( QIODevice *device );
%Docstring
Constructs a QgsNmeaConnection with given ``device``.
%End


protected slots: protected slots:
virtual void parseData(); virtual void parseData();
Expand All @@ -35,11 +39,26 @@ Parse available data source content
%Docstring %Docstring
Splits mStringBuffer into sentences and calls libnmea Splits mStringBuffer into sentences and calls libnmea
%End %End
void processGGASentence( const char *data, int len ); void processGgaSentence( const char *data, int len );
void processRMCSentence( const char *data, int len ); %Docstring
void processGSVSentence( const char *data, int len ); process GGA sentence
void processVTGSentence( const char *data, int len ); %End
void processGSASentence( const char *data, int len ); 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
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@


#define KNOTS_TO_KMH 1.852 #define KNOTS_TO_KMH 1.852


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


Expand Down Expand Up @@ -95,35 +95,35 @@ void QgsNmeaConnection::processStringBuffer()
if ( substring.startsWith( QLatin1String( "$GPGGA" ) ) ) if ( substring.startsWith( QLatin1String( "$GPGGA" ) ) )
{ {
QgsDebugMsg( substring ); QgsDebugMsg( substring );
processGGASentence( ba.data(), ba.length() ); processGgaSentence( ba.data(), ba.length() );
mStatus = GPSDataReceived; mStatus = GPSDataReceived;
QgsDebugMsg( "*******************GPS data received****************" ); QgsDebugMsg( "*******************GPS data received****************" );
} }
else if ( substring.startsWith( QLatin1String( "$GPRMC" ) ) || substring.startsWith( QLatin1String( "$GNRMC" ) ) ) else if ( substring.startsWith( QLatin1String( "$GPRMC" ) ) || substring.startsWith( QLatin1String( "$GNRMC" ) ) )
{ {
QgsDebugMsg( substring ); QgsDebugMsg( substring );
processRMCSentence( ba.data(), ba.length() ); processRmcSentence( ba.data(), ba.length() );
mStatus = GPSDataReceived; mStatus = GPSDataReceived;
QgsDebugMsg( "*******************GPS data received****************" ); QgsDebugMsg( "*******************GPS data received****************" );
} }
else if ( substring.startsWith( QLatin1String( "$GPGSV" ) ) ) else if ( substring.startsWith( QLatin1String( "$GPGSV" ) ) )
{ {
QgsDebugMsg( substring ); QgsDebugMsg( substring );
processGSVSentence( ba.data(), ba.length() ); processGsvSentence( ba.data(), ba.length() );
mStatus = GPSDataReceived; mStatus = GPSDataReceived;
QgsDebugMsg( "*******************GPS data received****************" ); QgsDebugMsg( "*******************GPS data received****************" );
} }
else if ( substring.startsWith( QLatin1String( "$GPVTG" ) ) ) else if ( substring.startsWith( QLatin1String( "$GPVTG" ) ) )
{ {
QgsDebugMsg( substring ); QgsDebugMsg( substring );
processVTGSentence( ba.data(), ba.length() ); processVtgSentence( ba.data(), ba.length() );
mStatus = GPSDataReceived; mStatus = GPSDataReceived;
QgsDebugMsg( "*******************GPS data received****************" ); QgsDebugMsg( "*******************GPS data received****************" );
} }
else if ( substring.startsWith( QLatin1String( "$GPGSA" ) ) ) else if ( substring.startsWith( QLatin1String( "$GPGSA" ) ) )
{ {
QgsDebugMsg( substring ); QgsDebugMsg( substring );
processGSASentence( ba.data(), ba.length() ); processGsaSentence( ba.data(), ba.length() );
mStatus = GPSDataReceived; mStatus = GPSDataReceived;
QgsDebugMsg( "*******************GPS data received****************" ); 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; nmeaGPGGA result;
if ( nmea_parse_GPGGA( data, len, &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; nmeaGPRMC result;
if ( nmea_parse_GPRMC( data, len, &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; nmeaGPGSV result;
if ( nmea_parse_GPGSV( data, len, &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; nmeaGPVTG result;
if ( nmea_parse_GPVTG( data, len, &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; nmeaGPGSA result;
if ( nmea_parse_GPGSA( data, len, &result ) ) if ( nmea_parse_GPGSA( data, len, &result ) )
Expand Down
21 changes: 15 additions & 6 deletions src/core/gps/qgsnmeaconnection.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ class CORE_EXPORT QgsNmeaConnection: public QgsGpsConnection
{ {
Q_OBJECT Q_OBJECT
public: public:
QgsNmeaConnection( QIODevice *dev );
/**
* @brief Constructs a QgsNmeaConnection with given \a device.
*/
QgsNmeaConnection( QIODevice *device );


protected slots: protected slots:
//! Parse available data source content //! Parse available data source content
Expand All @@ -42,11 +46,16 @@ class CORE_EXPORT QgsNmeaConnection: public QgsGpsConnection
//! Splits mStringBuffer into sentences and calls libnmea //! Splits mStringBuffer into sentences and calls libnmea
void processStringBuffer(); void processStringBuffer();
//handle the different sentence type //handle the different sentence type
void processGGASentence( const char *data, int len ); //! process GGA sentence
void processRMCSentence( const char *data, int len ); void processGgaSentence( const char *data, int len );
void processGSVSentence( const char *data, int len ); //! process RMC sentence
void processVTGSentence( const char *data, int len ); void processRmcSentence( const char *data, int len );
void processGSASentence( 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 #endif // QGSNMEACONNECTION_H

0 comments on commit 51654af

Please sign in to comment.