tdaq-develop-2025-02-12
OtsSlowControlsInterface_slowcontrols.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::vector<std::string> OtsSlowControlsInterface::getChannelList() { return {}; }
30 
31 std::string OtsSlowControlsInterface::getList(const std::string& /*format*/)
32 {
33  //__COUT__ <<
34  // theXDAQContextConfigTree.getNode(controlsConfigurationPath).getValue <<
35  // std::endl;
36  return (std::string) "list";
37 }
38 void OtsSlowControlsInterface::subscribe(const std::string& /*Name*/) {}
39 
40 void OtsSlowControlsInterface::subscribeJSON(const std::string& /*List*/) {}
41 
42 void OtsSlowControlsInterface::unsubscribe(const std::string& /*Name*/) {}
43 
44 std::array<std::string, 4> OtsSlowControlsInterface::getCurrentValue(
45  const std::string& /*Name*/)
46 {
47  return {"a", "b", "c", "d"};
48 }
49 
50 std::vector<std::vector<std::string>> OtsSlowControlsInterface::getChannelHistory(
51  const std::string& /*Name*/
52  , int /*start time*/
53  , int /* end time*/)
54 {
55  return {};
56 }
57 
58 std::vector<std::vector<std::string>> OtsSlowControlsInterface::getLastAlarms(
59  const std::string& /*Name*/)
60 {
61  return {};
62 }
63 
64 std::vector<std::vector<std::string>> OtsSlowControlsInterface::getAlarmsLog(
65  const std::string& /*Name*/)
66 {
67  return {};
68 }
69 
70 std::array<std::string, 9> OtsSlowControlsInterface::getSettings(
71  const std::string& /*Name*/)
72 {
73  return {"a", "b", "c", "d", "e", "f", "g", "h", "i"};
74 }
75 
76 std::vector<std::vector<std::string>> OtsSlowControlsInterface::checkAlarmNotifications(
77  void)
78 {
79  return {};
80 }
81 
82 DEFINE_OTS_SLOW_CONTROLS(OtsSlowControlsInterface)