Mantid
|
#include <AlgorithmProgressModel.h>
Public Member Functions | |
AlgorithmProgressModel (AlgorithmProgressPresenter *presenter) | |
void | errorHandle (const Mantid::API::IAlgorithm *alg, const std::string &what) override |
Triggered when the algorithm encounters an error. More... | |
void | finishHandle (const Mantid::API::IAlgorithm *alg) override |
Triggered when the algorithm is finished. More... | |
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. More... | |
void | removeFrom (const Mantid::API::IAlgorithm *alg) |
Removes itself as an observer from the algorithm. More... | |
void | setDialog (AlgorithmProgressDialogPresenter *) |
void | startHandle (const Mantid::API::IAlgorithm *alg) override |
Triggered when the algorithm is executed. More... | |
void | startingHandle (Mantid::API::IAlgorithm_sptr alg) override |
Observes ALL starting algorithms. More... | |
~AlgorithmProgressModel () override | |
Public Member Functions inherited from Mantid::API::AlgorithmObserver | |
AlgorithmObserver () | |
Default constructor. More... | |
AlgorithmObserver (const IAlgorithm_const_sptr &alg) | |
Constructs AlgorithmObserver and connects all its handlers to algorithm alg. More... | |
virtual void | errorHandle (const IAlgorithm *alg, const std::string &what) |
virtual void | finishHandle (const IAlgorithm *alg) |
void | observeAll (const IAlgorithm_const_sptr &alg) |
Connect to algorithm alg and observe all its notifications. More... | |
void | observeError (const IAlgorithm_const_sptr &alg) |
Connect to algorithm alg and observe its error notification. More... | |
void | observeFinish (const IAlgorithm_const_sptr &alg) |
Connect to algorithm alg and observe its finish notification. More... | |
void | observeProgress (const IAlgorithm_const_sptr &alg) |
Connect to algorithm alg and observe its progress notification. More... | |
void | observeStart (const IAlgorithm_const_sptr &alg) |
Connect to algorithm alg and observe its start notification. More... | |
void | observeStarting () |
Connect to AlgorithmManager and observe its starting notifications. More... | |
virtual void | progressHandle (const IAlgorithm *alg, double p, const std::string &msg, const double estimatedTime, const int progressPrecision) |
virtual void | startHandle (const IAlgorithm *alg) |
virtual void | startingHandle (IAlgorithm_sptr alg) |
void | stopObserving (const IAlgorithm_const_sptr &alg) |
Disconnect from algorithm alg. More... | |
void | stopObserving (const Mantid::API::IAlgorithm *alg) |
void | stopObservingManager () |
Disconnect from the algorithm manager. More... | |
virtual | ~AlgorithmObserver () |
Virtual destructor. More... | |
Private Attributes | |
QPointer< AlgorithmProgressDialogPresenter > | m_dialogPresenter |
AlgorithmProgressPresenter * | m_mainWindowPresenter |
Definition at line 37 of file AlgorithmProgressModel.h.
MantidQt::MantidWidgets::AlgorithmProgressModel::AlgorithmProgressModel | ( | AlgorithmProgressPresenter * | presenter | ) |
Definition at line 13 of file AlgorithmProgressModel.cpp.
References Mantid::API::AlgorithmObserver::observeStarting().
|
override |
Definition at line 22 of file AlgorithmProgressModel.cpp.
References Mantid::API::AlgorithmObserver::stopObservingManager().
|
overridevirtual |
Triggered when the algorithm encounters an error.
This handle is triggered when the algorithm encounters an error.
It does the same thing as the algorithm finishing
alg | The algorithm that has finished |
what | Unused error message |
Reimplemented from Mantid::API::AlgorithmObserver.
Definition at line 72 of file AlgorithmProgressModel.cpp.
References removeFrom(), and UNUSED_ARG.
|
overridevirtual |
Triggered when the algorithm is finished.
This handle is triggered when the algorithm finishes.
It will notify presenters that there is not going to be any more progress for this algorithm
alg | The algorithm that has finished |
Reimplemented from Mantid::API::AlgorithmObserver.
Definition at line 67 of file AlgorithmProgressModel.cpp.
References removeFrom().
|
overridevirtual |
Triggered when the algorithm reports progress.
This handle is triggered whenever the algorithm reports progress.
alg | The algorithm that has reported progress |
progress | The progress that the algorithm is currently at |
message | The message that the progress bar should display |
estimatedTime | :: estimated time to completion in seconds |
progressPrecision | :: number of digits after the decimal |
Reimplemented from Mantid::API::AlgorithmObserver.
Definition at line 55 of file AlgorithmProgressModel.cpp.
References Mantid::API::IAlgorithm::getAlgorithmID(), m_dialogPresenter, m_mainWindowPresenter, and MantidQt::MantidWidgets::AlgorithmProgressPresenterBase::updateProgressBar().
void MantidQt::MantidWidgets::AlgorithmProgressModel::removeFrom | ( | const Mantid::API::IAlgorithm * | alg | ) |
Removes itself as an observer from the algorithm.
Remove the algorithm from presenters.
alg | The algorithm that has to be removed from the presenters |
Definition at line 79 of file AlgorithmProgressModel.cpp.
References MantidQt::MantidWidgets::AlgorithmProgressPresenterBase::algorithmEnded(), Mantid::API::IAlgorithm::getAlgorithmID(), m_dialogPresenter, m_mainWindowPresenter, and Mantid::API::AlgorithmObserver::stopObserving().
Referenced by errorHandle(), and finishHandle().
void MantidQt::MantidWidgets::AlgorithmProgressModel::setDialog | ( | AlgorithmProgressDialogPresenter * | presenter | ) |
Definition at line 24 of file AlgorithmProgressModel.cpp.
References m_dialogPresenter.
Referenced by MantidQt::MantidWidgets::AlgorithmProgressDialogPresenter::AlgorithmProgressDialogPresenter().
|
overridevirtual |
Triggered when the algorithm is executed.
This handle is triggered when the algorithm is executed.
It is used to notify the necessary presenters that there is a new algorithm for which progress has to be displayed
alg | The algorithm that is executing |
Reimplemented from Mantid::API::AlgorithmObserver.
Definition at line 41 of file AlgorithmProgressModel.cpp.
References MantidQt::MantidWidgets::AlgorithmProgressPresenterBase::algorithmStarted(), Mantid::API::IAlgorithm::getAlgorithmID(), m_dialogPresenter, and m_mainWindowPresenter.
|
overridevirtual |
Observes ALL starting algorithms.
This handle observes all starting algorithms.
Triggered when a new algorithm is constructed, and will attach itself as an observer Note: at this point the algorithm is not fully initialized
When an algorithm is starting it will attach the model as an observer for further events.
alg | The algorithm that is starting |
Reimplemented from Mantid::API::AlgorithmObserver.
Definition at line 31 of file AlgorithmProgressModel.cpp.
References Mantid::API::AlgorithmObserver::observeError(), Mantid::API::AlgorithmObserver::observeFinish(), Mantid::API::AlgorithmObserver::observeProgress(), and Mantid::API::AlgorithmObserver::observeStart().
|
private |
Definition at line 60 of file AlgorithmProgressModel.h.
Referenced by progressHandle(), removeFrom(), setDialog(), and startHandle().
|
private |
Definition at line 61 of file AlgorithmProgressModel.h.
Referenced by progressHandle(), removeFrom(), and startHandle().