Belle II Software  release-05-02-19
Display.h
1 //-----------------------------------------------------------------------------
2 // $Id$
3 //-----------------------------------------------------------------------------
4 // Filename : Display.h
5 // Section : TRG CDC
6 // Owner : Yoshihito Iwasaki
7 // Email : yoshihito.iwasaki@kek.jp
8 //-----------------------------------------------------------------------------
9 // Description : A class to display CDC trigger information.
10 //-----------------------------------------------------------------------------
11 // $Log$
12 //-----------------------------------------------------------------------------
13 
14 #ifdef TRGCDC_DISPLAY
15 
16 #ifndef TRGCDCDisplay_FLAG_
17 #define TRGCDCDisplay_FLAG_
18 
19 #include <gtkmm.h>
20 
21 #ifdef TRGCDC_SHORT_NAMES
22 #define TCDisplay TRGCDCDisplay
23 #endif
24 
25 namespace Belle2 {
30  class TRGCDCDisplayDrawingArea;
31  class TRGCDCDisplayRphi;
32  class TRGCDCDisplayHough;
34 }
35 
36 namespace Belle2 {
42  class TRGCDCDisplay : public Gtk::Window {
44 
45  public:
46 
48  TRGCDCDisplay(const std::string& name,
49  int sizeWindow = 600,
50  int sizeMax = 600);
51 
53  virtual ~TRGCDCDisplay();
54 
55  public: // display control
56 
58  void run(void);
59 
61  virtual void clear(void);
62 
64  void beginningOfEvent(void);
65 
67  void endOfEvent(void);
68 
70  bool skip(void) const;
71 
73  bool skip(bool);
74 
76  bool wireName(void) const;
77 
79  void stop(void);
80 
81  public: // Status
82 
84  void stage(const std::string& stage);
85 
87  void information(const std::string& information);
88 
89  public: // Access to drawing area.
90 
92  virtual TRGCDCDisplayDrawingArea& area(void) = 0;
93 
95  void link(TRGCDCDisplayRphi&);
96 
98  TRGCDCDisplayRphi* rphi(void);
99 
100  private: // Actions
101 
103  virtual void on_next(void);
104 
106  virtual void on_endOfEvent(void);
107 
109  virtual void on_nextEvent(void);
110 
112  virtual void on_nonStop(void);
113 
115  virtual void on_positionReset(void);
116 
118  virtual void on_wireName(void);
119 
120  private: // Objects to display and control
121 
123  std::string _stage;
124 
126  std::string _info;
127 
129  bool _skip;
130 
132  static bool _endOfEvent;
133 
135  static bool _endOfEventFlag;
136 
138  static bool _skipEvent;
139 
141  static bool _nonStop;
142 
143  private: // GTK stuff
144 
146  bool _wireName;
147 
149  bool _oldCDC;
150 
152  Gtk::VBox _box0;
153 
155  Gtk::HBox _menuButtons;
156 
158  Gtk::Button _buttonNext;
159 
161  Gtk::Button _buttonEndOfEvent;
162 
164  Gtk::Button _buttonNextEvent;
165 
167  Gtk::Button _buttonNonStop;
168 
170  Gtk::Label _label;
171 
173  Gtk::HBox _bottom;
174 
176  Gtk::Button _buttonPositionReset;
177 
179  Gtk::CheckButton _buttonWireName;
180 
182  friend class TRGCDCDisplayRphi;
183 
185  friend class TRGCDCDisplayHough;
186 
188  TRGCDCDisplayRphi* _rphi;
189  };
190 
191 //-----------------------------------------------------------------------------
192 
193  inline
194  void
195  TRGCDCDisplay::stage(const std::string& a)
196  {
197  _stage = a;
198  Glib::ustring s = "Stage : " + _stage + "\nInformation : " + _info;
199  _label.set_label(s);
200  }
201 
202  inline
203  void
204  TRGCDCDisplay::information(const std::string& a)
205  {
206 // _info += a;
207  _info = a;
208  Glib::ustring s = "Stage : " + _stage + "\nInformation : " + _info;
209  _label.set_label(s);
210  }
211 
212  inline
213  bool
214  TRGCDCDisplay::skip(void) const
215  {
216  return _skip;
217  }
218 
219  inline
220  bool
221  TRGCDCDisplay::skip(bool a)
222  {
223  return _skip = a;
224  }
225 
226  inline
227  bool
228  TRGCDCDisplay::wireName(void) const
229  {
230  return _wireName;
231  }
232 
233  inline
234  void
235  TRGCDCDisplay::beginningOfEvent(void)
236  {
237  _skipEvent = false;
238  _endOfEvent = false;
239  }
240 
241  inline
242  void
243  TRGCDCDisplay::endOfEvent(void)
244  {
245  _endOfEvent = true;
246  }
247 
248  inline
249  void
250  TRGCDCDisplay::link(TRGCDCDisplayRphi& a)
251  {
252  _rphi = & a;
253  }
254 
255  inline
256  TRGCDCDisplayRphi*
257  TRGCDCDisplay::rphi(void)
258  {
259  return _rphi;
260  }
261 
263 } // namespace Belle2
264 
265 #endif // TRGCDCDisplay_FLAG_
266 #endif
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19