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

OP-1351 thermal calibration - fixed duplicate signal warning

This commit is contained in:
Philippe Renon 2014-05-29 00:26:37 +02:00
parent 9cced08f82
commit bd6bd043d1
3 changed files with 19 additions and 18 deletions

View File

@ -64,10 +64,10 @@ ThermalCalibrationModel::ThermalCalibrationModel(QObject *parent) :
connect(m_helper.data(), SIGNAL(temperatureGradientChanged(float)), this, SLOT(setTemperatureGradient(float))); connect(m_helper.data(), SIGNAL(temperatureGradientChanged(float)), this, SLOT(setTemperatureGradient(float)));
connect(m_helper.data(), SIGNAL(progressChanged(int)), this, SLOT(setProgress(int))); connect(m_helper.data(), SIGNAL(progressChanged(int)), this, SLOT(setProgress(int)));
connect(m_helper.data(), SIGNAL(instructionsAdded(QString, WizardModel::MessageType)), this, SLOT(addInstructions(QString, WizardModel::MessageType))); connect(m_helper.data(), SIGNAL(instructionsAdded(QString, WizardModel::MessageType)), this, SLOT(addInstructions(QString, WizardModel::MessageType)));
connect(m_readyState, SIGNAL(entered()), this, SLOT(wizardReady())); connect(m_readyState, SIGNAL(entered()), this, SLOT(stopWizard()));
connect(m_readyState, SIGNAL(exited()), this, SLOT(wizardStarted())); connect(m_readyState, SIGNAL(exited()), this, SLOT(startWizard()));
connect(m_completedState, SIGNAL(entered()), this, SLOT(wizardReady())); connect(m_completedState, SIGNAL(entered()), this, SLOT(stopWizard()));
connect(m_completedState, SIGNAL(exited()), this, SLOT(wizardStarted())); connect(m_completedState, SIGNAL(exited()), this, SLOT(startWizard()));
setInitialState(m_readyState); setInitialState(m_readyState);
@ -81,9 +81,9 @@ void ThermalCalibrationModel::init()
setStartEnabled(true); setStartEnabled(true);
setEndEnabled(false); setEndEnabled(false);
setCancelEnabled(false); setCancelEnabled(false);
start();
setTemperature(0); setTemperature(0);
setTemperatureGradient(0); setTemperatureGradient(0);
start();
} }
} }

View File

@ -165,8 +165,8 @@ signals:
void endEnabledChanged(bool state); void endEnabledChanged(bool state);
void cancelEnabledChanged(bool state); void cancelEnabledChanged(bool state);
void started(); void wizardStarted();
void stopped(); void wizardStopped();
void temperatureChanged(float temp); void temperatureChanged(float temp);
void temperatureGradientChanged(float tempGradient); void temperatureGradientChanged(float tempGradient);
@ -195,21 +195,22 @@ public slots:
{ {
emit abort(); emit abort();
} }
void wizardReady() void startWizard()
{
setStartEnabled(false);
setEndEnabled(true);
setCancelEnabled(true);
wizardStarted();
}
void stopWizard()
{ {
setStartEnabled(true); setStartEnabled(true);
setEndEnabled(false); setEndEnabled(false);
setCancelEnabled(false); setCancelEnabled(false);
stopped(); wizardStopped();
}
void wizardStarted()
{
started();
setStartEnabled(false);
setEndEnabled(true);
setCancelEnabled(true);
} }
}; };
} }
#endif // THERMALCALIBRATIONMODEL_H #endif // THERMALCALIBRATIONMODEL_H

View File

@ -106,8 +106,8 @@ ConfigRevoWidget::ConfigRevoWidget(QWidget *parent) :
connect(m_thermalCalibrationModel, SIGNAL(startEnabledChanged(bool)), m_ui->ThermalBiasStart, SLOT(setEnabled(bool))); connect(m_thermalCalibrationModel, SIGNAL(startEnabledChanged(bool)), m_ui->ThermalBiasStart, SLOT(setEnabled(bool)));
connect(m_thermalCalibrationModel, SIGNAL(endEnabledChanged(bool)), m_ui->ThermalBiasEnd, SLOT(setEnabled(bool))); connect(m_thermalCalibrationModel, SIGNAL(endEnabledChanged(bool)), m_ui->ThermalBiasEnd, SLOT(setEnabled(bool)));
connect(m_thermalCalibrationModel, SIGNAL(cancelEnabledChanged(bool)), m_ui->ThermalBiasCancel, SLOT(setEnabled(bool))); connect(m_thermalCalibrationModel, SIGNAL(cancelEnabledChanged(bool)), m_ui->ThermalBiasCancel, SLOT(setEnabled(bool)));
connect(m_thermalCalibrationModel, SIGNAL(started()), this, SLOT(disableAllCalibrations())); connect(m_thermalCalibrationModel, SIGNAL(wizardStarted()), this, SLOT(disableAllCalibrations()));
connect(m_thermalCalibrationModel, SIGNAL(stopped()), this, SLOT(enableAllCalibrations())); connect(m_thermalCalibrationModel, SIGNAL(wizardStopped()), this, SLOT(enableAllCalibrations()));
connect(m_thermalCalibrationModel, SIGNAL(instructionsAdded(QString, WizardModel::MessageType)), connect(m_thermalCalibrationModel, SIGNAL(instructionsAdded(QString, WizardModel::MessageType)),
this, SLOT(addInstructions(QString, WizardModel::MessageType))); this, SLOT(addInstructions(QString, WizardModel::MessageType)));