|
QGroundControl
Ground Control Station for MAVLink Drones
|
Interface holding link specific settings. More...
#include <LinkConfiguration.h>
Inheritance diagram for LinkConfiguration:
Collaboration diagram for LinkConfiguration:Public Types | |
| enum | LinkType { TypeSerial , TypeUdp , TypeTcp , TypeBluetooth , TypeLogReplay , TypeLast } |
Signals | |
| void | nameChanged (const QString &name) |
| void | linkChanged () |
| void | linkActiveChanged () |
| void | dynamicChanged () |
| void | autoConnectChanged () |
| void | highLatencyChanged () |
Public Member Functions | |
| LinkConfiguration (const QString &name, QObject *parent=nullptr) | |
| LinkConfiguration (const LinkConfiguration *copy, QObject *parent=nullptr) | |
| virtual | ~LinkConfiguration () |
| QString | name () const |
| void | setName (const QString &name) |
| LinkInterface * | link () const |
| void | setLink (const std::shared_ptr< LinkInterface > link) |
| bool | linkActive () const |
| bool | isDynamic () const |
| void | setDynamic (bool dynamic=true) |
| Set if this is this a dynamic configuration. (decided at runtime) | |
| bool | isForwarding () const |
| void | setForwarding (bool forwarding=true) |
| Set if this is this a forwarding link configuration. (decided at runtime) | |
| bool | isAutoConnect () const |
| virtual void | setAutoConnect (bool autoc=true) |
| Set if this is this an Auto Connect configuration. | |
| bool | suppressAutoReconnect () const |
| void | setSuppressAutoReconnect (bool suppress) |
| bool | autoConnectStarted () const |
| void | setAutoConnectStarted (bool started) |
| bool | reconnectReady () const |
| void | noteReconnectAttempt () |
| void | resetReconnectBackoff () |
| void | noteConnected () |
| void | noteDisconnected () |
| Reset backoff only if the link stayed up long enough to count as working. | |
| bool | isHighLatency () const |
| void | setHighLatency (bool hl=false) |
| Set if this is this an High Latency configuration. | |
| virtual void | copyFrom (const LinkConfiguration *source) |
| virtual LinkType | type () const =0 |
| virtual void | loadSettings (QSettings &settings, const QString &root)=0 |
| virtual void | saveSettings (QSettings &settings, const QString &root) const =0 |
| virtual QString | settingsURL () const =0 |
| Settings URL, Pure virtual method providing the URL for the (QML) settings dialog. | |
| virtual QString | settingsTitle () const =0 |
| Settings Title, Pure virtual method providing the Title for the (QML) settings dialog. | |
Static Public Member Functions | |
| static LinkConfiguration * | createSettings (int type, const QString &name) |
| static LinkConfiguration * | duplicateSettings (const LinkConfiguration *source) |
| static QString | settingsRoot () |
Protected Attributes | |
| std::weak_ptr< LinkInterface > | _link |
| Link currently using this configuration (if any) | |
Interface holding link specific settings.
Definition at line 13 of file LinkConfiguration.h.
The link types supported by QGC Any changes here MUST be reflected in LinkManager::linkTypeStrings()
| Enumerator | |
|---|---|
| TypeSerial | Serial Link. |
| TypeUdp | UDP Link. |
| TypeTcp | TCP Link. |
| TypeBluetooth | Bluetooth Link. |
| TypeLogReplay | |
| TypeLast | |
Definition at line 104 of file LinkConfiguration.h.
| LinkConfiguration::LinkConfiguration | ( | const QString & | name, |
| QObject * | parent = nullptr |
||
| ) |
Definition at line 16 of file LinkConfiguration.cc.
| LinkConfiguration::LinkConfiguration | ( | const LinkConfiguration * | copy, |
| QObject * | parent = nullptr |
||
| ) |
Definition at line 23 of file LinkConfiguration.cc.
|
virtual |
Definition at line 36 of file LinkConfiguration.cc.
|
signal |
Referenced by setAutoConnect().
|
inline |
Definition at line 69 of file LinkConfiguration.h.
|
virtual |
Copy instance data, When manipulating data, you create a copy of the configuration using the copy constructor, edit it and then transfer its content to the original using this method.
| [in] | source | The source instance (the edited copy) |
Reimplemented in MockConfiguration, BluetoothConfiguration, LogReplayConfiguration, SerialConfiguration, TCPConfiguration, and UDPConfiguration.
Definition at line 41 of file LinkConfiguration.cc.
References _link, isAutoConnect(), isDynamic(), isHighLatency(), name(), setAutoConnect(), setDynamic(), setHighLatency(), setLink(), and setName().
Referenced by MockConfiguration::copyFrom(), BluetoothConfiguration::copyFrom(), LogReplayConfiguration::copyFrom(), SerialConfiguration::copyFrom(), TCPConfiguration::copyFrom(), and UDPConfiguration::copyFrom().
|
static |
Configuration Factory to create new link configuration instance based on the given type.
Definition at line 52 of file LinkConfiguration.cc.
References config, name(), type(), TypeBluetooth, TypeLast, TypeLogReplay, TypeSerial, TypeTcp, and TypeUdp.
Referenced by LinkManager::createConfiguration().
|
static |
Duplicate configuration instance. Helper method to create a new instance copy for editing.
Definition at line 87 of file LinkConfiguration.cc.
References type(), TypeBluetooth, TypeLast, TypeLogReplay, TypeSerial, TypeTcp, and TypeUdp.
Referenced by LinkManager::startConfigurationEditing().
|
signal |
Referenced by setDynamic().
|
signal |
Referenced by setHighLatency().
|
inline |
Definition at line 59 of file LinkConfiguration.h.
Referenced by SerialWorker::connectToPort(), copyFrom(), and UDPConfiguration::setAutoConnect().
|
inline |
Is this a dynamic configuration?
Definition at line 47 of file LinkConfiguration.h.
Referenced by copyFrom().
|
inline |
Is this a forwarding link configuration?
Definition at line 54 of file LinkConfiguration.h.
|
inline |
Is this a High Latency configuration?
Definition at line 92 of file LinkConfiguration.h.
Referenced by copyFrom().
|
inline |
Definition at line 38 of file LinkConfiguration.h.
References _link.
Referenced by linkActive(), and setLink().
|
inline |
True while the link is connected or being kept connected by auto-reconnect. Stays true across reconnect attempts so UI doesn't flicker between retries.
Definition at line 43 of file LinkConfiguration.h.
References link().
|
signal |
Referenced by setAutoConnect(), setAutoConnectStarted(), setLink(), and setSuppressAutoReconnect().
|
signal |
Referenced by setLink().
|
pure virtual |
Load settings, Pure virtual method telling the instance to load its configuration.
| [in] | settings | The QSettings instance to use |
| [in] | root | The root path of the setting. |
Implemented in MockConfiguration, BluetoothConfiguration, LogReplayConfiguration, SerialConfiguration, TCPConfiguration, and UDPConfiguration.
Referenced by LinkManager::loadLinkConfigurationList().
|
inline |
Definition at line 35 of file LinkConfiguration.h.
Referenced by SerialConfiguration::cleanPortDisplayName(), copyFrom(), createSettings(), LogReplayLink::LogReplayLink(), MockLink::MockLink(), SerialLink::SerialLink(), BluetoothConfiguration::setDevice(), setName(), SerialConfiguration::setPortName(), TCPLink::TCPLink(), and UDPLink::UDPLink().
|
signal |
Referenced by setName().
|
inline |
Definition at line 81 of file LinkConfiguration.h.
|
inline |
Reset backoff only if the link stayed up long enough to count as working.
Definition at line 83 of file LinkConfiguration.h.
References resetReconnectBackoff().
|
inline |
Definition at line 75 of file LinkConfiguration.h.
|
inline |
Definition at line 74 of file LinkConfiguration.h.
|
inline |
Definition at line 80 of file LinkConfiguration.h.
Referenced by noteDisconnected().
|
pure virtual |
Save settings, Pure virtual method telling the instance to save its configuration.
| [in] | settings | The QSettings instance to use |
| [in] | root | The root path of the setting. |
Implemented in MockConfiguration, BluetoothConfiguration, LogReplayConfiguration, SerialConfiguration, TCPConfiguration, and UDPConfiguration.
|
virtual |
Set if this is this an Auto Connect configuration.
Reimplemented in UDPConfiguration.
Definition at line 151 of file LinkConfiguration.cc.
References autoConnectChanged(), and linkActiveChanged().
Referenced by copyFrom(), LinkManager::loadLinkConfigurationList(), and UDPConfiguration::setAutoConnect().
|
inline |
Definition at line 70 of file LinkConfiguration.h.
References linkActiveChanged().
| void LinkConfiguration::setDynamic | ( | bool | dynamic = true | ) |
Set if this is this a dynamic configuration. (decided at runtime)
Definition at line 143 of file LinkConfiguration.cc.
References dynamicChanged().
Referenced by copyFrom().
|
inline |
Set if this is this a forwarding link configuration. (decided at runtime)
Definition at line 57 of file LinkConfiguration.h.
| void LinkConfiguration::setHighLatency | ( | bool | hl = false | ) |
Set if this is this an High Latency configuration.
Definition at line 160 of file LinkConfiguration.cc.
References highLatencyChanged().
Referenced by copyFrom(), and LinkManager::loadLinkConfigurationList().
| void LinkConfiguration::setLink | ( | const std::shared_ptr< LinkInterface > | link | ) |
Definition at line 130 of file LinkConfiguration.cc.
References _link, LinkInterface::disconnected(), link(), linkActiveChanged(), and linkChanged().
Referenced by copyFrom().
| void LinkConfiguration::setName | ( | const QString & | name | ) |
Definition at line 122 of file LinkConfiguration.cc.
References name(), and nameChanged().
Referenced by copyFrom(), and LinkManager::startLogReplay().
|
inline |
Definition at line 65 of file LinkConfiguration.h.
References linkActiveChanged().
|
inlinestatic |
Root path for QSettings
Definition at line 149 of file LinkConfiguration.h.
Referenced by LinkManager::loadLinkConfigurationList(), and LinkManager::saveLinkConfigurationList().
|
pure virtual |
Settings Title, Pure virtual method providing the Title for the (QML) settings dialog.
Implemented in MockConfiguration, BluetoothConfiguration, LogReplayConfiguration, SerialConfiguration, TCPConfiguration, and UDPConfiguration.
|
pure virtual |
Settings URL, Pure virtual method providing the URL for the (QML) settings dialog.
Implemented in MockConfiguration, BluetoothConfiguration, LogReplayConfiguration, SerialConfiguration, TCPConfiguration, and UDPConfiguration.
|
inline |
Definition at line 64 of file LinkConfiguration.h.
|
pure virtual |
Connection type, pure virtual method returning one of the -TypeXxx types above.
Implemented in MockConfiguration, BluetoothConfiguration, LogReplayConfiguration, SerialConfiguration, TCPConfiguration, and UDPConfiguration.
Referenced by createSettings(), and duplicateSettings().
|
protected |
Link currently using this configuration (if any)
Definition at line 160 of file LinkConfiguration.h.
Referenced by copyFrom(), link(), and setLink().