Mantid
Loading...
Searching...
No Matches
AlgorithmProgressModel.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2019 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
11
12#include <QPointer>
13
14#include <string>
15
33namespace MantidQt {
34namespace MantidWidgets {
35class AlgorithmProgressPresenter;
36class AlgorithmProgressDialogPresenter;
38public:
40 ~AlgorithmProgressModel() override;
41
47 void startHandle(const Mantid::API::IAlgorithm *alg) override;
49 void finishHandle(const Mantid::API::IAlgorithm *alg) override;
51 void progressHandle(const Mantid::API::IAlgorithm *alg, double progress, const std::string &message,
52 const double estimatedTime, const int progressPrecision) override;
54 void errorHandle(const Mantid::API::IAlgorithm *alg, const std::string &what) override;
56 void removeFrom(const Mantid::API::IAlgorithm *alg);
57 void setDialog(AlgorithmProgressDialogPresenter * /*presenter*/);
58
59private:
60 QPointer<AlgorithmProgressDialogPresenter> m_dialogPresenter;
62};
63
64} // namespace MantidWidgets
65} // namespace MantidQt
void setDialog(AlgorithmProgressDialogPresenter *)
void startingHandle(Mantid::API::IAlgorithm_sptr alg) override
Observes ALL starting algorithms.
QPointer< AlgorithmProgressDialogPresenter > m_dialogPresenter
void progressHandle(const Mantid::API::IAlgorithm *alg, double progress, const std::string &message, const double estimatedTime, const int progressPrecision) override
Triggered when the algorithm reports progress.
void removeFrom(const Mantid::API::IAlgorithm *alg)
Removes itself as an observer from the algorithm.
void finishHandle(const Mantid::API::IAlgorithm *alg) override
Triggered when the algorithm is finished.
void startHandle(const Mantid::API::IAlgorithm *alg) override
Triggered when the algorithm is executed.
void errorHandle(const Mantid::API::IAlgorithm *alg, const std::string &what) override
Triggered when the algorithm encounters an error.
Observes Algorithm notifications: start,progress,finish,error.
IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:45
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