Changeset 452 for trunk/MagicSoft
- Timestamp:
- 11/16/00 10:57:58 (24 years ago)
- Location:
- trunk/MagicSoft/MarsOctober
- Files:
-
- 6 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/MarsOctober/mars.cc
r448 r452 39 39 TApplication theApp("App", &argc, argv); 40 40 41 MGOctMain mainWin(gClient->GetRoot(), 500, 600);41 MGOctMain mainWin(gClient->GetRoot(), 1, 1); 42 42 43 43 theApp.Run(); -
trunk/MagicSoft/MarsOctober/mbase/BaseLinkDef.h
r447 r452 21 21 #pragma link C++ class MInputStreamID; 22 22 23 #pragma link C++ class MEvtLoop; 24 23 25 #endif -
trunk/MagicSoft/MarsOctober/mocttest/BaseLinkDef.h
r450 r452 12 12 #pragma link C++ class MTdcSpect ; 13 13 #pragma link C++ class MShowSpect ; 14 #pragma link C++ class MCalcPed1 ; 14 15 15 16 #endif -
trunk/MagicSoft/MarsOctober/mocttest/MGDisplayAdc.cc
r447 r452 1 #include "MGDisplayAdc.h" 1 2 #include "MGDisplayAdc.h" 2 3 3 4 MGDisplayAdc::MGDisplayAdc ( MHistosAdc *Histos, 4 5 6 7 5 const TGWindow *p, const TGWindow *main, 6 UInt_t w, UInt_t h, 7 UInt_t options) 8 : TGTransientFrame(p, main, w, h, options ) 8 9 { 9 10 // default constructor 10 11 // 11 12 fHists = Histos ; 12 13 13 14 // the top frame for the list and some buttons and the Canvas 14 15 15 16 fFrameTop = new TGHorizontalFrame (this, 60,20, kFitWidth ) ; 16 17 18 17 19 // left part of top frame 18 20 fFT1 = new TGVerticalFrame (fFrameTop, 80,300, kFitWidth ) ; 19 21 20 22 fHistoList = new TGListBox ( fFT1, M_LIST_HISTO ) ; 21 23 fHistoList->Associate( this ) ; 22 fFT1->AddFrame ( fHistoList, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 10, 10 ) ) ; 24 fFT1->AddFrame ( fHistoList, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 10, 10 ) ) ; 25 23 26 fHistoList->Resize(80, 300 ) ; 24 27 25 28 fFrameTop->AddFrame (fFT1, new TGLayoutHints ( kLHintsTop , 10, 10, 10, 10 ) ) ; 26 27 29 28 30 // middle part of top frame 29 31 // 32 30 33 fFT2 = new TGVerticalFrame (fFrameTop, 80,20, kFitWidth ) ; 31 34 32 35 fButtonPrev = new TGTextButton ( fFT2, "Prev Histo", M_BUTTON_PREV ) ; 33 36 fButtonPrev->Associate (this) ; 34 fFT2->AddFrame ( fButtonPrev, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 50, 10 ) ) ; 35 36 fButtonNext = new TGTextButton ( fFT2, "Next Histo", M_BUTTON_NEXT ) ; 37 fButtonNext->Associate (this) ; 38 fFT2->AddFrame ( fButtonNext, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 10, 5 ) ) ; 39 40 fFrameTop->AddFrame (fFT2, new TGLayoutHints ( kLHintsTop , 10, 10, 10, 10 ) ) ; 41 37 fFT2->AddFrame ( fButtonPrev, new TGLayoutHints (kLHintsLeft | kLHintsTop,10, 10, 0, 10 ) ) ; 38 39 40 fVslider1 = new TGVSlider (fFT2, 250, kSlider1 | kScaleBoth, VSId1); 41 42 fVslider1->Associate(this); 43 fVslider1->SetRange(0, 576); 44 fFT2->AddFrame(fVslider1); 45 46 fButtonNext = new TGTextButton ( fFT2, "Next Histo", M_BUTTON_NEXT ) ; 47 fButtonNext->Associate (this) ; 48 fFT2->AddFrame ( fButtonNext, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 10, 5 ) ) ; 49 50 fFrameTop->AddFrame (fFT2, new TGLayoutHints ( kLHintsTop , 10, 10, 10, 10 ) ) ; 51 52 42 53 // right part of top frame 43 54 // 44 55 fFT3 = new TGVerticalFrame (fFrameTop, 60, 60, kFitWidth ) ; 45 56 46 57 fECanv = new TRootEmbeddedCanvas("fECanv", fFT3, 400, 400 ) ; 47 fFT3->AddFrame( fECanv, new TGLayoutHints ( kLHintsCenterX | kLHintsCenterY | kLHintsExpandX | kLHintsExpandY , 10, 10, 10, 10 ) ) ; 48 58 fFT3->AddFrame( fECanv, new TGLayoutHints ( kLHintsCenterX | kLHintsCenterY | kLHintsExpandX | kLHintsExpandY , 10, 10, 10, 10 ) ) ; 59 49 60 fCanv = fECanv->GetCanvas() ; 50 61 51 62 fFrameTop->AddFrame (fFT3, new TGLayoutHints ( kLHintsCenterX | kLHintsCenterY | kLHintsExpandX | kLHintsExpandY , 10, 10, 10, 10 ) ) ; 52 63 53 64 AddFrame ( fFrameTop, new TGLayoutHints ( kLHintsTop | kLHintsExpandX , 10, 10, 10, 10 ) ) ; 54 65 55 66 // 56 67 // the low frame for the control buttons 57 68 // 58 69 fFrameLow = new TGHorizontalFrame (this, 60,20, kFixedWidth ) ; 59 70 60 71 fButtonSave = new TGTextButton ( fFrameLow, "Save", M_BUTTON_SAVE ) ; 61 72 fButtonSave->Associate (this) ; 62 fFrameLow->AddFrame ( fButtonSave, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 5, 5 ) ) ; 63 73 fFrameLow->AddFrame ( fButtonSave, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 5, 5 ) ) ; 74 64 75 fButtonPrint = new TGTextButton ( fFrameLow, "Print", M_BUTTON_PRINT ) ; 65 76 fButtonPrint->Associate (this) ; 66 77 fFrameLow->AddFrame ( fButtonPrint, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 5, 5 ) ) ; 67 78 68 79 fButtonPrintAll = new TGTextButton ( fFrameLow, "PrintAll", M_BUTTON_PRINTALL ) ; 69 80 fButtonPrintAll->Associate (this) ; 70 fFrameLow->AddFrame ( fButtonPrintAll, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 5, 5 ) ) ; 71 81 fFrameLow->AddFrame ( fButtonPrintAll, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 5, 5 ) ) ; 82 83 84 72 85 fButtonClose = new TGTextButton ( fFrameLow, "Close", M_BUTTON_CLOSE ) ; 73 86 fButtonClose->Associate (this) ; 74 87 fFrameLow->AddFrame ( fButtonClose, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 5, 5 ) ) ; 75 88 AddFrame ( fFrameLow, new TGLayoutHints ( kLHintsBottom | kLHintsExpandX , 10, 10, 10, 10 ) ) ; 76 89 77 90 // 78 91 // 79 92 // 80 93 BuildHistoList() ; 81 94 82 95 MapSubwindows(); 83 96 … … 87 100 SetIconName("ADC Spectra"); 88 101 89 MapWindow(); 102 MapWindow(); 103 104 SetWMSizeHints(400, 470, 1000, 1000, 10, 10); 90 105 } 91 92 // ====================================================================== 93 // ====================================================================== 94 95 106 107 // ====================================================================== 108 // ====================================================================== 109 // 110 // 96 111 97 112 MGDisplayAdc::~MGDisplayAdc () … … 101 116 delete fButtonPrintAll ; 102 117 delete fButtonClose ; 103 118 104 119 delete fButtonPrev; 105 120 delete fButtonNext ; … … 120 135 void MGDisplayAdc::CloseWindow() 121 136 { 122 123 124 125 126 137 // Got close message for this MainFrame. Calls parent CloseWindow() 138 // (which destroys the window) and terminate the application. 139 // The close message is generated by the window manager when its close 140 // window menu item is selected. 141 // 127 142 delete this ; 128 143 // TGTransientFrame::CloseWindow(); … … 137 152 Bool_t MGDisplayAdc::BuildHistoList() 138 153 { 139 // looks in the container of the AdcSpectra and reads in the 140 // Histogramms in there. 141 // 142 // In the class MHistosAdc are in fact two lists. One for the high and 143 // one for the low gain. Here we will use only the high gain list!!! 144 // With some special options (settings in the gui) we will also be able 145 // to plot the low gain 146 147 for ( Int_t i=0 ; i < fHists->GetHighEntries(); i++ ) { 154 // looks in the container of the AdcSpectra and reads in the 155 // Histogramms in there. 156 // 157 // In the class MHistosAdc are in fact two lists. One for the high and 158 // one for the low gain. Here we will use only the high gain list!!! 159 // With some special options (settings in the gui) we will also be able 160 // to plot the low gain 161 // 162 for ( Int_t i=0 ; i < fHists->GetHighEntries(); i++ ) { 163 164 fHistoList->AddEntry(fHists->GetHighList()->At(i)->GetName(), i+1) ; 165 } 166 167 fHistoList->MapSubwindows() ; 168 fHistoList->Layout() ; 169 170 return (kTRUE) ; 171 } 172 173 // ====================================================================== 174 // ====================================================================== 175 176 Bool_t MGDisplayAdc::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2) 177 { 178 179 // cout <<"Entering process method." << endl; 180 // Process events generated by the buttons in the frame. 181 // 182 Int_t buttons = 4, retval = 0 ; 183 Char_t wort[100] ; 184 Char_t extens[5] ; 185 Char_t command[110] ; 186 187 TGFileItem *item ; // to process items in the file view container 188 void *np = NULL ; // null pointer 189 190 switch (GET_MSG(msg)) 191 { 192 case kC_COMMAND: 193 switch (GET_SUBMSG(msg)) 194 { 195 case kCM_BUTTON: 196 197 switch (parm1) 198 { 199 200 case M_BUTTON_SAVE: 201 new TGMsgBox(fClient->GetRoot(), this, 202 "WARNING!", 203 "Not implemented yet.", 204 kMBIconExclamation, buttons, &retval); 205 206 break ; 207 208 case M_BUTTON_PRINT: 209 break; 210 211 case M_BUTTON_CLOSE: 212 CloseWindow() ; 213 break ; 214 case M_BUTTON_PREV: 215 fCanv->cd() ; 148 216 149 fHistoList->AddEntry(fHists->GetHighList()->At(i)->GetName(), i+1) ; 150 } 151 152 fHistoList->MapSubwindows() ; 153 fHistoList->Layout() ; 154 155 return (kTRUE) ; 156 } 157 158 // ====================================================================== 159 // ====================================================================== 160 161 Bool_t MGDisplayAdc::ProcessMessage(Long_t msg, Long_t parm1, Long_t) 162 { 163 // Process events generated by the buttons in the frame. 164 165 Int_t buttons = 4, retval = 0 ; 166 Char_t wort[100] ; 167 Char_t extens[5] ; 168 Char_t command[110] ; 169 170 TGFileItem *item ; // to process items in the file view container 171 void *np = NULL ; // null pointer 172 173 switch (GET_MSG(msg)) 174 { 175 case kC_COMMAND: 176 switch (GET_SUBMSG(msg)) 177 { 178 case kCM_BUTTON: 179 180 switch (parm1) 181 { 182 183 case M_BUTTON_SAVE: 184 break ; 217 fHists->GetHighList()->At( fHistoList->GetSelected()-1-1)->Draw() ; 218 219 fCanv->Modified() ; 220 fCanv->Update() ; 221 fVslider1->SetPosition( fHistoList->GetSelected()-1); 222 223 224 225 break; 226 227 default: 228 break ; 229 } 230 231 case kCM_MENU: 232 switch (parm1) 233 { 234 } 235 break ; 236 237 default: 238 break ; 239 240 } 241 242 case kCM_LISTBOX: 243 switch (GET_SUBMSG(msg)) 244 { 245 case M_LIST_HISTO: 246 fCanv->cd() ; 247 248 fHists->GetHighList()->At( fHistoList->GetSelected()-1)->Draw() ; 249 250 fCanv->Modified() ; 251 fCanv->Update() ; 252 fVslider1->SetPosition( fHistoList->GetSelected()-1); 253 254 255 256 default: 257 break ; 258 } 185 259 186 case M_BUTTON_CLOSE: 187 CloseWindow() ; 188 break ; 260 261 case kC_CONTAINER: 262 switch (GET_SUBMSG(msg)) 263 { 189 264 265 case kCT_ITEMDBLCLICK: 266 267 break; 268 190 269 default: 191 270 break ; 192 } 193 194 case kCM_MENU: 195 switch (parm1) { 196 } 197 break ; 271 } 272 273 198 274 199 275 default: 200 break ; 276 break; 277 278 case kC_VSLIDER: 279 switch(GET_SUBMSG(msg)) 280 { 281 case kSL_POS: 282 { 283 switch(parm1) 284 { 285 case VSId1: 286 fCanv->cd() ; 287 288 fHists->GetHighList()->At(parm2)->Draw() ; 289 290 fCanv->Modified() ; 291 fCanv->Update() ; 292 293 break; 294 } 295 break; 296 } 297 break; 298 } 299 break; 201 300 202 301 } 203 204 case kCM_LISTBOX: 205 switch (GET_SUBMSG(msg)) 206 { 207 case M_LIST_HISTO: 208 fCanv->cd() ; 209 210 fHists->GetHighList()->At( fHistoList->GetSelected()-1)->Draw() ; 211 212 fCanv->Modified() ; 213 fCanv->Update() ; 214 215 break; 216 217 default: 218 break ; 219 } 220 221 case kC_CONTAINER: 222 switch (GET_SUBMSG(msg)) { 223 224 case kCT_ITEMDBLCLICK: 225 226 break; 227 228 default: 229 break ; 230 } 231 232 233 234 default: 235 break; 236 } 237 return kTRUE; 302 return kTRUE; 238 303 } -
trunk/MagicSoft/MarsOctober/mocttest/MGDisplayAdc.h
r447 r452 16 16 #include <TGFSContainer.h> 17 17 #include <TGMsgBox.h> 18 #include <TVirtualX.h> 19 #include <TGFrame.h> 20 #include <TGTextEntry.h> 21 #include <TGSlider.h> 22 #include <TGDoubleSlider.h> 23 #include <TGScrollBar.h> 24 #include <TSlider.h> 25 26 27 28 29 ////#include <TGPrintDialog> 18 30 19 31 #include <TVirtualX.h> … … 23 35 24 36 class MHistosAdc; 37 38 enum ETestCommandIdentifiers { 39 VSId1 40 }; 41 25 42 26 43 enum ComIdentDisplayAdc { … … 56 73 TGTextButton *fButtonSave, *fButtonPrint, *fButtonPrintAll, *fButtonClose ; 57 74 58 TCanvas *fCanv ; 59 75 TCanvas *fCanv ; 76 77 //for sliders 78 79 TGVSlider *fVslider1; 80 60 81 public: 61 82 -
trunk/MagicSoft/MarsOctober/mocttest/MGOctMain.cc
r450 r452 47 47 fTop1->AddFrame (fButEvtDisp, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) ); 48 48 49 fFrameTop->AddFrame (fTop1, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) ); 50 49 fFrameTop->AddFrame (fTop1, new TGLayoutHints(kLHintsCenterX, 10, 10, 5, 5) ); 51 50 52 51 fTop2 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ; … … 60 59 fTop2->AddFrame (fButCrADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) ); 61 60 62 fFrameTop->AddFrame (fTop2, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) ); 63 61 fFrameTop->AddFrame (fTop2, new TGLayoutHints(kLHintsCenterX, 10, 10, 5, 5) ); 64 62 65 63 fTop3 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ; … … 73 71 fTop3->AddFrame (fButCrTDC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) ); 74 72 75 fFrameTop->AddFrame (fTop3, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) ); 76 77 78 79 AddFrame(fFrameTop, new TGLayoutHints (kLHintsExpandX ) ) ; 73 fFrameTop->AddFrame (fTop3, new TGLayoutHints(kLHintsCenterX, 10, 10, 5, 5) ); 74 75 AddFrame(fFrameTop, new TGLayoutHints (kLHintsTop ) ) ; 76 80 77 81 78 // … … 85 82 fFrameLow = new TGCompositeFrame (this, 300,100, kHorizontalFrame ) ; 86 83 87 fLayTab = new TGLayoutHints ( kLHints Top | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ;84 fLayTab = new TGLayoutHints ( kLHintsExpandX , 5, 5, 5, 5 ) ; 88 85 89 86 // create the first tab … … 94 91 95 92 fTabF1 = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 96 tf->AddFrame(fTabF1, fLayTab ) ;93 // tf->AddFrame(fTabF1, fLayTab ) ; 97 94 98 95 … … 152 149 fTabF1b->AddFrame(fFileView, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5) ) ; 153 150 154 155 tf->AddFrame(fTabF1, fLayTab) ;151 tf->AddFrame(fTabF1, fLayTab) ; 152 156 153 fFrameLow->AddFrame ( fTab, new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ); 157 154 … … 161 158 // Map the window, set up the layout, etc. 162 159 // 160 161 SetWMSizeHints(400, 650, 1000, 1000, 10, 10 ) ; // set the smallest and biggest size of the Main frame 163 162 164 163 MapSubwindows(); -
trunk/MagicSoft/MarsOctober/mocttest/MHistosAdc.h
r447 r452 27 27 { 28 28 return ( fHistHigh ) ; 29 } 30 31 TObjArray* GetLowList() 32 { 33 return ( fHistLow ) ; 29 34 } 30 35 -
trunk/MagicSoft/MarsOctober/mocttest/Makefile
r450 r452 59 59 MTdcSpect.cc \ 60 60 MShowSpect.cc \ 61 MGDisplayAdc.cc 61 MGDisplayAdc.cc \ 62 MCalcPed1.cc 62 63 63 64 SRCS = $(SRCFILES) -
trunk/MagicSoft/MarsOctober/mrootformat/BaseLinkDef.h
r447 r452 7 7 #pragma link C++ class MRawPixel; 8 8 9 #pragma link C++ class MPixPedest; 10 #pragma link C++ class MPedest; 11 9 12 10 13 #endif -
trunk/MagicSoft/MarsOctober/mrootformat/Makefile
r447 r452 54 54 55 55 SRCFILES = MRawPixel.cc \ 56 MRawEvt.cc 56 MRawEvt.cc \ 57 MPixPedest.cc \ 58 MPedest.cc 57 59 58 60 SRCS = $(SRCFILES)
Note:
See TracChangeset
for help on using the changeset viewer.