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