QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
src
core
gps
qgsgpsconnection.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsgpsconnection.h - description
3
-------------------
4
begin : November 30th, 2009
5
copyright : (C) 2009 by Marco Hugentobler
6
email : marco at hugis dot net
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
#ifndef QGSGPSCONNECTION_H
19
#define QGSGPSCONNECTION_H
20
21
#include <QDateTime>
22
#include <QObject>
23
#include <QString>
24
25
class
QIODevice
;
26
27
struct
CORE_EXPORT
QgsSatelliteInfo
28
{
29
int
id
;
30
bool
inUse
;
31
int
elevation
;
32
int
azimuth
;
33
int
signal
;
34
};
35
36
struct
CORE_EXPORT
QgsGPSInformation
37
{
38
double
latitude
;
39
double
longitude
;
40
double
elevation
;
41
double
speed
;
//in km/h
42
double
direction
;
43
QList<QgsSatelliteInfo>
satellitesInView
;
44
double
pdop
;
45
double
hdop
;
46
double
vdop
;
47
double
hacc
;
//horizontal accurancy in meters
48
double
vacc
;
//vertical accurancy in meters
49
QDateTime
utcDateTime
;
50
QChar
fixMode
;
51
int
fixType
;
52
int
quality
;
// from GPGGA
53
int
satellitesUsed
;
// from GPGGA
54
QChar
status
;
// from GPRMC A,V
55
QList<int>
satPrn
;
// list of SVs in use; needed for QgsSatelliteInfo.inUse and other uses
56
bool
satInfoComplete
;
// based on GPGSV sentences - to be used to determine when to graph signal and satellite position
57
};
58
61
class
CORE_EXPORT
QgsGPSConnection
:
public
QObject
62
{
63
Q_OBJECT
64
public
:
65
66
enum
Status
67
{
68
NotConnected
,
69
Connected
,
70
DataReceived
,
71
GPSDataReceived
72
};
73
77
QgsGPSConnection
(
QIODevice
* dev );
78
virtual
~
QgsGPSConnection
();
80
bool
connect
();
82
bool
close();
83
85
void
setSource(
QIODevice
* source );
86
88
Status
status
()
const
{
return
mStatus; }
89
91
QgsGPSInformation
currentGPSInformation
()
const
{
return
mLastGPSInformation; }
92
93
signals:
94
void
stateChanged(
const
QgsGPSInformation
& info );
95
void
nmeaSentenceReceived(
const
QString
& substring );
// added to capture 'raw' data
96
97
protected
:
99
QIODevice
*
mSource
;
101
QgsGPSInformation
mLastGPSInformation
;
103
Status
mStatus
;
104
105
private
:
107
void
cleanupSource();
108
void
clearLastGPSInformation();
109
110
protected
slots:
112
virtual
void
parseData() = 0;
113
};
114
115
#endif // QGSGPSCONNECTION_H
QIODevice
QgsGPSInformation::fixMode
QChar fixMode
Definition:
qgsgpsconnection.h:50
QgsGPSConnection::mStatus
Status mStatus
Connection status.
Definition:
qgsgpsconnection.h:103
QgsGPSInformation::fixType
int fixType
Definition:
qgsgpsconnection.h:51
QgsGPSInformation::longitude
double longitude
Definition:
qgsgpsconnection.h:39
QgsGPSInformation
Definition:
qgsgpsconnection.h:36
QgsGPSConnection::Status
Status
Definition:
qgsgpsconnection.h:66
QgsGPSInformation::utcDateTime
QDateTime utcDateTime
Definition:
qgsgpsconnection.h:49
QChar
QgsGPSInformation::latitude
double latitude
Definition:
qgsgpsconnection.h:38
QgsGPSInformation::satellitesInView
QList< QgsSatelliteInfo > satellitesInView
Definition:
qgsgpsconnection.h:43
QgsSatelliteInfo::inUse
bool inUse
Definition:
qgsgpsconnection.h:30
QgsGPSInformation::hacc
double hacc
Definition:
qgsgpsconnection.h:47
QgsSatelliteInfo::azimuth
int azimuth
Definition:
qgsgpsconnection.h:32
QgsGPSInformation::satellitesUsed
int satellitesUsed
Definition:
qgsgpsconnection.h:53
QgsGPSConnection::DataReceived
Definition:
qgsgpsconnection.h:70
QgsGPSInformation::satPrn
QList< int > satPrn
Definition:
qgsgpsconnection.h:55
QgsGPSInformation::pdop
double pdop
Definition:
qgsgpsconnection.h:44
QgsGPSInformation::direction
double direction
Definition:
qgsgpsconnection.h:42
QgsGPSConnection
Abstract base class for connection to a GPS device.
Definition:
qgsgpsconnection.h:61
QObject
QgsGPSConnection::mLastGPSInformation
QgsGPSInformation mLastGPSInformation
Last state of the gps related variables (e.g.
Definition:
qgsgpsconnection.h:101
QgsGPSInformation::quality
int quality
Definition:
qgsgpsconnection.h:52
QgsSatelliteInfo
Definition:
qgsgpsconnection.h:27
QString
QList< QgsSatelliteInfo >
QgsGPSConnection::currentGPSInformation
QgsGPSInformation currentGPSInformation() const
Returns the current gps information (lat, lon, etc.)
Definition:
qgsgpsconnection.h:91
QgsGPSInformation::vacc
double vacc
Definition:
qgsgpsconnection.h:48
QgsGPSConnection::Connected
Definition:
qgsgpsconnection.h:69
QgsGPSConnection::mSource
QIODevice * mSource
Data source (e.g.
Definition:
qgsgpsconnection.h:99
QgsGPSConnection::NotConnected
Definition:
qgsgpsconnection.h:68
QgsSatelliteInfo::signal
int signal
Definition:
qgsgpsconnection.h:33
QgsSatelliteInfo::elevation
int elevation
Definition:
qgsgpsconnection.h:31
QgsGPSInformation::hdop
double hdop
Definition:
qgsgpsconnection.h:45
QgsGPSInformation::status
QChar status
Definition:
qgsgpsconnection.h:54
QgsGPSInformation::speed
double speed
Definition:
qgsgpsconnection.h:41
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QgsGPSConnection::status
Status status() const
Returns the status.
Definition:
qgsgpsconnection.h:88
QgsGPSInformation::elevation
double elevation
Definition:
qgsgpsconnection.h:40
QDateTime
QgsSatelliteInfo::id
int id
Definition:
qgsgpsconnection.h:29
QgsGPSInformation::vdop
double vdop
Definition:
qgsgpsconnection.h:46
QgsGPSInformation::satInfoComplete
bool satInfoComplete
Definition:
qgsgpsconnection.h:56
Generated on Sun Jun 24 2018 11:42:48 for QGIS API Documentation by
1.8.13