Changeset 4575 for trunk/MagicSoft
- Timestamp:
- 08/11/04 10:35:11 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 added
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/merpp.cc
r4452 r4575 8 8 #include "MSqlInsertRun.h" 9 9 #include "MRawFileWrite.h" 10 11 #include "MReportFileRead.h" 10 #include "MReportFileReadCC.h" 12 11 #include "MWriteRootFile.h" 13 12 … … 77 76 gLog << " --start=yyyy-mm-dd/hh:mm:ss.mmm Start event time for merpping report files" << endl; 78 77 gLog << " --stop=yyyy-mm-dd/hh:mm:ss.mmm Stop event time for merpping report files" << endl; 79 gLog << " --run=# Only data corresponding to this run number" << endl; 78 gLog << " --run=# Only data corresponding to this run number (from RUN-REPORT)" << endl; 79 gLog << " --runfile=# Check that CC file corresponds to this run (from .rep header)" << endl; 80 gLog << " --sumfile Check that CC file is a all night summary (from .rep header)" << endl; 81 gLog << " --allfiles Don't check file type for CC files <default>" << endl; 80 82 gLog << " --debug[=n] Enable root debugging (Default: gDebug=1)" << endl; 81 83 gLog << " -?, -h, --help This help" << endl << endl; … … 133 135 const Int_t kRunNumber = arg.HasOption("--run=") ? arg.GetIntAndRemove("--run=") : -1; 134 136 const TString kSqlDataBase(arg.GetStringAndRemove("--sql=")); 137 138 Int_t kRunFile = arg.HasOption("--runfile=") ? arg.GetIntAndRemove("--runfile=") : -1; 139 if (arg.HasOnlyAndRemove("--sumfile")) 140 kRunFile = 0; 135 141 136 142 if (kTimeStart) … … 284 290 write = w; 285 291 286 MReportFileRead *r = new MReportFileRead(kNamein);292 MReportFileReadCC *r = new MReportFileReadCC(kNamein); 287 293 r->SetTimeStart(kTimeStart); 288 294 r->SetTimeStop(kTimeStop); … … 294 300 else 295 301 { 302 r->SetRunNumber(kRunFile); 296 303 r->AddToList("MReportCC"); 297 304 //r->AddToList("MReportDAQ"); -
trunk/MagicSoft/Mars/mreport/MReport.cc
r3589 r4575 91 91 // argument. 92 92 // 93 Int_t MReport::InterpreteBody(TString &str )93 Int_t MReport::InterpreteBody(TString &str, Int_t ver) 94 94 { 95 95 *fLog << warn << "No interpreter existing for: " << fIdentifier << endl; … … 105 105 // SetupReading must be called successfully before. 106 106 // 107 Int_t MReport::Interprete(TString &str, const MTime &start, const MTime &stop )107 Int_t MReport::Interprete(TString &str, const MTime &start, const MTime &stop, Int_t ver) 108 108 { 109 109 if (!InterpreteHeader(str)) … … 116 116 return -1; 117 117 118 const Int_t rc = InterpreteBody(str );118 const Int_t rc = InterpreteBody(str, ver); 119 119 if (rc != kTRUE) 120 120 return rc; -
trunk/MagicSoft/Mars/mreport/MReport.h
r2892 r4575 25 25 26 26 virtual Bool_t SetupReading(MParList &plist); 27 virtual Int_t InterpreteBody(TString &str );27 virtual Int_t InterpreteBody(TString &str, Int_t ver); 28 28 29 Int_t Interprete(TString &str, const MTime &start, const MTime &stop );29 Int_t Interprete(TString &str, const MTime &start, const MTime &stop, const Int_t ver); 30 30 Bool_t CheckIdentifier(TString &str) const 31 31 { -
trunk/MagicSoft/Mars/mreport/MReportCC.cc
r2892 r4575 58 58 // Interprete the body of the CC-REPORT string 59 59 // 60 Int_t MReportCC::InterpreteBody(TString &str )60 Int_t MReportCC::InterpreteBody(TString &str, Int_t ver) 61 61 { 62 62 // Remove the 30 tokens of the subsystem status -
trunk/MagicSoft/Mars/mreport/MReportCC.h
r2892 r4575 14 14 Float_t fSolarRadiation; // [W/m^2] IR-Radiation 15 15 16 Int_t InterpreteBody(TString &str );16 Int_t InterpreteBody(TString &str, Int_t ver); 17 17 18 18 public: -
trunk/MagicSoft/Mars/mreport/MReportCamera.cc
r4569 r4575 447 447 // Interprete the body of the CAMERA-REPORT string 448 448 // 449 Int_t MReportCamera::InterpreteBody(TString &str )449 Int_t MReportCamera::InterpreteBody(TString &str, Int_t ver) 450 450 { 451 451 if (!InterpreteCamera(str)) -
trunk/MagicSoft/Mars/mreport/MReportCamera.h
r4569 r4575 40 40 Bool_t InterpreteHOT(TString &str); 41 41 42 Int_t InterpreteBody(TString &str );42 Int_t InterpreteBody(TString &str, Int_t ver); 43 43 44 44 public: -
trunk/MagicSoft/Mars/mreport/MReportCurrents.cc
r2892 r4575 70 70 // Interprete the body of the DC-REPORT string 71 71 // 72 Int_t MReportCurrents::InterpreteBody(TString &str )72 Int_t MReportCurrents::InterpreteBody(TString &str, Int_t ver) 73 73 { 74 74 Int_t len; -
trunk/MagicSoft/Mars/mreport/MReportCurrents.h
r2892 r4575 17 17 18 18 Bool_t SetupReading(MParList &plist); 19 Int_t InterpreteBody(TString &str );19 Int_t InterpreteBody(TString &str, Int_t ver); 20 20 21 21 public: -
trunk/MagicSoft/Mars/mreport/MReportDAQ.cc
r2892 r4575 48 48 } 49 49 50 Int_t MReportDAQ::InterpreteBody(TString &str )50 Int_t MReportDAQ::InterpreteBody(TString &str, Int_t ver) 51 51 { 52 52 *fLog << dbg << "D" << flush; -
trunk/MagicSoft/Mars/mreport/MReportDAQ.h
r2892 r4575 9 9 { 10 10 private: 11 Int_t InterpreteBody(TString &str );11 Int_t InterpreteBody(TString &str, Int_t ver); 12 12 13 13 public: -
trunk/MagicSoft/Mars/mreport/MReportDrive.cc
r3667 r4575 88 88 // Interprete the body of the DRIVE-REPORT string 89 89 // 90 Int_t MReportDrive::InterpreteBody(TString &str )90 Int_t MReportDrive::InterpreteBody(TString &str, Int_t ver) 91 91 { 92 92 MAstro::String2Angle(str, fRa); -
trunk/MagicSoft/Mars/mreport/MReportDrive.h
r2892 r4575 23 23 Double_t fErrorAz; // [?] sistem error in the azimuth angle axis 24 24 25 Int_t InterpreteBody(TString &str );25 Int_t InterpreteBody(TString &str, Int_t ver); 26 26 27 27 public: -
trunk/MagicSoft/Mars/mreport/MReportFileRead.cc
r3568 r4575 56 56 using namespace std; 57 57 58 const TString MReportFileRead::gsReportHeader ="[CC Report File]";59 const TString MReportFileRead::gsVersionPrefix="Arehucas Version Number";60 61 58 // -------------------------------------------------------------------------- 62 59 // … … 65 62 // 66 63 MReportFileRead::MReportFileRead(const char *fname, const char *name, const char *title) 67 : fFileName(fname), f In(NULL)64 : fFileName(fname), fVersion(-1), fIn(NULL) 68 65 { 69 66 fName = name ? name : "MReportFileRead"; 70 fTitle = title ? title : "Read task to read Central Control report files";67 fTitle = title ? title : "Read task to read general report files"; 71 68 72 69 fIn = new ifstream; … … 137 134 fList->Add(help); 138 135 return kTRUE; 139 }140 141 // --------------------------------------------------------------------------142 //143 // Check whether the file header corresponds to a central control file144 // header and check for the existance of a correct version number.145 // The version number may later be used to be able to read different146 // file versions147 //148 Int_t MReportFileRead::CheckFileHeader() const149 {150 Int_t line = 0;151 152 TString str;153 str.ReadLine(*fIn); // Read to EOF or newline154 if (str != gsReportHeader)155 {156 *fLog << err << "ERROR - First line doesn't match '" << gsReportHeader <<"' ";157 *fLog << "in file '" << fFileName << "'"<<endl;158 return line;159 }160 line++;161 162 str.ReadLine(*fIn); // Read to EOF or newline163 if (!str.BeginsWith(gsVersionPrefix))164 {165 *fLog << err << "ERROR - Version prefix '" << gsVersionPrefix <<"' ";166 *fLog << "not found in second line of file '" << fFileName << "'"<<endl;167 return line;168 }169 line++;170 171 str.Remove(0, gsVersionPrefix.Length());172 str = str.Strip(TString::kBoth);173 174 TString ver = str(TRegexp("^[0-9][0-9][0-9][0-9][0-9][0-9]-[0-9]$"));175 if (ver.IsNull())176 {177 *fLog << err << "ERROR - Version string '" << str <<"' doesn't ";178 *fLog << "match regular expression." << endl;179 return line;180 }181 182 *fLog << dbg << "Report File version: <" << ver << ">" << endl;183 184 return line;185 136 } 186 137 … … 257 208 } 258 209 259 const Int_t rc = rep->Interprete(str, fStart, fStop );210 const Int_t rc = rep->Interprete(str, fStart, fStop, fVersion); 260 211 261 212 switch (rc) -
trunk/MagicSoft/Mars/mreport/MReportFileRead.h
r2711 r4575 23 23 { 24 24 private: 25 static const TString gsReportHeader; 26 static const TString gsVersionPrefix; 25 TString fFileName; // Name of the input file 27 26 28 TString fFileName; 29 ifstream *fIn; //! buffered input stream (file to read from) 27 THashTable *fList; // List of possible reports to be interpreted 30 28 31 THashTable *fList; 29 MTime fStart; // Time range which should be read from file 30 MTime fStop; // Time range which should be read from file 32 31 33 MTime fStart; // Time range which should be read from file 34 MTime fStop; // Time range which should be read from file 32 ULong_t fNumLine; // line counter 35 33 36 ULong_t fNumLine; // line counter34 Int_t fVersion; // File format version 37 35 38 36 enum { kHasNoHeader = BIT(14) }; … … 42 40 Int_t PostProcess(); 43 41 44 Int_t CheckFileHeader() const;42 virtual Int_t CheckFileHeader() { return 0; } 45 43 MReport *GetReport(const TString &str) const; 46 44 MReport *GetReport(MReportHelp *help) const; 47 45 MReportHelp *GetReportHelp(const TString &str) const; 46 47 protected: 48 ifstream *fIn; //! buffered input stream (file to read from) 49 void SetVersion(Int_t v) { fVersion = v; } 48 50 49 51 public: … … 57 59 Bool_t AddToList(const char *name) const; 58 60 59 ClassDef(MReportFileRead, 0)// Task to read the central control report file61 ClassDef(MReportFileRead, 0)// Task to read general report file 60 62 }; 61 63 -
trunk/MagicSoft/Mars/mreport/MReportHelp.cc
r2892 r4575 138 138 // successfull interpretations. 139 139 // 140 Int_t MReportHelp::Interprete(TString &str, const MTime &start, const MTime &stop )140 Int_t MReportHelp::Interprete(TString &str, const MTime &start, const MTime &stop, Int_t ver) 141 141 { 142 const Int_t rc = fReport->Interprete(str, start, stop );142 const Int_t rc = fReport->Interprete(str, start, stop, ver); 143 143 144 144 switch (rc) -
trunk/MagicSoft/Mars/mreport/MReportHelp.h
r2892 r4575 30 30 MReport *GetReport() { return fReport; } 31 31 32 Int_t Interprete(TString &str, const MTime &start, const MTime &stop );32 Int_t Interprete(TString &str, const MTime &start, const MTime &stop, Int_t ver); 33 33 34 34 Bool_t SetupReading(MParList &plist); -
trunk/MagicSoft/Mars/mreport/MReportRun.cc
r3818 r4575 57 57 // Interprete the body of the RUN-REPORT string 58 58 // 59 Int_t MReportRun::InterpreteBody(TString &str )59 Int_t MReportRun::InterpreteBody(TString &str, Int_t ver) 60 60 { 61 61 const Int_t ws = str.First(' '); -
trunk/MagicSoft/Mars/mreport/MReportRun.h
r2892 r4575 12 12 TString fSourceName; 13 13 14 Int_t InterpreteBody(TString &str );14 Int_t InterpreteBody(TString &str, Int_t ver); 15 15 16 16 public: -
trunk/MagicSoft/Mars/mreport/MReportTrigger.cc
r2892 r4575 52 52 // Interprete the body of the TRIGGER-REPORT string 53 53 // 54 Int_t MReportTrigger::InterpreteBody(TString &str )54 Int_t MReportTrigger::InterpreteBody(TString &str, Int_t ver) 55 55 { 56 56 str = str.Strip(TString::kLeading); -
trunk/MagicSoft/Mars/mreport/MReportTrigger.h
r3148 r4575 22 22 //TArrayF fRates; //[Hz] currently undefined 23 23 24 Int_t InterpreteBody(TString &str );24 Int_t InterpreteBody(TString &str, Int_t ver); 25 25 26 26 public: -
trunk/MagicSoft/Mars/mreport/Makefile
r3927 r4575 31 31 MReportTrigger.cc \ 32 32 MReportCurrents.cc \ 33 MReportFileRead.cc 33 MReportFileRead.cc \ 34 MReportFileReadCC.cc 34 35 35 36 ############################################################ -
trunk/MagicSoft/Mars/mreport/ReportLinkDef.h
r2800 r4575 17 17 #pragma link C++ class MReportHelp+; 18 18 #pragma link C++ class MReportFileRead+; 19 #pragma link C++ class MReportFileReadCC+; 19 20 20 21 #endif
Note:
See TracChangeset
for help on using the changeset viewer.