Skip to content

Commit e545d44

Browse files
committedJun 8, 2017
sipify core gps
1 parent e052933 commit e545d44

File tree

7 files changed

+237
-81
lines changed

7 files changed

+237
-81
lines changed
 

‎python/auto_sip.blacklist

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@ core/composer/qgspaperitem.sip
4141
core/composer/qgsscalebarstyle.sip
4242
core/composer/qgssingleboxscalebarstyle.sip
4343
core/composer/qgsticksscalebarstyle.sip
44-
core/gps/qgsgpsconnection.sip
45-
core/gps/qgsgpsconnectionregistry.sip
46-
core/gps/qgsgpsdconnection.sip
47-
core/gps/qgsgpsdetector.sip
48-
core/gps/qgsnmeaconnection.sip
49-
core/gps/qgsqtlocationconnection.sip
5044
core/symbology-ng/qgsrulebasedrenderer.sip
5145
core/symbology-ng/qgssinglesymbolrenderer.sip
5246
core/symbology-ng/qgsgeometrygeneratorsymbollayer.sip

‎python/core/gps/qgsgpsconnection.sip

Lines changed: 54 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/gps/qgsgpsconnection.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
13+
114
struct QgsSatelliteInfo
215
{
3-
%TypeHeaderCode
4-
#include <qgsgpsconnection.h>
5-
%End
6-
716
int id;
817
bool inUse;
918
int elevation;
@@ -13,10 +22,6 @@ struct QgsSatelliteInfo
1322

1423
struct QgsGPSInformation
1524
{
16-
%TypeHeaderCode
17-
#include <qgsgpsconnection.h>
18-
%End
19-
2025
double latitude;
2126
double longitude;
2227
double elevation;
@@ -38,24 +43,15 @@ struct QgsGPSInformation
3843
bool satInfoComplete; // based on GPGSV sentences - to be used to determine when to graph signal and satellite position
3944
};
4045

41-
/** Abstract base class for connection to a GPS device*/
4246
class QgsGPSConnection : QObject
4347
{
44-
%TypeHeaderCode
45-
#include <qgsgpsconnection.h>
46-
#include <qgsgpsdconnection.h>
47-
#include <qgsnmeaconnection.h>
48+
%Docstring
49+
Abstract base class for connection to a GPS device*
4850
%End
4951

50-
%ConvertToSubClassCode
51-
if (sipCpp->inherits("QgsGpsdConnection"))
52-
sipType = sipType_QgsGpsdConnection;
53-
else if (sipCpp->inherits("QgsNMEAConnection"))
54-
sipType = sipType_QgsNMEAConnection;
55-
else
56-
sipType = NULL;
52+
%TypeHeaderCode
53+
#include "qgsgpsconnection.h"
5754
%End
58-
5955
public:
6056

6157
enum Status
@@ -66,30 +62,57 @@ class QgsGPSConnection : QObject
6662
GPSDataReceived
6763
};
6864

69-
/** Constructor
70-
@param dev input device for the connection (e.g. serial device). The class takes ownership of the object
71-
*/
7265
QgsGPSConnection( QIODevice *dev /Transfer/ );
66+
%Docstring
67+
Constructor
68+
\param dev input device for the connection (e.g. serial device). The class takes ownership of the object
69+
%End
7370
virtual ~QgsGPSConnection();
74-
/** Opens connection to device*/
7571
bool connect();
76-
/** Closes connection to device*/
72+
%Docstring
73+
Opens connection to device
74+
:rtype: bool
75+
%End
7776
bool close();
77+
%Docstring
78+
Closes connection to device
79+
:rtype: bool
80+
%End
7881

79-
/** Sets the GPS source. The class takes ownership of the device class*/
8082
void setSource( QIODevice *source /Transfer/ );
83+
%Docstring
84+
Sets the GPS source. The class takes ownership of the device class
85+
%End
8186

82-
/** Returns the status. Possible state are not connected, connected, data received*/
8387
Status status() const;
88+
%Docstring
89+
Returns the status. Possible state are not connected, connected, data received
90+
:rtype: Status
91+
%End
8492

85-
/** Returns the current gps information (lat, lon, etc.)*/
8693
QgsGPSInformation currentGPSInformation() const;
94+
%Docstring
95+
Returns the current gps information (lat, lon, etc.)
96+
:rtype: QgsGPSInformation
97+
%End
8798

8899
signals:
89100
void stateChanged( const QgsGPSInformation &info );
90-
void nmeaSentenceReceived( const QString &substring );
101+
void nmeaSentenceReceived( const QString &substring ); // added to capture 'raw' data
102+
103+
protected:
91104

92105
protected slots:
93-
/** Parse available data source content*/
94106
virtual void parseData() = 0;
107+
%Docstring
108+
Parse available data source content
109+
%End
95110
};
111+
112+
/************************************************************************
113+
* This file has been generated automatically from *
114+
* *
115+
* src/core/gps/qgsgpsconnection.h *
116+
* *
117+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
118+
************************************************************************/
Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,54 @@
1-
/** A singleton class to register / unregister existing GPS connections such that the information
2-
is available to all classes and plugins*/
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/gps/qgsgpsconnectionregistry.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
13+
314
class QgsGPSConnectionRegistry
415
{
16+
%Docstring
17+
A class to register / unregister existing GPS connections such that the information
18+
is available to all classes and plugins.
19+
20+
QgsGPSConnectionRegistry is not usually directly created, but rather accessed through
21+
QgsApplication.gpsConnectionRegistry().
22+
%End
23+
524
%TypeHeaderCode
6-
#include <qgsgpsconnectionregistry.h>
25+
#include "qgsgpsconnectionregistry.h"
726
%End
827
public:
928
QgsGPSConnectionRegistry();
1029
~QgsGPSConnectionRegistry();
1130

12-
/** Inserts a connection into the registry. The connection is owned by the registry class until it is unregistered again*/
31+
1332
void registerConnection( QgsGPSConnection *c );
14-
/** Unregisters connection. The registry does no longer own the connection*/
33+
%Docstring
34+
Inserts a connection into the registry. The connection is owned by the registry class until it is unregistered again
35+
%End
1536
void unregisterConnection( QgsGPSConnection *c );
37+
%Docstring
38+
Unregisters connection. The registry does no longer own the connection
39+
%End
1640

1741
QList< QgsGPSConnection *> connectionList() const;
42+
%Docstring
43+
:rtype: list of QgsGPSConnection
44+
%End
1845

19-
private:
20-
21-
QgsGPSConnectionRegistry( const QgsGPSConnectionRegistry &rh );
2246
};
47+
48+
/************************************************************************
49+
* This file has been generated automatically from *
50+
* *
51+
* src/core/gps/qgsgpsconnectionregistry.h *
52+
* *
53+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
54+
************************************************************************/

