diff --git a/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp b/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp index 19bd01c694014494d6b74aa06740ffaaec86b704..14f3c77549bc7f07713bf03b9648fee8cfa39f5c 100644 --- a/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp +++ b/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp @@ -299,9 +299,22 @@ void MuonFitPropertyBrowser::runFit() { alg->setPropertyValue("Output", outputName()); alg->setPropertyValue("Minimizer", minimizer()); alg->setPropertyValue("CostFunction", costFunction()); + + // If we are doing a simultaneous fit, set this up here + const int nWorkspaces = static_cast<int>(m_workspacesToFit.size()); + if (nWorkspaces > 1) { + for (int i = 1; i < nWorkspaces; i++) { + std::string suffix = boost::lexical_cast<std::string>(i); + alg->setPropertyValue("InputWorkspace_" + suffix, m_workspacesToFit[i]); + alg->setProperty("WorkspaceIndex_" + suffix, workspaceIndex()); + alg->setProperty("StartX_" + suffix, startX()); + alg->setProperty("EndX_" + suffix, endX()); + } + } + observeFinish(alg); alg->executeAsync(); - } catch (std::exception &e) { + } catch (const std::exception &e) { QString msg = "Fit algorithm failed.\n\n" + QString(e.what()) + "\n"; QMessageBox::critical(this, "Mantid - Error", msg); }