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

#include <AlgorithmProgressDialogPresenter.h>

Inheritance diagram for MantidQt::MantidWidgets::AlgorithmProgressDialogPresenter:
MantidQt::MantidWidgets::AlgorithmProgressPresenterBase

Public Member Functions

void algorithmEndedSlot (Mantid::API::AlgorithmID) override
 This slot is triggered whenever an algorithms ends. More...
 
 AlgorithmProgressDialogPresenter (QWidget *parent, IAlgorithmProgressDialogWidget *view, AlgorithmProgressModel &model)
 
void algorithmStartedSlot (Mantid::API::AlgorithmID) override
 This slot is triggered whenever an algorithm has started executing. More...
 
size_t getNumberTrackedAlgorithms ()
 
void updateProgressBarSlot (Mantid::API::AlgorithmID, const double progress, const QString message, const double estimatedTime, const int progressPrecision) override
 This slot is triggered whenever an algorithm reports progress. More...
 
- Public Member Functions inherited from MantidQt::MantidWidgets::AlgorithmProgressPresenterBase
void algorithmEnded (Mantid::API::AlgorithmID)
 Signals to the presenters that an algorithm has ended. More...
 
virtual void algorithmEndedSlot (Mantid::API::AlgorithmID)=0
 
 AlgorithmProgressPresenterBase (QObject *parent)
 
void algorithmStarted (Mantid::API::AlgorithmID)
 Signals to the presenters that an algorithm has started. More...
 
virtual void algorithmStartedSlot (Mantid::API::AlgorithmID)=0
 
void setProgressBar (QProgressBar *, const double, const QString &, const double, const int)
 Sets the parameter progress bar to show the progress and message. More...
 
void updateProgressBar (Mantid::API::AlgorithmID, double, const std::string &, const double estimatedTime, const int progressPrecision)
 Signals to the presenters that there has been progress in one of the algorithms. More...
 
virtual void updateProgressBarSlot (Mantid::API::AlgorithmID, const double, const QString, const double, const int)=0
 

Private Types

using RunningAlgorithms = std::unordered_map< Mantid::API::AlgorithmID, std::pair< QTreeWidgetItem *, QProgressBar * > >
 

Private Attributes

AlgorithmProgressModelm_model
 Reference to the model of the main window progress bar. More...
 
RunningAlgorithms m_progressBars
 Container for all the progress bars that are currently being displayed This container does NOT own any of the progress bars. More...
 
IAlgorithmProgressDialogWidgetm_view
 

Additional Inherited Members

- Signals inherited from MantidQt::MantidWidgets::AlgorithmProgressPresenterBase
void algorithmEndedSignal (Mantid::API::AlgorithmID)
 
void algorithmStartedSignal (Mantid::API::AlgorithmID)
 
void updateProgressBarSignal (Mantid::API::AlgorithmID, double progress, QString message, double estimatedTime, int progressPrecision)
 

Detailed Description

Definition at line 26 of file AlgorithmProgressDialogPresenter.h.

Member Typedef Documentation

◆ RunningAlgorithms

using MantidQt::MantidWidgets::AlgorithmProgressDialogPresenter::RunningAlgorithms = std::unordered_map<Mantid::API::AlgorithmID, std::pair<QTreeWidgetItem *, QProgressBar *> >
private

Definition at line 28 of file AlgorithmProgressDialogPresenter.h.

Constructor & Destructor Documentation

◆ AlgorithmProgressDialogPresenter()

MantidQt::MantidWidgets::AlgorithmProgressDialogPresenter::AlgorithmProgressDialogPresenter ( QWidget *  parent,
IAlgorithmProgressDialogWidget view,
AlgorithmProgressModel model 
)

Member Function Documentation

◆ algorithmEndedSlot()

void MantidQt::MantidWidgets::AlgorithmProgressDialogPresenter::algorithmEndedSlot ( Mantid::API::AlgorithmID  alg)
overridevirtual

This slot is triggered whenever an algorithms ends.

If the algorithm is not being tracked, there will not be an active progress bar for it, in which case no work is done

Parameters
algThe ID of the algorithm that is ending

Implements MantidQt::MantidWidgets::AlgorithmProgressPresenterBase.

Definition at line 82 of file AlgorithmProgressDialogPresenter.cpp.

References m_progressBars.

◆ algorithmStartedSlot()

void MantidQt::MantidWidgets::AlgorithmProgressDialogPresenter::algorithmStartedSlot ( Mantid::API::AlgorithmID  alg)
overridevirtual

This slot is triggered whenever an algorithm has started executing.

Parameters
algThe ID of the algorithm that has started executing

Implements MantidQt::MantidWidgets::AlgorithmProgressPresenterBase.

Definition at line 35 of file AlgorithmProgressDialogPresenter.cpp.

References MantidQt::MantidWidgets::IAlgorithmProgressDialogWidget::addAlgorithm(), Mantid::Kernel::SingletonHolder< T >::Instance(), m_progressBars, and m_view.

Referenced by AlgorithmProgressDialogPresenter(), and updateProgressBarSlot().

◆ getNumberTrackedAlgorithms()

size_t MantidQt::MantidWidgets::AlgorithmProgressDialogPresenter::getNumberTrackedAlgorithms ( )

Definition at line 94 of file AlgorithmProgressDialogPresenter.cpp.

References m_progressBars.

◆ updateProgressBarSlot()

void MantidQt::MantidWidgets::AlgorithmProgressDialogPresenter::updateProgressBarSlot ( Mantid::API::AlgorithmID  alg,
const double  progress,
const QString  message,
const double  estimatedTime,
const int  progressPrecision 
)
overridevirtual

This slot is triggered whenever an algorithm reports progress.

If the algorithm is not being tracked (e.g. the Details window is opened AFTER the algorithm has started) then the started slot is triggered to add an active progress bar for it.

Parameters
algThe ID of the algorithm that is reporting progress
progressThe progress that the algorithm has reported
messageThe message that the algorithm has reported. It can be emitted from another thread, so a copy of the message is forced
estimatedTime:: estimated time to completion in seconds
progressPrecision:: number of digits after the decimal

Implements MantidQt::MantidWidgets::AlgorithmProgressPresenterBase.

Definition at line 61 of file AlgorithmProgressDialogPresenter.cpp.

References algorithmStartedSlot(), m_progressBars, and MantidQt::MantidWidgets::AlgorithmProgressPresenterBase::setProgressBar().

Member Data Documentation

◆ m_model

AlgorithmProgressModel& MantidQt::MantidWidgets::AlgorithmProgressDialogPresenter::m_model
private

Reference to the model of the main window progress bar.

Definition at line 43 of file AlgorithmProgressDialogPresenter.h.

◆ m_progressBars

RunningAlgorithms MantidQt::MantidWidgets::AlgorithmProgressDialogPresenter::m_progressBars
private

Container for all the progress bars that are currently being displayed This container does NOT own any of the progress bars.

Definition at line 46 of file AlgorithmProgressDialogPresenter.h.

Referenced by algorithmEndedSlot(), AlgorithmProgressDialogPresenter(), algorithmStartedSlot(), getNumberTrackedAlgorithms(), and updateProgressBarSlot().

◆ m_view

IAlgorithmProgressDialogWidget* MantidQt::MantidWidgets::AlgorithmProgressDialogPresenter::m_view
private

Definition at line 41 of file AlgorithmProgressDialogPresenter.h.

Referenced by algorithmStartedSlot().


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