diff --git a/Framework/Kernel/src/ConfigService.cpp b/Framework/Kernel/src/ConfigService.cpp index f6ad5cc02e153c0df50717e0d6b0f09533bb31f8..553dd63948c1bcbd61be9bddcc8445b6c6416db0 100644 --- a/Framework/Kernel/src/ConfigService.cpp +++ b/Framework/Kernel/src/ConfigService.cpp @@ -1689,24 +1689,31 @@ bool ConfigServiceImpl::addDirectoryifExists( void ConfigServiceImpl::updateFacilities(const std::string &fName) { clearFacilities(); - //search all of the instrument directories + // search all of the instrument directories std::vector<std::string> directoryNames = getInstrumentDirectories(); std::string fileName = ""; for (const auto &instrDir : directoryNames) { fileName = fName.empty() ? instrDir + "Facilities.xml" : fName; - Poco::File facilitiesFile(fileName); + Poco::File facilitiesFile(fileName); // stop when you find the first one if (facilitiesFile.exists()) break; } - // Set up the DOM parser and parse xml file Poco::XML::DOMParser pParser; Poco::AutoPtr<Poco::XML::Document> pDoc; try { + if (fileName.empty()) { + std::string directoryNamesList = + boost::algorithm::join(directoryNames, ", "); + throw std::runtime_error( + "Could not find a facilities info file! Searched for " + + directoryNamesList); + } + try { pDoc = pParser.parse(fileName); } catch (...) { diff --git a/docs/source/release/v3.9.0/framework.rst b/docs/source/release/v3.9.0/framework.rst index 6e4f624c950c64d8fae403c4c1539128e9fe595d..2eecd5067bccd30e15f49146c2ed2184f0aefded 100644 --- a/docs/source/release/v3.9.0/framework.rst +++ b/docs/source/release/v3.9.0/framework.rst @@ -5,6 +5,12 @@ Framework Changes .. contents:: Table of Contents :local: +Facility Updates +---------------- + +- Mantid now supports automatic updates to the facilities.xml file in the same way that it does the instrument definitions. This allows extensions and changes to the list of supported instruments without needing to install a new release of Mantid. + - This has been initially put into place to support a data file naming change for Vesuvio, but will help for future changes as well. + Algorithms ----------