QGIS API Documentation
3.99.0-Master (2fe06baccd8)
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>
37
class
QgsSettingsEntryEnumFlag
;
38
#endif
39
40
class
QgsGpsConnection
;
41
class
QgsGpsInformation
;
42
class
QTimer;
43
48
class
CORE_EXPORT
QgsGpsDetector
:
public
QObject
49
{
50
Q_OBJECT
51
public
:
52
53
// TODO QGIS 4.0 -- remove useUnsafeSignals option
54
67
QgsGpsDetector
(
const
QString &portName = QString(),
bool
useUnsafeSignals =
true
);
68
69
#if defined( HAVE_QTSERIALPORT )
70
static
const
QgsSettingsEntryEnumFlag<QSerialPort::StopBits>
*settingsGpsStopBits
SIP_SKIP
;
71
static
const
QgsSettingsEntryEnumFlag<QSerialPort::DataBits>
*settingsGpsDataBits
SIP_SKIP
;
72
static
const
QgsSettingsEntryEnumFlag<QSerialPort::Parity>
*settingsGpsParity
SIP_SKIP
;
73
static
const
QgsSettingsEntryEnumFlag<QSerialPort::FlowControl>
*settingsGpsFlowControl
SIP_SKIP
;
74
#endif
75
76
~QgsGpsDetector
()
override
;
77
90
QgsGpsConnection
*
takeConnection
()
SIP_TRANSFERBACK
;
91
92
static
QList< QPair<QString, QString> >
availablePorts
();
93
94
public
slots:
95
void
advance
();
96
void
detected
(
const
QgsGpsInformation
& );
97
void
connDestroyed
( QObject * );
98
99
signals:
100
108
void
connectionDetected
();
109
116
Q_DECL_DEPRECATED
void
detected
(
QgsGpsConnection
*connection )
SIP_DEPRECATED
;
117
121
void
detectionFailed
();
122
123
private
slots:
124
125
void
connectionTimeout();
126
127
private
:
128
bool
mUseUnsafeSignals =
true
;
129
int
mPortIndex = 0;
130
int
mBaudIndex = -1;
131
QList< QPair< QString, QString > > mPortList;
132
QList<qint32> mBaudList;
133
134
std::unique_ptr< QgsGpsConnection > mConn;
135
QTimer *mTimeoutTimer =
nullptr
;
136
};
137
138
#endif
// QGSGPSDETECTOR_H
QgsGpsConnection
Abstract base class for connections to a GPS device.
Definition
qgsgpsconnection.h:50
QgsGpsDetector::connDestroyed
void connDestroyed(QObject *)
Definition
qgsgpsdetector.cpp:279
QgsGpsDetector::detected
void detected(const QgsGpsInformation &)
Definition
qgsgpsdetector.cpp:230
QgsGpsDetector::availablePorts
static QList< QPair< QString, QString > > availablePorts()
Definition
qgsgpsdetector.cpp:47
QgsGpsDetector::takeConnection
QgsGpsConnection * takeConnection()
Returns the detected GPS connection, and removes it from the detector.
Definition
qgsgpsdetector.cpp:98
QgsGpsDetector::advance
void advance()
Definition
qgsgpsdetector.cpp:127
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:70
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:36
qgis_sip.h
SIP_DEPRECATED
#define SIP_DEPRECATED
Definition
qgis_sip.h:114
SIP_SKIP
#define SIP_SKIP
Definition
qgis_sip.h:134
SIP_TRANSFERBACK
#define SIP_TRANSFERBACK
Definition
qgis_sip.h:48
Generated on
for QGIS API Documentation by
1.15.0