Mantid
Loading...
Searching...
No Matches
InstrumentInfo.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
11#include <boost/python/class.hpp>
12#include <boost/python/copy_const_reference.hpp>
13#include <boost/python/overloads.hpp>
14
16using namespace boost::python;
17
19 using namespace Mantid::PythonInterface;
20 std_vector_exporter<InstrumentInfo>::wrap("std_vector_InstrumentInfo");
21
22 class_<InstrumentInfo>("InstrumentInfo", no_init)
23 .def("name", &InstrumentInfo::name, arg("self"),
24 ""
25 "Returns the full name of the instrument as defined in the "
26 "Facilites.xml file")
27
28 .def("shortName", &InstrumentInfo::shortName, arg("self"),
29 "Returns the abbreviated name of the instrument as definined in the "
30 "Facilites.xml file")
31
32 .def("__str__", &InstrumentInfo::shortName, arg("self"),
33 "Returns the abbreviated name of the instrument as definined in the "
34 "Facilites.xml file")
35
36 .def("zeroPadding", &InstrumentInfo::zeroPadding, (arg("self"), arg("runNumber")),
37 "Returns zero padding for this instrument")
38
39 .def("filePrefix", &InstrumentInfo::filePrefix, (arg("self"), arg("runNumber")),
40 "Returns file prefix for this instrument")
41
42 .def("delimiter", &InstrumentInfo::delimiter, arg("self"),
43 "Returns the delimiter "
44 "between the instrument "
45 "name and the run number.")
46
47 .def("techniques", &InstrumentInfo::techniques, arg("self"), return_value_policy<copy_const_reference>(),
48 "Return list of techniques this instrument supports")
49
50 .def("facility", &InstrumentInfo::facility, arg("self"), return_value_policy<copy_const_reference>(),
51 "Returns the facility that contains this instrument.")
52
53 .def("liveListener", &InstrumentInfo::liveListener, (arg("self"), arg("name") = ""),
54 "Returns the name of the specific LiveListener class that is used "
55 "by the given connection name. If no name is provided, the default "
56 "connection is used.")
57
58 // Unclear why this is named "instdae", leaving in case legacy req'd
59 .def("instdae", &InstrumentInfo::liveDataAddress, arg("self"),
60 "Returns the host name and the port of the machine hosting DAE and "
61 "providing port to connect to for a live data stream")
62
63 .def("liveDataAddress", &InstrumentInfo::liveDataAddress, (arg("self"), arg("name") = ""),
64 "Returns the Address string of a live data connection on this "
65 "instrument. If no connection name is provided, the default "
66 "connection is used.")
67
68 .def("liveListenerInfo", &InstrumentInfo::liveListenerInfo, (arg("self"), arg("name") = ""),
69 return_value_policy<copy_const_reference>(),
70 "Returns a LiveListenerInfo instance for this instrument. If "
71 "no connection name is specified, the default is used.")
72
73 .def("hasLiveListenerInfo", &InstrumentInfo::hasLiveListenerInfo, arg("self"),
74 "Returns true if this instrument has at least one LiveListenerInfo")
75
76 .def("liveListenerInfoList", &InstrumentInfo::liveListenerInfoList, arg("self"),
77 return_value_policy<copy_const_reference>(), "Returns all available LiveListenerInfo instances as a vector")
78
79 ;
80}
void export_InstrumentInfo()
A class that holds information about an instrument.
std::string filePrefix(unsigned int runNumber) const
Returns file prefix for this instrument and a run number.
bool hasLiveListenerInfo() const
Returns true if this instrument has at least one live listener defined.
std::string liveDataAddress(const std::string &name="") const
Returns a string containing the "host:port" for default live listener.
const FacilityInfo & facility() const
The facility to which this instrument belongs.
const std::string name() const
Return the name of the instrument.
const std::set< std::string > & techniques() const
Return list of techniques.
const std::vector< LiveListenerInfo > & liveListenerInfoList() const
Returns all available LiveListenerInfos as a vector.
int zeroPadding(unsigned int runNumber) const
Returns zero padding for this instrument and a run number.
std::string delimiter() const
Returns the default delimiter between instrument name and run number.
std::string liveListener(const std::string &name="") const
Returns the name of the default live listener.
const LiveListenerInfo & liveListenerInfo(std::string name="") const
Returns LiveListenerInfo for specified connection name (or default)
const std::string shortName() const
Return the short name of the instrument.
A struct to help export std::vector types.