Skip to content

Commit

Permalink
fix(cpn): Incorrect T5/T6 trims on TX16S (#4303)
Browse files Browse the repository at this point in the history
  • Loading branch information
philmoz authored Nov 11, 2023
1 parent 670e1c9 commit 51c258f
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions companion/src/simulation/simulatorwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,33 +628,32 @@ void SimulatorWidget::setupRadioWidgets()
}

// faders between sticks
int c = extraTrims / 2; // leave space for any extra trims
int fc = extraTrims / 2; // leave space for any extra trims
for (i = 0; i < ttlFaders; ++i) {
if (!radioSettings.isSliderAvailable(i))
continue;

wname = RawSource(RawSourceType::SOURCE_TYPE_STICK, ttlSticks + ttlKnobs + i).toString(nullptr, &radioSettings);
RadioFaderWidget * sl = new RadioFaderWidget(wname, 0, ui->radioWidgetsVC);
sl->setIndex(i);
ui->VCGridLayout->addWidget(sl, 0, c++, 1, 1);
ui->VCGridLayout->addWidget(sl, 0, fc++, 1, 1);

m_radioWidgets.append(sl);
}

// extra trims around faders
int tridx = Board::TRIM_AXIS_COUNT;
int trswidx = Board::TRIM_SW_COUNT;
for (i = extraTrims; i > 0; --i) {
trswidx -= 2;
--tridx;
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);
wname = wname.left(1) % wname.right(1);
RadioTrimWidget * tw = new RadioTrimWidget(Qt::Vertical, ui->radioWidgetsVC);
tw->setIndices(tridx, trswidx, trswidx + 1);
tw->setIndices(tridx, tridx * 2, tridx * 2 + 1);
tw->setLabelText(wname);
if (i <= extraTrims / 2)
c = 0;
ui->VCGridLayout->addWidget(tw, 0, c++, 1, 1);
if (i == extraTrims / 2)
tc += (fc + extraTrims / 2 - 1);
ui->VCGridLayout->addWidget(tw, 0, tc, 1, 1);
tc += (i >= extraTrims / 2) ? -1 : 1;

connect(simulator, &SimulatorInterface::trimValueChange, tw, &RadioTrimWidget::setTrimValue);
connect(simulator, &SimulatorInterface::trimRangeChange, tw, &RadioTrimWidget::setTrimRangeQual);
Expand Down

0 comments on commit 51c258f

Please sign in to comment.