Belle II Software development
Display.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9//-----------------------------------------------------------------------------
10// Description : A class to display CDC trigger information.
11//-----------------------------------------------------------------------------
12
13#ifdef TRGCDC_DISPLAY
14
15#ifndef TRGCDCDisplay_FLAG_
16#define TRGCDCDisplay_FLAG_
17
18#include <gtkmm.h>
19
20#ifdef TRGCDC_SHORT_NAMES
21#define TCDisplay TRGCDCDisplay
22#endif
23
24namespace Belle2 {
29 class TRGCDCDisplayDrawingArea;
30 class TRGCDCDisplayRphi;
31 class TRGCDCDisplayHough;
33}
34
35namespace Belle2 {
42 class TRGCDCDisplay : public Gtk::Window {
43
44 public:
45
47 TRGCDCDisplay(const std::string& name,
48 int sizeWindow = 600,
49 int sizeMax = 600);
50
52 virtual ~TRGCDCDisplay();
53
54 public: // display control
55
57 void run(void);
58
60 virtual void clear(void);
61
63 void beginningOfEvent(void);
64
66 void endOfEvent(void);
67
69 bool skip(void) const;
70
72 bool skip(bool);
73
75 bool wireName(void) const;
76
78 void stop(void);
79
80 public: // Status
81
83 void stage(const std::string& stage);
84
86 void information(const std::string& information);
87
88 public: // Access to drawing area.
89
91 virtual TRGCDCDisplayDrawingArea& area(void) = 0;
92
94 void link(TRGCDCDisplayRphi&);
95
97 TRGCDCDisplayRphi* rphi(void);
98
99 private: // Actions
100
102 virtual void on_next(void);
103
105 virtual void on_endOfEvent(void);
106
108 virtual void on_nextEvent(void);
109
111 virtual void on_nonStop(void);
112
114 virtual void on_positionReset(void);
115
117 virtual void on_wireName(void);
118
119 private: // Objects to display and control
120
122 std::string _stage;
123
125 std::string _info;
126
128 bool _skip;
129
131 static bool _endOfEvent;
132
134 static bool _endOfEventFlag;
135
137 static bool _skipEvent;
138
140 static bool _nonStop;
141
142 private: // GTK stuff
143
145 bool _wireName;
146
148 bool _oldCDC;
149
151 Gtk::VBox _box0;
152
154 Gtk::HBox _menuButtons;
155
157 Gtk::Button _buttonNext;
158
160 Gtk::Button _buttonEndOfEvent;
161
163 Gtk::Button _buttonNextEvent;
164
166 Gtk::Button _buttonNonStop;
167
169 Gtk::Label _label;
170
172 Gtk::HBox _bottom;
173
175 Gtk::Button _buttonPositionReset;
176
178 Gtk::CheckButton _buttonWireName;
179
181 friend class TRGCDCDisplayRphi;
182
184 friend class TRGCDCDisplayHough;
185
187 TRGCDCDisplayRphi* _rphi;
188 };
189
190//-----------------------------------------------------------------------------
191
192 inline
193 void
194 TRGCDCDisplay::stage(const std::string& a)
195 {
196 _stage = a;
197 Glib::ustring s = "Stage : " + _stage + "\nInformation : " + _info;
198 _label.set_label(s);
199 }
200
201 inline
202 void
203 TRGCDCDisplay::information(const std::string& a)
204 {
205// _info += a;
206 _info = a;
207 Glib::ustring s = "Stage : " + _stage + "\nInformation : " + _info;
208 _label.set_label(s);
209 }
210
211 inline
212 bool
213 TRGCDCDisplay::skip(void) const
214 {
215 return _skip;
216 }
217
218 inline
219 bool
220 TRGCDCDisplay::skip(bool a)
221 {
222 return _skip = a;
223 }
224
225 inline
226 bool
227 TRGCDCDisplay::wireName(void) const
228 {
229 return _wireName;
230 }
231
232 inline
233 void
234 TRGCDCDisplay::beginningOfEvent(void)
235 {
236 _skipEvent = false;
237 _endOfEvent = false;
238 }
239
240 inline
241 void
242 TRGCDCDisplay::endOfEvent(void)
243 {
244 _endOfEvent = true;
245 }
246
247 inline
248 void
249 TRGCDCDisplay::link(TRGCDCDisplayRphi& a)
250 {
251 _rphi = & a;
252 }
253
254 inline
255 TRGCDCDisplayRphi*
256 TRGCDCDisplay::rphi(void)
257 {
258 return _rphi;
259 }
260
262} // namespace Belle2
263
264#endif // TRGCDCDisplay_FLAG_
265#endif
Abstract base class for different kinds of events.