Mantid
Loading...
Searching...
No Matches
CatalogListInstruments.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
11
12namespace Mantid::ICat {
13
14DECLARE_ALGORITHM(CatalogListInstruments)
15
16
18 declareProperty("Session", "", "The session information of the catalog to use.");
19 declareProperty(std::make_unique<Kernel::ArrayProperty<std::string>>("InstrumentList", std::vector<std::string>(),
20 std::make_shared<Kernel::NullValidator>(),
22 "A list containing instrument names.");
23}
24
27 std::vector<std::string> instruments;
28 API::CatalogManager::Instance().getCatalog(getPropertyValue("Session"))->listInstruments(instruments);
29 setProperty("InstrumentList", instruments);
30}
31} // namespace Mantid::ICat
#define DECLARE_ALGORITHM(classname)
Definition Algorithm.h:547
std::string getPropertyValue(const std::string &name) const override
Get the value of a property as a string.
This algorithm obtains a list of instruments types from the catalog.
void exec() override
Overwrites Algorithm exec method.
Support for a property that holds an array of values.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
@ Output
An output workspace.
Definition Property.h:55