diff --git a/Framework/Algorithms/src/Stitch1D.cpp b/Framework/Algorithms/src/Stitch1D.cpp index 76c99ae2871b567c3e52a95279214d983e4456e0..4d05b3902450996042efa9113b21e0929c0362d1 100644 --- a/Framework/Algorithms/src/Stitch1D.cpp +++ b/Framework/Algorithms/src/Stitch1D.cpp @@ -1,3 +1,4 @@ +#include "MantidAlgorithms/RunCombinationHelpers/RunCombinationHelper.h" #include "MantidAlgorithms/Stitch1D.h" #include "MantidAPI/AnalysisDataService.h" #include "MantidAPI/MatrixWorkspace.h" @@ -159,20 +160,22 @@ void Stitch1D::init() { } /** Validate the algorithm's properties. - * @return A map of porperty names and their issues. + * @return A map of property names and their issues. */ std::map<std::string, std::string> Stitch1D::validateInputs(void) { std::map<std::string, std::string> issues; - MatrixWorkspace_const_sptr lhs = getProperty("LHSWorkspace"); - MatrixWorkspace_const_sptr rhs = getProperty("RHSWorkspace"); + MatrixWorkspace_sptr lhs = getProperty("LHSWorkspace"); + MatrixWorkspace_sptr rhs = getProperty("RHSWorkspace"); if (!lhs) issues["LHSWorkspace"] = "Cannot retrieve workspace"; if (!rhs) issues["RHSWorkspace"] = "Cannot retrieve workspace"; - if (lhs->isHistogramData() && !rhs->isHistogramData()) - issues["RHSWorkspace"] = rhs->getName() + " must be a histogram."; - if (!lhs->isHistogramData() && rhs->isHistogramData()) - issues["RHSWorkspace"] = lhs->getName() + " must be point data."; + RunCombinationHelper combHelper; + combHelper.setReferenceProperties(lhs); + std::string compatible = combHelper.checkCompatibility(rhs, true); + if (!compatible.empty()) + issues["RHSWorkspace"] = "Workspace " + rhs->getName() + + " is not compatible: " + compatible + "\n"; return issues; } diff --git a/Framework/Algorithms/test/Stitch1DManyTest.h b/Framework/Algorithms/test/Stitch1DManyTest.h index 05490c3c1092362f4f30bb2668c07f30a18c5839..d765cb86baf9ddae2fb3fcacbcd224c4245ce4b2 100644 --- a/Framework/Algorithms/test/Stitch1DManyTest.h +++ b/Framework/Algorithms/test/Stitch1DManyTest.h @@ -1149,7 +1149,7 @@ public: AnalysisDataService::Instance().clear(); } - void test_input_manualScaleFactors(){ + void test_input_manualScaleFactors() { createUniformWorkspace(0.1, 0.1, 1., 2., "ws1", true); createUniformWorkspace(0.1, 0.1, 1.5, 2.5, "ws2", true); Stitch1DMany alg;