‎python/core/gps/qgsgpsdconnection.sip

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,34 @@
1-
/** Evaluates NMEA sentences coming from gpsd*/
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/gps/qgsgpsdconnection.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
213
class QgsGpsdConnection: QgsNMEAConnection
314
{
15+
%Docstring
16+
Evaluates NMEA sentences coming from gpsd*
17+
%End
18+
419
%TypeHeaderCode
520
#include "qgsgpsdconnection.h"
621
%End
722
public:
823
QgsGpsdConnection( const QString &host, qint16 port, const QString &device );
924
~QgsGpsdConnection();
25+
1026
};
27+
28+
/************************************************************************
29+
* This file has been generated automatically from *
30+
* *
31+
* src/core/gps/qgsgpsdconnection.h *
32+
* *
33+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
34+
************************************************************************/

‎python/core/gps/qgsgpsdetector.sip

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,49 @@
1-
// Class to detect the GPS port
2-
class QgsGPSDetector: QObject
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/gps/qgsgpsdetector.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
13+
14+
class QgsGPSDetector : QObject
315
{
16+
%Docstring
17+
Class to detect the GPS port
18+
%End
19+
420
%TypeHeaderCode
521
#include "qgsgpsdetector.h"
622
%End
7-
823
public:
924
QgsGPSDetector( const QString &portName );
1025
~QgsGPSDetector();
1126

1227
static QList< QPair<QString, QString> > availablePorts();
28+
%Docstring
29+
:rtype: list of QPair<str, QString>
30+
%End
1331

1432
public slots:
1533
void advance();
16-
void detected( const QgsGPSInformation& );
34+
void detected( const QgsGPSInformation & );
1735
void connDestroyed( QObject * );
1836

1937
signals:
2038
void detected( QgsGPSConnection * );
2139
void detectionFailed();
40+
2241
};
42+
43+
/************************************************************************
44+
* This file has been generated automatically from *
45+
* *
46+
* src/core/gps/qgsgpsdetector.h *
47+
* *
48+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
49+
************************************************************************/

