source: trunk/MagicSoft/Mars/mmain/MDataCheck.cc@ 724

Last change on this file since 724 was 714, checked in by tbretz, 24 years ago
*** empty log message ***
File size: 2.5 KB
Line 
1#include "MDataCheck.h"
2
3#include <TGButton.h> // TGTextButton
4
5ClassImp(MDataCheck)
6
7enum {
8 M_BUTTON_PEDADC,
9 M_BUTTON_CRADC,
10 M_BUTTON_PEDTDC,
11 M_BUTTON_CRTDC
12};
13
14MDataCheck::MDataCheck(const TGWindow *main, const TGWindow *p,
15 const UInt_t w, const UInt_t h)
16: MBrowser(main, p, w, h)
17{
18
19 fButPedADC = new TGTextButton(fTop2, "ADC Spectra of Pedestals", M_BUTTON_PEDADC );
20 fButPedADC->Associate(this) ;
21 fTop2->AddFrame (fButPedADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
22
23 fButCrADC = new TGTextButton(fTop2, "ADC Specta of Cosmics", M_BUTTON_CRADC );
24 fButCrADC->Associate(this) ;
25 fTop2->AddFrame (fButCrADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
26
27 fButPedTDC = new TGTextButton(fTop3, "TDC Spectra of Pedestals", M_BUTTON_PEDTDC );
28 fButPedTDC->Associate(this) ;
29 fTop3->AddFrame (fButPedTDC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
30
31 fButCrTDC = new TGTextButton(fTop3, "TDC Specta of Cosmics", M_BUTTON_CRTDC );
32 fButCrTDC->Associate(this) ;
33 fTop3->AddFrame (fButCrTDC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
34
35 MapSubwindows();
36
37 Layout();
38
39 SetWindowName("DataCheck Window");
40 SetIconName("DataCheck");
41
42 MapWindow();
43}
44
45MDataCheck::~MDataCheck()
46{
47 delete fButPedADC;
48 delete fButCrADC;
49 delete fButPedTDC;
50 delete fButCrTDC;
51}
52
53// ======================================================================
54
55Bool_t MDataCheck::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
56{
57 // Process events generated by the buttons in the frame.
58
59 if (GET_MSG(msg)!=kC_COMMAND || GET_SUBMSG(msg)!=kCM_BUTTON)
60 return MBrowser::ProcessMessage(msg, parm1, parm2);
61
62 switch (parm1)
63 {
64 case M_BUTTON_PEDADC:
65 case M_BUTTON_CRADC:
66 case M_BUTTON_PEDTDC:
67 case M_BUTTON_CRTDC:
68 if (!InputFileSelected())
69 {
70 DisplError("No Input (root) File selected!");
71 return kTRUE;
72 }
73
74 switch (parm1)
75 {
76 case M_BUTTON_PEDADC:
77 fViewAdc.AdcSpectra(fInputFile, "PedEvents" ) ;
78 return kTRUE;
79
80 case M_BUTTON_CRADC:
81 fViewAdc.AdcSpectra(fInputFile, "Events" ) ;
82 return kTRUE;
83
84 case M_BUTTON_PEDTDC:
85 // fOctober.PedTdcSpectra(fInputFile) ;
86 return kTRUE;
87
88 case M_BUTTON_CRTDC:
89 return kTRUE;
90 }
91 return kTRUE;
92 }
93
94 return MBrowser::ProcessMessage(msg, parm1, parm2);
95}
Note: See TracBrowser for help on using the repository browser.