Belle II Software  release-05-01-25
DisplayHough.cc
1 //-----------------------------------------------------------------------------
2 // $Id$
3 //-----------------------------------------------------------------------------
4 // Filename : DisplayHough.cc
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 #include <iostream>
17 #include "trg/cdc/DisplayHough.h"
18 
19 using namespace std;
20 
21 namespace Belle2 {
27  TRGCDCDisplayHough::TRGCDCDisplayHough(const std::string& name,
28  int size)
29  : TRGCDCDisplay(name, size, 10),
30  _w(* this, size),
31  _adjustment(1., 1., 50.0, 0.1),
32  _scaler(_adjustment)
33  {
34 
35  _w.set_size_request(size, size);
36 
37  _scaler.set_update_policy(Gtk::UPDATE_CONTINUOUS);
38  _scaler.set_digits(3);
39  _scaler.set_value_pos(Gtk::POS_LEFT);
40  _scaler.set_draw_value();
41  _scaler.set_size_request(200, 30);
42  _scaler
43  .signal_value_changed()
44  .connect(sigc::mem_fun(* this,
45  & TRGCDCDisplayHough::on_scale_value_changed));
46 
47  _bottom.pack_start(_scaler, Gtk::PACK_SHRINK, 5);
48  _bottom.pack_start(_buttonPositionReset, Gtk::PACK_EXPAND_WIDGET, 2);
49  _bottom.pack_start(_buttonWireName, Gtk::PACK_SHRINK, 2);
50 
51  _box0.pack_start(_menuButtons, Gtk::PACK_SHRINK, 5);
52  _box0.pack_start(_label, Gtk::PACK_EXPAND_WIDGET, 5);
53  _box0.pack_start(_w, Gtk::PACK_EXPAND_WIDGET, 5);
54  _box0.pack_start(_bottom, Gtk::PACK_SHRINK, 5);
55 
56  set_border_width(5);
57  add(_box0);
58  show_all();
59  }
60 
61  TRGCDCDisplayHough::~TRGCDCDisplayHough()
62  {
63  }
64 
65  void
66  TRGCDCDisplayHough::on_scale_value_changed(void)
67  {
68  const double val = scale();
69  _w.scale(val);
70  cout << "TRGCDCDisplayHough ... scale value=" << val << endl;
71  _w.on_expose_event((GdkEventExpose*) NULL);
72  }
73 
74  void
75  TRGCDCDisplayHough::on_positionReset(void)
76  {
77  area().resetPosition();
78  const double val = _w.scale();
79  scale(val);
80  _w.on_expose_event((GdkEventExpose*) NULL);
81  }
82 
84 } // namespace Belle2
85 
86 #endif
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19