Browse Source

Fix multiple off by ones in channel function code

QGC4.4
DonLakeFlyer 4 years ago committed by Don Gagne
parent
commit
7ed9d39a61
  1. 2
      src/AutoPilotPlugins/APM/APMFlightModesComponent.qml
  2. 2
      src/AutoPilotPlugins/APM/APMFlightModesComponentController.cc
  3. 2
      src/AutoPilotPlugins/APM/APMFlightModesComponentController.h

2
src/AutoPilotPlugins/APM/APMFlightModesComponent.qml

@ -211,7 +211,7 @@ SetupPage {
QGCLabel { QGCLabel {
anchors.baseline: optCombo.baseline anchors.baseline: optCombo.baseline
text: qsTr("Channel option %1 :").arg(index) text: qsTr("Channel option %1 :").arg(index)
color: controller.channelOptionEnabled[modelData] ? "yellow" : qgcPal.text color: controller.channelOptionEnabled[modelData + (_ch7OptAvailable ? 1 : 0)] ? "yellow" : qgcPal.text
} }
FactComboBox { FactComboBox {

2
src/AutoPilotPlugins/APM/APMFlightModesComponentController.cc

@ -107,7 +107,7 @@ void APMFlightModesComponentController::_rcChannelsChanged(int channelCount, int
for (int i=0; i<_cChannelOptions; i++) { for (int i=0; i<_cChannelOptions; i++) {
_rgChannelOptionEnabled[i] = QVariant(false); _rgChannelOptionEnabled[i] = QVariant(false);
channelValue = pwmValues[i+6]; channelValue = pwmValues[i+5];
if (channelValue > 1800) { if (channelValue > 1800) {
_rgChannelOptionEnabled[i] = QVariant(true); _rgChannelOptionEnabled[i] = QVariant(true);
} }

2
src/AutoPilotPlugins/APM/APMFlightModesComponentController.h

@ -81,7 +81,7 @@ private:
QVariantList _superSimpleModeEnabled; QVariantList _superSimpleModeEnabled;
static const uint8_t _allSimpleBits = 0x3F; static const uint8_t _allSimpleBits = 0x3F;
static const int _cChannelOptions = 10; static const int _cChannelOptions = 11;
static const int _cSimpleModeBits = 8; static const int _cSimpleModeBits = 8;
static const int _cFltModes = 6; static const int _cFltModes = 6;

Loading…
Cancel
Save