display receiver or module name for each sensor (if available)
This commit is contained in:
@@ -680,26 +680,11 @@ void TelemetrySensorPanel::update()
|
||||
ui->instanceLabel->show();
|
||||
ui->instance->show();
|
||||
|
||||
const ModuleData& module = model->moduleData[sensor.moduleIdx];
|
||||
if (module.isPxx2Module()) {
|
||||
ui->rxLabel->show();
|
||||
ui->moduleLabel->hide();
|
||||
if (module.access.receivers & (1 << sensor.rxIdx)) {
|
||||
ui->rxOrMod->setText(module.access.receiverName[sensor.rxIdx]);
|
||||
}
|
||||
else {
|
||||
// receiver does not seem to be active
|
||||
ui->rxOrMod->clear();
|
||||
}
|
||||
}
|
||||
else {
|
||||
ui->rxLabel->hide();
|
||||
ui->moduleLabel->show();
|
||||
if (sensor.moduleIdx)
|
||||
ui->rxOrMod->setText(tr("Internal"));
|
||||
else
|
||||
ui->rxOrMod->setText(tr("External"));
|
||||
}
|
||||
bool is_pxx2 = model->moduleData[sensor.moduleIdx].isPxx2Module();
|
||||
ui->rxLabel->setVisible(is_pxx2);
|
||||
ui->moduleLabel->setVisible(!is_pxx2);
|
||||
|
||||
ui->rxOrMod->setText(sensor.getRxOrModName(model));
|
||||
ui->rxOrMod->show();
|
||||
|
||||
ui->formula->hide();
|
||||
@@ -767,14 +752,24 @@ void populateTelemetrySourcesComboBox(AutoComboBox * cb, const ModelData * model
|
||||
cb->clear();
|
||||
if (negative) {
|
||||
for (int i=-CPN_MAX_SENSORS; i<0; ++i) {
|
||||
if (model->sensorData[-i-1].isAvailable())
|
||||
cb->addItem(QString("-%1").arg(model->sensorData[-i-1].label), i);
|
||||
const SensorData& sensor = model->sensorData[-i-1];
|
||||
if (sensor.isAvailable()) {
|
||||
if (sensor.type == SensorData::TELEM_TYPE_CUSTOM)
|
||||
cb->addItem(QString("-%1 (%2)").arg(sensor.label, sensor.getRxOrModName(model)), i);
|
||||
else
|
||||
cb->addItem(QString("-%1").arg(sensor.label), i);
|
||||
}
|
||||
}
|
||||
}
|
||||
cb->addItem("---", 0);
|
||||
for (unsigned i=1; i<=CPN_MAX_SENSORS; ++i) {
|
||||
if (model->sensorData[i-1].isAvailable())
|
||||
cb->addItem(model->sensorData[i-1].label, i);
|
||||
const SensorData& sensor = model->sensorData[i-1];
|
||||
if (sensor.isAvailable()) {
|
||||
if (sensor.type == SensorData::TELEM_TYPE_CUSTOM)
|
||||
cb->addItem(QString("%1 (%2)").arg(sensor.label, sensor.getRxOrModName(model)), i);
|
||||
else
|
||||
cb->addItem(QString("%1").arg(sensor.label), i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user