QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GPSCorrectionSettings.cc
Go to the documentation of this file.
2
3#include <utility>
4
5#include <QtCore/QSettings>
6
8
9QGC_LOGGING_CATEGORY(GPSCorrectionSettingsLog, "GPS.Settings.GPSCorrectionSettings")
10
11// Preserve persisted keys and custom setting overrides.
12DECLARE_SETTINGGROUP(GPSCorrection, "NTRIP")
13{
14 qCDebug(GPSCorrectionSettingsLog) << this;
15
16 // UDP forwarding moved from NTRIP-only to the selected stream, and its keys with it.
17 QSettings settings;
18 settings.beginGroup(settingsGroup);
19 for (const auto& [legacy, current] : {std::pair{"ntripUdpForwardEnabled", rtcmUdpOutputEnabledName},
20 std::pair{"ntripUdpTargetAddress", rtcmUdpOutputAddressName},
21 std::pair{"ntripUdpTargetPort", rtcmUdpOutputPortName}}) {
22 const QString legacyKey = QLatin1String(legacy);
23 if (settings.contains(legacyKey)) {
24 if (!settings.contains(current)) {
25 settings.setValue(current, settings.value(legacyKey));
26 }
27 settings.remove(legacyKey);
28 }
29 }
30 // UDP input is always validated.
31 settings.remove(QStringLiteral("rtcmUdpValidate"));
32 // "All sources" (4) was removed; fall back to the default highest-priority selection.
33 if (settings.value(correctionSourceName).toUInt() == 4) {
34 settings.remove(correctionSourceName);
35 }
36 // Sources are chosen by category only.
37 settings.remove(QStringLiteral("correctionSourceInstance"));
38 settings.endGroup();
39}
40
42{
43 qCDebug(GPSCorrectionSettingsLog) << this;
44}
45
#define QGC_LOGGING_CATEGORY(name, categoryStr)
#define DECLARE_SETTINGSFACT(CLASS, NAME)
#define DECLARE_SETTINGGROUP(NAME, GROUP)