#include <GPSReceiver.h>
Public Types | |
| using | Configuration = GPSReceiverConfiguration |
| using | WorkerFactory = GPSReceiverWorkerFactory |
| using | Dependencies = GPSReceiverDependencies |
Signals | |
| void | receiverChanged () |
| void | errorMessageChanged () |
| void | configurationChanged () |
| void | persistentChangesAllowedChanged () |
| void | serialPortEntriesChanged () |
| void | serialDeviceRenamed (const QString &device) |
| void | summaryLabelChanged () |
| void | statusTextChanged () |
Public Member Functions | |
| GPSReceiver (QObject *parent=nullptr, RuntimeScheduler *scheduler=nullptr, const Dependencies &dependencies={}) | |
| ~GPSReceiver () | |
| void | setConfiguration (const Configuration &configuration) |
| void | setWorkerFactory (WorkerFactory factory) |
| Inject before connecting; an empty factory restores the real worker. | |
| const Configuration & | configuration () const |
| QList< GPSSerialPortEntry > | serialPortEntries () const |
| std::optional< GPSObservation > | acceptedPositionObservation (GPSObservation::PositionUse use) const |
| Latest receiver solution that passes the consumer's gates; empty without a fresh fix. | |
| Q_INVOKABLE bool | connectReceiver () |
| Q_INVOKABLE void | disconnectReceiver () |
| Disconnects and pauses automatic connection until the user connects again. | |
| void | startConnectionPolling (std::function< bool()> suspended={}) |
| Runs tick() every POLL_INTERVAL until shutdown(), skipping ticks while suspended returns true. | |
| void | tick () |
| One step of automatic connection: connections due, reconnections, and USB discovery. | |
| void | shutdown () |
| GPSReceiverFactGroup * | facts () const |
| The receiver's reported state; with no receiver, every Fact is at its metadata default. | |
| bool | hasReceiver () const override |
| bool | serialSupported () const |
| QString | errorMessage () const |
| The connection or input problem, else a recent report that the receiver dropped output. | |
| int | activeBaseMode () const |
| QString | activeEndpoint () const |
| Serial device or TCP host:port of the active receiver. | |
| QString | receiverIdentity () const |
| QString | detectedReceiver () const |
| QString | summaryLabel () const |
| QString | statusText () const |
| bool | reconnecting () const |
| The saved receiver is being connected automatically, at startup or after its connection was lost. | |
| Q_INVOKABLE GPSReceiverPresentation | capabilitiesFor (int role, int manufacturer) const |
| Editable settings for a role; configured bases also depend on the manufacturer. | |
| GPSReceiverPresentation | activePresentation () const |
| Presentation capabilities of the connected receiver family. | |
| RTKSettings::ReceiverRole | activeRole () const |
| bool | forwardingCorrections () const |
| bool | persistentChangesAllowed () const |
| void | setPersistentChangesAllowed (bool allowed) |
| Granting permission only lasts until the configuration changes, a session starts or ends, or it is used. | |
| RTKSettings::ConnectionType | effectiveConnectionType () const |
| bool | connectionSupported () const |
| UDP only receives, so a receiver QGroundControl configures needs serial or TCP. | |
| bool | baseModeSupported () const |
| bool | canConnect () const |
Static Public Member Functions | |
| static QList< int > | serialBaudRates () |
| The application's serial rates that a receiver accepts as an explicit rate; empty without serial links. | |
Static Public Attributes | |
| static constexpr std::chrono::seconds | POLL_INTERVAL {1} |
| How often connection polling ticks the receiver. | |
| static constexpr std::chrono::seconds | OUTPUT_OVERFLOW_WARNING_DURATION {30} |
| How long the warning about output the receiver dropped stays after the last report of it. | |
| static constexpr std::chrono::seconds | SHUTDOWN_TIMEOUT {2} |
| How long shutdown() waits for the workers of retired sessions. | |
Friends | |
| class | GPSReceiverTest |
| The active receiver's RTCM output is a correction source. | |
| class | GPSReceiverSettingsBindingTest |
| class | GPSReceiverConnectionPolicyTest |
Runs the local GPS receiver session and publishes its status Facts, corrections, and position. Public methods and report handlers update state first and emit each changed signal once at their end. The status Facts update their raw values as the receiver writes them, and notify QML of new values at most once a second. Observers may stop or replace the receiver from a signal, and delete it only with deleteLater().
Definition at line 66 of file GPSReceiver.h.
Definition at line 108 of file GPSReceiver.h.
Definition at line 118 of file GPSReceiver.h.
Definition at line 109 of file GPSReceiver.h.
|
explicit |
Definition at line 57 of file GPSReceiver.cc.
References SerialPortManager::portsEnumerated(), GPSSourceHealth::positionChanged(), Fact::rawValueChanged(), receiverChanged(), GPSSourceHealth::Stale, and FactGroup::telemetryAvailableChanged().
| GPSReceiver::~GPSReceiver | ( | ) |
Definition at line 181 of file GPSReceiver.cc.
| std::optional< GPSObservation > GPSReceiver::acceptedPositionObservation | ( | GPSObservation::PositionUse | use | ) | const |
Latest receiver solution that passes the consumer's gates; empty without a fresh fix.
Definition at line 615 of file GPSReceiver.cc.
| int GPSReceiver::activeBaseMode | ( | ) | const |
Definition at line 511 of file GPSReceiver.cc.
| QString GPSReceiver::activeEndpoint | ( | ) | const |
Serial device or TCP host:port of the active receiver.
Definition at line 516 of file GPSReceiver.cc.
| GPSReceiverPresentation GPSReceiver::activePresentation | ( | ) | const |
Presentation capabilities of the connected receiver family.
Definition at line 545 of file GPSReceiver.cc.
References gpsReceiverPresentation().
| RTKSettings::ReceiverRole GPSReceiver::activeRole | ( | ) | const |
Definition at line 535 of file GPSReceiver.cc.
References RTKSettings::ConfiguredBase.
Referenced by detectedReceiver().
| bool GPSReceiver::baseModeSupported | ( | ) | const |
Definition at line 142 of file GPSReceiver.cc.
References capabilitiesFor(), GPSReceiverPresentation::passive, GPSReceiverPresentation::receiverAveraging, GPSReceiverPresentation::rtkBase, and GPSReceiverPresentation::surveyIn.
Referenced by canConnect().
| bool GPSReceiver::canConnect | ( | ) | const |
Definition at line 162 of file GPSReceiver.cc.
References GPSReceiverPresentation::automatic, baseModeSupported(), capabilitiesFor(), connectionSupported(), and GPSReceiverPresentation::specificReceiver.
| GPSReceiverPresentation GPSReceiver::capabilitiesFor | ( | int | role, |
| int | manufacturer ) const |
Editable settings for a role; configured bases also depend on the manufacturer.
Definition at line 495 of file GPSReceiver.cc.
References RTKSettings::ConfiguredBase, gpsReceiverManufacturerForType(), and gpsReceiverPresentation().
Referenced by baseModeSupported(), canConnect(), and connectReceiver().
|
inline |
Definition at line 128 of file GPSReceiver.h.
Referenced by setConfiguration().
|
signal |
| bool GPSReceiver::connectionSupported | ( | ) | const |
UDP only receives, so a receiver QGroundControl configures needs serial or TCP.
Definition at line 137 of file GPSReceiver.cc.
References RTKSettings::ConfiguredBase, effectiveConnectionType(), and RTKSettings::Udp.
Referenced by canConnect().
| bool GPSReceiver::connectReceiver | ( | ) |
Connects the configured receiver at the user's request, spending the persistent-change permission on this attempt. A serial device that QGroundControl may not open yet is asked for first. Lifecycle observers may stop or replace this receiver, and delete it only with deleteLater().
Definition at line 550 of file GPSReceiver.cc.
References capabilitiesFor(), effectiveConnectionType(), hasReceiver(), GPSReceiverPresentation::persistentConfiguration, and RTKSettings::Serial.
| QString GPSReceiver::detectedReceiver | ( | ) | const |
Name of the family an Automatic connection detected, such as "Septentrio", or of the protocol a passive receiver's output carries, such as "u-blox (UBX)" or "NMEA"; empty until detected.
Definition at line 526 of file GPSReceiver.cc.
References activeRole(), gpsInputProtocolName(), gpsReceiverName(), and RTKSettings::Passive.
| void GPSReceiver::disconnectReceiver | ( | ) |
Disconnects and pauses automatic connection until the user connects again.
Definition at line 579 of file GPSReceiver.cc.
|
inline |
Definition at line 205 of file GPSReceiver.h.
Referenced by connectionSupported(), and connectReceiver().
| QString GPSReceiver::errorMessage | ( | ) | const |
The connection or input problem, else a recent report that the receiver dropped output.
Definition at line 243 of file GPSReceiver.cc.
|
signal |
|
inline |
The receiver's reported state; with no receiver, every Fact is at its metadata default.
Definition at line 156 of file GPSReceiver.h.
| bool GPSReceiver::forwardingCorrections | ( | ) | const |
Definition at line 540 of file GPSReceiver.cc.
Referenced by statusTextChanged().
|
overridevirtual |
Implements GPSReceiverConnector.
Definition at line 501 of file GPSReceiver.cc.
Referenced by connectReceiver(), setWorkerFactory(), and statusTextChanged().
|
inline |
Definition at line 200 of file GPSReceiver.h.
|
signal |
|
signal |
Referenced by GPSReceiver().
| QString GPSReceiver::receiverIdentity | ( | ) | const |
Definition at line 521 of file GPSReceiver.cc.
| bool GPSReceiver::reconnecting | ( | ) | const |
The saved receiver is being connected automatically, at startup or after its connection was lost.
Definition at line 610 of file GPSReceiver.cc.
Referenced by statusTextChanged().
|
static |
The application's serial rates that a receiver accepts as an explicit rate; empty without serial links.
Definition at line 481 of file GPSReceiver.cc.
References gpsValidBaudRate(), and SerialPortManager::supportedBaudRates().
|
signal |
The receiver connected on the saved serial device, whose port has device as the name to save it by. The settings store it, so that the receiver is found again once it has been replugged.
Referenced by GPSSettingsBindings::bindReceiver().
|
inline |
The serial device picker's entries from the last scan. "value" is the name to save the port by: one that survives replugging where the port has one, else its system location. The port that the saved device names goes by the saved name instead, so that the picker finds its selection. "label" is the device's description and system location, marked when another QGroundControl connection, such as a vehicle link, holds the port.
Definition at line 134 of file GPSReceiver.h.
|
signal |
|
inline |
Definition at line 160 of file GPSReceiver.h.
| void GPSReceiver::setConfiguration | ( | const Configuration & | configuration | ) |
Definition at line 96 of file GPSReceiver.cc.
References configuration(), GPSReceiverConfiguration::sameConnection(), and GPSReceiverConfiguration::serialDevice.
Referenced by GPSSettingsBindings::bindReceiver().
| void GPSReceiver::setPersistentChangesAllowed | ( | bool | allowed | ) |
Granting permission only lasts until the configuration changes, a session starts or ends, or it is used.
Definition at line 124 of file GPSReceiver.cc.
| void GPSReceiver::setWorkerFactory | ( | WorkerFactory | factory | ) |
Inject before connecting; an empty factory restores the real worker.
Definition at line 169 of file GPSReceiver.cc.
References hasReceiver().
| void GPSReceiver::shutdown | ( | ) |
Stops polling and disconnects, then waits up to SHUTDOWN_TIMEOUT for the workers of retired sessions, which otherwise finish on their own once the event loop delivers their exit.
Definition at line 679 of file GPSReceiver.cc.
| void GPSReceiver::startConnectionPolling | ( | std::function< bool()> | suspended = {} | ) |
Runs tick() every POLL_INTERVAL until shutdown(), skipping ticks while suspended returns true.
Definition at line 589 of file GPSReceiver.cc.
References POLL_INTERVAL.
|
inline |
Definition at line 185 of file GPSReceiver.h.
|
signal |
References RTKSettings::ConfiguredBase, forwardingCorrections(), hasReceiver(), and reconnecting().
|
inline |
Definition at line 183 of file GPSReceiver.h.
|
signal |
| void GPSReceiver::tick | ( | ) |
One step of automatic connection: connections due, reconnections, and USB discovery.
Definition at line 601 of file GPSReceiver.cc.
|
friend |
Definition at line 105 of file GPSReceiver.h.
References GPSReceiverConnectionPolicyTest.
Referenced by GPSReceiverConnectionPolicyTest.
|
friend |
Definition at line 104 of file GPSReceiver.h.
References GPSReceiverSettingsBindingTest.
Referenced by GPSReceiverSettingsBindingTest.
|
friend |
The active receiver's RTCM output is a correction source.
The one-use permission to write receiver flash, for the configuration currently selected. Short state for compact views: a configured base's survey state, otherwise the fix type. What the receiver is doing, as a sentence; empty when no receiver is connected or being connected. The configured receiver supports the selected base mode; a passive receiver has none to support. Connect may start the configured receiver: a selected receiver type, base mode and connection it supports.
Definition at line 103 of file GPSReceiver.h.
References GPSReceiverTest.
Referenced by GPSReceiverTest.
|
staticconstexpr |
How long the warning about output the receiver dropped stays after the last report of it.
Definition at line 114 of file GPSReceiver.h.
|
staticconstexpr |
How often connection polling ticks the receiver.
Definition at line 112 of file GPSReceiver.h.
Referenced by startConnectionPolling().
|
staticconstexpr |
How long shutdown() waits for the workers of retired sessions.
Definition at line 116 of file GPSReceiver.h.