Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qnmeasatelliteinfosource_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QNMESATELLITEINFOSOURCE_P_H
5#define QNMESATELLITEINFOSOURCE_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
19#include <QtPositioning/qgeosatelliteinfo.h>
20
21#include <QObject>
22#include <QQueue>
23#include <QPointer>
24#include <QMap>
25#include <QtCore/qiodevice.h>
26#include <QtCore/qtimer.h>
27#include <QtCore/private/qglobal_p.h>
28
30
31#define USE_SATELLITE_NMEA_PIMPL 1
32
34{
37 QList<int> inUseIds; // temp buffer for GSA received before GSV
39 bool updatingGSV = false;
40 bool validInView = false;
41 bool validInUse = false;
42};
43
45{
48 bool m_validInView = false; // global state for all satellite systems
49 bool m_validInUse = false; // global state for all satellite systems
50 bool m_fresh = false;
51#if USE_SATELLITE_NMEA_PIMPL
54#endif
58 const QList<QGeoSatelliteInfo> &inView);
60 void consume();
61 bool isFresh() const;
62 void clear();
63 bool isValid() const;
64 bool calculateValidInUse() const;
65 bool calculateValidInView() const;
66};
67
70{
72public:
75
76 void startUpdates();
77 void stopUpdates();
78 void requestUpdate(int msec);
79 void notifyNewUpdate();
81
82public slots:
83 void readyRead();
84 void emitPendingUpdate();
85 void sourceDataClosed();
87
88public:
94 bool m_invokedStart = false;
96 bool m_updateTimeoutSent = false;
98 QBasicTimer *m_updateTimer = nullptr; // the timer used in startUpdates()
99 QTimer *m_requestTimer = nullptr; // the timer used in requestUpdate()
103
104protected:
105 bool openSourceDevice();
106 bool initialize();
107 void prepareSourceDevice();
108 bool emitUpdated(QNmeaSatelliteInfoUpdate &update, bool fromRequestUpdate);
109 void timerEvent(QTimerEvent *event) override;
110};
111
113{
114public:
116 virtual ~QNmeaSatelliteReader();
117
118 virtual void readAvailableData() = 0;
119
120protected:
122};
123
125{
126public:
128 void readAvailableData() override;
129};
130
132{
133public:
135 void readAvailableData() override;
136 void setUpdateInterval(int msec);
137 int updateInterval() const;
138
139private:
141 int m_updateInterval;
142};
143
145
146#endif
\inmodule QtCore
Definition qbasictimer.h:18
\inmodule QtCore
Definition qbytearray.h:57
Error
The Error enumeration represents the errors which can occur.
SatelliteSystem
Defines the GNSS system of the satellite.
Definition qlist.h:74
Definition qmap.h:186
bool emitUpdated(QNmeaSatelliteInfoUpdate &update, bool fromRequestUpdate)
QScopedPointer< QNmeaSatelliteReader > m_nmeaReader
void processNmeaData(QNmeaSatelliteInfoUpdate &updateInfo)
QNmeaSatelliteInfoSource::UpdateMode m_updateMode
void timerEvent(QTimerEvent *event) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
QGeoSatelliteInfoSource::Error m_satelliteError
UpdateMode
Defines the available update modes.
virtual void readAvailableData()=0
QNmeaSatelliteInfoSourcePrivate * m_proxy
\inmodule QtCore
Definition qobject.h:90
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:311
\inmodule QtCore
Definition qpointer.h:18
\inmodule QtCore
\inmodule QtCore
Definition qcoreevent.h:359
\inmodule QtCore
Definition qtimer.h:20
Combined button and popup list for selecting options.
struct _cl_event * event
#define Q_OBJECT
#define slots
QMap< QGeoSatelliteInfo::SatelliteSystem, SatelliteInfo > m_satellites
bool setSatellitesInUse(QGeoSatelliteInfo::SatelliteSystem system, const QList< int > &inUse)
QList< QGeoSatelliteInfo > allSatellitesInView() const
QList< QGeoSatelliteInfo > allSatellitesInUse() const
QList< QGeoSatelliteInfo > m_satellitesInViewParsed
void setSatellitesInView(QGeoSatelliteInfo::SatelliteSystem system, const QList< QGeoSatelliteInfo > &inView)
QList< QGeoSatelliteInfo > satellitesInView
QList< QGeoSatelliteInfo > satellitesInUse