QGIS API Documentation
3.32.0-Lima (311a8cb8a6)
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
46
class
CORE_EXPORT
QgsGpsDetector
:
public
QObject
47
{
48
Q_OBJECT
49
public
:
50
QgsGpsDetector
(
const
QString &portName );
51
52
#if defined( HAVE_QTSERIALPORT )
53
static
const
QgsSettingsEntryEnumFlag<QSerialPort::StopBits>
*settingsGpsStopBits
SIP_SKIP
;
54
static
const
QgsSettingsEntryEnumFlag<QSerialPort::DataBits>
*settingsGpsDataBits
SIP_SKIP
;
55
static
const
QgsSettingsEntryEnumFlag<QSerialPort::Parity>
*settingsGpsParity
SIP_SKIP
;
56
static
const
QgsSettingsEntryEnumFlag<QSerialPort::FlowControl>
*settingsGpsFlowControl
SIP_SKIP
;
57
#endif
58
59
~QgsGpsDetector
()
override
;
60
61
static
QList< QPair<QString, QString> > availablePorts();
62
63
public
slots:
64
void
advance();
65
void
detected(
const
QgsGpsInformation
& );
66
void
connDestroyed( QObject * );
67
68
signals:
69
70
// TODO QGIS 4.0 - this is horrible, fragile, leaky and crash prone API.
71
// don't transfer ownership with this signal, and add an explicit takeConnection member!
72
77
void
detected
(
QgsGpsConnection
*connection );
78
79
void
detectionFailed
();
80
81
private
:
82
int
mPortIndex = 0;
83
int
mBaudIndex = -1;
84
QList< QPair< QString, QString > > mPortList;
85
QList<qint32> mBaudList;
86
87
std::unique_ptr< QgsGpsConnection > mConn;
88
};
89
90
#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:47
QgsGpsDetector::~QgsGpsDetector
~QgsGpsDetector() override
QgsGpsDetector::detected
void detected(QgsGpsConnection *connection)
Emitted when the GPS connection has been detected.
QgsGpsDetector::detectionFailed
void detectionFailed()
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_SKIP
#define SIP_SKIP
Definition:
qgis_sip.h:126
Generated on Sun Jun 25 2023 11:54:04 for QGIS API Documentation by
1.9.4