Add multiplier to RPM sensor (Fix #1688), fix offset/ratio DSBs
This commit is contained in:
@@ -558,13 +558,28 @@ void TelemetrySensorPanel::update()
|
||||
ui->instance->show();
|
||||
ui->formula->hide();
|
||||
ratioFieldsDisplayed = (sensor.unit != SensorData::UNIT_GPS && sensor.unit != SensorData::UNIT_DATETIME);
|
||||
ui->offset->setDecimals(sensor.prec);
|
||||
precDisplayed = (sensor.unit != SensorData::UNIT_GPS && sensor.unit != SensorData::UNIT_DATETIME);
|
||||
ui->offset->setMaximum((sensor.prec > 0 ? sensor.prec == 2 ? 30000 : 3000 : 300));
|
||||
ui->offset->setMinimum((sensor.prec > 0 ? sensor.prec == 2 ? -30000 : -3000 : -300));
|
||||
|
||||
if (sensor.unit == SensorData::UNIT_RPMS) {
|
||||
ui->offset->setDecimals(0);
|
||||
ui->ratio->setDecimals(0);
|
||||
ui->autoOffset->hide();
|
||||
ui->ratio->setMinimum(1);
|
||||
ui->offset->setMinimum(1);
|
||||
}
|
||||
else {
|
||||
ui->offset->setDecimals(sensor.prec);
|
||||
ui->ratio->setDecimals(1);
|
||||
}
|
||||
}
|
||||
|
||||
ui->ratioLabel->setVisible(ratioFieldsDisplayed);
|
||||
ui->ratioLabel->setVisible(ratioFieldsDisplayed && sensor.unit != SensorData::UNIT_RPMS);
|
||||
ui->bladesLabel->setVisible(sensor.unit == SensorData::UNIT_RPMS);
|
||||
ui->ratio->setVisible(ratioFieldsDisplayed);
|
||||
ui->offsetLabel->setVisible(ratioFieldsDisplayed);
|
||||
ui->offsetLabel->setVisible(ratioFieldsDisplayed && sensor.unit != SensorData::UNIT_RPMS);
|
||||
ui->multiplierLabel->setVisible(sensor.unit == SensorData::UNIT_RPMS);
|
||||
ui->offset->setVisible(ratioFieldsDisplayed);
|
||||
ui->precLabel->setVisible(precDisplayed);
|
||||
ui->prec->setVisible(precDisplayed);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1,0,0,0,1,1,1,1,0,0,1,0,1,0,1,1,1,1,1,1,0,1,0,1,0,1,0,0,0,1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1,0,0,0,1,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,1">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@@ -506,6 +506,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="bladesLabel">
|
||||
<property name="text">
|
||||
<string>Blades</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="AutoDoubleSpinBox" name="ratio">
|
||||
<property name="enabled">
|
||||
@@ -518,7 +525,10 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>3000.000000000000000</double>
|
||||
@@ -538,6 +548,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="multiplierLabel">
|
||||
<property name="text">
|
||||
<string>Multiplier</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="AutoDoubleSpinBox" name="offset">
|
||||
<property name="sizePolicy">
|
||||
@@ -547,16 +564,16 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-12.800000000000001</double>
|
||||
<double>-30000.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>12.699999999999999</double>
|
||||
<double>30000.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user