CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
WebGUI.h
Go to the documentation of this file.
1 #ifndef WEBGUI_H
2 #define WEBGUI_H 1
3 
4 
7 
8 #include "xdaq/Application.h"
9 
10 #include "toolbox/lang/Class.h"
11 
12 #include "xdata/Serializable.h"
13 #include "xdata/UnsignedInteger32.h"
14 #include "xdata/InfoSpaceFactory.h"
15 
16 #include "xgi/Method.h"
17 #include "xgi/Input.h"
18 #include "xgi/Output.h"
19 #include "xgi/exception/Exception.h"
20 
21 #include <string>
22 #include <vector>
23 
24 
25 namespace evf {
26 
27  class WebGUI : public toolbox::lang::Class
28  {
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  //
45  // construction/destruction
46  //
47  WebGUI(xdaq::Application* app,StateMachine* fsm);
48  virtual ~WebGUI();
49 
50 
51  //
52  // public memeber functions
53  //
56  void css(Input_t *in,Output_t *out) throw (XgiException_t);
57 
58  void addStandardParam(CString_t& name,Param_t* param);
59  void addMonitorParam(CString_t& name,Param_t* param);
60  void addDebugParam(CString_t& name,Param_t* param);
61 
65 
66  void exportParameters(); // must be called once after registering all params!
67  void resetCounters();
68 
69  void addItemChangedListener(CString_t& name,xdata::ActionListener* l);
70 
71  xdata::InfoSpace* appInfoSpace() { return appInfoSpace_; }
72  xdata::InfoSpace* monInfoSpace() { return monInfoSpace_; }
73 
74  void setLargeAppIcon(CString_t& icon) { largeAppIcon_=icon; }
75  void setSmallAppIcon(CString_t& icon) { smallAppIcon_=icon; }
76  void setSmallDbgIcon(CString_t& icon) { smallDbgIcon_=icon; }
77  void setHyperDAQIcon(CString_t& icon) { hyperDAQIcon_=icon; }
78 
79 
81  CString_t& title,const ParamVec_t& params);
82  void htmlHead(Input_t*in,Output_t*out,CString_t& pageTitle);
84 
85 
86  private:
87  //
88  // private member functions
89  //
90  void addParamsToInfoSpace(const ParamVec_t& params,xdata::InfoSpace* infoSpace);
91  void addCountersToParams();
93  void updateParams();
94 
95 
96 
97  private:
98  //
99  // member data
100  //
101  xdaq::Application *app_;
104  Logger log_;
105 
106  std::string sourceId_;
107  std::string urn_;
108 
109  xdata::InfoSpace *appInfoSpace_;
110  xdata::InfoSpace *monInfoSpace_;
111 
112  xdata::ActionListener *itemGroupListener_;
113 
120 
123 
124  std::string largeAppIcon_;
125  std::string smallAppIcon_;
126  std::string smallDbgIcon_;
127  std::string smallCtmIcon_;
128  std::string hyperDAQIcon_;
129 
130  };
131 
132 
133 } // namespace evf
134 
135 
136 #endif
xdata::UnsignedInteger32 Counter_t
Definition: WebGUI.h:34
void setLargeAppIcon(CString_t &icon)
Definition: WebGUI.h:74
void addDebugCounter(CString_t &name, Counter_t *counter)
Definition: WebGUI.cc:189
StateMachine * fsm_
Definition: WebGUI.h:102
void resetCounters()
Definition: WebGUI.cc:217
void htmlTable(Input_t *in, Output_t *out, CString_t &title, const ParamVec_t &params)
Definition: WebGUI.cc:335
void updateParams()
Definition: WebGUI.cc:325
#define Input(cl)
Definition: vmac.h:189
bool parametersExported_
Definition: WebGUI.h:121
CounterVec_t standardCounters_
Definition: WebGUI.h:117
void addStandardParam(CString_t &name, Param_t *param)
Definition: WebGUI.cc:134
void exportParameters()
Definition: WebGUI.cc:200
void addCountersToParams()
Definition: WebGUI.cc:291
const std::string CString_t
Definition: WebGUI.h:40
xdata::Serializable Param_t
Definition: WebGUI.h:33
xgi::exception::Exception XgiException_t
Definition: WebGUI.h:41
void htmlHead(Input_t *in, Output_t *out, CString_t &pageTitle)
Definition: WebGUI.cc:365
std::string smallAppIcon_
Definition: WebGUI.h:125
CounterVec_t monitorCounters_
Definition: WebGUI.h:118
bool countersAddedToParams_
Definition: WebGUI.h:122
std::vector< std::pair< std::string, Param_t * > > ParamVec_t
Definition: WebGUI.h:35
xgi::Input Input_t
Definition: WebGUI.h:38
void setSmallAppIcon(CString_t &icon)
Definition: WebGUI.h:75
void addMonitorParam(CString_t &name, Param_t *param)
Definition: WebGUI.cc:145
void addItemChangedListener(CString_t &name, xdata::ActionListener *l)
Definition: WebGUI.cc:238
ParamVec_t standardParams_
Definition: WebGUI.h:114
xgi::Output Output_t
Definition: WebGUI.h:39
void addDebugParam(CString_t &name, Param_t *param)
Definition: WebGUI.cc:156
std::vector< std::pair< std::string, void * > > UpdateVec_t
Definition: WebGUI.h:37
xdata::InfoSpace * appInfoSpace_
Definition: WebGUI.h:109
Css css_
Definition: WebGUI.h:103
WebGUI(xdaq::Application *app, StateMachine *fsm)
Definition: WebGUI.cc:32
std::string sourceId_
Definition: WebGUI.h:106
Definition: Css.h:12
xdaq::Application * app_
Definition: WebGUI.h:101
xdata::InfoSpace * monInfoSpace_
Definition: WebGUI.h:110
ParamVec_t monitorParams_
Definition: WebGUI.h:115
xdata::InfoSpace * appInfoSpace()
Definition: WebGUI.h:71
tuple out
Definition: dbtoconf.py:99
xdata::InfoSpace * monInfoSpace()
Definition: WebGUI.h:72
virtual ~WebGUI()
Definition: WebGUI.cc:80
void htmlHeadline(Input_t *in, Output_t *out)
Definition: WebGUI.cc:375
std::vector< std::pair< std::string, Counter_t * > > CounterVec_t
Definition: WebGUI.h:36
Logger log_
Definition: WebGUI.h:104
void debugWebPage(Input_t *in, Output_t *out)
Definition: WebGUI.cc:110
#define Output(cl)
Definition: vmac.h:193
void addParamsToInfoSpace(const ParamVec_t &params, xdata::InfoSpace *infoSpace)
Definition: WebGUI.cc:272
void addStandardCounter(CString_t &name, Counter_t *counter)
Definition: WebGUI.cc:167
std::string urn_
Definition: WebGUI.h:107
void addMonitorCounter(CString_t &name, Counter_t *counter)
Definition: WebGUI.cc:178
void defaultWebPage(Input_t *in, Output_t *out)
Definition: WebGUI.cc:91
void setHyperDAQIcon(CString_t &icon)
Definition: WebGUI.h:77
std::string largeAppIcon_
Definition: WebGUI.h:124
bool isMonitorParam(CString_t &name)
Definition: WebGUI.cc:315
std::string smallCtmIcon_
Definition: WebGUI.h:127
CounterVec_t debugCounters_
Definition: WebGUI.h:119
std::string hyperDAQIcon_
Definition: WebGUI.h:128
ParamVec_t debugParams_
Definition: WebGUI.h:116
xdata::ActionListener * itemGroupListener_
Definition: WebGUI.h:112
void setSmallDbgIcon(CString_t &icon)
Definition: WebGUI.h:76
std::string smallDbgIcon_
Definition: WebGUI.h:126
void css(Input_t *in, Output_t *out)
Definition: WebGUI.cc:127