From 09bf9fdb70956237b5ed292d4606784d36b555f4 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 4 Nov 2015 09:55:58 +0100 Subject: [PATCH] Disable COM_RC_IN_MODE magic handling, as its causing confusion on all autopilot stacks. This is a developer thing which is actually much easier to not expose, even for the involved developers. --- src/Vehicle/Vehicle.cc | 20 +------------------- src/VehicleSetup/JoystickConfig.qml | 5 ++--- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index b68209948..fd5b1709c 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -813,25 +813,7 @@ bool Vehicle::joystickEnabled(void) void Vehicle::setJoystickEnabled(bool enabled) { - // The magic parameter will go away, - // until then don't mess with the logic here! - Fact* fact = _autopilotPlugin->getParameterFact(FactSystem::defaultComponentId, "COM_RC_IN_MODE"); - if (!fact) { - qCWarning(JoystickLog) << "Missing COM_RC_IN_MODE parameter"; - } - - // Any value greater than one - // indicates special handling on - // the autopilot side. Force the - // joystick to on. - if (fact->value().toInt() > 1) { - // Mandatory in this setting - _joystickEnabled = true; - } else { - fact->setValue(enabled ? 1 : 0); - _joystickEnabled = enabled; - } - + _joystickEnabled = enabled; _startJoystick(_joystickEnabled); _saveSettings(); } diff --git a/src/VehicleSetup/JoystickConfig.qml b/src/VehicleSetup/JoystickConfig.qml index 11f578f8e..2613ad30d 100644 --- a/src/VehicleSetup/JoystickConfig.qml +++ b/src/VehicleSetup/JoystickConfig.qml @@ -356,11 +356,10 @@ QGCView { QGCCheckBox { enabled: allowEnableDisable - text: _activeJoystick.calibrated ? (rcInMode.value < 2 ? "Enable joystick input, disable RC input" : "Enable/Disable not allowed (COM_RC_IN_MODE=2)") : "Enable/Disable not allowed (Calibrate First)" + text: _activeJoystick.calibrated ? "Enable joystick input" : "Enable/Disable not allowed (Calibrate First)" checked: _activeVehicle.joystickEnabled - property bool allowEnableDisable: _activeJoystick.calibrated && rcInMode.value < 2 - property Fact rcInMode: controller.getParameterFact(-1, "COM_RC_IN_MODE") + property bool allowEnableDisable: _activeJoystick.calibrated onClicked: _activeVehicle.joystickEnabled = checked } -- 2.22.0