Mantid
|
#include <ProgressBase.h>
Public Member Functions | |
virtual void | doReport (const std::string &msg="")=0 |
Pure virtual method that does the progress reporting, to be overridden. More... | |
double | getEstimatedTime () const |
Returns the estimated number of seconds until the algorithm completes. More... | |
virtual bool | hasCancellationBeenRequested () const |
Override so that the reporter can inform whether a cancellation request has been used. More... | |
ProgressBase & | operator= (const ProgressBase &rhs) |
ProgressBase () | |
Default constructor. More... | |
ProgressBase (const ProgressBase &source) | |
Copy constructor that builds a new ProgressBase object. More... | |
ProgressBase (double start, double end, int64_t numSteps) | |
Creates a ProgressBase instance. More... | |
void | report () |
Increments the loop counter by 1, then sends the progress notification on behalf of its algorithm. More... | |
void | report (const std::string &msg) |
Increments the loop counter by 1, then sends the progress notification on behalf of its algorithm. More... | |
void | report (int64_t i, const std::string &msg="") |
Sends the progress notification on behalf of its algorithm. More... | |
void | reportIncrement (int inc, const std::string &msg="") |
Sends the progress notification and increment the loop counter by more than one. More... | |
void | reportIncrement (size_t inc, const std::string &msg="") |
Sends the progress notification and increment the loop counter by more than one. More... | |
void | resetNumSteps (int64_t nsteps, double start, double end) |
Change the number of steps between start/end. More... | |
void | setNotifyStep (double notifyStepPct) |
Override the frequency at which notifications are sent out. More... | |
void | setNumSteps (int64_t nsteps) |
Change the number of steps between start/end. More... | |
virtual | ~ProgressBase () |
Destructor. More... | |
Protected Attributes | |
double | m_end |
Ending progress. More... | |
std::atomic< int64_t > | m_i |
Loop counter. More... | |
int64_t | m_ifirst |
Loop counter initial value. More... | |
std::atomic< int64_t > | m_last_reported |
Last loop counter value the was a peport. More... | |
int64_t | m_notifyStep |
Frequency of sending the notification (every m_step times) More... | |
double | m_notifyStepPct |
Frequency of sending the notification (as a min percentage step, e.g. More... | |
int | m_notifyStepPrecision |
Digits of precision in the reporting. More... | |
int64_t | m_numSteps |
Loop counter upper bound. More... | |
double | m_start |
Starting progress. More... | |
double | m_step |
Progress increment at each loop. More... | |
std::unique_ptr< Kernel::Timer > | m_timeElapsed |
Timer that is started when the progress bar is constructed. More... | |
A base class for progress reporting, to be overridden by Progress for algorithms.
Definition at line 30 of file ProgressBase.h.
Mantid::Kernel::ProgressBase::ProgressBase | ( | ) |
Mantid::Kernel::ProgressBase::ProgressBase | ( | double | start, |
double | end, | ||
int64_t | numSteps | ||
) |
Creates a ProgressBase instance.
start | :: Starting progress |
end | :: Ending progress |
numSteps | :: Number of times report(...) method will be called. |
Definition at line 31 of file ProgressBase.cpp.
References m_last_reported, m_notifyStep, m_timeElapsed, and setNumSteps().
Mantid::Kernel::ProgressBase::ProgressBase | ( | const ProgressBase & | source | ) |
Copy constructor that builds a new ProgressBase object.
The timer state is copied from the other object
source | The source of the copy |
Definition at line 50 of file ProgressBase.cpp.
|
virtualdefault |
Destructor.
|
pure virtual |
Pure virtual method that does the progress reporting, to be overridden.
Implemented in ProgressPresenter, and Mantid::API::Progress.
Referenced by Mantid::Crystal::FindSXPeaksHelper::FindMaxReduceStrategy::getPeakGroups(), report(), and reportIncrement().
double Mantid::Kernel::ProgressBase::getEstimatedTime | ( | ) | const |
Returns the estimated number of seconds until the algorithm completes.
Definition at line 200 of file ProgressBase.cpp.
References m_i, m_step, and m_timeElapsed.
Referenced by Mantid::API::Progress::doReport(), and export_ProgressBase().
|
inlinevirtual |
Override so that the reporter can inform whether a cancellation request has been used.
Reimplemented in Mantid::API::Progress.
Definition at line 42 of file ProgressBase.h.
Referenced by Mantid::Geometry::InstrumentDefinitionParser::setComponentLinks().
ProgressBase & Mantid::Kernel::ProgressBase::operator= | ( | const ProgressBase & | rhs | ) |
Definition at line 56 of file ProgressBase.cpp.
References m_end, m_i, m_ifirst, m_last_reported, m_notifyStep, m_notifyStepPct, m_notifyStepPrecision, m_numSteps, m_start, m_step, m_timeElapsed, and rhs.
|
inline |
Increments the loop counter by 1, then sends the progress notification on behalf of its algorithm.
Definition at line 51 of file ProgressBase.h.
Referenced by Mantid::CurveFitting::Algorithms::QENSFitSequential::addAdditionalLogs(), Mantid::CurveFitting::Algorithms::QENSFitSimultaneous::addAdditionalLogs(), Mantid::MDAlgorithms::ConvToMDEventsWSIndexing::appendEvents(), Mantid::MDAlgorithms::ConvToMDEventsWS::appendEventsFromInputWS(), Mantid::Crystal::LoadIsawPeaks::appendFile(), Mantid::Algorithms::CalculateCountRate::calcRateLog(), Mantid::MDAlgorithms::LoadSQW2::calculateDimLimitsFromData(), Mantid::DataHandling::SaveDspacemap::CalculateDspaceFromCal(), Mantid::Algorithms::MultipleScatteringCorrection::calculateSampleAndContainer(), Mantid::Algorithms::MultipleScatteringCorrection::calculateSingleComponent(), Mantid::Algorithms::ResetNegatives::changeNegatives(), Mantid::Algorithms::ConvertUnits::convertQuickly(), Mantid::Algorithms::ConvertUnits::convertViaTOF(), Mantid::Algorithms::SumEventsByLogValue::createBinnedOutput(), Mantid::Algorithms::Bin2DPowderDiffraction::createOutputWorkspace(), Mantid::Algorithms::SumEventsByLogValue::createTableOutput(), Mantid::Algorithms::PDCalibration::createTOFPeakCenterFitWindowWorkspaces(), Mantid::Algorithms::SumSpectra::doFractionalSum(), Mantid::Algorithms::RebinByPulseTimes::doHistogramming(), Mantid::Algorithms::RebinByTimeAtSample::doHistogramming(), Mantid::MDAlgorithms::MinusMD::doMinus(), Mantid::MDAlgorithms::PlusMD::doPlus(), Mantid::Algorithms::SumSpectra::doSimpleSum(), Mantid::Algorithms::MonteCarloAbsorption::doSimulation(), Mantid::Algorithms::AbsorptionCorrection::exec(), Mantid::Algorithms::AddAbsorptionWeightedPathLengths::exec(), Mantid::Algorithms::CalculateCarpenterSampleCorrection::exec(), Mantid::Algorithms::ChangePulsetime::exec(), Mantid::Algorithms::ChangePulsetime2::exec(), Mantid::Algorithms::ConvertAxisByFormula::exec(), Mantid::Algorithms::ConvertToConstantL2::exec(), Mantid::Algorithms::ConvertToEventWorkspace::exec(), Mantid::Algorithms::ConvertToMatrixWorkspace::exec(), Mantid::Algorithms::CorelliCrossCorrelate::exec(), Mantid::Algorithms::CorrectKiKf::exec(), Mantid::Algorithms::CorrectToFile::exec(), Mantid::Algorithms::CreateCalFileByNames::exec(), Mantid::Algorithms::CreateDummyCalFile::exec(), Mantid::Algorithms::DeleteWorkspaces::exec(), Mantid::Algorithms::DetectorEfficiencyCorUser::exec(), Mantid::Algorithms::DiffractionEventCalibrateDetectors::exec(), Mantid::Algorithms::DiffractionFocussing2::exec(), Mantid::Algorithms::DiscusMultipleScatteringCorrection::exec(), Mantid::Algorithms::ExtractFFTSpectrum::exec(), Mantid::Algorithms::ExtractMask::exec(), Mantid::Algorithms::ExtractSpectra2::exec(), Mantid::Algorithms::FilterByLogValue::exec(), Mantid::Algorithms::FilterByTime::exec(), Mantid::Algorithms::FilterByXValue::exec(), Mantid::Algorithms::FindPeakBackground::exec(), Mantid::Algorithms::GetDetectorOffsets::exec(), Mantid::Algorithms::HyspecScharpfCorrection::exec(), Mantid::Algorithms::IntegrateByComponent::exec(), Mantid::Algorithms::ModeratorTzero::exec(), Mantid::Algorithms::ModeratorTzeroLinear::exec(), Mantid::Algorithms::MonitorEfficiencyCorUser::exec(), Mantid::Algorithms::PaalmanPingsAbsorptionCorrection::exec(), Mantid::Algorithms::PaddingAndApodization::exec(), Mantid::Algorithms::PDCalibration::exec(), Mantid::Algorithms::PointByPointVCorrection::exec(), Mantid::Algorithms::Qxy::exec(), Mantid::Algorithms::RayTracerTester::exec(), Mantid::Algorithms::Rebin::exec(), Mantid::Algorithms::RemoveBackground::exec(), Mantid::Algorithms::RemoveBins::exec(), Mantid::Algorithms::ResampleX::exec(), Mantid::Algorithms::ResetNegatives::exec(), Mantid::Algorithms::MayersSampleCorrection::exec(), Mantid::Algorithms::SetUncertainties::exec(), Mantid::Algorithms::SofQWCentre::exec(), Mantid::Algorithms::SolidAngle::exec(), Mantid::Algorithms::SpatialGrouping::exec(), Mantid::Algorithms::VesuvioL1ThetaResolution::exec(), Mantid::Algorithms::XDataConverter::exec(), Mantid::Crystal::AnvredCorrection::exec(), Mantid::Crystal::IndexSXPeaks::exec(), Mantid::Crystal::IntegratePeakTimeSlices::exec(), Mantid::Crystal::NormaliseVanadium::exec(), Mantid::Crystal::PeakIntegration::exec(), Mantid::Crystal::PeakIntensityVsRadius::exec(), Mantid::Crystal::PredictPeaks::exec(), Mantid::CurveFitting::Algorithms::Fit1D::exec(), Mantid::CurveFitting::Algorithms::SplineInterpolation::exec(), Mantid::CurveFitting::Algorithms::SplineSmoothing::exec(), Mantid::DataHandling::LoadDetectorsGroupingFile::exec(), Mantid::DataHandling::LoadMuonLog::exec(), Mantid::DataHandling::LoadNexusMonitors2::exec(), Mantid::DataHandling::LoadNXSPE::exec(), Mantid::DataHandling::LoadParameterFile::exec(), Mantid::DataHandling::MaskSpectra::exec(), Mantid::DataHandling::NexusTester::exec(), Mantid::DataHandling::SaveCSV::exec(), Mantid::DataHandling::SaveOpenGenieAscii::exec(), Mantid::DataHandling::SaveParameterFile::exec(), Mantid::DataHandling::SaveVTK::exec(), Mantid::MDAlgorithms::CreateMD::exec(), Mantid::MDAlgorithms::SaveIsawQvector::exec(), Mantid::MDAlgorithms::ThresholdMD::exec(), Mantid::WorkflowAlgorithms::DgsReduction::exec(), Mantid::WorkflowAlgorithms::LoadEventAndCompress::exec(), Mantid::WorkflowAlgorithms::MuonProcess::exec(), Mantid::WorkflowAlgorithms::SANSBeamFluxCorrection::exec(), Mantid::Algorithms::CorrectKiKf::execEvent(), Mantid::Algorithms::ExtractSpectra::execEvent(), Mantid::Algorithms::HyspecScharpfCorrection::execEvent(), Mantid::Algorithms::ModeratorTzeroLinear::execEvent(), Mantid::Algorithms::UnaryOperation::execEvent(), Mantid::Crystal::AnvredCorrection::execEvent(), Mantid::Algorithms::SumSpectra::execEvent(), Mantid::Algorithms::ModeratorTzero::execEvent(), Mantid::Algorithms::ExtractSpectra::execHistogram(), Mantid::DataHandling::LoadEventNexus::execLoader(), Mantid::Crystal::PeaksIntersection::executePeaksIntersection(), export_ProgressBase(), Mantid::Algorithms::SmoothNeighbours::findNeighboursRectangular(), Mantid::Algorithms::FitPeaks::fitPeaks(), Mantid::Algorithms::SpectrumAlgorithm::for_each(), Mantid::DataHandling::LoadNexusMonitors2::getMonitorInfo(), Mantid::Algorithms::RebinToWorkspace::histogram(), Mantid::DataHandling::LoadEventNexus::loadEvents(), Mantid::Algorithms::makeGroupingByNames(), Mantid::Algorithms::makeGroupingByNumGroups(), Mantid::Algorithms::CalculateIqt::monteCarloErrorCalculation(), Mantid::DataHandling::SetScalingPSD::movePos(), Mantid::Algorithms::NormaliseToMonitor::normaliseBinByBin(), Mantid::DataObjects::FractionalRebinning::normaliseOutput(), Mantid::DataObjects::EventSortingTask::operator()(), Mantid::Algorithms::InterpolatingRebin::outputYandEValues(), Mantid::Geometry::InstrumentDefinitionParser::parseLocationsForEachTopLevelComponent(), Mantid::Algorithms::NormaliseToMonitor::performHistogramDivision(), Mantid::MDAlgorithms::PreprocessDetectorsToMD::processDetectorsPositions(), Mantid::Algorithms::NormaliseByDetector::processHistogram(), Mantid::DataHandling::SetScalingPSD::processScalingFile(), Mantid::Algorithms::LorentzCorrection::processTOF_PD(), Mantid::Algorithms::LorentzCorrection::processTOF_SCD(), Mantid::Algorithms::ResetNegatives::pushMinimum(), Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV2::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::qListFromHistoWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::qListFromHistoWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV2::qListFromHistoWS(), Mantid::DataHandling::LoadRKH::read2D(), Mantid::DataHandling::LoadMcStas::readEventData(), Mantid::MDAlgorithms::LoadSQW::readEvents(), Mantid::Algorithms::readGroupingFile(), Mantid::MDAlgorithms::LoadSQW2::readPixelDataIntoWorkspace(), Mantid::Algorithms::RebinToWorkspace::rebin(), Mantid::API::renameWorkspacesInQENSFit(), Mantid::DataHandling::LoadBankFromDiskTask::run(), Mantid::DataHandling::ProcessBankData::run(), Mantid::Kernel::ThreadPoolRunnable::run(), Mantid::MDAlgorithms::ConvToMDEventsWS::runConversion(), Mantid::MDAlgorithms::ConvToMDHistoWS::runConversion(), Mantid::DataHandling::SaveCSV::saveXerrors(), Mantid::DataHandling::SaveISISNexus::selog(), Mantid::Geometry::InstrumentDefinitionParser::setComponentLinks(), Mantid::Algorithms::ConvertEmptyToTof::setTofInWS(), Mantid::Algorithms::ConvertUnits::setupOutputWorkspace(), Mantid::Algorithms::ChangeTimeZero::shiftTimeOfLogs(), Mantid::DataHandling::ANSTO::ProgressTracker::update(), and Mantid::DataHandling::SaveRKH::write1D().
void Mantid::Kernel::ProgressBase::report | ( | const std::string & | msg | ) |
Increments the loop counter by 1, then sends the progress notification on behalf of its algorithm.
msg | :: message string that will be displayed in GUI, for example |
Definition at line 86 of file ProgressBase.cpp.
References doReport(), m_i, m_last_reported, and m_notifyStep.
void Mantid::Kernel::ProgressBase::report | ( | int64_t | i, |
const std::string & | msg = "" |
||
) |
Sends the progress notification on behalf of its algorithm.
Sets the loop counter to a particular value.
i | :: The new value of the loop counter |
msg | :: Optional message string |
Definition at line 100 of file ProgressBase.cpp.
References doReport(), m_i, m_last_reported, and m_notifyStep.
void Mantid::Kernel::ProgressBase::reportIncrement | ( | int | inc, |
const std::string & | msg = "" |
||
) |
Sends the progress notification and increment the loop counter by more than one.
inc | :: Increment the loop counter by this much |
msg | :: Optional message string |
Definition at line 116 of file ProgressBase.cpp.
References doReport(), m_i, m_last_reported, and m_notifyStep.
Referenced by Mantid::DataHandling::ANSTO::ProgressTracker::complete(), Mantid::DataHandling::SaveNexusProcessed::doExec(), Mantid::DataHandling::LoadEmptyInstrument::exec(), export_ProgressBase(), Mantid::DataObjects::EventWorkspace::sortAll(), and Mantid::NeXus::NexusFileIO::writeNexusProcessedData2D().
void Mantid::Kernel::ProgressBase::reportIncrement | ( | size_t | inc, |
const std::string & | msg = "" |
||
) |
Sends the progress notification and increment the loop counter by more than one.
inc | :: Increment the loop counter by this much |
msg | :: Optional message string |
Definition at line 132 of file ProgressBase.cpp.
References doReport(), m_i, m_last_reported, and m_notifyStep.
void Mantid::Kernel::ProgressBase::resetNumSteps | ( | int64_t | nsteps, |
double | start, | ||
double | end | ||
) |
Change the number of steps between start/end.
nsteps | :: the number of steps to take between start and end |
start | :: Starting progress |
end | :: Ending progress |
Definition at line 162 of file ProgressBase.cpp.
References m_end, m_i, m_last_reported, m_start, m_timeElapsed, and setNumSteps().
Referenced by Mantid::MDAlgorithms::ConvToMDEventsWSIndexing::appendEvents(), Mantid::MDAlgorithms::ConvToMDEventsWS::appendEventsFromInputWS(), Mantid::Crystal::ConnectedComponentLabeling::calculateDisjointTree(), Mantid::DataHandling::LoadParameterFile::exec(), Mantid::DataHandling::SaveParameterFile::exec(), Mantid::MDAlgorithms::LoadSQW::exec(), Mantid::WorkflowAlgorithms::LoadEventAndCompress::exec(), export_ProgressBase(), Mantid::Geometry::InstrumentDefinitionParser::parseLocationsForEachTopLevelComponent(), Mantid::MDAlgorithms::ConvToMDHistoWS::runConversion(), and Mantid::Geometry::InstrumentDefinitionParser::setComponentLinks().
void Mantid::Kernel::ProgressBase::setNotifyStep | ( | double | notifyStepPct | ) |
Override the frequency at which notifications are sent out.
The default is every change of 1%.
notifyStepPct | :: minimum change, in percentage, to skip between updates. Default is 1.. |
Definition at line 184 of file ProgressBase.cpp.
References m_end, m_notifyStep, m_notifyStepPct, m_notifyStepPrecision, m_numSteps, and m_start.
Referenced by Mantid::MDAlgorithms::LoadSQW2::calculateDimLimitsFromData(), Mantid::Algorithms::MonteCarloAbsorption::doSimulation(), Mantid::Algorithms::AddAbsorptionWeightedPathLengths::exec(), Mantid::Algorithms::DiscusMultipleScatteringCorrection::exec(), Mantid::Algorithms::MayersSampleCorrection::exec(), Mantid::Crystal::PredictPeaks::exec(), export_ProgressBase(), Mantid::MDAlgorithms::LoadSQW::readEvents(), and Mantid::MDAlgorithms::LoadSQW2::readPixelDataIntoWorkspace().
void Mantid::Kernel::ProgressBase::setNumSteps | ( | int64_t | nsteps | ) |
Change the number of steps between start/end.
nsteps | :: the number of steps to take between start and end |
Definition at line 145 of file ProgressBase.cpp.
References m_end, m_notifyStep, m_notifyStepPct, m_numSteps, m_start, and m_step.
Referenced by export_ProgressBase(), Mantid::Algorithms::makeGroupingByNames(), ProgressBase(), Mantid::MDAlgorithms::LoadSQW::readEvents(), and resetNumSteps().
|
protected |
Ending progress.
Definition at line 73 of file ProgressBase.h.
Referenced by Mantid::API::Progress::doReport(), operator=(), resetNumSteps(), setNotifyStep(), and setNumSteps().
|
protected |
Loop counter.
Definition at line 86 of file ProgressBase.h.
Referenced by ProgressPresenter::doReport(), Mantid::API::Progress::doReport(), getEstimatedTime(), operator=(), report(), reportIncrement(), and resetNumSteps().
|
protected |
Loop counter initial value.
Definition at line 75 of file ProgressBase.h.
Referenced by Mantid::API::Progress::doReport(), and operator=().
|
protected |
Last loop counter value the was a peport.
Definition at line 88 of file ProgressBase.h.
Referenced by operator=(), ProgressBase(), report(), reportIncrement(), and resetNumSteps().
|
protected |
Frequency of sending the notification (every m_step times)
Definition at line 79 of file ProgressBase.h.
Referenced by operator=(), ProgressBase(), report(), reportIncrement(), setNotifyStep(), and setNumSteps().
|
protected |
Frequency of sending the notification (as a min percentage step, e.g.
1 for 1 % (default) )
Definition at line 82 of file ProgressBase.h.
Referenced by operator=(), setNotifyStep(), and setNumSteps().
|
protected |
Digits of precision in the reporting.
Definition at line 92 of file ProgressBase.h.
Referenced by Mantid::API::Progress::doReport(), operator=(), and setNotifyStep().
|
protected |
Loop counter upper bound.
Definition at line 77 of file ProgressBase.h.
Referenced by operator=(), setNotifyStep(), and setNumSteps().
|
protected |
Starting progress.
Definition at line 71 of file ProgressBase.h.
Referenced by Mantid::API::Progress::doReport(), operator=(), resetNumSteps(), setNotifyStep(), and setNumSteps().
|
protected |
Progress increment at each loop.
Definition at line 84 of file ProgressBase.h.
Referenced by Mantid::API::Progress::doReport(), getEstimatedTime(), operator=(), and setNumSteps().
|
protected |
Timer that is started when the progress bar is constructed.
Definition at line 90 of file ProgressBase.h.
Referenced by getEstimatedTime(), operator=(), ProgressBase(), and resetNumSteps().