Ignore:
Timestamp:
07/05/08 20:01:55 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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;
Note: See TracChangeset for help on using the changeset viewer.