From 6d5ea22717c5c769ae2faca97502faf591b57964 Mon Sep 17 00:00:00 2001 From: Neil Horne <15316949+elecpower@users.noreply.github.com> Date: Tue, 4 Jun 2024 09:37:59 +1000 Subject: [PATCH] fix(simulator): mapping of labels to controls (#5117) --- companion/src/simulation/simulatorwidget.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/companion/src/simulation/simulatorwidget.cpp b/companion/src/simulation/simulatorwidget.cpp index 0c241a052a7..a708c013e8d 100644 --- a/companion/src/simulation/simulatorwidget.cpp +++ b/companion/src/simulation/simulatorwidget.cpp @@ -617,7 +617,7 @@ void SimulatorWidget::setupRadioWidgets() continue; swcfg = Board::SwitchType(radioSettings.switchConfig[i].type); - wname = RawSource(RawSourceType::SOURCE_TYPE_SWITCH, i).toString(nullptr, &radioSettings, Board::BOARD_UNKNOWN, false); + wname = RawSource(RawSourceType::SOURCE_TYPE_SWITCH, i + 1).toString(nullptr, &radioSettings, Board::BOARD_UNKNOWN, false); RadioSwitchWidget * sw = new RadioSwitchWidget(swcfg, wname, -1, ui->radioWidgetsHT); sw->setIndex(i); ui->radioWidgetsHTLayout->addWidget(sw); @@ -632,7 +632,7 @@ void SimulatorWidget::setupRadioWidgets() if (!(radioSettings.isInputAvailable(i) && radioSettings.isInputPot(i))) continue; - wname = RawSource(RawSourceType::SOURCE_TYPE_INPUT, i).toString(nullptr, &radioSettings, Board::BOARD_UNKNOWN, false); + wname = RawSource(RawSourceType::SOURCE_TYPE_INPUT, i + 1).toString(nullptr, &radioSettings, Board::BOARD_UNKNOWN, false); RadioKnobWidget * pot = new RadioKnobWidget(radioSettings.inputConfig[i].flexType, wname, 0, ui->radioWidgetsHT); pot->setIndex(i); ui->radioWidgetsHTLayout->insertWidget(midpos++, pot); @@ -646,7 +646,7 @@ void SimulatorWidget::setupRadioWidgets() if (!(radioSettings.isInputAvailable(i) && radioSettings.isInputSlider(i))) continue; - wname = RawSource(RawSourceType::SOURCE_TYPE_INPUT, i).toString(nullptr, &radioSettings, Board::BOARD_UNKNOWN, false); + wname = RawSource(RawSourceType::SOURCE_TYPE_INPUT, i + 1).toString(nullptr, &radioSettings, Board::BOARD_UNKNOWN, false); RadioFaderWidget * sl = new RadioFaderWidget(wname, 0, ui->radioWidgetsVC); sl->setIndex(i); ui->VCGridLayout->addWidget(sl, 0, fc++, 1, 1); @@ -657,7 +657,7 @@ void SimulatorWidget::setupRadioWidgets() int tc = 0; int tridx = ttlSticks; for (i = 0; i < extraTrims; i += 1, tridx += 1) { - wname = RawSource(RawSourceType::SOURCE_TYPE_TRIM, tridx).toString(nullptr, &radioSettings, Board::BOARD_UNKNOWN, false); + wname = RawSource(RawSourceType::SOURCE_TYPE_TRIM, tridx + 1).toString(nullptr, &radioSettings, Board::BOARD_UNKNOWN, false); wname = wname.left(1) % wname.right(1); RadioTrimWidget * tw = new RadioTrimWidget(Qt::Vertical, ui->radioWidgetsVC); tw->setIndices(tridx, tridx * 2, tridx * 2 + 1);