1 | /* ======================================================================== *\
|
---|
2 | !
|
---|
3 | ! *
|
---|
4 | ! * This file is part of MARS, the MAGIC Analysis and Reconstruction
|
---|
5 | ! * Software. It is distributed to you in the hope that it can be a useful
|
---|
6 | ! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
|
---|
7 | ! * It is distributed WITHOUT ANY WARRANTY.
|
---|
8 | ! *
|
---|
9 | ! * Permission to use, copy, modify and distribute this software and its
|
---|
10 | ! * documentation for any purpose is hereby granted without fee,
|
---|
11 | ! * provided that the above copyright notice appear in all copies and
|
---|
12 | ! * that both that copyright notice and this permission notice appear
|
---|
13 | ! * in supporting documentation. It is provided "as is" without express
|
---|
14 | ! * or implied warranty.
|
---|
15 | ! *
|
---|
16 | !
|
---|
17 | !
|
---|
18 | ! Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
|
---|
19 | ! Author(s): Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)
|
---|
20 | !
|
---|
21 | ! Copyright: MAGIC Software Development, 2000-2001
|
---|
22 | !
|
---|
23 | !
|
---|
24 | \* ======================================================================== */
|
---|
25 |
|
---|
26 | #include "MEvtDisp.h"
|
---|
27 |
|
---|
28 | #include <TGButton.h> // TGTextButton
|
---|
29 |
|
---|
30 | #include "MGFadcDisp.h"
|
---|
31 |
|
---|
32 | ClassImp(MEvtDisp)
|
---|
33 |
|
---|
34 | enum {
|
---|
35 | M_BUT_DISP1_EVT,
|
---|
36 | M_BUT_DISP1_PED,
|
---|
37 | M_BUT_DISP1_CAL,
|
---|
38 | };
|
---|
39 |
|
---|
40 | MEvtDisp::MEvtDisp(const TGWindow *main, const TGWindow *p,
|
---|
41 | const UInt_t w, const UInt_t h)
|
---|
42 | : MBrowser(main, p, w, h)
|
---|
43 | {
|
---|
44 |
|
---|
45 | fButFadcDispEvts = new TGTextButton(fTop1, "FADC Disp for Events", M_BUT_DISP1_EVT );
|
---|
46 | fButFadcDispEvts->Associate(this) ;
|
---|
47 | fTop1->AddFrame (fButFadcDispEvts, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
|
---|
48 |
|
---|
49 | fButFadcDispPed = new TGTextButton(fTop1, "FADC Disp for PedEvts", M_BUT_DISP1_PED );
|
---|
50 | fButFadcDispPed->Associate(this) ;
|
---|
51 | fTop1->AddFrame (fButFadcDispPed, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
|
---|
52 |
|
---|
53 | fButFadcDispCal = new TGTextButton(fTop1, "FADC Disp for CalEvts", M_BUT_DISP1_CAL );
|
---|
54 | fButFadcDispCal->Associate(this) ;
|
---|
55 | fTop1->AddFrame (fButFadcDispCal, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
|
---|
56 |
|
---|
57 | MapSubwindows();
|
---|
58 |
|
---|
59 | Layout();
|
---|
60 |
|
---|
61 | SetWindowName("EventDispMain");
|
---|
62 | SetIconName("EventDispMain");
|
---|
63 |
|
---|
64 | MapWindow();
|
---|
65 | }
|
---|
66 |
|
---|
67 | MEvtDisp::~MEvtDisp()
|
---|
68 | {
|
---|
69 | delete fButFadcDispCal;
|
---|
70 | delete fButFadcDispPed;
|
---|
71 | delete fButFadcDispEvts;
|
---|
72 | }
|
---|
73 |
|
---|
74 | // ======================================================================
|
---|
75 |
|
---|
76 | Bool_t MEvtDisp::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
|
---|
77 | {
|
---|
78 | // Process events generated by the buttons in the frame.
|
---|
79 |
|
---|
80 | if (GET_MSG(msg) != kC_COMMAND || GET_SUBMSG(msg) != kCM_BUTTON)
|
---|
81 | return MBrowser::ProcessMessage(msg, parm1, parm2);
|
---|
82 |
|
---|
83 | switch (parm1)
|
---|
84 | {
|
---|
85 | case M_BUT_DISP1_EVT:
|
---|
86 | case M_BUT_DISP1_PED:
|
---|
87 | case M_BUT_DISP1_CAL:
|
---|
88 | if (!InputFileSelected())
|
---|
89 | {
|
---|
90 | DisplError("No Input (root) File selected!");
|
---|
91 | return kTRUE;
|
---|
92 | }
|
---|
93 |
|
---|
94 | switch (parm1)
|
---|
95 | {
|
---|
96 | case M_BUT_DISP1_EVT:
|
---|
97 | new MGFadcDisp(fInputFile, "Events",
|
---|
98 | fClient->GetRoot(), this, 600, 500);
|
---|
99 | return kTRUE;
|
---|
100 |
|
---|
101 | case M_BUT_DISP1_PED:
|
---|
102 | new MGFadcDisp( fInputFile , "PedEvts",
|
---|
103 | fClient->GetRoot(), this, 600, 500 ) ;
|
---|
104 | return kTRUE;
|
---|
105 |
|
---|
106 | case M_BUT_DISP1_CAL:
|
---|
107 | new MGFadcDisp( fInputFile , "CalEvts",
|
---|
108 | fClient->GetRoot(), this, 600, 500 ) ;
|
---|
109 | return kTRUE;
|
---|
110 | }
|
---|
111 | return kTRUE;
|
---|
112 | }
|
---|
113 |
|
---|
114 | return MBrowser::ProcessMessage(msg, parm1, parm2);
|
---|
115 | }
|
---|