Skip to content
Permalink
Browse files

gps fixes

  • Loading branch information
3nids committed Jun 8, 2017
1 parent e545d44 commit 9e176feeac2c5be135474caf9c65dcc7854c6a4f
@@ -2072,7 +2072,8 @@ EXPAND_AS_DEFINED = "SIP_ABSTRACT" \
"SIP_SKIP" \
"SIP_TRANSFER" \
"SIP_TRANSFERBACK" \
"SIP_TRANSFERTHIS"
"SIP_TRANSFERTHIS" \
"SIP_WHEN_FEATURE"

# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
# remove all references to function-like macros that are alone on a line, have
@@ -51,6 +51,18 @@ class QgsGPSConnection : QObject

%TypeHeaderCode
#include "qgsgpsconnection.h"

#include <qgsgpsdconnection.h>
#include <qgsnmeaconnection.h>
%End

%ConvertToSubClassCode
if ( sipCpp->inherits( "QgsGpsdConnection" ) )
sipType = sipType_QgsGpsdConnection;
else if ( sipCpp->inherits( "QgsNMEAConnection" ) )
sipType = sipType_QgsNMEAConnection;
else
sipType = NULL;
%End
public:

@@ -43,6 +43,8 @@ Unregisters connection. The registry does no longer own the connection
:rtype: list of QgsGPSConnection
%End

private:
QgsGPSConnectionRegistry( const QgsGPSConnectionRegistry &rh );
};

/************************************************************************
@@ -11,17 +11,8 @@



QTM_USE_NAMESPACE
%Docstring
*************************************************************************
*
This program is free software; you can redistribute it and/or modify *
it under the terms of the GNU General Public License as published by *
the Free Software Foundation; either version 2 of the License, or *
(at your option) any later version. *
*
**************************************************************************
%End
%Feature MOBILITY_LOCATION
%If (MOBILITY_LOCATION)

class QgsQtLocationConnection: QgsGPSConnection
{
@@ -49,18 +40,31 @@ Needed to make QtLocation detected
Parse available data source content
%End

void positionUpdated( const QGeoPositionInfo &info );

%If (!ANDROID)

void satellitesInViewUpdated( const QList<QGeoSatelliteInfo> &satellites );
%Docstring
Called when the position updated.
Called when the number of satellites in view is updated.
.. note::

not available in Python binding
not available in Python bindings on android
%End

void satellitesInUseUpdated( const QList<QGeoSatelliteInfo> &satellites );
%Docstring
Called when the number of satellites in use is updated.
.. note::

not available in Python bindings on android
%End

%End

};

%End // MOBILITY_LOCATION

/************************************************************************
* This file has been generated automatically from *
* *
@@ -44,6 +44,7 @@
my $PRIVATE_SECTION_LINE = '';
my $RETURN_TYPE = '';
my $IS_OVERRIDE = 0;
my $IF_FEATURE_CONDITION = '';
my %QFLAG_HASH;

my $LINE_COUNT = @INPUT_LINES;
@@ -75,7 +76,10 @@ sub write_output {
else{
$dbg_code = '';
}
push @OUTPUT, "%If ($IF_FEATURE_CONDITION)\n" if $IF_FEATURE_CONDITION ne '';
push @OUTPUT, $dbg_code.$out;
push @OUTPUT, "%End\n" if $IF_FEATURE_CONDITION ne '';
$IF_FEATURE_CONDITION = '';
}

sub dbg_info {
@@ -275,6 +279,11 @@ sub detect_comment_block{
next;
}

if ( $LINE =~ s/SIP_WHEN_FEATURE\(\s*(.*?)\s*\)// ){
dbg_info('found SIP_WHEN_FEATURE');
$IF_FEATURE_CONDITION = $1;
}

# Skip preprocessor stuff
if ($LINE =~ m/^\s*#/){

@@ -626,9 +635,7 @@ sub detect_comment_block{
}
}

if ( $LINE =~ m/\boverride\b/){
$IS_OVERRIDE = 1;
}
$IS_OVERRIDE = 1 if ( $LINE =~ m/\boverride\b/);

# keyword fixes
do {no warnings 'uninitialized';
@@ -62,11 +62,12 @@ struct CORE_EXPORT QgsGPSInformation
/** \ingroup core
* Abstract base class for connection to a GPS device*/
class CORE_EXPORT QgsGPSConnection : public QObject
{
#ifdef SIP_RUN
#include <qgsgpsdconnection.h>
#include <qgsnmeaconnection.h>
#endif
{


#ifdef SIP_RUN
SIP_CONVERT_TO_SUBCLASS_CODE
@@ -51,6 +51,9 @@ class CORE_EXPORT QgsGPSConnectionRegistry
QList< QgsGPSConnection *> connectionList() const;

private:
#ifdef SIP_RUN
QgsGPSConnectionRegistry( const QgsGPSConnectionRegistry &rh );
#endif

QSet<QgsGPSConnection *> mConnections;
};
@@ -24,6 +24,7 @@

#include <QtCore/QPointer>

#ifndef SIP_RUN
#if defined(HAVE_QT_MOBILITY_LOCATION )
#include <QtLocation/QGeoPositionInfoSource>
#include <QtLocation/QGeoSatelliteInfo>
@@ -35,6 +36,10 @@ QTM_USE_NAMESPACE
#include <QtPositioning/QGeoSatelliteInfo>
#include <QtPositioning/QGeoSatelliteInfoSource>
#endif
#endif

SIP_FEATURE( MOBILITY_LOCATION )
SIP_IF_FEATURE( MOBILITY_LOCATION )

/**
* \ingroup core
@@ -56,19 +61,27 @@ class CORE_EXPORT QgsQtLocationConnection: public QgsGPSConnection
void parseData();

/** Called when the position updated.
* \note not available in Python binding
* \note not available in Python bindings
*/
void positionUpdated( const QGeoPositionInfo &info );
void positionUpdated( const QGeoPositionInfo &info ) SIP_SKIP;

#ifdef SIP_RUN
SIP_IF_FEATURE( !ANDROID )
#endif

/** Called when the number of satellites in view is updated.
* \note not available in Python bindings on android
*/
void satellitesInViewUpdated( const QList<QGeoSatelliteInfo> &satellites ) SIP_SKIP;
void satellitesInViewUpdated( const QList<QGeoSatelliteInfo> &satellites );

/** Called when the number of satellites in use is updated.
* \note not available in Python bindings on android
*/
void satellitesInUseUpdated( const QList<QGeoSatelliteInfo> &satellites ) SIP_SKIP;
void satellitesInUseUpdated( const QList<QGeoSatelliteInfo> &satellites );

#ifdef SIP_RUN
SIP_END
#endif

private:
void startGPS();
@@ -80,4 +93,6 @@ class CORE_EXPORT QgsQtLocationConnection: public QgsGPSConnection

};

SIP_END // MOBILITY_LOCATION

#endif // QGSQTLOCATIONCONNECTION_H
@@ -142,6 +142,11 @@
*/
#define SIP_IF_FEATURE(feature)

/*
* Will place the current line with an `%If feature` directive in sip file
*/
#define SIP_WHEN_FEATURE(feature)

/*
* Convert to subclass code
*/

0 comments on commit 9e176fe

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