Commit 2f8cd513 authored by Lorenz Meier's avatar Lorenz Meier

Merge pull request #2186 from mavlink/joystickfix

Disable COM_RC_IN_MODE magic handling, as its causing confusion on al…
parents fb371f36 09bf9fdb
......@@ -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();
}
......
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment