CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
IndependentWebGUI.h
Go to the documentation of this file.
1 #ifndef INDEPENDENTWEBGUI_H
2 #define INDEPENDENTWEBGUI_H 1
3 
9 
10 #include "xdaq/Application.h"
11 
12 #include "toolbox/lang/Class.h"
13 
14 #include "xdata/Serializable.h"
15 #include "xdata/UnsignedInteger32.h"
16 #include "xdata/InfoSpaceFactory.h"
17 
18 #include "xgi/Method.h"
19 #include "xgi/Input.h"
20 #include "xgi/Output.h"
21 #include "xgi/exception/Exception.h"
22 
23 #include <string>
24 #include <vector>
25 
26 namespace evf {
27 
28 class IndependentWebGUI: public toolbox::lang::Class {
29 public:
30  //
31  // typedefs
32  //
33  typedef xdata::Serializable Param_t;
34  typedef xdata::UnsignedInteger32 Counter_t;
35  typedef std::vector<std::pair<std::string, Param_t*> > ParamVec_t;
36  typedef std::vector<std::pair<std::string, Counter_t*> > CounterVec_t;
37  typedef std::vector<std::pair<std::string, void*> > UpdateVec_t;
40  typedef const std::string CString_t;
42 
43  //
44  // construction/destruction
45  //
46  IndependentWebGUI(xdaq::Application* app);
47  virtual ~IndependentWebGUI();
48 
49  //
50  // public memeber functions
51  //
54  void css(Input_t *in, Output_t *out) throw (XgiException_t);
55 
56  void addStandardParam(CString_t& name, Param_t* param);
57  void addMonitorParam(CString_t& name, Param_t* param);
58  void addDebugParam(CString_t& name, Param_t* param);
59 
60  void addStandardCounter(CString_t& name, Counter_t* counter);
61  void addMonitorCounter(CString_t& name, Counter_t* counter);
62  void addDebugCounter(CString_t& name, Counter_t* counter);
63 
64  void exportParameters(); // must be called once after registering all params!
65  void resetCounters();
66 
67  void addItemChangedListener(CString_t& name, xdata::ActionListener* l);
68 
69  xdata::InfoSpace* appInfoSpace() {
70  return appInfoSpace_;
71  }
72  xdata::InfoSpace* monInfoSpace() {
73  return monInfoSpace_;
74  }
75 
76  void setLargeAppIcon(CString_t& icon) {
77  largeAppIcon_ = icon;
78  }
79  void setSmallAppIcon(CString_t& icon) {
80  smallAppIcon_ = icon;
81  }
82  void setSmallDbgIcon(CString_t& icon) {
83  smallDbgIcon_ = icon;
84  }
85  void setHyperDAQIcon(CString_t& icon) {
86  hyperDAQIcon_ = icon;
87  }
88 
90  const ParamVec_t& params);
91  void htmlHead(Input_t*in, Output_t*out, CString_t& pageTitle);
93 
94  inline void updateExternalState(std::string newState) {
95  currentExternalStateName_ = newState;
96  }
97  inline void updateInternalState(std::string newState) {
98  currentInternalStateName_ = newState;
99  }
100  inline void setVersionString(std::string vers) {
101  versionString_ = vers;
102  }
103 
104 private:
105  //
106  // private member functions
107  //
108  void addParamsToInfoSpace(const ParamVec_t& params,
109  xdata::InfoSpace* infoSpace);
110  void addCountersToParams();
112  void updateParams();
113 
114 private:
115  //
116  // member data
117  //
118  xdaq::Application *app_;
120  Logger log_;
121 
122  std::string sourceId_;
123  std::string urn_;
124 
125  xdata::InfoSpace *appInfoSpace_;
126  xdata::InfoSpace *monInfoSpace_;
127 
128  xdata::ActionListener *itemGroupListener_;
129 
136 
139 
140  std::string largeAppIcon_;
141  std::string smallAppIcon_;
142  std::string smallDbgIcon_;
143  std::string smallCtmIcon_;
144  std::string hyperDAQIcon_;
145 
148  std::string versionString_;
149 
150 };
151 
152 } // namespace evf
153 
154 
155 #endif
void updateExternalState(std::string newState)
void addStandardCounter(CString_t &name, Counter_t *counter)
#define Input(cl)
Definition: vmac.h:189
void addStandardParam(CString_t &name, Param_t *param)
void addMonitorCounter(CString_t &name, Counter_t *counter)
std::string currentInternalStateName_
IndependentWebGUI(xdaq::Application *app)
xdaq::Application * app_
void addDebugParam(CString_t &name, Param_t *param)
xdata::UnsignedInteger32 Counter_t
const std::string CString_t
void setSmallAppIcon(CString_t &icon)
bool isMonitorParam(CString_t &name)
xdata::Serializable Param_t
xdata::ActionListener * itemGroupListener_
void setVersionString(std::string vers)
void defaultWebPage(Input_t *in, Output_t *out)
void htmlTable(Input_t *in, Output_t *out, CString_t &title, const ParamVec_t &params)
std::vector< std::pair< std::string, Counter_t * > > CounterVec_t
void addItemChangedListener(CString_t &name, xdata::ActionListener *l)
void addDebugCounter(CString_t &name, Counter_t *counter)
std::vector< std::pair< std::string, void * > > UpdateVec_t
void updateInternalState(std::string newState)
void htmlHead(Input_t *in, Output_t *out, CString_t &pageTitle)
Definition: Css.h:12
xdata::InfoSpace * monInfoSpace_
void setSmallDbgIcon(CString_t &icon)
tuple out
Definition: dbtoconf.py:99
void addParamsToInfoSpace(const ParamVec_t &params, xdata::InfoSpace *infoSpace)
xdata::InfoSpace * appInfoSpace_
void setHyperDAQIcon(CString_t &icon)
xdata::InfoSpace * appInfoSpace()
xgi::exception::Exception XgiException_t
xdata::InfoSpace * monInfoSpace()
#define Output(cl)
Definition: vmac.h:193
void debugWebPage(Input_t *in, Output_t *out)
std::string currentExternalStateName_
void addMonitorParam(CString_t &name, Param_t *param)
void setLargeAppIcon(CString_t &icon)
void css(Input_t *in, Output_t *out)
void htmlHeadline(Input_t *in, Output_t *out)
std::vector< std::pair< std::string, Param_t * > > ParamVec_t