10#include <Poco/Thread.h>
39 "The file into which the Python script will be generated.");
58 Poco::Thread::sleep(50);
63 std::ofstream file(filename.c_str(), std::ofstream::trunc);
80 auto props = alg->getProperties();
82 std::string algString;
83 for (
auto &prop : props) {
84 std::string opener =
"='";
85 if ((*prop).value().find(
'\\') != std::string::npos) {
89 std::string paramString = (*prop).name() + opener + (*prop).value() +
"'";
92 if (paramString.length() != 0) {
93 if (algString.length() != 0) {
96 algString += paramString;
#define DECLARE_ALGORITHM(classname)
Observes Algorithm notifications: start,progress,finish,error.
void observeStarting()
Connect to AlgorithmManager and observe its starting notifications.
void stopObservingManager()
Disconnect from the algorithm manager.
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
std::string getPropertyValue(const std::string &name) const override
Get the value of a property as a string.
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...
void useAlgorithm(const std::string &, const int version=-1)
The algorithm to use instead of this one.
@ Save
to specify a file to write to, the file may or may not exist
GeneratePythonScript : TODO: DESCRIPTION.
RecordPythonScript()
Constructor.
void startingHandle(API::IAlgorithm_sptr alg) override
Handler of the start notifications.
void exec() override
Run the algorithm.
void init() override
Initialise the properties.
std::string m_generatedScript
buffer for the script
Records the filename and the description of failure.
std::shared_ptr< IAlgorithm > IAlgorithm_sptr
shared pointer to Mantid::API::IAlgorithm