QGIS API Documentation
4.0.0-Norrköping (1ddcee3d0e4)
Loading...
Searching...
No Matches
src
core
gps
qgsgpsdetector.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsgpsdetector.h - description
3
-------------------
4
begin : January 13th, 2009
5
copyright : (C) 2009 by Juergen E. Fischer
6
email : jef at norbit dot de
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 QGSGPSDETECTOR_H
19
#define QGSGPSDETECTOR_H
20
21
#include "qgsconfig.h"
22
23
#include <QList>
24
#include <QObject>
25
#include <QPair>
26
27
#if defined( HAVE_QTSERIALPORT )
28
#include <QSerialPort>
29
#endif
30
#include <memory>
31
32
#include "qgis_core.h"
33
#include "
qgis_sip.h
"
34
35
#ifndef SIP_RUN
36
template
<
class
T>
class
QgsSettingsEntryEnumFlag
;
37
#endif
38
39
class
QgsGpsConnection
;
40
class
QgsGpsInformation
;
41
class
QTimer;
42
47
class
CORE_EXPORT
QgsGpsDetector
:
public
QObject
48
{
49
Q_OBJECT
50
public
:
51
// TODO QGIS 5.0 -- remove useUnsafeSignals option
52
65
QgsGpsDetector
(
const
QString &portName = QString(),
bool
useUnsafeSignals =
true
);
66
67
#if defined( HAVE_QTSERIALPORT )
68
static
const
QgsSettingsEntryEnumFlag<QSerialPort::StopBits>
*settingsGpsStopBits
SIP_SKIP
;
69
static
const
QgsSettingsEntryEnumFlag<QSerialPort::DataBits>
*settingsGpsDataBits
SIP_SKIP
;
70
static
const
QgsSettingsEntryEnumFlag<QSerialPort::Parity>
*settingsGpsParity
SIP_SKIP
;
71
static
const
QgsSettingsEntryEnumFlag<QSerialPort::FlowControl>
*settingsGpsFlowControl
SIP_SKIP
;
72
#endif
73
74
~QgsGpsDetector
()
override
;
75
88
QgsGpsConnection
*
takeConnection
()
SIP_TRANSFERBACK
;
89
90
static
QList< QPair<QString, QString> >
availablePorts
();
91
92
public
slots:
93
void
advance
();
94
void
detected
(
const
QgsGpsInformation
& );
95
void
connDestroyed
( QObject * );
96
97
signals:
98
106
void
connectionDetected
();
107
114
Q_DECL_DEPRECATED
void
detected
(
QgsGpsConnection
*connection )
SIP_DEPRECATED
;
115
119
void
detectionFailed
();
120
121
private
slots:
122
123
void
connectionTimeout();
124
125
private
:
126
bool
mUseUnsafeSignals =
true
;
127
int
mPortIndex = 0;
128
int
mBaudIndex = -1;
129
QList< QPair< QString, QString > > mPortList;
130
QList<qint32> mBaudList;
131
132
std::unique_ptr< QgsGpsConnection > mConn;
133
QTimer *mTimeoutTimer =
nullptr
;
134
};
135
136
#endif
// QGSGPSDETECTOR_H
QgsGpsConnection
Abstract base class for connections to a GPS device.
Definition
qgsgpsconnection.h:52
QgsGpsDetector::connDestroyed
void connDestroyed(QObject *)
Definition
qgsgpsdetector.cpp:286
QgsGpsDetector::detected
void detected(const QgsGpsInformation &)
Definition
qgsgpsdetector.cpp:237
QgsGpsDetector::availablePorts
static QList< QPair< QString, QString > > availablePorts()
Definition
qgsgpsdetector.cpp:54
QgsGpsDetector::takeConnection
QgsGpsConnection * takeConnection()
Returns the detected GPS connection, and removes it from the detector.
Definition
qgsgpsdetector.cpp:105
QgsGpsDetector::advance
void advance()
Definition
qgsgpsdetector.cpp:134
QgsGpsDetector::connectionDetected
void connectionDetected()
Emitted when a GPS connection is successfully detected.
QgsGpsDetector::QgsGpsDetector
QgsGpsDetector(const QString &portName=QString(), bool useUnsafeSignals=true)
Constructor for QgsGpsDetector.
Definition
qgsgpsdetector.cpp:77
QgsGpsDetector::detectionFailed
void detectionFailed()
Emitted when the detector could not find a valid GPS connection.
QgsGpsDetector::detected
Q_DECL_DEPRECATED void detected(QgsGpsConnection *connection)
Emitted when the GPS connection has been detected.
QgsGpsInformation
Encapsulates information relating to a GPS position fix.
Definition
qgsgpsinformation.h:35
QgsSettingsEntryEnumFlag
A template class for enum and flag settings entry.
Definition
qgssettingsentryenumflag.h:40
qgis_sip.h
SIP_DEPRECATED
#define SIP_DEPRECATED
Definition
qgis_sip.h:113
SIP_SKIP
#define SIP_SKIP
Definition
qgis_sip.h:133
SIP_TRANSFERBACK
#define SIP_TRANSFERBACK
Definition
qgis_sip.h:47
Generated on
for QGIS API Documentation by
1.15.0