QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
MavlinkSettings.cc
Go to the documentation of this file.
1#include "MavlinkSettings.h"
2#include "LinkManager.h"
3
5{
6 // Move deprecated settings to new location/names
7
8 QSettings deprecatedSettings;
9 QSettings newSettings;
10
11 newSettings.beginGroup(_settingsGroup);
12
13 static const char* deprecatedGCSHeartbeatEnabledKey = "gcsHeartbeatEnabled";
14 if (!newSettings.contains(sendGCSHeartbeatName) && deprecatedSettings.contains(deprecatedGCSHeartbeatEnabledKey)) {
15 newSettings.setValue(sendGCSHeartbeatName, deprecatedSettings.value(deprecatedGCSHeartbeatEnabledKey));
16 deprecatedSettings.remove(deprecatedGCSHeartbeatEnabledKey);
17 }
18
19 static const char* deprecatedMavlinkGroup = "QGC_MAVLINK_PROTOCOL";
20 static const char* deprecatedMavlinkSystemIdKey = "GCS_SYSTEM_ID";
21 deprecatedSettings.beginGroup(deprecatedMavlinkGroup);
22 if (!newSettings.contains(gcsMavlinkSystemIDName) && deprecatedSettings.contains(deprecatedMavlinkSystemIdKey)) {
23 newSettings.setValue(gcsMavlinkSystemIDName, deprecatedSettings.value(deprecatedMavlinkSystemIdKey));
24 deprecatedSettings.remove(deprecatedMavlinkSystemIdKey);
25 }
26
27 newSettings.endGroup();
28 deprecatedSettings.endGroup();
29}
30
33DECLARE_SETTINGSFACT(MavlinkSettings, apmStartMavlinkStreams)
36DECLARE_SETTINGSFACT(MavlinkSettings, forwardMavlinkHostName)
37DECLARE_SETTINGSFACT(MavlinkSettings, forwardMavlinkAPMSupportHostName)
40
42{
43 if (!_mavlink2SigningKeyFact) {
44 _mavlink2SigningKeyFact = _createSettingsFact(mavlink2SigningKeyName);
45 connect(_mavlink2SigningKeyFact, &Fact::rawValueChanged, this, &MavlinkSettings::_mavlink2SigningKeyChanged);
46 }
47 return _mavlink2SigningKeyFact;
48}
49
50void MavlinkSettings::_mavlink2SigningKeyChanged(void)
51{
52 LinkManager::instance()->resetMavlinkSigning();
53}
#define DECLARE_SETTINGSFACT_NO_FUNC(CLASS, NAME)
#define DECLARE_SETTINGSFACT(CLASS, NAME)
#define DECLARE_SETTINGGROUP(NAME, GROUP)
void rawValueChanged(const QVariant &value)
Application Settings.