From c7534df6cb85943ebe747ec184e44fa6edbd694b Mon Sep 17 00:00:00 2001 From: Willian Galvani Date: Thu, 20 Feb 2020 11:15:12 -0300 Subject: [PATCH] APMSubMotorComponent.qml: fix broken binding timer.start() and timer.stop() were breaking the 'running' binding of the timer --- src/AutoPilotPlugins/APM/APMSubMotorComponent.qml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/AutoPilotPlugins/APM/APMSubMotorComponent.qml b/src/AutoPilotPlugins/APM/APMSubMotorComponent.qml index f09c2d2a1..9400f20c2 100644 --- a/src/AutoPilotPlugins/APM/APMSubMotorComponent.qml +++ b/src/AutoPilotPlugins/APM/APMSubMotorComponent.qml @@ -28,7 +28,8 @@ SetupPage { property int neutralValue: 50; property int _lastIndex: 0; - property bool canDoManualTest: controller.vehicle.flightMode !== 'Motor Detection' && controller.vehicle.armed && motorPage.visible + property bool canRunManualTest: controller.vehicle.flightMode !== 'Motor Detection' && controller.vehicle.armed && motorPage.visible && setupView.visible + property var shouldRunManualTest: false // Does the operator intend to run the motor test? APMSubMotorComponentController { id: controller @@ -49,7 +50,7 @@ SetupPage { Row { id: motorSliders - enabled: canDoManualTest + enabled: canRunManualTest && shouldRunManualTest spacing: ScreenTools.defaultFontPixelWidth * 4 Column { @@ -169,7 +170,7 @@ SetupPage { id: safetySwitch onToggled: { if (controller.vehicle.armed) { - timer.stop() + shouldRunManualTest = false enabled = false coolDownTimer.start() } @@ -186,11 +187,11 @@ SetupPage { { safetySwitch.checked = armed if (!armed) { - timer.stop() + shouldRunManualTest = false safetySwitch.enabled = false coolDownTimer.start() } else { - timer.start() + shouldRunManualTest = true } for (var sliderIndex=0; sliderIndex