diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/QLRun.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/QLRun.py index 93bba345ccdd9460a2e0228ca7b990c1f8c5aef3..a058e40059b69a329f6046d6640f9d9797f0722f 100644 --- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/QLRun.py +++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/QLRun.py @@ -9,7 +9,7 @@ if is_supported_f2py_platform(): else: logger.error('F2Py functionality not currently available on your platform.') -from mantid.api import PythonAlgorithm, AlgorithmFactory, MatrixWorkspaceProperty, PropertyMode +from mantid.api import PythonAlgorithm, AlgorithmFactory, MatrixWorkspaceProperty, PropertyMode, WorkspaceGroupProperty from mantid.kernel import StringListValidator, Direction from mantid.simpleapi import * from mantid import config, logger @@ -94,6 +94,16 @@ class QLRun(PythonAlgorithm): self.declareProperty(name='Save', defaultValue=False, doc='Switch Save result to nxs file Off/On') + self.declareProperty(WorkspaceGroupProperty('OutputWorkspaceFit', '', direction=Direction.Output), + doc='The name of the fit output workspaces') + + self.declareProperty(MatrixWorkspaceProperty('OutputWorkspaceProb', '', optional=PropertyMode.Optional, + direction=Direction.Output), + doc='The name of the probability output workspaces') + + self.declareProperty(MatrixWorkspaceProperty('OutputWorkspaceResult', '', direction=Direction.Output), + doc='The name of the result output workspaces') + def validateInputs(self): self._get_properties() @@ -313,7 +323,7 @@ class QLRun(PythonAlgorithm): yProb = yPr0 yProb = np.append(yProb,yPr1) yProb = np.append(yProb,yPr2) - CreateWorkspace(OutputWorkspace=probWS, DataX=xProb, DataY=yProb, DataE=eProb,\ + probWs = CreateWorkspace(OutputWorkspace=probWS, DataX=xProb, DataY=yProb, DataE=eProb,\ Nspec=3, UnitX='MomentumTransfer') outWS = C2Fw(self._samWS[:-4],fname) if self._Plot != 'None': @@ -339,6 +349,11 @@ class QLRun(PythonAlgorithm): logger.information('Output fit file created : ' + fit_path) logger.information('Output paramter file created : ' + out_path) + self.setProperty('OutputworkspaceFit', fitWS) + self.setProperty('OutputWorkspaceResult', outWS) + if self._program == 'QL': + self.setProperty('OutputWorkspaceProb', probWS) + if is_supported_f2py_platform(): # Register algorithm with Mantid diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/Quasi.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/Quasi.h index 51f240b0f685ee475e4b087870ed2fe9b70a4808..5aed373ac62fda461893c76adad24146c0678794 100644 --- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/Quasi.h +++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/Quasi.h @@ -44,6 +44,8 @@ private: int m_previewSpec; /// The ui form Ui::Quasi m_uiForm; + /// alg + Mantid::API::IAlgorithm_sptr m_QuasiAlg; }; } // namespace CustomInterfaces } // namespace MantidQt diff --git a/MantidQt/CustomInterfaces/src/Indirect/Quasi.cpp b/MantidQt/CustomInterfaces/src/Indirect/Quasi.cpp index a0000d493346257b4e22cd323fec807da2c24806..ca37a7164ae6acbcd7cc1cbc016eb6a0af4576dc 100644 --- a/MantidQt/CustomInterfaces/src/Indirect/Quasi.cpp +++ b/MantidQt/CustomInterfaces/src/Indirect/Quasi.cpp @@ -186,6 +186,9 @@ void Quasi::run() { runAlg->setProperty("SampleWorkspace", sampleName); runAlg->setProperty("ResolutionWorkspace", resName); runAlg->setProperty("ResNormWorkspace", resNormFile); + runAlg->setProperty("OutputWorkspaceFit", "fit"); + runAlg->setProperty("OutputWorkspaceProb", "prob"); + runAlg->setProperty("OutputWorkspaceResult", "result"); runAlg->setProperty("MinRange", eMin); runAlg->setProperty("MaxRange", eMax); runAlg->setProperty("SampleBins", sampleBins); @@ -199,6 +202,7 @@ void Quasi::run() { runAlg->setProperty("Save", save); runAlg->setProperty("Plot", plot); + m_QuasiAlg = runAlg; m_batchAlgoRunner->addAlgorithm(runAlg); connect(m_batchAlgoRunner, SIGNAL(batchComplete(bool)), this, SLOT(algorithmComplete(bool)));