QGIS API Documentation
3.38.0-Grenoble (exported)
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 <QObject>
24
#include <QList>
25
#include <QPair>
26
#if defined( HAVE_QTSERIALPORT )
27
#include <QSerialPort>
28
#endif
29
#include <memory>
30
31
#include "qgis_core.h"
32
#include "
qgis_sip.h
"
33
34
#ifndef SIP_RUN
35
template
<
class
T>
36
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
52
// TODO QGIS 4.0 -- remove useUnsafeSignals option
53
66
QgsGpsDetector
(
const
QString &portName = QString(),
bool
useUnsafeSignals =
true
);
67
68
#if defined( HAVE_QTSERIALPORT )
69
static
const
QgsSettingsEntryEnumFlag<QSerialPort::StopBits>
*settingsGpsStopBits
SIP_SKIP
;
70
static
const
QgsSettingsEntryEnumFlag<QSerialPort::DataBits>
*settingsGpsDataBits
SIP_SKIP
;
71
static
const
QgsSettingsEntryEnumFlag<QSerialPort::Parity>
*settingsGpsParity
SIP_SKIP
;
72
static
const
QgsSettingsEntryEnumFlag<QSerialPort::FlowControl>
*settingsGpsFlowControl
SIP_SKIP
;
73
#endif
74
75
~QgsGpsDetector
()
override
;
76
89
QgsGpsConnection
*takeConnection()
SIP_TRANSFERBACK
;
90
91
static
QList< QPair<QString, QString> > availablePorts();
92
93
public
slots:
94
void
advance();
95
void
detected(
const
QgsGpsInformation
& );
96
void
connDestroyed( QObject * );
97
98
signals:
99
107
void
connectionDetected
();
108
115
Q_DECL_DEPRECATED
void
detected
(
QgsGpsConnection
*connection )
SIP_DEPRECATED
;
116
120
void
detectionFailed
();
121
122
private
slots:
123
124
void
connectionTimeout();
125
126
private
:
127
bool
mUseUnsafeSignals =
true
;
128
int
mPortIndex = 0;
129
int
mBaudIndex = -1;
130
QList< QPair< QString, QString > > mPortList;
131
QList<qint32> mBaudList;
132
133
std::unique_ptr< QgsGpsConnection > mConn;
134
QTimer *mTimeoutTimer =
nullptr
;
135
};
136
137
#endif
// QGSGPSDETECTOR_H
QgsGpsConnection
Abstract base class for connection to a GPS device.
Definition
qgsgpsconnection.h:50
QgsGpsDetector
Class to detect the GPS port.
Definition
qgsgpsdetector.h:48
QgsGpsDetector::connectionDetected
void connectionDetected()
Emitted when a GPS connection is successfully detected.
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:36
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:106
SIP_SKIP
#define SIP_SKIP
Definition
qgis_sip.h:126
SIP_TRANSFERBACK
#define SIP_TRANSFERBACK
Definition
qgis_sip.h:48
Generated on Thu Jun 27 2024 20:32:08 for QGIS API Documentation by
1.9.8