Changeset 3138


Ignore:
Timestamp:
02/13/04 14:53:46 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3137 r3138  
    3131     - changed the name of the "DC" tree to "Currents" to make
    3232       MReportRead work correctly with this tree
     33
     34   * mbase/MTime.[h,cc]:
     35     - Changed UpDMagicTime to support nanosec instead of millisec
     36
     37   * mraw/MRawEvtHeader.[h,cc]:
     38     - implemented decoding of the time-stamp for raw-data files
     39       with version>2. Thanks to Marcos.
     40
     41   * mraw/MRawRead.[h,c]:
     42     - pipe file version number to MRawEvtHeader::ReadEvt
     43     - create fake time for file-version<3
    3344
    3445
  • trunk/MagicSoft/Mars/mbase/MTime.cc

    r2728 r3138  
    141141        return kFALSE;
    142142
    143     const Bool_t am = ms < kHour*13; // day of sunrise?
     143    const Bool_t am = ms<kHour*13; // day of sunrise?
    144144
    145145    fMjd     = am ? mjd : mjd + 1;
     
    220220// between 13:00:00.0 (day of dawning) and 12:59:59.999 (day of sunrise)
    221221//
    222 Bool_t MTime::UpdMagicTime(Byte_t h, Byte_t m, Byte_t s, UShort_t ms)
    223 {
    224     if (h>23 || m>59 || s>59 || ms>999)
     222Bool_t MTime::UpdMagicTime(Byte_t h, Byte_t m, Byte_t s, UInt_t ns)
     223{
     224    if (h>23 || m>59 || s>59 || ns>999999999)
    225225         return kFALSE;
    226226
    227     const ULong_t tm = ((((h*60+m)*60)+s)*1000)+ms;
    228 
    229     fTime = (Long_t)(tm < kHour*13 ? tm  : tm-kDay); // day of sunrise?
    230     //fNanoSec = ns;
     227    const ULong_t tm = ((((h*60+m)*60)+s)*1000)+ns/1000000;
     228
     229    fTime = (Long_t)(tm<kHour*13 ? tm  : tm-kDay); // day of sunrise?
     230    fNanoSec = ns%1000000;
    231231
    232232    return kTRUE;
     
    244244    struct timeval tv;
    245245    if (gettimeofday(&tv, NULL)<0)
    246         Reset();
     246        Clear();
    247247    else
    248248        Set(tv);
    249249#else
    250     Reset();
     250    Clear();
    251251#endif
    252252}
  • trunk/MagicSoft/Mars/mbase/MTime.h

    r2728 r3138  
    4949    {
    5050        Init(name, title);
    51         Reset();
     51        Clear();
    5252    }
    5353    MTime(const struct timeval &tm)
     
    6868    }
    6969
    70     void Reset() { fMjd=0; fTime=0; fNanoSec=0; }
     70    void Clear(const Option_t *o="") { fMjd=0; fTime=0; fNanoSec=0; }
    7171
    7272    void Print(Option_t *t=NULL) const;
     
    7878    void     Set(const struct timeval &tv);
    7979    void     SetCT1Time(UInt_t mjd, UInt_t t1, UInt_t t0);
    80     Bool_t   UpdMagicTime(Byte_t h, Byte_t m, Byte_t s, UShort_t ms);
     80    Bool_t   UpdMagicTime(Byte_t h, Byte_t m, Byte_t s, UInt_t ns);
    8181    void     SetMjd(Double_t m);
    8282    Double_t GetMjd() const;
Note: See TracChangeset for help on using the changeset viewer.