Browse Source

Allow use of AutoConnect and HighLatency options for most link types. (#9117)

* Allow use of AutoConnect and HighLatency options for most link types.

* Remove isAutoConnectAllowed and isHighLatencyAllowed methods and assocated Q_PROPERTYs from LinkConfiguration class.  Allow user to configure these properties on all link types.
QGC4.4
brad112358 5 years ago committed by GitHub
parent
commit
b16a3a1f48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      src/comm/LinkConfiguration.h
  2. 1
      src/comm/SerialLink.h
  3. 1
      src/comm/TCPLink.h
  4. 2
      src/comm/UDPLink.h
  5. 2
      src/ui/preferences/LinkSettings.qml

16
src/comm/LinkConfiguration.h

@ -30,11 +30,9 @@ public: @@ -30,11 +30,9 @@ public:
Q_PROPERTY(LinkType linkType READ type CONSTANT)
Q_PROPERTY(bool dynamic READ isDynamic WRITE setDynamic NOTIFY dynamicChanged)
Q_PROPERTY(bool autoConnect READ isAutoConnect WRITE setAutoConnect NOTIFY autoConnectChanged)
Q_PROPERTY(bool autoConnectAllowed READ isAutoConnectAllowed CONSTANT)
Q_PROPERTY(QString settingsURL READ settingsURL CONSTANT)
Q_PROPERTY(QString settingsTitle READ settingsTitle CONSTANT)
Q_PROPERTY(bool highLatency READ isHighLatency WRITE setHighLatency NOTIFY highLatencyChanged)
Q_PROPERTY(bool highLatencyAllowed READ isHighLatencyAllowed CONSTANT)
// Property accessors
@ -91,20 +89,6 @@ public: @@ -91,20 +89,6 @@ public:
/// Virtual Methods
/*!
*
* Is Auto Connect allowed for this type?
* @return True if this type can be set as an Auto Connect configuration
*/
virtual bool isAutoConnectAllowed() { return false; }
/*!
*
* Is High Latency allowed for this type?
* @return True if this type can be set as an High Latency configuration
*/
virtual bool isHighLatencyAllowed() { return false; }
/*!
* @brief Connection type
*
* Pure virtual method returning one of the -TypeXxx types above.

1
src/comm/SerialLink.h

@ -76,7 +76,6 @@ public: @@ -76,7 +76,6 @@ public:
/// From LinkConfiguration
LinkType type () { return LinkConfiguration::TypeSerial; }
void copyFrom (LinkConfiguration* source);
bool isHighLatencyAllowed () { return true; }
void loadSettings (QSettings& settings, const QString& root);
void saveSettings (QSettings& settings, const QString& root);
void updateSettings ();

1
src/comm/TCPLink.h

@ -52,7 +52,6 @@ public: @@ -52,7 +52,6 @@ public:
//LinkConfiguration overrides
LinkType type (void) override { return LinkConfiguration::TypeTcp; }
void copyFrom (LinkConfiguration* source) override;
bool isHighLatencyAllowed(void) override { return true; }
void loadSettings (QSettings& settings, const QString& root) override;
void saveSettings (QSettings& settings, const QString& root) override;
QString settingsURL (void) override { return "TcpSettings.qml"; }

2
src/comm/UDPLink.h

@ -75,8 +75,6 @@ public: @@ -75,8 +75,6 @@ public:
void copyFrom (LinkConfiguration* source) override;
void loadSettings (QSettings& settings, const QString& root) override;
void saveSettings (QSettings& settings, const QString& root) override;
bool isAutoConnectAllowed (void) override { return true; }
bool isHighLatencyAllowed (void) override { return true; }
QString settingsURL (void) override { return "UdpSettings.qml"; }
QString settingsTitle (void) override { return tr("UDP Link Settings"); }

2
src/ui/preferences/LinkSettings.qml

@ -300,7 +300,6 @@ Rectangle { @@ -300,7 +300,6 @@ Rectangle {
QGCCheckBox {
text: qsTr("Automatically Connect on Start")
checked: false
enabled: editConfig ? editConfig.autoConnectAllowed : false
onCheckedChanged: {
if(editConfig) {
editConfig.autoConnect = checked
@ -314,7 +313,6 @@ Rectangle { @@ -314,7 +313,6 @@ Rectangle {
QGCCheckBox {
text: qsTr("High Latency")
checked: false
enabled: editConfig ? editConfig.highLatencyAllowed : false
onCheckedChanged: {
if(editConfig) {
editConfig.highLatency = checked

Loading…
Cancel
Save