From 02d851cdf7a5b2212aa4b5d27e416e16619eecc4 Mon Sep 17 00:00:00 2001 From: Neil Horne <15316949+elecpower@users.noreply.github.com> Date: Fri, 2 Aug 2024 10:12:16 +1000 Subject: [PATCH] fix(cpn): model setup post inverted sources feature (#5359) --- companion/src/modeledit/setup.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/companion/src/modeledit/setup.cpp b/companion/src/modeledit/setup.cpp index ef60ba2910e..ef5f59d5ee3 100644 --- a/companion/src/modeledit/setup.cpp +++ b/companion/src/modeledit/setup.cpp @@ -1706,7 +1706,7 @@ SetupPanel::SetupPanel(QWidget * parent, ModelData & model, GeneralSettings & ge const int ttlInputs = ttlSticks + ttlFlexInputs; for (int i = 0; i < ttlInputs + firmware->getCapability(RotaryEncoders); i++) { - RawSource src((i < ttlInputs) ? SOURCE_TYPE_INPUT : SOURCE_TYPE_ROTARY_ENCODER, (i < ttlInputs) ? i : ttlInputs - i); + RawSource src((i < ttlInputs) ? SOURCE_TYPE_INPUT : SOURCE_TYPE_ROTARY_ENCODER, (i < ttlInputs) ? i + 1 : i - ttlInputs); QCheckBox * checkbox = new QCheckBox(this); checkbox->setProperty("index", i); checkbox->setText(src.toString(&model, &generalSettings)); @@ -1732,7 +1732,7 @@ SetupPanel::SetupPanel(QWidget * parent, ModelData & model, GeneralSettings & ge continue; } - RawSource src(RawSourceType::SOURCE_TYPE_SWITCH, i); + RawSource src(RawSourceType::SOURCE_TYPE_SWITCH, i + 1); QLabel * label = new QLabel(this); QSlider * slider = new QSlider(this); QCheckBox * cb = new QCheckBox(this); @@ -1770,7 +1770,7 @@ SetupPanel::SetupPanel(QWidget * parent, ModelData & model, GeneralSettings & ge if (IS_HORUS_OR_TARANIS(board) && ttlInputs > 0) { for (int i = ttlSticks; i < ttlInputs; i++) { - RawSource src(SOURCE_TYPE_INPUT, i); + RawSource src(SOURCE_TYPE_INPUT, i + 1); QCheckBox * cb = new QCheckBox(this); cb->setProperty("index", i - ttlSticks); cb->setText(src.toString(&model, &generalSettings));