1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-16 21:05:26 +03:00

Telemetry fixes

This commit is contained in:
bsongis 2015-05-26 19:48:04 +02:00
parent 33de4e903e
commit 0f99e07d9a
7 changed files with 73 additions and 59 deletions

View file

@ -627,8 +627,8 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const GeneralSetti
}
}
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
if ((flags & POPULATE_TELEMETRY) || (flags & POPULATE_TELEMETRYEXT)) {
if (flags & POPULATE_TELEMETRY) {
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
for (int i=0; i<5; ++i) {
item = RawSource(SOURCE_TYPE_SPECIAL, i);
b->addItem(item.toString(model), item.toValue());
@ -645,25 +645,20 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const GeneralSetti
}
}
}
}
else if (flags & POPULATE_TELEMETRYEXT) {
for (int i=0; i<TELEMETRY_SOURCE_ACC; i++) {
if (i==TELEMETRY_SOURCE_RSSI_TX && IS_TARANIS(board))
continue;
item = RawSource(SOURCE_TYPE_TELEMETRY, i);
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
}
else if (flags & POPULATE_TELEMETRY) {
for (int i=0; i<TELEMETRY_SOURCES_COUNT; i++) {
if (i==TELEMETRY_SOURCE_RSSI_TX && IS_TARANIS(board))
continue;
if (i==TELEMETRY_SOURCE_TIMER3 && !IS_ARM(board))
continue;
item = RawSource(SOURCE_TYPE_TELEMETRY, i);
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
else {
for (int i=0; i<(flags & POPULATE_TELEMETRYEXT ? TELEMETRY_SOURCES_STATUS_COUNT : TELEMETRY_SOURCES_COUNT); i++) {
if (i==TELEMETRY_SOURCE_RSSI_TX && IS_TARANIS(board))
continue;
if (i==TELEMETRY_SOURCE_TX_TIME && !GetCurrentFirmware()->getCapability(RtcTime))
continue;
if (i==TELEMETRY_SOURCE_SWR && !GetCurrentFirmware()->getCapability(SportTelemetry))
continue;
if (i==TELEMETRY_SOURCE_TIMER3 && !IS_ARM(board))
continue;
item = RawSource(SOURCE_TYPE_TELEMETRY, i);
b->addItem(item.toString(model), item.toValue());
if (item == source) b->setCurrentIndex(b->count()-1);
}
}
}