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

#include <AlgorithmProgressPresenter.h>

Inheritance diagram for MantidQt::MantidWidgets::AlgorithmProgressPresenter:
MantidQt::MantidWidgets::AlgorithmProgressPresenterBase

Public Member Functions

void algorithmEndedSlot (Mantid::API::AlgorithmID) override
 
 AlgorithmProgressPresenter (QWidget *parent, IAlgorithmProgressWidget *)
 
void algorithmStartedSlot (Mantid::API::AlgorithmID) override
 
AlgorithmProgressModelmodel ()
 
void updateProgressBarSlot (Mantid::API::AlgorithmID, const double, const QString, const double, const int) 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 Attributes

Mantid::API::AlgorithmID m_algorithm
 The algorithm for which a progress bar is currently being controlled. More...
 
AlgorithmProgressModel m_model
 The model which observes events happening to the algorithms. More...
 
Mantid::Kernel::Timer m_timer
 Atimer to meaure how long since the last progress report. More...
 
IAlgorithmProgressWidgetm_view
 The view that contains the progress widget. More...
 

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 36 of file AlgorithmProgressPresenter.h.

Constructor & Destructor Documentation

◆ AlgorithmProgressPresenter()

MantidQt::MantidWidgets::AlgorithmProgressPresenter::AlgorithmProgressPresenter ( QWidget *  parent,
IAlgorithmProgressWidget view 
)

Definition at line 11 of file AlgorithmProgressPresenter.cpp.

Member Function Documentation

◆ algorithmEndedSlot()

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

◆ algorithmStartedSlot()

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

◆ model()

AlgorithmProgressModel & MantidQt::MantidWidgets::AlgorithmProgressPresenter::model ( )
inline

Definition at line 46 of file AlgorithmProgressPresenter.h.

◆ updateProgressBarSlot()

void MantidQt::MantidWidgets::AlgorithmProgressPresenter::updateProgressBarSlot ( Mantid::API::AlgorithmID  algorithm,
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, then the progress bar isn't changed. This can happen whenever there are multiple algorithms running simultaneously - the progress bar will only show the progress of the first one that started. If many algorithms are starting, this prevents having a very jittery progress bar, that never completely fills up

Parameters
algorithmThe 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 43 of file AlgorithmProgressPresenter.cpp.

References Mantid::Kernel::Timer::elapsed_no_reset(), m_algorithm, m_timer, m_view, Mantid::Kernel::Timer::reset(), and MantidQt::MantidWidgets::IAlgorithmProgressWidget::updateProgress().

Member Data Documentation

◆ m_algorithm

Mantid::API::AlgorithmID MantidQt::MantidWidgets::AlgorithmProgressPresenter::m_algorithm
private

The algorithm for which a progress bar is currently being controlled.

Definition at line 52 of file AlgorithmProgressPresenter.h.

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

◆ m_model

AlgorithmProgressModel MantidQt::MantidWidgets::AlgorithmProgressPresenter::m_model
private

The model which observes events happening to the algorithms.

Definition at line 50 of file AlgorithmProgressPresenter.h.

◆ m_timer

Mantid::Kernel::Timer MantidQt::MantidWidgets::AlgorithmProgressPresenter::m_timer
private

Atimer to meaure how long since the last progress report.

Definition at line 57 of file AlgorithmProgressPresenter.h.

Referenced by updateProgressBarSlot().

◆ m_view

IAlgorithmProgressWidget* MantidQt::MantidWidgets::AlgorithmProgressPresenter::m_view
private

The view that contains the progress widget.

The creator of the view also owns the view (Python), not this presenter.

Definition at line 55 of file AlgorithmProgressPresenter.h.

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


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