Changeset 959 for trunk/MagicSoft/Mars/mmain
- Timestamp:
- 10/02/01 14:46:56 (24 years ago)
- Location:
- trunk/MagicSoft/Mars/mmain
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mmain/MDataCheck.cc
r947 r959 28 28 #include <TGButton.h> // TGTextButton 29 29 30 // --- 31 32 #include "MParList.h" 33 #include "MTaskList.h" 34 #include "MEvtLoop.h" 35 #include "MReadTree.h" 36 #include "MFillH.h" 37 #include "MGDisplayAdc.h" 38 39 // --- 40 30 41 ClassImp(MDataCheck) 31 42 … … 37 48 }; 38 49 50 // -------------------------------------------------------------------------- 51 // 52 // Create the 'Data Check' GUI Controls (Window) on the screen. To use it 53 // from within the interpreter you can call a Standard Version with 54 // 'new MDataCheck()' 55 // 39 56 MDataCheck::MDataCheck(const TGWindow *main, const TGWindow *p, 40 57 const UInt_t w, const UInt_t h) 41 58 : MBrowser(main, p, w, h) 42 59 { … … 75 92 } 76 93 77 // ====================================================================== 94 // -------------------------------------------------------------------------- 95 // 96 // Create the 'View Adc' GUI Controls (Window) on the screen. 97 // Therefor we have to process all data in a file and fill the corresponding 98 // histograms. 99 // 100 void MDataCheck::ViewAdcSpectra(Char_t *inputfile, Char_t *treeName) 101 { 102 // 103 // create a (empty) list of parameters which can be used by the tasks 104 // and an (empty) list of tasks which should be executed 105 // connect them in the required way. 106 // 78 107 108 // 109 // create the data containers for the raw data 110 // 111 MParList plist; 112 113 // 114 // set up the tasks for this job 115 // 116 MTaskList tasks; 117 plist.AddToList(&tasks); 118 119 MReadTree readin(treeName, inputfile); 120 tasks.AddToList(&readin); 121 122 MFillH fillspect("MRawEvtData", "MHFadcCam"); 123 tasks.AddToList(&fillspect); 124 125 // 126 // set up the loop for the processing 127 // 128 MEvtLoop magic; 129 magic.SetParList(&plist); 130 131 // 132 // start the loop running 133 // 134 if (!magic.Eventloop()) 135 return; 136 137 new MGDisplayAdc((MHFadcCam*)plist.FindObject("MHFadcCam")); 138 } 139 140 // -------------------------------------------------------------------------- 141 // 142 // Process the GUI control events (here: mainly button clicks) 143 // 79 144 Bool_t MDataCheck::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2) 80 145 { … … 99 164 { 100 165 case M_BUTTON_PEDADC: 101 fViewAdc.AdcSpectra(fInputFile, "PedEvents");166 ViewAdcSpectra(fInputFile, "PedEvents"); 102 167 return kTRUE; 103 168 104 169 case M_BUTTON_CRADC: 105 fViewAdc.AdcSpectra(fInputFile, "Events");170 ViewAdcSpectra(fInputFile, "Events"); 106 171 return kTRUE; 107 172 -
trunk/MagicSoft/Mars/mmain/MDataCheck.h
r947 r959 10 10 #endif 11 11 12 #ifndef MVIEWADCSPECTRA_H13 #include "MViewAdcSpectra.h"14 #endif15 16 12 class MDataCheck : public MBrowser 17 13 { 18 14 private: 19 MViewAdcSpectra fViewAdc;15 void ViewAdcSpectra(Char_t *inputfile, Char_t *treeName); 20 16 21 17 public: -
trunk/MagicSoft/Mars/mmain/MMars.cc
r949 r959 34 34 #include <TG3DLine.h> // TGHorizontal3DLine 35 35 // use TGSplitter.h for root<3.00 36 37 36 #include "MEvtDisp.h" 38 37 #include "MAnalysis.h" 39 38 #include "MDataCheck.h" 40 39 #include "MMonteCarlo.h" 41 42 #include "MGPrototyp.h" 40 #include "MCameraDisplay.h" 43 41 44 42 ClassImp(MMars) 45 43 46 44 enum { 47 M_FILE_EXIT, 48 M_FILE_ABOUT, 49 50 M_PICTURE_MAGIC, 51 M_PICTURE_MARS, 52 53 M_BUTTON_EVTDISP, 54 M_BUTTON_DATACHECK, 55 M_BUTTON_ANALYSE, 56 M_BUTTON_MONTECARLO 45 M_FILE_EXIT, 46 M_FILE_ABOUT, 47 48 M_PICTURE_MAGIC, 49 M_PICTURE_MARS, 50 51 M_BUTTON_EVTDISP, 52 M_BUTTON_DATACHECK, 53 M_BUTTON_ANALYSE, 54 M_BUTTON_MONTECARLO, 55 M_BUTTON_CAMDISPLAY 57 56 }; 58 57 … … 97 96 mars->Associate(this); 98 97 99 TGLayoutHints *lay1 = new TGLayoutHints(kLHintsLeft, 10., 10., 20., 10.);100 TGLayoutHints *lay2 = new TGLayoutHints(kLHints Left, 10., 10., 10., 10.);98 TGLayoutHints *lay1 = new TGLayoutHints(kLHintsLeft, 10., 10., 20., 10.); 99 TGLayoutHints *lay2 = new TGLayoutHints(kLHintsRight, 10., 10., 10., 10.); 101 100 102 101 fList->Add(lay1); … … 105 104 top->AddFrame(magic, lay1); 106 105 top->AddFrame(mars, lay2); 106 } 107 108 void MMars::CreateTextButton(TGVerticalFrame *tab, const char *text, 109 const UInt_t id, TGLayoutHints *hints) const 110 { 111 // 112 // Create the button 113 // 114 TGTextButton *button = new TGTextButton(tab, text, id); 115 116 // 117 // Add button for 'auto-delete' 118 // 119 fList->Add(button); 120 121 // 122 // Send button events (meesages) to this object (s. ProcessMessage) 123 // 124 button->Associate(this); 125 126 // 127 // Add button with corresponding layout to containing frame 128 // 129 tab->AddFrame(button, hints); 107 130 } 108 131 … … 136 159 tf->AddFrame(tab2, laytabx); 137 160 138 TGTextButton *evtdisp = new TGTextButton(tab2, "EventDisplay", M_BUTTON_EVTDISP); 139 TGTextButton *datacheck = new TGTextButton(tab2, "Data Check", M_BUTTON_DATACHECK); 140 TGTextButton *analysis = new TGTextButton(tab2, "Analysis", M_BUTTON_ANALYSE); 141 TGTextButton *montecarlo = new TGTextButton(tab2, "MonteCarlo", M_BUTTON_MONTECARLO); 142 143 fList->Add(evtdisp); 144 fList->Add(datacheck); 145 fList->Add(analysis); 146 fList->Add(montecarlo); 147 148 evtdisp ->Associate(this); 149 datacheck ->Associate(this); 150 analysis ->Associate(this); 151 montecarlo->Associate(this); 152 153 TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsCenterX , 10, 10, 10, 10); 161 TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsCenterX, 10, 10, 10, 10); 154 162 fList->Add(laybut); 155 163 156 tab2->AddFrame(evtdisp, laybut); 157 tab2->AddFrame(datacheck, laybut); 158 tab2->AddFrame(analysis, laybut); 159 tab2->AddFrame(montecarlo, laybut); 164 CreateTextButton(tab2, "Event Display", M_BUTTON_EVTDISP, laybut); 165 CreateTextButton(tab2, "Data Check", M_BUTTON_DATACHECK, laybut); 166 CreateTextButton(tab2, "Analysis", M_BUTTON_ANALYSE, laybut); 167 CreateTextButton(tab2, "Monte Carlo", M_BUTTON_MONTECARLO, laybut); 168 CreateTextButton(tab2, "Camera Display", M_BUTTON_CAMDISPLAY, laybut); 160 169 } 161 170 162 171 MMars::MMars(/*const TGWindow *p,*/ UInt_t w, UInt_t h) 163 : TGMainFrame(gClient->GetRoot(), w, h) 172 : TGMainFrame(gClient->GetRoot(), w, h) 173 //: MBrowser (gClient->GetRoot(), gClient->GetRoot(), w, h) 164 174 { 165 175 // … … 196 206 AddFrame(low, layout); 197 207 208 // CreateTopFrame(fTop2); 209 // CreateBottomFrame(fTop3); 210 198 211 // 199 212 // Map the window, set up the layout, etc. 200 213 // 201 SetWMSizeHints(400, 380, 400, 380, 10, 10); // set the smallest and biggest size of the Main frame214 SetWMSizeHints(400, 410, 400, 410, 10, 10); // set the smallest and biggest size of the Main frame 202 215 203 216 MapSubwindows(); … … 271 284 return kTRUE; 272 285 286 case M_BUTTON_CAMDISPLAY: 287 new MCameraDisplay(this); 288 return kTRUE; 289 273 290 case M_PICTURE_MAGIC: 274 DisplWarning("Please open a Netscape to the MAGIC homepage"); 291 DisplWarning("Please open a Netscape to the MAGIC homepage\n" 292 "http://hegra1.mppmu.mpg.de/MAGICWeb/"); 275 293 return kTRUE; 276 294 277 295 case M_PICTURE_MARS: 278 DisplWarning("Please open a Netscape to the MARS homepage ");279 return kTRUE;280 296 DisplWarning("Please open a Netscape to the MARS homepage\n" 297 "http://magic.uni-sw.gwdg.de/mars/"); 298 return kTRUE; 281 299 } 282 300 -
trunk/MagicSoft/Mars/mmain/MMars.h
r946 r959 10 10 #endif 11 11 12 /* 13 #ifndef MBROWSER_H 14 #include <MBrowser.h> 15 #endif 16 */ 17 12 18 class TList; 19 class TGVerticalFrame; 20 class TGLayoutHints; 13 21 14 22 class MMars : public TGMainFrame … … 20 28 const TGPicture *fPic1; 21 29 const TGPicture *fPic2; 30 31 void CreateTextButton(TGVerticalFrame *tab, const char *text, 32 const UInt_t id, TGLayoutHints *hints) const; 22 33 23 34 void CreateMenuBar(); -
trunk/MagicSoft/Mars/mmain/MainLinkDef.h
r949 r959 12 12 #pragma link C++ class MDataCheck; 13 13 #pragma link C++ class MMonteCarlo; 14 #pragma link C++ class MCameraDisplay; 14 15 15 16 #endif -
trunk/MagicSoft/Mars/mmain/Makefile
r954 r959 34 34 MAnalysis.cc \ 35 35 MMonteCarlo.cc \ 36 MCameraDisplay.cc \ 36 37 MBrowser.cc 37 38
Note:
See TracChangeset
for help on using the changeset viewer.