Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
MantidQt::MantidWidgets::AlgorithmProgressModel Class Referencefinal

#include <AlgorithmProgressModel.h>

Inheritance diagram for MantidQt::MantidWidgets::AlgorithmProgressModel:
Mantid::API::AlgorithmObserver

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< AlgorithmProgressDialogPresenterm_dialogPresenter
 
AlgorithmProgressPresenterm_mainWindowPresenter
 

Detailed Description

Definition at line 37 of file AlgorithmProgressModel.h.

Constructor & Destructor Documentation

◆ AlgorithmProgressModel()

MantidQt::MantidWidgets::AlgorithmProgressModel::AlgorithmProgressModel ( AlgorithmProgressPresenter presenter)

◆ ~AlgorithmProgressModel()

MantidQt::MantidWidgets::AlgorithmProgressModel::~AlgorithmProgressModel ( )
override

Member Function Documentation

◆ errorHandle()

void MantidQt::MantidWidgets::AlgorithmProgressModel::errorHandle ( const Mantid::API::IAlgorithm alg,
const std::string &  what 
)
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

Parameters
algThe algorithm that has finished
whatUnused error message

Reimplemented from Mantid::API::AlgorithmObserver.

Definition at line 72 of file AlgorithmProgressModel.cpp.

References removeFrom(), and UNUSED_ARG.

◆ finishHandle()

void MantidQt::MantidWidgets::AlgorithmProgressModel::finishHandle ( const Mantid::API::IAlgorithm alg)
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

Parameters
algThe algorithm that has finished

Reimplemented from Mantid::API::AlgorithmObserver.

Definition at line 67 of file AlgorithmProgressModel.cpp.

References removeFrom().

◆ progressHandle()

void MantidQt::MantidWidgets::AlgorithmProgressModel::progressHandle ( const Mantid::API::IAlgorithm alg,
double  progress,
const std::string &  message,
const double  estimatedTime,
const int  progressPrecision 
)
overridevirtual

Triggered when the algorithm reports progress.

This handle is triggered whenever the algorithm reports progress.

Parameters
algThe algorithm that has reported progress
progressThe progress that the algorithm is currently at
messageThe 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().

◆ removeFrom()

void MantidQt::MantidWidgets::AlgorithmProgressModel::removeFrom ( const Mantid::API::IAlgorithm alg)

Removes itself as an observer from the algorithm.

Remove the algorithm from presenters.

Parameters
algThe 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().

◆ setDialog()

void MantidQt::MantidWidgets::AlgorithmProgressModel::setDialog ( AlgorithmProgressDialogPresenter presenter)

◆ startHandle()

void MantidQt::MantidWidgets::AlgorithmProgressModel::startHandle ( const Mantid::API::IAlgorithm alg)
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

Parameters
algThe 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.

◆ startingHandle()

void MantidQt::MantidWidgets::AlgorithmProgressModel::startingHandle ( Mantid::API::IAlgorithm_sptr  alg)
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.

Parameters
algThe 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().

Member Data Documentation

◆ m_dialogPresenter

QPointer<AlgorithmProgressDialogPresenter> MantidQt::MantidWidgets::AlgorithmProgressModel::m_dialogPresenter
private

Definition at line 60 of file AlgorithmProgressModel.h.

Referenced by progressHandle(), removeFrom(), setDialog(), and startHandle().

◆ m_mainWindowPresenter

AlgorithmProgressPresenter* MantidQt::MantidWidgets::AlgorithmProgressModel::m_mainWindowPresenter
private

Definition at line 61 of file AlgorithmProgressModel.h.

Referenced by progressHandle(), removeFrom(), and startHandle().


The documentation for this class was generated from the following files: