source: trunk/MagicSoft/Mars/mmain/MEvtDisp.cc@ 2273

Last change on this file since 2273 was 1668, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 3.3 KB
Line 
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): Thomas Bretz 12/2000 <mailto:tbretz@uni-sw.gwdg.de>
19! Author(s): Harald Kornmayer 1/2001
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 "MGList.h"
31#include "MGFadcDisp.h"
32
33ClassImp(MEvtDisp)
34
35enum {
36 kButDispEvt = 0x100,
37 kButDispPedestal = 0x101,
38 kButDispCalibration = 0x102
39};
40
41MEvtDisp::MEvtDisp(/*const TGWindow *main,*/ const TGWindow *p,
42 const UInt_t w, const UInt_t h)
43: MBrowser(/*main,*/ p, w, h)
44{
45 TGTextButton *fadcevt = new TGTextButton(fTop1, "FADC Disp for Events", kButDispEvt);
46 TGTextButton *fadcped = new TGTextButton(fTop1, "FADC Disp for PedEvts", kButDispPedestal);
47 TGTextButton *fadccal = new TGTextButton(fTop1, "FADC Disp for CalEvts", kButDispCalibration);
48
49 fadcevt->Associate(this);
50 fadcped->Associate(this);
51 fadccal->Associate(this);
52
53 fList->Add(fadcevt);
54 fList->Add(fadcped);
55 fList->Add(fadccal);
56
57 TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsLeft, 10, 10, 5, 5);
58 fList->Add(laybut);
59
60 fTop1->AddFrame(fadcevt, laybut);
61 fTop1->AddFrame(fadcped, laybut);
62 fTop1->AddFrame(fadccal, laybut);
63
64 MapSubwindows();
65
66 Layout();
67
68 SetWindowName("EventDispMain");
69 SetIconName("EventDispMain");
70
71 MapWindow();
72}
73
74// ======================================================================
75
76Bool_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 kButDispEvt:
86 case kButDispPedestal:
87 case kButDispCalibration:
88 if (!InputFileSelected())
89 {
90 DisplError("No Input (root) File selected!");
91 return kTRUE;
92 }
93
94 switch (parm1)
95 {
96 case kButDispEvt:
97 new MGFadcDisp(fInputFile, "Events",
98 fClient->GetRoot(), /*this,*/ 600, 500);
99 return kTRUE;
100
101 case kButDispPedestal:
102 new MGFadcDisp(fInputFile , "PedEvts",
103 fClient->GetRoot(), /*this,*/ 600, 500);
104 return kTRUE;
105
106 case kButDispCalibration:
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}
Note: See TracBrowser for help on using the repository browser.