From 02727f2bd5a0a6c676e2ccbb5f026857b541e624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Tue, 27 Jul 2021 14:30:24 -0400 Subject: [PATCH] APMSafetyComponentSummarySub: Add 'Disabled' text when battery monitor is not enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Parameter only exists if the battery monitor was configured (not None) Signed-off-by: Patrick José Pereira --- src/AutoPilotPlugins/APM/APMSafetyComponentSummarySub.qml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/AutoPilotPlugins/APM/APMSafetyComponentSummarySub.qml b/src/AutoPilotPlugins/APM/APMSafetyComponentSummarySub.qml index 8289619..ca2cdcf 100644 --- a/src/AutoPilotPlugins/APM/APMSafetyComponentSummarySub.qml +++ b/src/AutoPilotPlugins/APM/APMSafetyComponentSummarySub.qml @@ -53,7 +53,17 @@ Item { VehicleSummaryRow { visible: !_firmware34 labelText: qsTr("Battery failsafe:") - valueText: _firmware34 ? "" : _failsafeBatteryEnable.enumOrValueString + valueText: { + if(_firmware34) { + return "Firmware not supported" + } + + if (!_failsafeBatteryEnable) { + return "Disabled" + } + + return _failsafeBatteryEnable.enumOrValueString + } } VehicleSummaryRow { visible: !_firmware34