Skip to content
Snippets Groups Projects
Commit 76ea7d6c authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

FitWorker: disambiguate signals

parent 7f06baba
No related branches found
No related tags found
1 merge request!2621consolidate fcts to compute and check relative differences
...@@ -17,13 +17,13 @@ ...@@ -17,13 +17,13 @@
void FitWorker::startFit() void FitWorker::startFit()
{ {
emit started(); emit fit_started();
try { try {
m_fit_objective->runFit(); m_fit_objective->runFit();
} catch (const std::exception& ex) { } catch (const std::exception& ex) {
emit error(QString::fromStdString(ex.what())); emit fit_error(QString::fromStdString(ex.what()));
} }
emit finished(); emit fit_finished();
} }
void FitWorker::interruptFitting() void FitWorker::interruptFitting()
......
...@@ -26,18 +26,13 @@ public: ...@@ -26,18 +26,13 @@ public:
FitWorker(std::shared_ptr<FitObjectiveBuilder> suite) { m_fit_objective = suite; } FitWorker(std::shared_ptr<FitObjectiveBuilder> suite) { m_fit_objective = suite; }
public slots: public slots:
void startFit(); void startFit();
void interruptFitting(); void interruptFitting();
signals: signals:
void fit_started();
void started(); void fit_finished();
void fit_error(const QString& message);
void finished();
void error(const QString& message);
private: private:
std::shared_ptr<FitObjectiveBuilder> m_fit_objective; std::shared_ptr<FitObjectiveBuilder> m_fit_objective;
......
...@@ -33,16 +33,16 @@ void FitWorkerLauncher::runFitting(std::shared_ptr<FitObjectiveBuilder> suite) ...@@ -33,16 +33,16 @@ void FitWorkerLauncher::runFitting(std::shared_ptr<FitObjectiveBuilder> suite)
// start fitting when thread starts // start fitting when thread starts
connect(thread, &QThread::started, fw, &FitWorker::startFit); connect(thread, &QThread::started, fw, &FitWorker::startFit);
connect(fw, &FitWorker::started, this, &FitWorkerLauncher::intern_workerStarted); connect(fw, &FitWorker::fit_started, this, &FitWorkerLauncher::intern_workerStarted);
connect(this, &FitWorkerLauncher::intern_interruptFittingWorker, fw, connect(this, &FitWorkerLauncher::intern_interruptFittingWorker, fw,
&FitWorker::interruptFitting, Qt::DirectConnection); &FitWorker::interruptFitting, Qt::DirectConnection);
connect(fw, &FitWorker::error, this, &FitWorkerLauncher::intern_error); connect(fw, &FitWorker::fit_error, this, &FitWorkerLauncher::intern_error);
connect(fw, &FitWorker::finished, this, &FitWorkerLauncher::intern_workerFinished); connect(fw, &FitWorker::fit_finished, this, &FitWorkerLauncher::intern_workerFinished);
// delete fitting worker and thread when done // delete fitting worker and thread when done
connect(fw, &FitWorker::finished, fw, &FitWorker::deleteLater); connect(fw, &FitWorker::fit_finished, fw, &FitWorker::deleteLater);
connect(thread, &QThread::finished, thread, &QThread::deleteLater); connect(thread, &QThread::finished, thread, &QThread::deleteLater);
m_is_fit_running = true; m_is_fit_running = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment