QGIS API Documentation
2.10.1-Pisa
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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
60
class
CORE_EXPORT
QgsGPSConnection
:
public
QObject
61
{
62
Q_OBJECT
63
public
:
64
65
enum
Status
66
{
67
NotConnected
,
68
Connected
,
69
DataReceived
,
70
GPSDataReceived
71
};
72
76
QgsGPSConnection
(
QIODevice
* dev );
77
virtual
~
QgsGPSConnection
();
79
bool
connect
();
81
bool
close();
82
84
void
setSource(
QIODevice
* source );
85
87
Status
status
()
const
{
return
mStatus; }
88
90
QgsGPSInformation
currentGPSInformation
()
const
{
return
mLastGPSInformation; }
91
92
signals:
93
void
stateChanged(
const
QgsGPSInformation
& info );
94
void
nmeaSentenceReceived(
const
QString
& substring );
// added to capture 'raw' data
95
96
protected
:
98
QIODevice
*
mSource
;
100
QgsGPSInformation
mLastGPSInformation
;
102
Status
mStatus
;
103
104
private
:
106
void
cleanupSource();
107
void
clearLastGPSInformation();
108
109
protected
slots:
111
virtual
void
parseData() = 0;
112
};
113
114
#endif // QGSGPSCONNECTION_H
QIODevice
QgsGPSConnection::status
Status status() const
Returns the status.
Definition:
qgsgpsconnection.h:87
QgsGPSInformation::fixMode
QChar fixMode
Definition:
qgsgpsconnection.h:50
QgsGPSConnection::mStatus
Status mStatus
Connection status.
Definition:
qgsgpsconnection.h:102
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:65
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:69
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:60
QObject
QgsGPSConnection::mLastGPSInformation
QgsGPSInformation mLastGPSInformation
Last state of the gps related variables (e.g.
Definition:
qgsgpsconnection.h:100
QgsGPSInformation::quality
int quality
Definition:
qgsgpsconnection.h:52
QgsSatelliteInfo
Definition:
qgsgpsconnection.h:27
QString
QList< QgsSatelliteInfo >
QgsGPSInformation::vacc
double vacc
Definition:
qgsgpsconnection.h:48
QgsGPSConnection::Connected
Definition:
qgsgpsconnection.h:68
QgsGPSConnection::mSource
QIODevice * mSource
Data source (e.g.
Definition:
qgsgpsconnection.h:98
QgsGPSConnection::NotConnected
Definition:
qgsgpsconnection.h:67
QgsSatelliteInfo::signal
int signal
Definition:
qgsgpsconnection.h:33
QgsSatelliteInfo::elevation
int elevation
Definition:
qgsgpsconnection.h:31
QgsGPSConnection::currentGPSInformation
QgsGPSInformation currentGPSInformation() const
Returns the current gps information (lat, lon, etc.)
Definition:
qgsgpsconnection.h:90
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)
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 Sat Aug 22 2015 02:53:38 for QGIS API Documentation by
1.8.6