Issue 3473 port to next (#3587)
This commit is contained in:
committed by
Bertrand Songis
parent
13558214a8
commit
dd12d09c92
@@ -110,10 +110,10 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
|
||||
reUse[i] = new QComboBox(ui->reGB);
|
||||
reUse[i]->setProperty("index", i);
|
||||
populateGvarUseCB(reUse[i], phaseIdx);
|
||||
connect(reUse[i], SIGNAL(currentIndexChanged(int)), this, SLOT(phaseREUse_currentIndexChanged(int)));
|
||||
if (phase.rotaryEncoders[i] > 1024) {
|
||||
reUse[i]->setCurrentIndex(phase.rotaryEncoders[i] - 1024);
|
||||
}
|
||||
connect(reUse[i], SIGNAL(currentIndexChanged(int)), this, SLOT(phaseREUse_currentIndexChanged(int)));
|
||||
reLayout->addWidget(reUse[i], i, 1, 1, 1);
|
||||
}
|
||||
// RE value
|
||||
@@ -290,8 +290,14 @@ void FlightModePanel::trimUpdate(unsigned int trim)
|
||||
trimsUse[trim]->setCurrentIndex(1 + 2*phase.trimRef[chn] + phase.trimMode[chn] - (phase.trimRef[chn] > phaseIdx ? 1 : 0));
|
||||
else
|
||||
trimsUse[trim]->setCurrentIndex(phase.trimRef[chn]);
|
||||
trimsValue[trim]->setEnabled(true);
|
||||
trimsSlider[trim]->setEnabled(true);
|
||||
if (phaseIdx == 0 || phase.trimRef[chn] == phaseIdx || (IS_TARANIS(board) && phase.trimMode[chn] != 0)) {
|
||||
trimsValue[trim]->setEnabled(true);
|
||||
trimsSlider[trim]->setEnabled(true);
|
||||
}
|
||||
else {
|
||||
trimsValue[trim]->setEnabled(false);
|
||||
trimsSlider[trim]->setEnabled(false);
|
||||
}
|
||||
}
|
||||
lock = false;
|
||||
}
|
||||
@@ -443,7 +449,7 @@ void FlightModePanel::fmClear()
|
||||
{
|
||||
int res = QMessageBox::question(this, "Companion", tr("Clear all current Flight Mode properties?"), QMessageBox::Yes | QMessageBox::No);
|
||||
if (res == QMessageBox::Yes) {
|
||||
phase.clear();
|
||||
phase.clear(phaseIdx);
|
||||
if (phaseIdx == 0) {
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
for (int i=0; i < gvCount; ++i) {
|
||||
@@ -459,11 +465,11 @@ void FlightModePanel::fmClear()
|
||||
pswtch->setCurrentIndex(pswtch->findText(item.toString()));
|
||||
if (gvCount > 0 && (firmware->getCapability(GvarsFlightModes))) {
|
||||
for (int i=0; i<gvCount; i++) {
|
||||
gvUse[i]->setCurrentIndex(0);
|
||||
gvUse[i]->setCurrentIndex((phase.gvars[i] > 1024 ? (phase.gvars[i] - 1024) : 0));
|
||||
}
|
||||
}
|
||||
for (int i=0; i<reCount; i++) {
|
||||
reUse[i]->setCurrentIndex(0);
|
||||
reUse[i]->setCurrentIndex((phase.rotaryEncoders[i] > 1024 ? (phase.rotaryEncoders[i] - 1024) : 0));
|
||||
}
|
||||
lock = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user