otsdaq_utilities  v2_04_01
ControlsDashboardSupervisor.h
1 #ifndef _ots_ControlsDashboardSupervisor_h_
2 #define _ots_ControlsDashboardSupervisor_h_
3 
4 #include "otsdaq-core/CoreSupervisors/CoreSupervisorBase.h"
5 
6 //#include "otsdaq-utilities/SlowControlsInterfacePlugins/EpicsInterface.h"
7 //#include "EpicsInterface.h.bkup"
8 
9 namespace ots
10 {
11 class SlowControlsVInterface;
12 class ConfigurationManager;
13 
14 // ControlsDashboardSupervisor
15 // This class handles the management of slow controls interface plugins, as well as the
16 // user web interface
17 class ControlsDashboardSupervisor : public CoreSupervisorBase
18 {
19  public:
20  XDAQ_INSTANTIATOR();
21 
22  ControlsDashboardSupervisor(xdaq::ApplicationStub* s);
23  virtual ~ControlsDashboardSupervisor(void);
24 
25  void init(void);
26  void destroy(void);
27 
28  virtual void request(const std::string& requestType,
29  cgicc::Cgicc& cgiIn,
30  HttpXmlDocument& xmlOut,
31  const WebUsers::RequestUserInfo& userInfo) override;
32  virtual void handleRequest(const std::string Command,
33  HttpXmlDocument& xmlOut,
34  cgicc::Cgicc& cgiIn,
35  const std::string& username);
36 
37  virtual void setSupervisorPropertyDefaults(void) override;
38  virtual void forceSupervisorPropertyValues(void) override; // override to force
39  // supervisor property
40  // values (and ignore user
41  // settings)
42 
43  void Poll(cgicc::Cgicc& cgiIn, HttpXmlDocument& xmlOut, std::string UID);
44  void GetPVSettings(cgicc::Cgicc& cgiIn, HttpXmlDocument& xmlOut, std::string pvList);
45  void GenerateUID(cgicc::Cgicc& cgiIn, HttpXmlDocument& xmlOut, std::string pvlist);
46  void GetList(cgicc::Cgicc& cgiIn, HttpXmlDocument& xmlOut);
47  void GetPages(cgicc::Cgicc& cgiIn, HttpXmlDocument& xmlOut);
48  void loadPage(cgicc::Cgicc& cgiIn, HttpXmlDocument& xmlOut, std::string page);
49  void SavePage(cgicc::Cgicc& cgiIn,
50  HttpXmlDocument& xmlOut,
51  std::string pageName,
52  std::string page);
53  void Subscribe(cgicc::Cgicc& cgiIn, HttpXmlDocument& xmlOut);
54  void Unsubscribe(cgicc::Cgicc& cgiIn, HttpXmlDocument& xmlOut);
55 
56  // Utilities, eventually to be moved
57  bool isDir(std::string dir);
58  void listFiles(std::string baseDir, bool recursive, std::vector<std::string>* pages);
59 
60  private:
61  // SlowControlsInterface
62  // AllSupervisorInfo allSupervisorInfo_;
63  // EpicsInterface * interface_;
64 
65  // ConfigurationManager* theConfigurationManager_;
66  // RemoteWebUsers theRemoteWebUsers_;
67  // std::string username;
68  std::map<int, std::set<std::string>> pvDependencyLookupMap_;
69  int UID_;
70 
71  public:
72  SlowControlsVInterface* interface_;
73  std::mutex pluginBusyMutex_;
74 };
75 }
76 
77 #endif