QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
LinkConfiguration Class Referenceabstract

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 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)
 
LinkInterfacelink () const
 
void setLink (const std::shared_ptr< LinkInterface > link)
 
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 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 LinkConfigurationcreateSettings (int type, const QString &name)
 
static LinkConfigurationduplicateSettings (const LinkConfiguration *source)
 
static QString settingsRoot ()
 

Protected Attributes

std::weak_ptr< LinkInterface_link
 Link currently using this configuration (if any)
 

Detailed Description

Interface holding link specific settings.

Definition at line 11 of file LinkConfiguration.h.

Member Enumeration Documentation

◆ LinkType

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 71 of file LinkConfiguration.h.

Constructor & Destructor Documentation

◆ LinkConfiguration() [1/2]

LinkConfiguration::LinkConfiguration ( const QString &  name,
QObject *  parent = nullptr 
)

Definition at line 16 of file LinkConfiguration.cc.

◆ LinkConfiguration() [2/2]

LinkConfiguration::LinkConfiguration ( const LinkConfiguration copy,
QObject *  parent = nullptr 
)

Definition at line 23 of file LinkConfiguration.cc.

◆ ~LinkConfiguration()

LinkConfiguration::~LinkConfiguration ( )
virtual

Definition at line 36 of file LinkConfiguration.cc.

Member Function Documentation

◆ autoConnectChanged

void LinkConfiguration::autoConnectChanged ( )
signal

Referenced by setAutoConnect().

◆ copyFrom()

void LinkConfiguration::copyFrom ( const LinkConfiguration source)
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.

Parameters
[in]sourceThe 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(), UDPConfiguration::copyFrom(), and LinkManager::endConfigurationEditing().

◆ createSettings()

LinkConfiguration * LinkConfiguration::createSettings ( int  type,
const QString &  name 
)
static

Configuration Factory to create new link configuration instance based on the given type.

Returns
A new instance of the given type

Definition at line 52 of file LinkConfiguration.cc.

References name(), type(), TypeBluetooth, TypeLast, TypeLogReplay, TypeSerial, TypeTcp, and TypeUdp.

Referenced by LinkManager::createConfiguration().

◆ duplicateSettings()

LinkConfiguration * LinkConfiguration::duplicateSettings ( const LinkConfiguration source)
static

Duplicate configuration instance. Helper method to create a new instance copy for editing.

Returns
A new copy of the given settings instance

Definition at line 87 of file LinkConfiguration.cc.

References type(), TypeBluetooth, TypeLast, TypeLogReplay, TypeSerial, TypeTcp, and TypeUdp.

Referenced by LinkManager::startConfigurationEditing().

◆ dynamicChanged

void LinkConfiguration::dynamicChanged ( )
signal

Referenced by setDynamic().

◆ highLatencyChanged

void LinkConfiguration::highLatencyChanged ( )
signal

Referenced by setHighLatency().

◆ isAutoConnect()

bool LinkConfiguration::isAutoConnect ( ) const
inline

◆ isDynamic()

bool LinkConfiguration::isDynamic ( ) const
inline

Is this a dynamic configuration?

Returns
True if not persisted

Definition at line 40 of file LinkConfiguration.h.

Referenced by copyFrom().

◆ isForwarding()

bool LinkConfiguration::isForwarding ( ) const
inline

Is this a forwarding link configuration?

Returns
True if forwarding

Definition at line 47 of file LinkConfiguration.h.

◆ isHighLatency()

bool LinkConfiguration::isHighLatency ( ) const
inline

Is this a High Latency configuration?

Returns
True if this is an High Latency configuration (link with large delays).

Definition at line 59 of file LinkConfiguration.h.

Referenced by copyFrom().

◆ link()

LinkInterface * LinkConfiguration::link ( ) const
inline

Definition at line 35 of file LinkConfiguration.h.

References _link.

Referenced by LinkManager::removeConfiguration(), and setLink().

◆ linkChanged

void LinkConfiguration::linkChanged ( )
signal

Referenced by setLink().

◆ loadSettings()

virtual void LinkConfiguration::loadSettings ( QSettings &  settings,
const QString &  root 
)
pure virtual

Load settings, Pure virtual method telling the instance to load its configuration.

Parameters
[in]settingsThe QSettings instance to use
[in]rootThe root path of the setting.