‎python/core/gps/qgsnmeaconnection.sip

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1-
/** Evaluates NMEA sentences coming from a GPS device*/
2-
class QgsNMEAConnection: QgsGPSConnection {
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/gps/qgsnmeaconnection.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
class QgsNMEAConnection: QgsGPSConnection
13+
{
14+
%Docstring
15+
Evaluates NMEA sentences coming from a GPS device
16+
%End
17+
318
%TypeHeaderCode
419
#include "qgsnmeaconnection.h"
520
%End
@@ -8,16 +23,28 @@ class QgsNMEAConnection: QgsGPSConnection {
823
~QgsNMEAConnection();
924

1025
protected slots:
11-
/** Parse available data source content*/
12-
void parseData();
26+
virtual void parseData();
27+
28+
%Docstring
29+
Parse available data source content
30+
%End
1331

1432
protected:
15-
/** Splits mStringBuffer into sentences and calls libnmea*/
1633
void processStringBuffer();
17-
//handle the different sentence type
34+
%Docstring
35+
Splits mStringBuffer into sentences and calls libnmea
36+
%End
1837
void processGGASentence( const char *data, int len );
1938
void processRMCSentence( const char *data, int len );
2039
void processGSVSentence( const char *data, int len );
2140
void processVTGSentence( const char *data, int len );
2241
void processGSASentence( const char *data, int len );
2342
};
43+
44+
/************************************************************************
45+
* This file has been generated automatically from *
46+
* *
47+
* src/core/gps/qgsnmeaconnection.h *
48+
* *
49+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
50+
************************************************************************/
Lines changed: 54 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,70 @@
1-
%Feature MOBILITY_LOCATION
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/gps/qgsqtlocationconnection.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
13+
14+
QTM_USE_NAMESPACE
15+
%Docstring
16+
*************************************************************************
17+
*
18+
This program is free software; you can redistribute it and/or modify *
19+
it under the terms of the GNU General Public License as published by *
20+
the Free Software Foundation; either version 2 of the License, or *
21+
(at your option) any later version. *
22+
*
23+
**************************************************************************
24+
%End
225

3-
%If (MOBILITY_LOCATION)
4-
/**
5-
* \class QgsQtLocationConnection
6-
* \note may not be available in Python bindings on all platforms
7-
*/
826
class QgsQtLocationConnection: QgsGPSConnection
927
{
28+
%Docstring
29+
.. note::
30+
31+
may not be available in Python bindings on all platforms
32+
%End
33+
1034
%TypeHeaderCode
11-
#include <qgsqtlocationconnection.h>
35+
#include "qgsqtlocationconnection.h"
1236
%End
1337
public:
1438
QgsQtLocationConnection();
1539
~QgsQtLocationConnection();
1640

1741
protected slots:
18-
/** Needed to make QtLocation detected*/
1942
void broadcastConnectionAvailable();
43+
%Docstring
44+
Needed to make QtLocation detected
45+
%End
2046

21-
/** Parse available data source content*/
2247
void parseData();
48+
%Docstring
49+
Parse available data source content
50+
%End
2351

24-
/** Called when the position updated.
25-
* @note not available in python binding
26-
*/
27-
// void positionUpdated( const QGeoPositionInfo &info );
28-
29-
%If (!ANDROID)
30-
/** Called when the number of satellites in view is updated.
31-
* @note not available in python bindings on android
32-
*/
33-
void satellitesInViewUpdated( const QList<QGeoSatelliteInfo> &satellites );
34-
35-
/** Called when the number of satellites in use is updated.
36-
* @note not available in python bindings on android
37-
*/
38-
void satellitesInUseUpdated( const QList<QGeoSatelliteInfo> &satellites );
52+
void positionUpdated( const QGeoPositionInfo &info );
53+
%Docstring
54+
Called when the position updated.
55+
.. note::
56+
57+
not available in Python binding
3958
%End
59+
60+
61+
4062
};
41-
%End
63+
64+
/************************************************************************
65+
* This file has been generated automatically from *
66+
* *
67+
* src/core/gps/qgsqtlocationconnection.h *
68+
* *
69+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
70+
************************************************************************/

0 commit comments

Comments
 (0)
Please sign in to comment.