Skip to content
Snippets Groups Projects
Commit cfc38947 authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

RunFitManager -> FitWorkerLauncher

parent 3146bdac
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,7 @@
FitSuiteManager::FitSuiteManager(QObject* parent)
: QObject(parent)
, m_jobItem(nullptr)
, m_runFitManager(new RunFitManager(this))
, m_runFitManager(new FitWorkerLauncher(this))
, m_observer(new GUIFitObserver)
, m_fitlog(new FitLog)
, m_block_progress_update(false)
......@@ -43,11 +43,11 @@ FitSuiteManager::FitSuiteManager(QObject* parent)
m_fitlog->append(text.toStdString(), FitLogFlags::DEFAULT);
});
connect(m_runFitManager, &RunFitManager::fittingStarted, this,
connect(m_runFitManager, &FitWorkerLauncher::fittingStarted, this,
&FitSuiteManager::onFittingStarted);
connect(m_runFitManager, &RunFitManager::fittingFinished, this,
connect(m_runFitManager, &FitWorkerLauncher::fittingFinished, this,
&FitSuiteManager::onFittingFinished);
connect(m_runFitManager, &RunFitManager::fittingError, this, &FitSuiteManager::onFittingError);
connect(m_runFitManager, &FitWorkerLauncher::fittingError, this, &FitSuiteManager::onFittingError);
}
FitSuiteManager::~FitSuiteManager()
......
......@@ -22,7 +22,7 @@
#include <memory>
class JobItem;
class RunFitManager;
class FitWorkerLauncher;
class GUIFitObserver;
class FitProgressInfo;
class FitLog;
......@@ -62,7 +62,7 @@ private slots:
private:
JobItem* m_jobItem;
RunFitManager* m_runFitManager;
FitWorkerLauncher* m_runFitManager;
std::shared_ptr<GUIFitObserver> m_observer;
std::unique_ptr<FitLog> m_fitlog;
bool m_block_progress_update;
......
......@@ -2,8 +2,8 @@
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file GUI/coregui/Views/FitWidgets/RunFitManager.cpp
//! @brief Implements class RunFitManager
//! @file GUI/coregui/Views/FitWidgets/FitWorkerLauncher.cpp
//! @brief Implements class FitWorkerLauncher
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
......@@ -19,7 +19,7 @@
#include "FitWorker.h"
#include <QThread>
RunFitManager::RunFitManager(QObject* parent)
FitWorkerLauncher::FitWorkerLauncher(QObject* parent)
: QObject(parent)
, m_is_fit_running(false)
, m_duration(0)
......@@ -27,7 +27,7 @@ RunFitManager::RunFitManager(QObject* parent)
}
// start fitting in separate thread
void RunFitManager::runFitting(std::shared_ptr<FitSuite> suite)
void FitWorkerLauncher::runFitting(std::shared_ptr<FitSuite> suite)
{
if (!suite || m_is_fit_running)
return;
......@@ -38,13 +38,13 @@ void RunFitManager::runFitting(std::shared_ptr<FitSuite> suite)
// start fitting when thread starts
connect(thread, &QThread::started, fw, &FitWorker::startFit);
connect(fw, &FitWorker::started, this, &RunFitManager::intern_workerStarted);
connect(fw, &FitWorker::started, this, &FitWorkerLauncher::intern_workerStarted);
connect(this, &RunFitManager::intern_interruptFittingWorker,
connect(this, &FitWorkerLauncher::intern_interruptFittingWorker,
fw, &FitWorker::interruptFitting, Qt::DirectConnection);
connect(fw, &FitWorker::error, this, &RunFitManager::intern_error);
connect(fw, &FitWorker::finished, this, &RunFitManager::intern_workerFinished);
connect(fw, &FitWorker::error, this, &FitWorkerLauncher::intern_error);
connect(fw, &FitWorker::finished, this, &FitWorkerLauncher::intern_workerFinished);
// delete fitting worker and thread when done
connect(fw, SIGNAL(finished(int)), fw, SLOT(deleteLater()));
......@@ -56,30 +56,30 @@ void RunFitManager::runFitting(std::shared_ptr<FitSuite> suite)
//! Returns duration of fit in msec.
int RunFitManager::getDuration()
int FitWorkerLauncher::getDuration()
{
return m_duration;
}
void RunFitManager::interruptFitting()
void FitWorkerLauncher::interruptFitting()
{
if (m_is_fit_running)
emit intern_interruptFittingWorker();
}
void RunFitManager::intern_workerFinished(int duration)
void FitWorkerLauncher::intern_workerFinished(int duration)
{
m_is_fit_running = false;
m_duration = duration;
emit fittingFinished();
}
void RunFitManager::intern_workerStarted()
void FitWorkerLauncher::intern_workerStarted()
{
emit fittingStarted();
}
void RunFitManager::intern_error(const QString& mesg)
void FitWorkerLauncher::intern_error(const QString& mesg)
{
emit fittingError(mesg);
}
......@@ -2,8 +2,8 @@
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file GUI/coregui/Views/FitWidgets/RunFitManager.h
//! @brief Implements class RunFitManager
//! @file GUI/coregui/Views/FitWidgets/FitWorkerLauncher.h
//! @brief Implements class FitWorkerLauncher
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
......@@ -14,8 +14,8 @@
//
// ************************************************************************** //
#ifndef RUNFITMANAGER_H
#define RUNFITMANAGER_H
#ifndef FITWORKERLAUNCHER_H
#define FITWORKERLAUNCHER_H
#include "WinDllMacros.h"
#include <QObject>
......@@ -24,12 +24,12 @@
class FitSuite;
class BA_CORE_API_ RunFitManager : public QObject
class BA_CORE_API_ FitWorkerLauncher : public QObject
{
Q_OBJECT
public:
RunFitManager(QObject* parent);
FitWorkerLauncher(QObject* parent);
void runFitting(std::shared_ptr<FitSuite> suite);
......@@ -56,4 +56,4 @@ private:
int m_duration;
};
#endif // RUNFITMANAGER_H
#endif // FITWORKERLAUNCHER_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment