Ignore:
Timestamp:
07/05/08 20:01:55 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mjobs
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mjobs/JobsLinkDef.h

    r8988 r8996  
    66
    77#pragma link C++ class MSequence+;
     8#pragma link C++ class MSequenceSQL+;
    89#pragma link C++ class MDataSet+;
    910
  • trunk/MagicSoft/Mars/mjobs/MSequence.cc

    r8989 r8996  
    171171//
    172172/////////////////////////////////////////////////////////////////////////////
    173 #include "MSequence.h"
     173#include "MSequenceSQL.h"
    174174
    175175#include <stdlib.h>
     
    575575// --------------------------------------------------------------------------
    576576//
    577 // Get LightCondition from resource file and convert it to LIghtCondition_t
    578 //
    579 MSequence::LightCondition_t MSequence::ReadLightCondition(TEnv &env, const char *prefix) const
    580 {
    581     TString str = GetEnvValue2(env, prefix, "LightConditions", "n/a");
     577// Get LightCondition from str and convert it to LightCondition_t
     578//
     579MSequence::LightCondition_t MSequence::GetLightCondition(const TString &str) const
     580{
    582581    if (!str.CompareTo("n/a", TString::kIgnoreCase))
    583582        return kNA;
     
    634633    fPeriod    = GetEnvValue2(env, prefix, "Period",    -1);
    635634
    636     fLightCondition = ReadLightCondition(env, prefix);
    637 
    638635    TString str;
     636    str = GetEnvValue2(env, prefix, "LightConditions", "n/a");
     637    fLightCondition = GetLightCondition(str);
     638
    639639    str = GetEnvValue2(env, prefix, "Start", "");
    640640    fStart.SetSqlDateTime(str);
     641
    641642    str = GetEnvValue2(env, prefix, "Night", "");
    642643    str += " 00:00:00";
     
    667668        env.PrintUntouched();
    668669    }
     670}
     671
     672MSequence::MSequence(const char *fname, UInt_t seq)
     673{
     674    *this = MSequenceSQL(fname, seq);
    669675}
    670676
     
    875881        return;
    876882    }
    877     out << "# Path: " << GetFileName() << endl;
    878     out << "# Name: " << GetBaseName() << endl;
     883    if (!fFileName.IsNull())
     884        out << "# FileName: " << fFileName << endl;
     885    if (!fDataPath.IsNull())
     886        out << "# DataPath: " << fDataPath << endl;
    879887    out << endl;
    880888    if (pre.IsNull())
     
    885893        out << pre << "Period:         " << fPeriod << endl;
    886894    if (fNight!=MTime())
    887         out << pre << "Night:          " << fNight << endl;
     895        out << pre << "Night:          " << fNight.GetStringFmt("%Y-%m-%d") << endl;
    888896    out << endl;
    889897    out << pre << "LightCondition: ";
     
    894902    case kTwilight: out << "Twilight" << endl; break;
    895903    case kMoon:     out << "Moon" << endl;     break;
    896     case kDay:      out << "Day" << endl;     break;
     904    case kDay:      out << "Day" << endl;      break;
    897905    }
    898906
    899907    if (fStart!=MTime())
    900         out << pre << "Start:          " << fStart << endl;
     908        out << pre << "Start:          " << fStart.GetSqlDateTime() << endl;
    901909    if (fLastRun>=0)
    902910        out << pre << "LastRun:        " << fLastRun << endl;
  • trunk/MagicSoft/Mars/mjobs/MSequence.h

    r8989 r8996  
    1414class MSequence : public MParContainer
    1515{
     16    friend class MSequenceSQL;
    1617public:
    1718    enum LightCondition_t { kNA, kNoMoon, kTwilight, kMoon, kDay };
     
    6768    void    Split(const TEnv &env, const TString &prefix, const char *name, TArrayI &data, TArrayI &sub) const;
    6869
    69     LightCondition_t ReadLightCondition(TEnv &env, const char *prefix) const;
     70    LightCondition_t GetLightCondition(const TString &str) const;
    7071
    7172    // Helper for file setup
     
    9293public:
    9394    MSequence() : fSequence((UInt_t)-1), fLastRun((UInt_t)-1),
    94         fNumEvents((UInt_t)-1), fPeriod((UInt_t)-1), fMonteCarlo(kFALSE)
     95        fNumEvents((UInt_t)-1), fPeriod((UInt_t)-1), fLightCondition(kNA), fMonteCarlo(kFALSE)
    9596    {
    9697        fName  = "MSequence";
     
    9899    }
    99100    MSequence(const char *fname, const char *path="", UInt_t id=(UInt_t)-1);
     101    MSequence(const char *fname, UInt_t seq);
    100102    MSequence(const MSequence &s) : MParContainer(s),
    101103        fFileName(s.fFileName), fDataPath(s.fDataPath),
    102104        fSequence(s.fSequence), fStart(s.fStart),
    103105        fLastRun(s.fLastRun), fNumEvents(s.fNumEvents), fPeriod(s.fPeriod),
    104         fNight(s.fNight), fProject(s.fProject), fSource(s.fSource),
     106        fNight(s.fNight), fLightCondition(s.fLightCondition),
     107        fProject(s.fProject), fSource(s.fSource),
    105108        fTriggerTable(s.fTriggerTable), fHvSettings(s.fHvSettings),
    106         fRuns(s.fRuns), fCalRuns(s.fCalRuns), fPedRuns(s.fPedRuns),
    107         fDatRuns(s.fDatRuns), fMonteCarlo(s.fMonteCarlo) { }
     109        fRuns(s.fRuns), fRunsSub(s.fRunsSub), fCalRuns(s.fCalRuns),
     110        fCalRunsSub(s.fCalRunsSub), fPedRuns(s.fPedRuns),
     111        fPedRunsSub(s.fPedRunsSub), fDatRuns(s.fDatRuns),
     112        fDatRunsSub(s.fDatRunsSub), fExclRuns(s.fExclRuns),
     113        fExclRunsSub(s.fExclRunsSub), fMonteCarlo(s.fMonteCarlo) { }
    108114
    109115    // I/O
  • trunk/MagicSoft/Mars/mjobs/Makefile

    r8988 r8996  
    2424           -I../mtools -I../mimage -I../mpointing -I../mastro -I../mfbase \
    2525           -I../mhvstime -I../mtrigger -I../mmuon -I../mmc -I../mmovie \
    26            -I../mextralgo -I../mhflux
     26           -I../mextralgo -I../mhflux -I../msql
    2727
    2828SRCFILES = MSequence.cc \
     29           MSequenceSQL.cc \
    2930           MDataSet.cc \
    3031           MJob.cc \
Note: See TracChangeset for help on using the changeset viewer.