Bsongis/issue 6798 (#6818)
* Avoid conversion of unused sensors * Allow conversion of R9M sensors * Conversion fixes in Companion
This commit is contained in:
@@ -653,9 +653,8 @@ void TelemetrySensorPanel::update()
|
||||
ui->id->hide();
|
||||
ui->instanceLabel->hide();
|
||||
ui->instance->hide();
|
||||
ui->rxLabel->hide();
|
||||
ui->moduleLabel->hide();
|
||||
ui->rxOrMod->hide();
|
||||
ui->originLabel->hide();
|
||||
ui->origin->hide();
|
||||
ui->formula->show();
|
||||
ui->formula->setCurrentIndex(sensor.formula);
|
||||
isConfigurable = (sensor.formula < SensorData::TELEM_FORMULA_CELL);
|
||||
@@ -679,13 +678,10 @@ void TelemetrySensorPanel::update()
|
||||
ui->id->show();
|
||||
ui->instanceLabel->show();
|
||||
ui->instance->show();
|
||||
|
||||
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();
|
||||
QString origin = sensor.getOrigin(model);
|
||||
ui->originLabel->setVisible(!origin.isEmpty());
|
||||
ui->origin->setVisible(!origin.isEmpty());
|
||||
ui->origin->setText(origin);
|
||||
|
||||
ui->formula->hide();
|
||||
isConfigurable = sensor.unit < SensorData::UNIT_FIRST_VIRTUAL;
|
||||
@@ -755,7 +751,7 @@ void populateTelemetrySourcesComboBox(AutoComboBox * cb, const ModelData * model
|
||||
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);
|
||||
cb->addItem(QString("-%1 (%2)").arg(sensor.label, sensor.getOrigin(model)), i);
|
||||
else
|
||||
cb->addItem(QString("-%1").arg(sensor.label), i);
|
||||
}
|
||||
@@ -766,7 +762,7 @@ void populateTelemetrySourcesComboBox(AutoComboBox * cb, const ModelData * model
|
||||
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);
|
||||
cb->addItem(QString("%1 (%2)").arg(sensor.label, sensor.getOrigin(model)), i);
|
||||
else
|
||||
cb->addItem(QString("%1").arg(sensor.label), i);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1,0,0,0,1,0,0,0,1,1,1,0,0,1,0,1,0,1,1,1,1,1,1,0,1,0,0,1,0,0,1,0,0,0,0,0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1,0,0,0,1,0,0,1,1,1,0,0,1,0,1,0,1,1,1,1,1,1,0,1,0,0,1,0,0,1,0,0,0,0,0">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@@ -121,21 +121,14 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="rxLabel">
|
||||
<widget class="QLabel" name="originLabel">
|
||||
<property name="text">
|
||||
<string>Rx</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="moduleLabel">
|
||||
<property name="text">
|
||||
<string>Mod.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="rxOrMod">
|
||||
<widget class="QLineEdit" name="origin">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
|
||||
Reference in New Issue
Block a user