Mantid
Loading...
Searching...
No Matches
AlgorithmRunner.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2012 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9#include "DllOption.h"
10#include "MantidAPI/Algorithm.h"
11
12#include <Poco/NObserver.h>
13#include <QObject>
14
15namespace MantidQt {
16namespace API {
33 Q_OBJECT
34
35public:
36 explicit AlgorithmRunner(QObject *parent = nullptr);
37 ~AlgorithmRunner() override;
38
39 virtual void cancelRunningAlgorithm();
40
41 virtual void startAlgorithm(Mantid::API::IAlgorithm_sptr alg);
42 virtual Mantid::API::IAlgorithm_sptr getAlgorithm() const;
43
44signals:
48
50 void algorithmProgress(double p, const std::string &msg);
51
52protected:
54 void handleAlgorithmFinishedNotification(const Poco::AutoPtr<Mantid::API::Algorithm::FinishedNotification> &pNf);
56
57 void handleAlgorithmProgressNotification(const Poco::AutoPtr<Mantid::API::Algorithm::ProgressNotification> &pNf);
59
60 void handleAlgorithmErrorNotification(const Poco::AutoPtr<Mantid::API::Algorithm::ErrorNotification> &pNf);
62
66
69};
70
71} // namespace API
72} // namespace MantidQt
#define EXPORT_OPT_MANTIDQT_COMMON
Definition: DllOption.h:15
double error
Definition: IndexPeaks.cpp:133
The AlgorithmRunner is a QObject that encapsulates methods for running an algorithm asynchronously (i...
void algorithmComplete(bool error)
Signal emitted when the algorithm has completed execution/encountered an error.
Mantid::API::IAlgorithm_sptr m_asyncAlg
Reference to the algorithm executing asynchronously.
Poco::ActiveResult< bool > * m_asyncResult
For the asynchronous call in dynamic rebinning.
Poco::NObserver< AlgorithmRunner, Mantid::API::Algorithm::FinishedNotification > m_finishedObserver
Poco::NObserver< AlgorithmRunner, Mantid::API::Algorithm::ProgressNotification > m_progressObserver
Poco::NObserver< AlgorithmRunner, Mantid::API::Algorithm::ErrorNotification > m_errorObserver
void algorithmProgress(double p, const std::string &msg)
Signal emitted when the algorithm reports progress.
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
std::shared_ptr< IAlgorithm > IAlgorithm_sptr
shared pointer to Mantid::API::IAlgorithm