[Companion] Current calibration masked on Taranis
This commit is contained in:
@@ -159,6 +159,11 @@ CalibrationPanel::CalibrationPanel(QWidget * parent, GeneralSettings & generalSe
|
||||
ui->serialPortLabel->hide();
|
||||
}
|
||||
|
||||
if (!IS_SKY9X(firmware->getBoard())) {
|
||||
ui->txCurrentCalibration->hide();
|
||||
ui->txCurrentCalibrationLabel->hide();
|
||||
}
|
||||
|
||||
if (IS_TARANIS_X9E(firmware->getBoard())) {
|
||||
ui->bluetoothEnable->setChecked(generalSettings.bluetoothEnable);
|
||||
ui->bluetoothName->setField(generalSettings.bluetoothName, 10, this);
|
||||
@@ -214,9 +219,9 @@ void CalibrationPanel::on_PPM4_editingFinished()
|
||||
}
|
||||
|
||||
|
||||
void CalibrationPanel::on_CurrentCalib_SB_editingFinished()
|
||||
void CalibrationPanel::on_txCurrentCalibration_editingFinished()
|
||||
{
|
||||
generalSettings.currentCalib = ui->CurrentCalib_SB->value();
|
||||
generalSettings.txCurrentCalibration = ui->txCurrentCalibration->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
@@ -228,8 +233,8 @@ void CalibrationPanel::on_bluetoothEnable_stateChanged(int)
|
||||
|
||||
void CalibrationPanel::setValues()
|
||||
{
|
||||
ui->battCalibDSB->setValue((double)generalSettings.vBatCalib/10);
|
||||
ui->CurrentCalib_SB->setValue((double)generalSettings.currentCalib);
|
||||
ui->txVoltageCalibration->setValue((double)generalSettings.txVoltageCalibration/10);
|
||||
ui->txCurrentCalibration->setValue((double)generalSettings.txCurrentCalibration);
|
||||
|
||||
ui->ana1Neg->setValue(generalSettings.calibSpanNeg[0]);
|
||||
ui->ana2Neg->setValue(generalSettings.calibSpanNeg[1]);
|
||||
@@ -265,9 +270,9 @@ void CalibrationPanel::setValues()
|
||||
ui->PPM_MultiplierDSB->setValue((qreal)(generalSettings.PPM_Multiplier+10)/10);
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_battCalibDSB_editingFinished()
|
||||
void CalibrationPanel::on_txVoltageCalibration_editingFinished()
|
||||
{
|
||||
generalSettings.vBatCalib = ui->battCalibDSB->value()*10;
|
||||
generalSettings.txVoltageCalibration = ui->txVoltageCalibration->value()*10;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
|
||||
@@ -21,14 +21,14 @@ class CalibrationPanel : public GeneralPanel
|
||||
// virtual void update();
|
||||
|
||||
private slots:
|
||||
void on_battCalibDSB_editingFinished();
|
||||
void on_txVoltageCalibration_editingFinished();
|
||||
void on_PPM1_editingFinished();
|
||||
void on_PPM2_editingFinished();
|
||||
void on_PPM3_editingFinished();
|
||||
void on_PPM4_editingFinished();
|
||||
void on_PPM_MultiplierDSB_editingFinished();
|
||||
|
||||
void on_CurrentCalib_SB_editingFinished();
|
||||
void on_txCurrentCalibration_editingFinished();
|
||||
void on_bluetoothEnable_stateChanged(int);
|
||||
|
||||
void on_ana1Neg_editingFinished();
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>805</width>
|
||||
<height>1269</height>
|
||||
<height>1313</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -562,14 +562,14 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="42" column="0">
|
||||
<widget class="QLabel" name="label_22">
|
||||
<widget class="QLabel" name="txVoltageCalibrationLabel">
|
||||
<property name="text">
|
||||
<string>Battery</string>
|
||||
<string>Battery Offset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="42" column="1">
|
||||
<widget class="QDoubleSpinBox" name="battCalibDSB">
|
||||
<widget class="QDoubleSpinBox" name="txVoltageCalibration">
|
||||
<property name="statusTip">
|
||||
<string/>
|
||||
</property>
|
||||
@@ -674,7 +674,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="43" column="1">
|
||||
<widget class="QSpinBox" name="CurrentCalib_SB">
|
||||
<widget class="QSpinBox" name="txCurrentCalibration">
|
||||
<property name="minimum">
|
||||
<number>-49</number>
|
||||
</property>
|
||||
@@ -698,9 +698,9 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="43" column="0">
|
||||
<widget class="QLabel" name="label_CurrentCalib">
|
||||
<widget class="QLabel" name="txCurrentCalibrationLabel">
|
||||
<property name="text">
|
||||
<string>Current</string>
|
||||
<string>Current Offset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -88,8 +88,8 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
||||
}
|
||||
else {
|
||||
QString trainercalib = g.profile[profile_id].trainerCalib();
|
||||
int8_t vBatCalib = (int8_t)g.profile[profile_id].vBatCalib();
|
||||
int8_t currentCalib = (int8_t)g.profile[profile_id].currentCalib();
|
||||
int8_t txVoltageCalibration = (int8_t)g.profile[profile_id].txVoltageCalibration();
|
||||
int8_t txCurrentCalibration = (int8_t)g.profile[profile_id].txCurrentCalibration();
|
||||
int8_t PPM_Multiplier = (int8_t)g.profile[profile_id].ppmMultiplier();
|
||||
uint8_t GSStickMode = (uint8_t)g.profile[profile_id].gsStickMode();
|
||||
uint8_t vBatWarn = (uint8_t)g.profile[profile_id].vBatWarn();
|
||||
@@ -123,8 +123,8 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
||||
if (ok)
|
||||
generalSettings.trainer.calib[i]=byte16;
|
||||
}
|
||||
generalSettings.currentCalib=currentCalib;
|
||||
generalSettings.vBatCalib=vBatCalib;
|
||||
generalSettings.txCurrentCalibration=txCurrentCalibration;
|
||||
generalSettings.txVoltageCalibration=txVoltageCalibration;
|
||||
generalSettings.vBatWarn=vBatWarn;
|
||||
if (GetCurrentFirmware()->getCapability(HasBatMeterRange)) {
|
||||
generalSettings.vBatMin = (int8_t) g.profile[profile_id].vBatMin();
|
||||
@@ -225,8 +225,8 @@ void GeneralEdit::on_calstore_PB_clicked()
|
||||
calib.append(QString("%1").arg((uint16_t)generalSettings.trainer.calib[i], 4, 16, QChar('0')));
|
||||
}
|
||||
g.profile[profile_id].trainerCalib( calib );
|
||||
g.profile[profile_id].vBatCalib( generalSettings.vBatCalib );
|
||||
g.profile[profile_id].currentCalib( generalSettings.currentCalib );
|
||||
g.profile[profile_id].txVoltageCalibration( generalSettings.txVoltageCalibration );
|
||||
g.profile[profile_id].txCurrentCalibration( generalSettings.txCurrentCalibration );
|
||||
g.profile[profile_id].vBatWarn( generalSettings.vBatWarn );
|
||||
if (GetCurrentFirmware()->getCapability(HasBatMeterRange)) {
|
||||
g.profile[profile_id].vBatMin( generalSettings.vBatMin );
|
||||
|
||||
Reference in New Issue
Block a user