Browse Source

Control COMPONENT_INFORMATION query from app setting

QGC4.4
DonLakeFlyer 4 years ago committed by Don Gagne
parent
commit
ec13a2d0ab
  1. 6
      src/Settings/App.SettingsGroup.json
  2. 1
      src/Settings/AppSettings.cc
  3. 2
      src/Settings/AppSettings.h
  4. 5
      src/Vehicle/ComponentInformationManager.cc
  5. 8
      src/ui/preferences/GeneralSettings.qml

6
src/Settings/App.SettingsGroup.json

@ -310,6 +310,12 @@ @@ -310,6 +310,12 @@
"longDesc": "Host name to forward mavlink to. i.e: localhost:14445",
"type": "string",
"default": "localhost:14445"
},
{
"name": "useComponentInformationQuery",
"shortDesc": "Use COMPONENT_INFORMATION query (beta)",
"type": "bool",
"default": false
}
]
}

1
src/Settings/AppSettings.cc

@ -136,6 +136,7 @@ DECLARE_SETTINGSFACT(AppSettings, saveCsvTelemetry) @@ -136,6 +136,7 @@ DECLARE_SETTINGSFACT(AppSettings, saveCsvTelemetry)
DECLARE_SETTINGSFACT(AppSettings, firstRunPromptIdsShown)
DECLARE_SETTINGSFACT(AppSettings, forwardMavlink)
DECLARE_SETTINGSFACT(AppSettings, forwardMavlinkHostName)
DECLARE_SETTINGSFACT(AppSettings, useComponentInformationQuery)
DECLARE_SETTINGSFACT_NO_FUNC(AppSettings, indoorPalette)
{

2
src/Settings/AppSettings.h

@ -63,7 +63,7 @@ public: @@ -63,7 +63,7 @@ public:
DEFINE_SETTINGFACT(firstRunPromptIdsShown)
DEFINE_SETTINGFACT(forwardMavlink)
DEFINE_SETTINGFACT(forwardMavlinkHostName)
DEFINE_SETTINGFACT(useComponentInformationQuery)
// Although this is a global setting it only affects ArduPilot vehicle since PX4 automatically starts the stream from the vehicle side
DEFINE_SETTINGFACT(apmStartMavlinkStreams)

5
src/Vehicle/ComponentInformationManager.cc

@ -16,6 +16,8 @@ @@ -16,6 +16,8 @@
#include "CompInfoParam.h"
#include "QGCFileDownload.h"
#include "QGCApplication.h"
#include "SettingsManager.h"
#include "AppSettings.h"
#include <QStandardPaths>
#include <QJsonDocument>
@ -184,6 +186,9 @@ void RequestMetaDataTypeStateMachine::_stateRequestCompInfo(StateMachine* stateM @@ -184,6 +186,9 @@ void RequestMetaDataTypeStateMachine::_stateRequestCompInfo(StateMachine* stateM
if (weakLink.expired()) {
qCDebug(ComponentInformationManagerLog) << QStringLiteral("_stateRequestCompInfo Skipping component information %1 request due to no primary link").arg(requestMachine->typeToString());
stateMachine->advance();
} else if (!qgcApp()->toolbox()->settingsManager()->appSettings()->useComponentInformationQuery()->rawValue().toBool()) {
qCDebug(ComponentInformationManagerLog) << QStringLiteral("_stateRequestCompInfo Skipping component information %1 request due to application setting").arg(requestMachine->typeToString());
stateMachine->advance();
} else {
SharedLinkInterfacePtr sharedLink = weakLink.lock();
if (sharedLink->linkConfiguration()->isHighLatency() || sharedLink->isPX4Flow() || sharedLink->isLogReplay()) {

8
src/ui/preferences/GeneralSettings.qml

@ -645,6 +645,14 @@ Rectangle { @@ -645,6 +645,14 @@ Rectangle {
}
}
}
FactCheckBox {
text: _fact.shortDescription
fact: _fact
visible: _fact.visible
property Fact _fact: QGroundControl.settingsManager.appSettings.useComponentInformationQuery
}
}
}

Loading…
Cancel
Save