diff --git a/src/AutoPilotPlugins/APM/APMSafetyComponent.qml b/src/AutoPilotPlugins/APM/APMSafetyComponent.qml index 3ac3f26ab76..531a2806d72 100644 --- a/src/AutoPilotPlugins/APM/APMSafetyComponent.qml +++ b/src/AutoPilotPlugins/APM/APMSafetyComponent.qml @@ -661,13 +661,7 @@ SetupPage { Column { spacing: _margins / 2 - property Fact _rtlAltFact: { - if (controller.firmwareMajorVersion < 4 || (controller.firmwareMajorVersion === 4 && controller.firmwareMinorVersion < 5)) { - return controller.getParameterFact(-1, "ALT_HOLD_RTL") - } else { - return controller.getParameterFact(-1, "RTL_ALTITUDE") - } - } + property Fact _rtlAltFact: controller.getParameterFact(-1, "r.RTL_ALTITUDE") QGCLabel { text: qsTr("Return to Launch") diff --git a/src/AutoPilotPlugins/APM/APMSafetyComponentPlane.qml b/src/AutoPilotPlugins/APM/APMSafetyComponentPlane.qml index 427fab309b3..0f35a163137 100644 --- a/src/AutoPilotPlugins/APM/APMSafetyComponentPlane.qml +++ b/src/AutoPilotPlugins/APM/APMSafetyComponentPlane.qml @@ -39,14 +39,7 @@ SetupPage { property Fact _failsafeThrEnable: controller.getParameterFact(-1, "THR_FAILSAFE") property Fact _failsafeThrValue: controller.getParameterFact(-1, "THR_FS_VALUE") property Fact _failsafeGCSEnable: controller.getParameterFact(-1, "FS_GCS_ENABL") - - property Fact _rtlAltFact: { - if (controller.firmwareMajorVersion < 4 || (controller.firmwareMajorVersion === 4 && controller.firmwareMinorVersion < 5)) { - return controller.getParameterFact(-1, "ALT_HOLD_RTL") - } else { - return controller.getParameterFact(-1, "RTL_ALTITUDE") - } - } + property Fact _rtlAltFact: controller.getParameterFact(-1, "r.RTL_ALTITUDE") property real _margins: ScreenTools.defaultFontPixelHeight diff --git a/src/AutoPilotPlugins/APM/APMSafetyComponentSummary.qml b/src/AutoPilotPlugins/APM/APMSafetyComponentSummary.qml index 9ba5f829876..772276ccd47 100644 --- a/src/AutoPilotPlugins/APM/APMSafetyComponentSummary.qml +++ b/src/AutoPilotPlugins/APM/APMSafetyComponentSummary.qml @@ -147,7 +147,7 @@ Item { valueText: fact ? (fact.value < 0 ? qsTr("current") : fact.valueString + " " + fact.units) : "" visible: controller.vehicle.fixedWing - property Fact fact: controller.getParameterFact(-1, "ALT_HOLD_RTL", false /* reportMissing */) + property Fact fact: controller.getParameterFact(-1, "r.RTL_ALTITUDE", false /* reportMissing */) } } } diff --git a/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryPlane.qml b/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryPlane.qml index 14491890aca..e98c5726836 100644 --- a/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryPlane.qml +++ b/src/AutoPilotPlugins/APM/APMSafetyComponentSummaryPlane.qml @@ -18,14 +18,7 @@ Item { property Fact _failsafeThrEnable: controller.getParameterFact(-1, "THR_FAILSAFE") property Fact _failsafeThrValue: controller.getParameterFact(-1, "THR_FS_VALUE") property Fact _failsafeGCSEnable: controller.getParameterFact(-1, "FS_GCS_ENABL") - - property Fact _rtlAltFact: { - if (controller.firmwareMajorVersion < 4 || (controller.firmwareMajorVersion === 4 && controller.firmwareMinorVersion < 5)) { - return controller.getParameterFact(-1, "ALT_HOLD_RTL") - } else { - return controller.getParameterFact(-1, "RTL_ALTITUDE") - } - } + property Fact _rtlAltFact: controller.getParameterFact(-1, "r.RTL_ALTITUDE") Column { anchors.fill: parent diff --git a/src/FirmwarePlugin/APM/ArduPlaneFirmwarePlugin.cc b/src/FirmwarePlugin/APM/ArduPlaneFirmwarePlugin.cc index d8e04f52218..3c6123cedcf 100644 --- a/src/FirmwarePlugin/APM/ArduPlaneFirmwarePlugin.cc +++ b/src/FirmwarePlugin/APM/ArduPlaneFirmwarePlugin.cc @@ -82,6 +82,8 @@ ArduPlaneFirmwarePlugin::ArduPlaneFirmwarePlugin(QObject *parent) remapV4_5["AIRSPEED_MIN"] = QStringLiteral("ARSPD_FBW_MIN"); remapV4_5["AIRSPEED_MAX"] = QStringLiteral("ARSPD_FBW_MAX"); + remapV4_5["RTL_ALTITUDE"] = QStringLiteral("ALT_HOLD_RTL"); + // LAND_SPEED is only used in a Copter component _remapParamNameIntialized = true; }