|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <NTRIPManager.h>
Inheritance diagram for NTRIPManager:
Collaboration diagram for NTRIPManager:Classes | |
| struct | Configuration |
| The NTRIP settings as values; the application's settings binding supplies them. More... | |
Public Types | |
| enum class | ConnectionStatus { Disconnected = 0 , Connecting = 1 , Connected = 2 , Reconnecting = 3 , Error = 4 } |
| Public connection status. Numeric values are stable — QML binds against them. More... | |
| enum class | Event { StartRequested , StopRequested , ConfigInvalid , TransportConnected , TransportError , TransportFatalError , ReconnectDue , ReconnectGaveUp , HotReconfigure } |
| using | Dependencies = NTRIPManagerDependencies |
| using | TransportFactory = std::function< NTRIPTransport *(const Configuration &configuration, QObject *parent)> |
| Creates the transport of one connection attempt, parented to parent; null opens an NTRIPHttpTransport. | |
Signals | |
| void | connectionStatusChanged () |
| void | statusMessageChanged () |
| void | securityWarningChanged () |
| void | ggaSourceChanged () |
| void | enableRequested () |
| Retrying after an error turns the saved connection on. | |
| void | certificatePinChanged (const QString &pin) |
| The trusted self-signed caster certificate changed, or was forgotten (empty); the settings should store it. | |
Public Member Functions | |
| NTRIPManager (QObject *parent=nullptr, RuntimeScheduler *scheduler=nullptr, const Dependencies &dependencies={}) | |
| ~NTRIPManager () override | |
| void | init () |
| Applies the configuration; call once the position providers are installed. | |
| void | setConfiguration (const Configuration &configuration) |
| const Configuration & | configuration () const |
| ConnectionStatus | connectionStatus () const |
| QString | connectionStatusText () const |
| QString | statusMessage () const |
| QString | securityWarning () const |
| Set while a connected stream sends its credentials without TLS. | |
| QString | ggaSource () const |
| NTRIPSourceTableController * | sourceTableController () |
| NTRIPConnectionStats * | connectionStats () |
| Q_INVOKABLE void | fetchMountpoints (const QGeoCoordinate &sortCoordinate=QGeoCoordinate()) |
| void | setTransportFactory (TransportFactory factory) |
| An empty factory restores NTRIPHttpTransport for every attempt. | |
| void | setGgaPositionProvider (NTRIPGgaReporter::PositionSource source, NTRIPGgaReporter::PositionProvider provider) |
| Q_INVOKABLE void | retryNTRIP () |
| Retry a user-visible error, preserving the enabled setting for subsequent automatic retries. | |
| void | shutdown () |
| Permanently retire this manager, including deferred settings work. | |
Friends | |
| class | NTRIPManagerTest |
| Short connection state for compact views. | |
Manages the NTRIP caster connection lifecycle as an explicit event-driven state machine. All connection state changes flow through _dispatch() and the transition table in NTRIPManager.cc — there is no second, internal state enum. Entry actions own per-state side effects: each Connecting entry opens a new transport and registers it as the NTRIP correction source, teardown retires both, and the manager schedules reconnects.
Definition at line 52 of file NTRIPManager.h.
Definition at line 107 of file NTRIPManager.h.
| using NTRIPManager::TransportFactory = std::function<NTRIPTransport*(const Configuration& configuration, QObject* parent)> |
Creates the transport of one connection attempt, parented to parent; null opens an NTRIPHttpTransport.
Definition at line 141 of file NTRIPManager.h.
|
strong |
Public connection status. Numeric values are stable — QML binds against them.
| Enumerator | |
|---|---|
| Disconnected | |
| Connecting | |
| Connected | |
| Reconnecting | |
| Error | |
Definition at line 71 of file NTRIPManager.h.
|
strong |
Internal state-machine events, public only so the log names them. Each represents an external stimulus; the transition table in _dispatch() maps (state, event) to the next state.
| Enumerator | |
|---|---|
| StartRequested | Settings enable went true, or the user retried an error. |
| StopRequested | Settings enable went false, or the manager shut down. |
| ConfigInvalid | Connection configuration failed validation. |
| TransportConnected | NTRIPTransport emitted connected(). |
| TransportError | NTRIPTransport emitted a retryable error. |
| TransportFatalError | NTRIPTransport emitted a non-retryable error. |
| ReconnectDue | The reconnect delay elapsed or the network returned. |
| ReconnectGaveUp | The reconnect attempt ceiling was reached. |
| HotReconfigure | Transport-affecting setting changed while connected; reconnect in place. |
Definition at line 83 of file NTRIPManager.h.
|
explicit |
Definition at line 60 of file NTRIPManager.cc.
References QGCNetworkAvailabilityMonitor::availableChanged(), NTRIPSourceTableController::certificatePinned(), ggaSourceChanged(), ReconnectDue, Reconnecting, and NTRIPGgaReporter::sourceChanged().
|
override |
Definition at line 91 of file NTRIPManager.cc.
References shutdown().
|
signal |
The trusted self-signed caster certificate changed, or was forgotten (empty); the settings should store it.
Referenced by GPSSettingsBindings::bindNtrip(), and setConfiguration().
|
inline |
Definition at line 119 of file NTRIPManager.h.
Referenced by setConfiguration().
|
inline |
Definition at line 134 of file NTRIPManager.h.
|
inline |
Definition at line 121 of file NTRIPManager.h.
|
signal |
| QString NTRIPManager::connectionStatusText | ( | ) | const |
Definition at line 105 of file NTRIPManager.cc.
References Connected, Connecting, Disconnected, Error, and Reconnecting.
|
signal |
Retrying after an error turns the saved connection on.
Referenced by GPSSettingsBindings::bindNtrip(), and retryNTRIP().
| void NTRIPManager::fetchMountpoints | ( | const QGeoCoordinate & | sortCoordinate = QGeoCoordinate() | ) |
Fetches the caster's mountpoints, ordered by distance from sortCoordinate; an invalid coordinate keeps the caster's order.
Definition at line 194 of file NTRIPManager.cc.
References NTRIPManager::Configuration::connection, and NTRIPSourceTableController::fetch().
|
inline |
Definition at line 130 of file NTRIPManager.h.
References NTRIPGgaReporter::currentSource().
|
signal |
Referenced by NTRIPManager().
| void NTRIPManager::init | ( | ) |
Applies the configuration; call once the position providers are installed.
Definition at line 122 of file NTRIPManager.cc.
References NTRIPGgaReporter::configure(), and NTRIPManager::Configuration::gga.
Referenced by GPSManager::init().
| void NTRIPManager::retryNTRIP | ( | ) |
Retry a user-visible error, preserving the enabled setting for subsequent automatic retries.
Definition at line 174 of file NTRIPManager.cc.
References NTRIPManager::Configuration::enabled, enableRequested(), and Error.
| QString NTRIPManager::securityWarning | ( | ) | const |
Set while a connected stream sends its credentials without TLS.
Definition at line 99 of file NTRIPManager.cc.
References Connected, NTRIPManager::Configuration::connection, and NTRIPConnectionConfig::credentialsInClearWarning().
|
signal |
| void NTRIPManager::setConfiguration | ( | const Configuration & | configuration | ) |
Before init() the configuration is only stored. After it, stream changes apply after a short debounce, so editing a field does not reconnect per keystroke, and GGA changes apply at once.
Definition at line 133 of file NTRIPManager.cc.
References NTRIPConnectionConfig::allowSelfSignedCerts, certificatePinChanged(), configuration(), NTRIPGgaReporter::configure(), NTRIPManager::Configuration::connection, NTRIPManager::Configuration::enabled, NTRIPManager::Configuration::filter, NTRIPManager::Configuration::gga, NTRIPConnectionConfig::pinnedCertificate, and ScheduledTask::schedule().
Referenced by GPSSettingsBindings::bindNtrip().
| void NTRIPManager::setGgaPositionProvider | ( | NTRIPGgaReporter::PositionSource | source, |
| NTRIPGgaReporter::PositionProvider | provider | ||
| ) |
Definition at line 160 of file NTRIPManager.cc.
References NTRIPGgaReporter::setPositionProvider().
Referenced by NTRIPVehicleGgaSource::attach().
|
inline |
An empty factory restores NTRIPHttpTransport for every attempt.
Definition at line 144 of file NTRIPManager.h.
| void NTRIPManager::shutdown | ( | ) |
Permanently retire this manager, including deferred settings work.
Definition at line 184 of file NTRIPManager.cc.
References NTRIPSourceTableController::cancel().
Referenced by GPSManager::shutdown(), and ~NTRIPManager().
|
inline |
Definition at line 132 of file NTRIPManager.h.
|
inline |
Definition at line 125 of file NTRIPManager.h.
|
signal |
|
friend |
Short connection state for compact views.
Definition at line 67 of file NTRIPManager.h.