diff --git a/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/FitPropertyBrowser.h b/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/FitPropertyBrowser.h index ab21560ff6deb12ab4d54d14b884797289137c43..f7808c9300562be4187f9b8900e08b8bdde7fa93 100644 --- a/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/FitPropertyBrowser.h +++ b/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/FitPropertyBrowser.h @@ -209,6 +209,9 @@ public: void postDeleteHandle(const std::string& wsName); void addHandle(const std::string& wsName,const boost::shared_ptr<Mantid::API::Workspace> ws); + /// Called when the Fit is finished + virtual void finishHandle(const Mantid::API::IAlgorithm* alg); + /// Returns the list of workspaces that are currently been worked on by the fit property browser. QStringList getWorkspaceNames(); /// Create a MatrixWorkspace from a TableWorkspace @@ -426,8 +429,6 @@ private: void createCompositeFunction(const QString& str = ""); /// Check if the workspace can be used in the fit virtual bool isWorkspaceValid(Mantid::API::Workspace_sptr)const; - /// Called when the fit is finished - void finishHandle(const Mantid::API::IAlgorithm* alg); /// Find QtBrowserItem for a property prop among the chidren of QtBrowserItem* findItem(QtBrowserItem* parent,QtProperty* prop)const; /// Set the parameters to the fit outcome diff --git a/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/MuonFitPropertyBrowser.h b/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/MuonFitPropertyBrowser.h index 1d05b1422cd2a8e64f284de0d931bb8fa8c7e841..8efd86a299c9469049a686b629f89713470e6fd1 100644 --- a/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/MuonFitPropertyBrowser.h +++ b/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/MuonFitPropertyBrowser.h @@ -42,7 +42,8 @@ public: virtual void init(); /// Set the input workspace name virtual void setWorkspaceName(const QString& wsName); - + /// Called when the fit is finished + virtual void finishHandle(const Mantid::API::IAlgorithm* alg); public slots: /// Perform the fit algorithm @@ -61,7 +62,6 @@ protected: private slots: virtual void doubleChanged(QtProperty* prop); - private: /// Get the registered function names virtual void populateFunctionNames(); diff --git a/Code/Mantid/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp b/Code/Mantid/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp index 6e19abb887d9a666cede05d4aa6e9f34b2bc7902..766e7f5bea8fa9beaa121e2fbe21c09565f6c564 100644 --- a/Code/Mantid/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp +++ b/Code/Mantid/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp @@ -346,5 +346,20 @@ bool MuonFitPropertyBrowser::isWorkspaceValid(Workspace_sptr ws)const return false; } +void MuonFitPropertyBrowser::finishHandle(const IAlgorithm* alg) +{ + // Input workspace should be a MatrixWorkspace according to isWorkspaceValid + auto inWs = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>( + static_cast<std::string>( alg->getProperty("InputWorkspace") ) ); + + auto outWs = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>( + outputName() + "_Workspace"); + + if (inWs && outWs) + outWs->copyExperimentInfoFrom(inWs.get()); + + FitPropertyBrowser::finishHandle(alg); +} + } // MantidQt } // API