Changeset 9012 for trunk/MagicSoft


Ignore:
Timestamp:
07/18/08 19:41:12 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9008 r9012  
    1919                                                 -*-*- END OF LINE -*-*-
    2020
     21 2008/07/18 Thomas Bretz
     22
     23   * datacenter/macros/buildsequenceentries.C:
     24     - Use the GetId also in the constructor of Rule
     25     - fixed reading of the sections in the sequences.rc
     26
     27   * mbase/MTime.cc:
     28     - GetStringFmt was taking the daylight saving time into account
     29       (hopefully this fix is not too much dependent on the kernel)
     30
     31   * mjobs/MSequence.cc:
     32     - added some preliminary code for comparing two sequences
     33     - fixed output in Print (the "s" was missing in LightConditions)
     34     - do not write the "Run[0-]*" line for anything else than
     35       the "Runs" (needs more fixes)
     36
     37
     38
    2139 2008/07/17 Thomas Bretz
    2240
     
    102120     - commmented out caco files
    103121     - write telescope run and file-number to the file
     122     - some simplification
    104123
    105124
  • trunk/MagicSoft/Mars/mbase/MTime.cc

    r8999 r9012  
    759759    time.tm_mon   = mon-1;
    760760    time.tm_year  = y-1900;
    761     time.tm_isdst = 0;
    762 
     761    time.tm_isdst = -1;
     762
     763    // -1: If dst, isdst is set to 1 but hour is not changed
     764    //  0: If dst, hour is changed
     765
     766    // Get old local
    763767    const TString locale = setlocale(LC_TIME, 0);
    764768
     769    // Set new local (e.g. Montag instead of Monday)
    765770    setlocale(LC_TIME, loc);
    766771
    767772    // recalculate tm_yday and tm_wday
    768     mktime(&time);
     773    if (mktime(&time)<0)
     774        return "";
    769775
    770776    char ret[128];
  • trunk/MagicSoft/Mars/mjobs/MSequence.cc

    r9003 r9012  
    705705}
    706706
     707static int operator==(const TArrayI &a, const TArrayI &b)
     708{
     709    return a.GetSize()==b.GetSize() ?
     710        memcmp(a.GetArray(), b.GetArray(), a.GetSize()*sizeof(Int_t))==0 :
     711        false;
     712}
     713
     714static int IsNull(const TArrayI &a)
     715{
     716    if (a.GetSize()==0)
     717        return true;
     718
     719    return a.GetSize()==0 ? true : a==TArrayI(a.GetSize());
     720}
     721
     722static int IsNull(const TArrayI &a, const TArrayI &b)
     723{
     724    return IsNull(a) && IsNull(b);
     725}
     726
     727Bool_t MSequence::IsSimilar(const MSequence &s) const
     728{
     729    return // Mandatory
     730        fTelescope==s.fTelescope && fSequence==s.fSequence &&
     731        fNight==s.fNight
     732        && fLightCondition==s.fLightCondition &&
     733
     734        fMonteCarlo==s.fMonteCarlo &&
     735
     736        (fRunsSub    ==s.fRunsSub     || IsNull(fRunsSub,     s.fRunsSub))     &&
     737        (fCalRunsSub ==s.fCalRunsSub  || IsNull(fCalRunsSub,  s.fCalRunsSub))  &&
     738        (fPedRunsSub ==s.fPedRunsSub  || IsNull(fPedRunsSub,  s.fPedRunsSub))  &&
     739        (fDatRunsSub ==s.fDatRunsSub  || IsNull(fDatRunsSub,  s.fDatRunsSub))  &&
     740        (fExclRunsSub==s.fExclRunsSub || IsNull(fExclRunsSub, s.fExclRunsSub))
     741        ;
     742}
     743
     744Bool_t MSequence::IsIdentical(const MSequence &s) const
     745{
     746    return IsSimilar(s) &&
     747        // Unnecessary
     748        fStart==s.fStart         && fLastRun==s.fLastRun   &&
     749        fNumEvents==s.fNumEvents && fPeriod==s.fPeriod     &&
     750        fProject==s.fProject     && fSource==s.fSource     &&
     751        /*fTriggerTable==s.fTriggerTable &&*/ fHvSettings==s.fHvSettings;
     752}
     753
     754Bool_t MSequence::operator==(const MSequence &s) const
     755{
     756    return IsIdentical(s) &&
     757        // Obsolete
     758        fDataPath==s.fDataPath && fFileName==s.fFileName;
     759}
     760
    707761//---------------------------------------------------------------------------
    708762//
     
    927981        out << pre << "Night:          " << fNight.GetStringFmt("%Y-%m-%d") << endl;
    928982    out << endl;
    929     out << pre << "LightCondition: ";
     983    out << pre << "LightConditions: ";
    930984    switch (fLightCondition)
    931985    {
     
    9651019    {
    9661020        str += PrintRuns(out, pre, "Runs:     ", fRuns,     fRunsSub);
    967         str += PrintRuns(out, pre, "CalRuns:  ", fCalRuns,  fCalRunsSub);
    968         str += PrintRuns(out, pre, "PedRuns:  ", fPedRuns,  fPedRunsSub);
    969         str += PrintRuns(out, pre, "DataRuns: ", fDatRuns,  fDatRunsSub);
    970         str += PrintRuns(out, pre, "Exclude:  ", fExclRuns, fExclRunsSub);
     1021        /*str +=*/ PrintRuns(out, pre, "CalRuns:  ", fCalRuns,  fCalRunsSub);
     1022        /*str +=*/ PrintRuns(out, pre, "PedRuns:  ", fPedRuns,  fPedRunsSub);
     1023        /*str +=*/ PrintRuns(out, pre, "DataRuns: ", fDatRuns,  fDatRunsSub);
     1024        /*str +=*/ PrintRuns(out, pre, "Exclude:  ", fExclRuns, fExclRunsSub);
    9711025    }
    9721026
  • trunk/MagicSoft/Mars/mjobs/MSequence.h

    r9003 r9012  
    2222        kCalibrated, kImages
    2323    };
     24
    2425private:
    2526    TString fFileName;         // Expanded file name
     
    115116        fExclRunsSub(s.fExclRunsSub), fMonteCarlo(s.fMonteCarlo) { }
    116117
     118    Bool_t IsSimilar(const MSequence &s) const;
     119    Bool_t IsIdentical(const MSequence &s) const;
     120    Bool_t operator==(const MSequence &s) const;
     121
    117122    // I/O
    118123    Bool_t WriteFile(const char *filename, const Option_t *o) const;
Note: See TracChangeset for help on using the changeset viewer.