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 +
10
11namespace Mantid::ICat {
12
13DECLARE_ALGORITHM(CatalogListInstruments)
14
15
17 declareProperty("Session", "", "The session information of the catalog to use.");
18 declareProperty(std::make_unique<Kernel::ArrayProperty<std::string>>("InstrumentList", std::vector<std::string>(),
19 std::make_shared<Kernel::NullValidator>(),
21 "A list containing instrument names.");
22}
23
26 std::vector<std::string> instruments;
27 API::CatalogManager::Instance().getCatalog(getPropertyValue("Session"))->listInstruments(instruments);
28 setProperty("InstrumentList", instruments);
29}
30} // namespace Mantid::ICat
#define DECLARE_ALGORITHM(classname)
Definition: Algorithm.h:576
std::string getPropertyValue(const std::string &name) const override
Get the value of a property as a string.
Definition: Algorithm.cpp:2026
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.
Definition: ArrayProperty.h:28
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
@ Output
An output workspace.
Definition: Property.h:54