Ignore:
Timestamp:
12/15/03 17:29:56 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mreport
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mreport/MReport.cc

    r2632 r2678  
    5353// While skip are numbers which won't enter the analysis
    5454//
     55// SetupReading must be called successfully before.
     56//
    5557Bool_t MReport::InterpreteHeader(TString &str)
    5658{
     
    7072
    7173    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    }
    8081
    8182    str.Remove(0, len);
     
    102103// when a corresponding time container exists.
    103104//
    104 Bool_t MReport::Interprete(TString &str)
     105// SetupReading must be called successfully before.
     106//
     107Int_t MReport::Interprete(TString &str, const MTime &start, const MTime &stop)
    105108{
    106109    if (!InterpreteHeader(str))
    107110        return kFALSE;
     111
     112    if (start && *fTime<start)
     113        return kCONTINUE;
     114    if (stop  && *fTime>stop)
     115        return kCONTINUE;
    108116
    109117    if (!InterpreteBody(str))
     
    111119
    112120    SetReadyToSave();
    113     if (fTime)
    114         fTime->SetReadyToSave();
     121    fTime->SetReadyToSave();
    115122
    116123    return kTRUE;
  • trunk/MagicSoft/Mars/mreport/MReport.h

    r2591 r2678  
    2727    virtual Bool_t InterpreteBody(TString &str);
    2828
    29     Bool_t Interprete(TString &str);
     29    Int_t  Interprete(TString &str, const MTime &start, const MTime &stop);
    3030    Bool_t CheckIdentifier(TString &str) const
    3131    {
  • trunk/MagicSoft/Mars/mreport/MReportFileRead.cc

    r2632 r2678  
    119119    MReport *GetReport() { return fReport; }
    120120    //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)
    124126            return kFALSE;
    125127
    126128        fNumReports++;
    127         return kTRUE;
     129        return rc;
    128130    }
    129131    Bool_t SetupReading(MParList &plist) { return fReport->SetupReading(plist); }
     
    289291    while (!GetReport(rep))
    290292    {
    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);
    294294        if (!*fIn)
    295295        {
     
    307307    }
    308308
    309     if (!rep->Interprete(str))
     309    const Int_t rc = rep->Interprete(str, fStart, fStop);
     310    if (rc==kFALSE)
    310311    {
    311312        *fLog << err << "ERROR - Interpretation of '" << rep->GetName() << "' failed." << endl;
     
    313314    }
    314315
    315     return kTRUE;
     316    return rc;
    316317}
    317318
  • trunk/MagicSoft/Mars/mreport/MReportFileRead.h

    r2632 r2678  
    55#include "MTask.h"
    66#endif
     7#ifndef MARS_MTime
     8#include "MTime.h"
     9#endif
    710
    8 // gcc 3.2
     11/*// gcc 3.2
    912//class ifstream;
    1013#include <iosfwd>
     14*/
    1115
    1216class THashTable;
     
    2731    THashTable *fList;
    2832
     33    MTime fStart;            // Time range which should be read from file
     34    MTime fStop;             // Time range which should be read from file
     35
    2936    enum { kHasNoHeader = BIT(14) };
    3037
     
    4350
    4451    void SetHasNoHeader() { SetBit(kHasNoHeader); }
     52    void SetTimeStart(const MTime &tm) { fStart = tm; }
     53    void SetTimeStop(const MTime &tm)  { fStop = tm; }
    4554
    4655    Bool_t AddToList(const char *name) const;
Note: See TracChangeset for help on using the changeset viewer.