Ignore:
Timestamp:
05/08/11 21:48:24 (14 years ago)
Author:
Daniela Dorner
Message:
implemented --dbname and its evaluation for the scheduler
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/scheduler.cc

    r10618 r10624  
    5858
    5959
    60 // config parameters
    61 // mintime
    62 // runtimec
    63 // runtimep
    64 // repostime
     60// config parameters:
     61//   mintime
     62//   runtimec
     63//   runtimep
     64//   repostime
    6565
    6666// missing:
     
    6969// calculate sun set/rise
    7070//
    71 // check for double std sources
    72 //
    73 // return errors
    74 // get input from sendcommand
     71// return errors and other otherput from sendcommand to webinterface
    7572
    7673// in which cases should the scheduler go in error state?
     
    173170
    174171    int fSessionId;
     172    string fDBName;
    175173
    176174
     
    189187        cout << "Scheduling for the period from " << startsched << " to " << stopsched << endl;
    190188
    191         stringstream str;
    192         str << "Scheduling started -> Preview (id=" << fSessionId << ")";
    193         T::Message(str);
    194 
    195189        static const boost::regex expr("(([[:word:].-]+)(:(.+))?@)?([[:word:].-]+)(:([[:digit:]]+))?(/([[:word:].-]+))");
    196190        // 2: user
     
    216210        const string passwd = what[4];
    217211        const string server = what[5];
    218         const string db     = what[9];
     212        string db = what[9];
     213        if (fDBName.size()!=0)
     214            db = fDBName;
    219215        const int port      = atoi(string(what[7]).c_str());
     216
     217        stringstream dbnamemsg;
     218        dbnamemsg << "Scheduling started -> using database " << fDBName << ".";
     219        T::Message(dbnamemsg);
    220220
    221221        cout << "Connecting to '";
     
    633633    */
    634634
    635     AutoScheduler(ostream &out=cout) : T(out, "SCHEDULER"), fNextIsPreview(true), fSessionId(-1)
     635    AutoScheduler(ostream &out=cout) : T(out, "SCHEDULER"), fNextIsPreview(true), fSessionId(-1), fDBName("")
    636636    {
    637637        AddStateName(kSM_Scheduling,  "Scheduling");
     
    662662        {
    663663        case kSM_Scheduling:
     664            if (evt.GetSize()>0)
     665                fDBName = evt.GetString();
    664666        //case kSM_Comitting:
    665667            //fSessionId = evt.GetInt();
     
    674676    }
    675677};
     678
    676679
    677680// ------------------------------------------------------------------------
     
    771774    }
    772775
    773     //if (conf.Has("mintime"))
    774     //    cout << "has mintime --------------------+" << conf.Get<int>("mintime")<< "+------------" << endl;
    775 
    776776    if (conf.Has("database"))
     777    {
    777778        database = conf.Get<string>("database").c_str();
     779    }
    778780    else
    779781    {
     
    781783        return -1;
    782784    }
    783 
    784785
    785786    if (conf.HasHelp() || conf.HasPrint())
Note: See TracChangeset for help on using the changeset viewer.