1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

OP-1351 Apply and Save logic for thermal calibration now works as expected

This commit is contained in:
Philippe Renon 2014-06-01 01:08:21 +02:00
parent 149f7e79d9
commit 0b108ecf04
4 changed files with 22 additions and 2 deletions

View File

@ -364,7 +364,6 @@ void ThermalCalibrationHelper::calculate()
.arg(m_results.accelOutSigma[0]).arg(m_results.accelOutSigma[1]).arg(m_results.accelOutSigma[2]) + QChar::CarriageReturn;
qDebug() << str;
m_debugStream << str;
copyResultToSettings();
emit calculationCompleted();
closeDebugLog();
}

View File

@ -116,6 +116,8 @@ public:
return m_results.baroCalibrated && ((m_results.baroTempMax - m_results.baroTempMin) > TargetTempDelta);
}
void copyResultToSettings();
signals:
void instructionsAdded(QString text, WizardModel::MessageType type = WizardModel::Info);
void statusRestoreCompleted(bool succesful);

View File

@ -88,6 +88,12 @@ public:
}
}
bool dirty()
{
return m_dirty;
}
public slots:
int progress()
{
@ -131,6 +137,7 @@ private:
bool m_cancelEnabled;
bool m_endEnabled;
bool m_initDone;
bool m_dirty;
int m_progress;
float m_temperature;
float m_temperatureGradient;
@ -197,6 +204,7 @@ public slots:
}
void startWizard()
{
m_dirty = false;
setStartEnabled(false);
setEndEnabled(true);
setCancelEnabled(true);
@ -204,11 +212,19 @@ public slots:
}
void stopWizard()
{
m_dirty = m_helper->calibrationSuccessful();
setStartEnabled(true);
setEndEnabled(false);
setCancelEnabled(false);
wizardStopped();
}
void save()
{
if (m_dirty) {
m_dirty = false;
m_helper->copyResultToSettings();
}
}
};
}

View File

@ -329,6 +329,9 @@ void ConfigRevoWidget::updateObjectsFromWidgets()
if (m_gyroBiasCalibrationModel->dirty()) {
m_gyroBiasCalibrationModel->save();
}
if (m_thermalCalibrationModel->dirty()) {
m_thermalCalibrationModel->save();
}
}
void ConfigRevoWidget::clearHomeLocation()
@ -363,7 +366,7 @@ void ConfigRevoWidget::enableAllCalibrations()
{
// TODO should use a signal instead
if (m_accelCalibrationModel->dirty() || m_magCalibrationModel->dirty() || m_levelCalibrationModel->dirty()
|| m_gyroBiasCalibrationModel->dirty()) {
|| m_gyroBiasCalibrationModel->dirty() || m_thermalCalibrationModel->dirty()) {
widgetsContentsChanged();
}