otsdaq_components  v2_04_01
OtsSlowControlsInterface_controls.cc
1 #include "otsdaq-components/SlowControlsInterfacePlugins/OtsSlowControlsInterface.h"
2 #include "otsdaq-core/Macros/SlowControlsPluginMacros.h"
3 
4 using namespace ots;
5 
6 OtsSlowControlsInterface::OtsSlowControlsInterface(
7  const std::string& interfaceUID,
8  const ConfigurationTree& theXDAQContextConfigTree,
9  const std::string& controlsConfigurationPath)
10  // TODO -- listen on a socket for data
11  // or read from disk
12  // :Socket (
13  // theXDAQContextConfigTree.getNode(interfaceConfigurationPath).getNode("HostIPAddress").getValue<std::string>()
14  // ,theXDAQContextConfigTree.getNode(interfaceConfigurationPath).getNode("HostPort").getValue<unsigned
15  // int>())
16  // ,
17  : SlowControlsVInterface(
18  interfaceUID, theXDAQContextConfigTree, controlsConfigurationPath)
19 {
20 }
21 
22 OtsSlowControlsInterface::~OtsSlowControlsInterface() { destroy(); }
23 
24 void OtsSlowControlsInterface::initialize() {}
25 
26 void OtsSlowControlsInterface::destroy() {}
27 
28 std::string OtsSlowControlsInterface::getList(std::string format)
29 {
30  //__COUT__ <<
31  // theXDAQContextConfigTree.getNode(controlsConfigurationPath).getValue <<
32  // std::endl;
33  return (std::string) "list";
34 }
35 void OtsSlowControlsInterface::subscribe(std::string Name) {}
36 
37 void OtsSlowControlsInterface::subscribeJSON(std::string List) {}
38 
39 void OtsSlowControlsInterface::unsubscribe(std::string Name) {}
40 
41 std::array<std::string, 4> OtsSlowControlsInterface::getCurrentValue(std::string Name)
42 {
43  return {"a", "b", "c", "d"};
44 }
45 
46 std::array<std::string, 9> OtsSlowControlsInterface::getSettings(std::string Name)
47 {
48  return {"a", "b", "c", "d", "e", "f", "g", "h", "i"};
49 }
50 
51 DEFINE_OTS_SLOW_CONTROLS(OtsSlowControlsInterface)