Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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;
54#endif
57 void setSatellitesInView(QGeoSatelliteInfo::SatelliteSystem system,
58 const QList<QGeoSatelliteInfo> &inView);
59 bool setSatellitesInUse(QGeoSatelliteInfo::SatelliteSystem system, const QList<int> &inUse);
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
130
132{
133public:
135 void readAvailableData() override;
136 void setUpdateInterval(int msec);
137 int updateInterval() const;
138
139private:
140 QScopedPointer<QTimer> m_timer;
141 int m_updateInterval;
142};
143
144QT_END_NAMESPACE
145
146#endif
bool emitUpdated(QNmeaSatelliteInfoUpdate &update, bool fromRequestUpdate)
QScopedPointer< QNmeaSatelliteReader > m_nmeaReader
void processNmeaData(QNmeaSatelliteInfoUpdate &updateInfo)
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
virtual void readAvailableData()=0
QNmeaSatelliteInfoSourcePrivate * m_proxy
QNmeaSatelliteReader(QNmeaSatelliteInfoSourcePrivate *sourcePrivate)
QNmeaSatelliteRealTimeReader(QNmeaSatelliteInfoSourcePrivate *sourcePrivate)
QNmeaSatelliteSimulationReader(QNmeaSatelliteInfoSourcePrivate *sourcePrivate)
Combined button and popup list for selecting options.
#define USE_SATELLITE_NMEA_PIMPL
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