Skip to content

Commit

Permalink
Put back a method that was used by the instrument view.
Browse files Browse the repository at this point in the history
Refs #9756
  • Loading branch information
martyngigg committed Jun 30, 2014
1 parent a210289 commit 2978ba8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,24 @@ void MantidUI::executeAlgorithm(Mantid::API::IAlgorithm_sptr alg)
executeAlgorithmAsync(alg);
}

/**
* Execute an algorithm
* @param algName :: The algorithm name
* @param paramList :: A list of algorithm properties to be passed to Algorithm::setProperties
* @param obs :: A pointer to an instance of AlgorithmObserver which will be attached to the finish notification
*/
void MantidUI::executeAlgorithm(const QString & algName, const QString & paramList,Mantid::API::AlgorithmObserver* obs)
{
//Get latest version of the algorithm
Mantid::API::IAlgorithm_sptr alg = this->createAlgorithm(algName, -1);
if( !alg ) return;
if (obs)
{
obs->observeFinish(alg);
}
alg->setProperties(paramList.toStdString());
executeAlgorithmAsync(alg);
}

/**
* This creates an algorithm dialog (the default property entry thingie).
Expand Down
2 changes: 2 additions & 0 deletions Code/Mantid/MantidPlot/src/Mantid/MantidUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ class MantidUI:public QObject
void showAlgorithmDialog(QString algName, QHash<QString, QString> paramList, Mantid::API::AlgorithmObserver* obs = NULL);
// Execute an algorithm
void executeAlgorithm(Mantid::API::IAlgorithm_sptr alg);
// Execute a named algorithm using the given parameters
void executeAlgorithm(const QString & algName, const QString & paramList,Mantid::API::AlgorithmObserver* obs);

// Find the name of the first input workspace for an algorithm
QString findInputWorkspaceProperty(Mantid::API::IAlgorithm_sptr algorithm) const;
Expand Down

0 comments on commit 2978ba8

Please sign in to comment.