Changeset 1325
- Timestamp:
- 04/30/02 12:00:44 (23 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1324 r1325 7 7 * macros/tar.C: 8 8 - implemented some sanity checks (existing files) 9 10 * mgui/MCamDisplay.[h,cc]: 11 - changed to use DeepSea palette in root versions newer than 3.01/05 12 - fixed a bug which caused the destructor to do strange thing 13 (the uncloned fGeomCam was deleted) 14 - implemented a more accurate deletion of the objects in the 15 TClonesArrays by using TClonesArray::Delete 16 - Implemented deletion of automatically created TCanvas 17 - Implemented a sanity check in Draw and DrawPhotNum 18 19 * macros/readCT1.C, macros/readMagic.C: 20 - changed to Handling of the gui and keyboard input 21 - implemented the filename as function argument 22 23 * manalysis/MCT1ReadAscii.cc: 24 - Expanded filename to support filnames containing '~' 9 25 10 26 -
trunk/MagicSoft/Mars/NEWS
r1317 r1325 75 75 by unfolding 76 76 77 - changed the color palette in the camera display to DeapSea. 77 78 78 79 -
trunk/MagicSoft/Mars/macros/readCT1.C
r1282 r1325 23 23 \* ======================================================================== */ 24 24 25 Bool_t HandleInput() 26 { 27 TTimer timer("gSystem->ProcessEvents();", 50, kFALSE); 28 while (1) 29 { 30 // 31 // While reading the input process gui events asynchronously 32 // 33 timer.TurnOn(); 34 TString input = Getline("Type 'q' to exit, <return> to go on: "); 35 timer.TurnOff(); 25 36 26 void readCT1() 37 if (input=="q\n") 38 return kFALSE; 39 40 if (input=="\n") 41 return kTRUE; 42 }; 43 44 return kFALSE; 45 } 46 47 void readCT1(const char *fname="~/data/CT1_97_on1.dat") 27 48 { 28 49 MParList plist; … … 36 57 plist.AddToList(&tlist); 37 58 38 MCT1ReadAscii read( "/home/tbretz/data/CT1_97_on1.dat");59 MCT1ReadAscii read(fname); 39 60 MClone clone("MCerPhotEvt"); 40 61 MImgCleanStd clean; … … 66 87 67 88 display.DrawPhotNum(evt); 68 gClient->HandleInput(); 69 if ( getchar()=='q')89 90 if (!HandleInput()) 70 91 break; 71 92 … … 74 95 display.DrawPhotNum((MCerPhotEvt*)plist.FindObject("MCerPhotEvt")); 75 96 76 gClient->HandleInput(); 77 if (getchar()=='q') 97 if (!HandleInput()) 78 98 break; 79 99 } -
trunk/MagicSoft/Mars/macros/readMagic.C
r1206 r1325 24 24 25 25 26 void readMagic() 26 Bool_t HandleInput() 27 { 28 TTimer timer("gSystem->ProcessEvents();", 50, kFALSE); 29 while (1) 30 { 31 // 32 // While reading the input process gui events asynchronously 33 // 34 timer.TurnOn(); 35 TString input = Getline("Type 'q' to exit, <return> to go on: "); 36 timer.TurnOff(); 37 38 if (input=="q\n") 39 return kFALSE; 40 41 if (input=="\n") 42 return kTRUE; 43 }; 44 45 return kFALSE; 46 } 47 48 void readMagic(const char *fname="~/data/camera.root") 27 49 { 28 50 MParList plist; … … 36 58 plist.AddToList(&tlist); 37 59 38 MReadMarsFile read("Events", "~/data/camera.root");60 MReadMarsFile read("Events", fname); 39 61 40 62 MMcPedestalCopy pcopy; … … 71 93 display.DrawPhotNum((MCerPhotEvt*)clone.GetClone()); 72 94 73 gClient->HandleInput(); 74 if(getchar()=='q') 95 if (!HandleInput()) 75 96 break; 76 97 … … 80 101 display.DrawPhotNum((MCerPhotEvt*)plist.FindObject("MCerPhotEvt")); 81 102 82 gClient->HandleInput(); 83 if(getchar()=='q') 84 break; 103 if (!HandleInput()) 104 break; 85 105 } 86 106 87 107 evtloop.PostProcess(); 88 89 108 } 90 109 91 92 93 -
trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.cc
r1081 r1325 44 44 45 45 #include <TList.h> 46 #include <TSystem.h> 46 47 47 48 #include "MLog.h" … … 124 125 const char *name = file->GetName(); 125 126 126 fIn = new ifstream( name);127 fIn = new ifstream(gSystem->ExpandPathName(name)); 127 128 128 129 const Bool_t noexist = !(*fIn); -
trunk/MagicSoft/Mars/mgui/MCamDisplay.cc
r1268 r1325 27 27 // 28 28 MCamDisplay::MCamDisplay(MGeomCam *geom) 29 : fAutoScale(kTRUE), fMinPhe(-2), fMaxPhe(50), fW(0), fH(0), fDrawingPad(NULL) 30 { 31 fGeomCam = geom; // FIXME: Clone doesn't work! (MGeomCam*)geom->Clone();29 : fAutoScale(kTRUE), fMinPhe(-2), fMaxPhe(50), fW(0), fH(0), fDrawingPad(NULL), fIsAllocated(kFALSE) 30 { 31 fGeomCam = (MGeomCam*)geom; // FIXME: Clone doesn't work! (MGeomCam*)geom->Clone(); 32 32 33 33 // … … 53 53 // set the color palette for the TBox elements 54 54 // 55 #if ROOT_VERSION_CODE < ROOT_VERSION(3,01,06) 55 56 gStyle->SetPalette(1, 0); 57 #else 58 gStyle->SetPalette(51, 0); 59 #endif 56 60 57 61 // … … 81 85 MCamDisplay::~MCamDisplay() 82 86 { 87 fPixels->Delete(); 88 fLegend->Delete(); 89 fLegText->Delete(); 90 83 91 delete fPixels; 84 92 delete fLegend; 85 93 delete fLegText; 86 94 87 delete fGeomCam; 95 // delete fGeomCam; 96 97 if (fIsAllocated) 98 delete fDrawingPad; 88 99 } 89 100 … … 157 168 // gPad->SetFixedAspectRatio() 158 169 170 if (fDrawingPad) 171 return; 172 159 173 // 160 174 // if no canvas is yet existing to draw into, create a new one 161 175 // 162 176 if (!gPad) 177 { 163 178 fDrawingPad = new TCanvas("CamDisplay", "Magic Camera Display", 0, 0, 750, 600); 179 fIsAllocated = kTRUE; 180 } 164 181 else 182 { 165 183 fDrawingPad = gPad; 184 fIsAllocated = kFALSE; 185 } 166 186 167 187 fDrawingPad->SetBorderMode(0); … … 176 196 // Setup the correct environment 177 197 // 198 #if ROOT_VERSION_CODE < ROOT_VERSION(3,01,06) 178 199 gStyle->SetPalette(1, 0); 200 #else 201 gStyle->SetPalette(51, 0); 202 #endif 179 203 180 204 gPad->SetFillColor(22); … … 220 244 void MCamDisplay::DrawPhotNum(const MCerPhotEvt *event) 221 245 { 246 if (!event) 247 return; 248 222 249 if (!fDrawingPad) 223 250 Draw(); -
trunk/MagicSoft/Mars/mgui/MCamDisplay.h
r1203 r1325 38 38 UInt_t fH; // Height of canvas 39 39 TVirtualPad *fDrawingPad; // pad in which we are drawing 40 Bool_t fIsAllocated; 40 41 41 42 TBox *GetBox(Int_t i) { return (TBox*) fLegend->At(i); }
Note:
See TracChangeset
for help on using the changeset viewer.