Implemented in MockConfiguration, BluetoothConfiguration, LogReplayConfiguration, SerialConfiguration, TCPConfiguration, and UDPConfiguration.

Referenced by LinkManager::loadLinkConfigurationList().

◆ name()

◆ nameChanged

void LinkConfiguration::nameChanged ( const QString &  name)
signal

◆ saveSettings()

virtual void LinkConfiguration::saveSettings ( QSettings &  settings,
const QString &  root 
) const
pure virtual

Save settings, Pure virtual method telling the instance to save its configuration.

Parameters
[in]settingsThe QSettings instance to use
[in]rootThe root path of the setting.

Implemented in MockConfiguration, BluetoothConfiguration, LogReplayConfiguration, SerialConfiguration, TCPConfiguration, and UDPConfiguration.

◆ setAutoConnect()

void LinkConfiguration::setAutoConnect ( bool  autoc = true)
virtual

Set if this is this an Auto Connect configuration.

Reimplemented in UDPConfiguration.

Definition at line 150 of file LinkConfiguration.cc.

References autoConnectChanged().

Referenced by copyFrom(), LinkManager::loadLinkConfigurationList(), and UDPConfiguration::setAutoConnect().

◆ setDynamic()

void LinkConfiguration::setDynamic ( bool  dynamic = true)

Set if this is this a dynamic configuration. (decided at runtime)

Definition at line 142 of file LinkConfiguration.cc.

References dynamicChanged().

Referenced by copyFrom().

◆ setForwarding()

void LinkConfiguration::setForwarding ( bool  forwarding = true)
inline

Set if this is this a forwarding link configuration. (decided at runtime)

Definition at line 50 of file LinkConfiguration.h.

◆ setHighLatency()

void LinkConfiguration::setHighLatency ( bool  hl = false)

Set if this is this an High Latency configuration.

Definition at line 158 of file LinkConfiguration.cc.

References highLatencyChanged().

Referenced by copyFrom(), and LinkManager::loadLinkConfigurationList().

◆ setLink()

void LinkConfiguration::setLink ( const std::shared_ptr< LinkInterface link)

Definition at line 130 of file LinkConfiguration.cc.

References _link, LinkInterface::disconnected(), link(), and linkChanged().

Referenced by copyFrom().

◆ setName()

void LinkConfiguration::setName ( const QString &  name)

Definition at line 122 of file LinkConfiguration.cc.

References name(), and nameChanged().

Referenced by copyFrom(), and LinkManager::startLogReplay().

◆ settingsRoot()

static QString LinkConfiguration::settingsRoot ( )
inlinestatic

Root path for QSettings

Returns
The root path of the settings.

Definition at line 116 of file LinkConfiguration.h.

Referenced by LinkManager::loadLinkConfigurationList(), and LinkManager::saveLinkConfigurationList().

◆ settingsTitle()

virtual QString LinkConfiguration::settingsTitle ( ) const
pure virtual

Settings Title, Pure virtual method providing the Title for the (QML) settings dialog.

Implemented in MockConfiguration, BluetoothConfiguration, LogReplayConfiguration, SerialConfiguration, TCPConfiguration, and UDPConfiguration.

◆ settingsURL()

virtual QString LinkConfiguration::settingsURL ( ) const
pure virtual

Settings URL, Pure virtual method providing the URL for the (QML) settings dialog.

Implemented in MockConfiguration, BluetoothConfiguration, LogReplayConfiguration, SerialConfiguration, TCPConfiguration, and UDPConfiguration.

◆ type()

virtual LinkType LinkConfiguration::type ( ) const
pure virtual

Connection type, pure virtual method returning one of the -TypeXxx types above.

Returns
The type of links these settings belong to.

Implemented in MockConfiguration, BluetoothConfiguration, LogReplayConfiguration, SerialConfiguration, TCPConfiguration, and UDPConfiguration.

Referenced by createSettings(), duplicateSettings(), and LinkManager::startConfigurationEditing().

Member Data Documentation

◆ _link

std::weak_ptr<LinkInterface> LinkConfiguration::_link
protected

Link currently using this configuration (if any)

Definition at line 126 of file LinkConfiguration.h.

Referenced by copyFrom(), link(), and setLink().


The documentation for this class was generated from the following files: