11#include <Poco/Thread.h>
15using Mantid::Types::Core::DateAndTime;
23const
std::
string Pause::name()
const {
return "Pause"; }
35 "How long to pause, in seconds. Default 1.\n"
36 "Enter a negative number to pause forever until cancelled.");
42 DateAndTime startTime = DateAndTime::getCurrentTime();
47 bool breakOut =
false;
60 Poco::Thread::sleep(50);
62 DateAndTime now = DateAndTime::getCurrentTime();
63 double seconds = DateAndTime::secondsFromDuration(now - startTime);
67 if (seconds > duration)
70 this->
progress(seconds / duration,
"", duration - seconds);
#define DECLARE_ALGORITHM(classname)
CancelException is thrown to cancel execution of the algorithm.
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
void progress(double p, const std::string &msg="", double estimatedTime=0.0, int progressPrecision=0)
Sends ProgressNotification.
void interruption_point()
This is called during long-running operations, and check if the algorithm has requested that it be ca...
Pause a script for a given duration.
const std::string category() const override
Algorithm's category for identification.
void init() override
Initialize the algorithm's properties.
void exec() override
Execute the algorithm.
int version() const override
Algorithm's version for identification.
void notice(const std::string &msg)
Logs at notice level.