|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <GPSReceiverWorker.h>
Inheritance diagram for GPSReceiverWorker:
Collaboration diagram for GPSReceiverWorker:Public Types | |
| using | TransportFactory = std::function< std::unique_ptr< GPSTransport >(GPSCancelToken)> |
| Consumed on the worker thread, so transport construction, I/O and destruction share that thread. | |
Signals | |
| void | satelliteInfoUpdated (const GPSSatelliteReport &message) |
| void | positionUpdated (const GPSPositionReport &report) |
| void | rtcmDataReceived (const QByteArray &message, qint64 receivedAtMs) |
| RTCM output the receiver sent, stamped with the steady clock when it was read. | |
| void | surveyInStatusUpdated (const GPSSurveyReport &report) |
| void | connectionError (GPSConnectionError error, const QString &detail={}) |
| detail is the transport's or the protocol's diagnostic, or empty when it gave none. | |
| void | receiverDetected (GPSType type) |
| void | inputProblem (GPSInputProblem problem) |
| void | receiverReady (const QString &identity={}) |
| identity is the receiver model and firmware, or empty when the family does not report them. | |
| void | finished () |
| Delivered on this object's thread once the session thread has finished. | |
Public Member Functions | |
| GPSReceiverWorker (TransportFactory transportFactory, GPSType type, const GPSReceiverConfig &config, QObject *parent=nullptr, GPSClock clock={}) | |
| The session's receive deadlines and inactivity limit run on clock; the default is the steady clock. | |
| ~GPSReceiverWorker () override | |
| virtual void | start () |
| Starts the session once; later calls are ignored. | |
| virtual void | stop () |
| bool | wait (QDeadlineTimer deadline=QDeadlineTimer(QDeadlineTimer::Forever)) |
| Waits for the worker to exit; returns true at once when the session never started. | |
| void | setEndsWhenIdle (bool endsWhenIdle) |
Static Public Attributes | |
| static constexpr std::chrono::milliseconds | RECEIVE_TIMEOUT {1200} |
| Longest wait for one read before the session re-checks cancellation. | |
| static constexpr std::chrono::milliseconds | USEFUL_DATA_TIMEOUT = 3 * RECEIVE_TIMEOUT |
Friends | |
| class | GPSReceiverWorkerTest |
| class | GPSReceiverTest |
One receiver session hosted on a dedicated thread. The object lives on its creator's thread; only the session body runs on that thread, which it owns and joins before destruction.
Definition at line 25 of file GPSReceiverWorker.h.
| using GPSReceiverWorker::TransportFactory = std::function<std::unique_ptr<GPSTransport>(GPSCancelToken)> |
Consumed on the worker thread, so transport construction, I/O and destruction share that thread.
Definition at line 34 of file GPSReceiverWorker.h.
| GPSReceiverWorker::GPSReceiverWorker | ( | TransportFactory | transportFactory, |
| GPSType | type, | ||
| const GPSReceiverConfig & | config, | ||
| QObject * | parent = nullptr, |
||
| GPSClock | clock = {} |
||
| ) |
The session's receive deadlines and inactivity limit run on clock; the default is the steady clock.
Definition at line 15 of file GPSReceiverWorker.cc.
|
override |
Definition at line 26 of file GPSReceiverWorker.cc.
|
signal |
detail is the transport's or the protocol's diagnostic, or empty when it gave none.
Referenced by GPSReceiverSession::start().
|
signal |
Delivered on this object's thread once the session thread has finished.
Referenced by start(), and GPSReceiverSession::start().
|
signal |
Why a session that does not end when idle has delivered no position for USEFUL_DATA_TIMEOUT; None once positions arrive. The session keeps running.
Referenced by GPSReceiverSession::start().
|
signal |
Referenced by GPSReceiverSession::start().
|
signal |
The family a GPSType::automatic session detected, before it configures the receiver, or the protocol a passive session's input carries (GPSDriverSinks::onReceiverDetected).
Referenced by GPSReceiverSession::start().
|
signal |
identity is the receiver model and firmware, or empty when the family does not report them.
Referenced by GPSReceiverSession::start().
|
signal |
RTCM output the receiver sent, stamped with the steady clock when it was read.
Referenced by GPSReceiverSession::start().
|
signal |
Referenced by GPSReceiverSession::start().
| void GPSReceiverWorker::setEndsWhenIdle | ( | bool | endsWhenIdle | ) |
Configured receivers must keep producing data; passive links stay open while the receiver is silent. Ignored once the session started, as its worker reads the setting.
Definition at line 49 of file GPSReceiverWorker.cc.
|
virtual |
Starts the session once; later calls are ignored.
Definition at line 33 of file GPSReceiverWorker.cc.
References finished().
|
virtual |
Requests cooperative cancellation. Network waits and serial reads wake at once; serial writes observe it within their polling interval.
Definition at line 44 of file GPSReceiverWorker.cc.
References GPSCancelSource::cancel().
Referenced by ~GPSReceiverWorker().
|
signal |
Referenced by GPSReceiverSession::start().
| bool GPSReceiverWorker::wait | ( | QDeadlineTimer | deadline = QDeadlineTimer(QDeadlineTimer::Forever) | ) |
Waits for the worker to exit; returns true at once when the session never started.
Definition at line 56 of file GPSReceiverWorker.cc.
Referenced by ~GPSReceiverWorker().
|
friend |
Definition at line 30 of file GPSReceiverWorker.h.
|
friend |
Definition at line 29 of file GPSReceiverWorker.h.
|
staticconstexpr |
Longest wait for one read before the session re-checks cancellation.
Definition at line 57 of file GPSReceiverWorker.h.
|
staticconstexpr |
A receiver that ends when idle ends after this long without useful data; one that stays connected reports inputProblem() after this long without a position.
Definition at line 60 of file GPSReceiverWorker.h.