1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-22 15:55:26 +03:00

Issue #192 - Trims and Rotary encoders buttons added to the switches

list
This commit is contained in:
Bertrand Songis 2014-02-06 12:45:53 +01:00
parent 46fe25fd24
commit 4a20329b2b
14 changed files with 178 additions and 108 deletions

View file

@ -506,18 +506,22 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, unsigned long attr,
}
}
for (int i=1; i<=GetEepromInterface()->getCapability(CustomSwitches); i++) {
item = RawSwitch(SWITCH_TYPE_VIRTUAL, i);
for (int i=0; i<GetEepromInterface()->getCapability(MultiposPots) * GetEepromInterface()->getCapability(MultiposPotsPositions); i++) {
item = RawSwitch(SWITCH_TYPE_MULTIPOS_POT, i);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
for (int i=0; i<GetEepromInterface()->getCapability(MultiposPots) * GetEepromInterface()->getCapability(MultiposPotsPositions); i++) {
item = RawSwitch(SWITCH_TYPE_MULTIPOS_POT, i);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
for (int i=0; i<GetEepromInterface()->getCapability(RotaryEncoders); i++) {
item = RawSwitch(SWITCH_TYPE_ROTARY_ENCODER, i);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
for (int i=1; i<=GetEepromInterface()->getCapability(CustomSwitches); i++) {
item = RawSwitch(SWITCH_TYPE_VIRTUAL, i);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
if (attr & POPULATE_ONOFF) {