diff --git a/src/AutoPilotPlugins/Common/RadioComponent.qml b/src/AutoPilotPlugins/Common/RadioComponent.qml index f4df9cc9c9dcb5f16c23faccccc14e9157b580b4..7eec8a97cc6d350236cf7d0beb0880825803f166 100644 --- a/src/AutoPilotPlugins/Common/RadioComponent.qml +++ b/src/AutoPilotPlugins/Common/RadioComponent.qml @@ -203,10 +203,10 @@ QGCView { anchors.verticalCenter: parent.verticalCenter width: parent.height * 0.75 height: width - x: ((Math.abs((rcValue - _pwmMin) - (reversed ? _pwmMin : 0)) / _pwmRange) * parent.width) - (width / 2) radius: width / 2 color: qgcPal.text visible: mapped + x: (((reversed ? _pwmMax - rcValue : rcValue - _pwmMin) / _pwmRange) * parent.width) - (width / 2) } QGCLabel { diff --git a/src/AutoPilotPlugins/Common/RadioComponentController.cc b/src/AutoPilotPlugins/Common/RadioComponentController.cc index 827b11b55bd49693e130192c5fd9be744aa195f7..a6f69d44fe671dba5c9786dd73a6977f263b01bd 100644 --- a/src/AutoPilotPlugins/Common/RadioComponentController.cc +++ b/src/AutoPilotPlugins/Common/RadioComponentController.cc @@ -403,8 +403,6 @@ void RadioComponentController::_inputStickDetect(enum rcCalFunctions function, i if (_stickSettleComplete(value)) { ChannelInfo* info = &_rgChannelInfo[channel]; - qCDebug(RadioComponentControllerLog) << "_inputStickDetect settle complete, function:channel:value" << function << channel << value; - // Stick detection is complete. Stick should be at max position. // Map the channel to the function _rgFunctionChannelMapping[function] = channel; @@ -413,6 +411,8 @@ void RadioComponentController::_inputStickDetect(enum rcCalFunctions function, i // Channel should be at max value, if it is below initial set point the the channel is reversed. info->reversed = value < _rcValueSave[channel]; + qCDebug(RadioComponentControllerLog) << "_inputStickDetect settle complete, function:channel:value:reversed" << function << channel << value << info->reversed; + if (info->reversed) { _rgChannelInfo[channel].rcMin = value; } else { @@ -885,9 +885,9 @@ void RadioComponentController::_stopCalibration(void) /// @brief Saves the current channel values, so that we can detect when the use moves an input. void RadioComponentController::_rcCalSaveCurrentValues(void) { - qCDebug(RadioComponentControllerLog) << "_rcCalSaveCurrentValues"; for (int i = 0; i < _chanMax(); i++) { _rcValueSave[i] = _rcRawValue[i]; + qCDebug(RadioComponentControllerLog) << "_rcCalSaveCurrentValues channel:value" << i << _rcValueSave[i]; } } diff --git a/src/QmlControls/RCChannelMonitor.qml b/src/QmlControls/RCChannelMonitor.qml index b0a1790702e34ec4f275c98612e20880c649852f..c3563eb4517806c0162075c5d988ba7babe55d44 100644 --- a/src/QmlControls/RCChannelMonitor.qml +++ b/src/QmlControls/RCChannelMonitor.qml @@ -67,7 +67,7 @@ FactPanel { anchors.verticalCenter: parent.verticalCenter width: parent.height * 0.75 height: width - x: ((Math.abs((rcValue - _pwmMin) - (reversed ? _pwmMin : 0)) / _pwmRange) * parent.width) - (width / 2) + x: (((reversed ? _pwmMax - rcValue : rcValue - _pwmMin) / _pwmRange) * parent.width) - (width / 2) radius: width / 2 color: qgcPal.text visible: mapped