Skip to content
Snippets Groups Projects
Commit 321b5c23 authored by Nick Draper's avatar Nick Draper
Browse files

Release notes and improved error messages

re #18844
parent 7c40dba2
No related branches found
No related tags found
No related merge requests found
...@@ -1689,24 +1689,31 @@ bool ConfigServiceImpl::addDirectoryifExists( ...@@ -1689,24 +1689,31 @@ bool ConfigServiceImpl::addDirectoryifExists(
void ConfigServiceImpl::updateFacilities(const std::string &fName) { void ConfigServiceImpl::updateFacilities(const std::string &fName) {
clearFacilities(); clearFacilities();
//search all of the instrument directories // search all of the instrument directories
std::vector<std::string> directoryNames = getInstrumentDirectories(); std::vector<std::string> directoryNames = getInstrumentDirectories();
std::string fileName = ""; std::string fileName = "";
for (const auto &instrDir : directoryNames) { for (const auto &instrDir : directoryNames) {
fileName = fName.empty() ? instrDir + "Facilities.xml" : fName; fileName = fName.empty() ? instrDir + "Facilities.xml" : fName;
Poco::File facilitiesFile(fileName); Poco::File facilitiesFile(fileName);
// stop when you find the first one // stop when you find the first one
if (facilitiesFile.exists()) if (facilitiesFile.exists())
break; break;
} }
// Set up the DOM parser and parse xml file // Set up the DOM parser and parse xml file
Poco::XML::DOMParser pParser; Poco::XML::DOMParser pParser;
Poco::AutoPtr<Poco::XML::Document> pDoc; Poco::AutoPtr<Poco::XML::Document> pDoc;
try { 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 { try {
pDoc = pParser.parse(fileName); pDoc = pParser.parse(fileName);
} catch (...) { } catch (...) {
......
...@@ -5,6 +5,12 @@ Framework Changes ...@@ -5,6 +5,12 @@ Framework Changes
.. contents:: Table of Contents .. contents:: Table of Contents
:local: :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 Algorithms
---------- ----------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment