Changeset 2678 for trunk/MagicSoft/Mars/mreport
- Timestamp:
- 12/15/03 17:29:56 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mreport
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mreport/MReport.cc
r2632 r2678 53 53 // While skip are numbers which won't enter the analysis 54 54 // 55 // SetupReading must be called successfully before. 56 // 55 57 Bool_t MReport::InterpreteHeader(TString &str) 56 58 { … … 70 72 71 73 fState=state; 72 if (fTime) 73 if (!fTime->Set(yea, mon, day, hor, min, sec, ms)) 74 { 75 *fLog << err << "ERROR - Event has invalid time: "; 76 *fLog << Form("%d.%d.%d %02s:%02d:%02d.%03d", day, mon, yea, hor, min, sec, ms); 77 *fLog << "... abort." << endl; 78 return kFALSE; 79 } 74 if (!fTime->Set(yea, mon, day, hor, min, sec, ms)) 75 { 76 *fLog << err << "ERROR - Event has invalid time: "; 77 *fLog << Form("%d.%d.%d %02s:%02d:%02d.%03d", day, mon, yea, hor, min, sec, ms); 78 *fLog << "... abort." << endl; 79 return kFALSE; 80 } 80 81 81 82 str.Remove(0, len); … … 102 103 // when a corresponding time container exists. 103 104 // 104 Bool_t MReport::Interprete(TString &str) 105 // SetupReading must be called successfully before. 106 // 107 Int_t MReport::Interprete(TString &str, const MTime &start, const MTime &stop) 105 108 { 106 109 if (!InterpreteHeader(str)) 107 110 return kFALSE; 111 112 if (start && *fTime<start) 113 return kCONTINUE; 114 if (stop && *fTime>stop) 115 return kCONTINUE; 108 116 109 117 if (!InterpreteBody(str)) … … 111 119 112 120 SetReadyToSave(); 113 if (fTime) 114 fTime->SetReadyToSave(); 121 fTime->SetReadyToSave(); 115 122 116 123 return kTRUE; -
trunk/MagicSoft/Mars/mreport/MReport.h
r2591 r2678 27 27 virtual Bool_t InterpreteBody(TString &str); 28 28 29 Bool_t Interprete(TString &str);29 Int_t Interprete(TString &str, const MTime &start, const MTime &stop); 30 30 Bool_t CheckIdentifier(TString &str) const 31 31 { -
trunk/MagicSoft/Mars/mreport/MReportFileRead.cc
r2632 r2678 119 119 MReport *GetReport() { return fReport; } 120 120 //void SetTime(MTime *t) { fReport->SetTime(t); } 121 Bool_t Interprete(TString &str) 122 { 123 if (!fReport->Interprete(str)) 121 Int_t Interprete(TString &str, const MTime &start, const MTime &stop) 122 { 123 const Int_t rc = fReport->Interprete(str, start, stop); 124 125 if (rc==kFALSE) 124 126 return kFALSE; 125 127 126 128 fNumReports++; 127 return kTRUE;129 return rc; 128 130 } 129 131 Bool_t SetupReading(MParList &plist) { return fReport->SetupReading(plist); } … … 289 291 while (!GetReport(rep)) 290 292 { 291 // Don't know the reason, but ReadLine and ReadString don't work 292 // for the (at least: converted) DC files. 293 str.ReadToDelim(*fIn); 293 str.ReadLine(*fIn); 294 294 if (!*fIn) 295 295 { … … 307 307 } 308 308 309 if (!rep->Interprete(str)) 309 const Int_t rc = rep->Interprete(str, fStart, fStop); 310 if (rc==kFALSE) 310 311 { 311 312 *fLog << err << "ERROR - Interpretation of '" << rep->GetName() << "' failed." << endl; … … 313 314 } 314 315 315 return kTRUE;316 return rc; 316 317 } 317 318 -
trunk/MagicSoft/Mars/mreport/MReportFileRead.h
r2632 r2678 5 5 #include "MTask.h" 6 6 #endif 7 #ifndef MARS_MTime 8 #include "MTime.h" 9 #endif 7 10 8 / / gcc 3.211 /*// gcc 3.2 9 12 //class ifstream; 10 13 #include <iosfwd> 14 */ 11 15 12 16 class THashTable; … … 27 31 THashTable *fList; 28 32 33 MTime fStart; // Time range which should be read from file 34 MTime fStop; // Time range which should be read from file 35 29 36 enum { kHasNoHeader = BIT(14) }; 30 37 … … 43 50 44 51 void SetHasNoHeader() { SetBit(kHasNoHeader); } 52 void SetTimeStart(const MTime &tm) { fStart = tm; } 53 void SetTimeStop(const MTime &tm) { fStop = tm; } 45 54 46 55 Bool_t AddToList(const char *name) const;
Note:
See TracChangeset
for help on using the changeset viewer.