Ignore:
Timestamp:
05/12/11 21:52:22 (14 years ago)
Author:
tbretz
Message:
Renamed AddConfiguration and AddTransition to AddEvent
File:
1 edited

Legend:

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

    r10676 r10688  
    590590
    591591                /*Add the possible transitions for this machine*/
    592                 AddTransition(kSM_NightlyOpen, fTransStart, kSM_Ready, kSM_BadNightlyConfig)
     592                AddEvent(kSM_NightlyOpen, fTransStart, kSM_Ready, kSM_BadNightlyConfig)
    593593                    (boost::bind(&DataLogger::StartPlease, this))
    594594                    ("Start the nightly logging. Nightly file location must be specified already");
    595595
    596                 AddTransition(kSM_Ready, fTransStop, kSM_NightlyOpen, kSM_WaitingRun, kSM_Logging)
     596                AddEvent(kSM_Ready, fTransStop, kSM_NightlyOpen, kSM_WaitingRun, kSM_Logging)
    597597                    (boost::bind(&DataLogger::GoToReadyPlease, this))
    598598                    ("Stop all data logging, close all files.");
    599599
    600                 AddTransition(kSM_Logging, fTransStartRun, kSM_WaitingRun, kSM_BadRunConfig)
     600                AddEvent(kSM_Logging, fTransStartRun, kSM_WaitingRun, kSM_BadRunConfig)
    601601                    (boost::bind(&DataLogger::StartRunPlease, this))
    602602                    ("Start the run logging. Run file location must be specified already.");
    603603
    604                 AddTransition(kSM_WaitingRun, fTransStopRun, kSM_Logging)
     604                AddEvent(kSM_WaitingRun, fTransStopRun, kSM_Logging)
    605605                    (boost::bind(&DataLogger::StopRunPlease, this))
    606606                    ("Wait for a run to be started, open run-files as soon as a run number arrives.");
    607607
    608                 AddTransition(kSM_Ready, fTransReset, kSM_Error, kSM_BadNightlyConfig, kSM_BadRunConfig, kSM_Error)
     608                AddEvent(kSM_Ready, fTransReset, kSM_Error, kSM_BadNightlyConfig, kSM_BadRunConfig, kSM_Error)
    609609                    (boost::bind(&DataLogger::GoToReadyPlease, this))
    610610                    ("Transition to exit error states. Closes the nightly file if already opened.");
    611611
    612                 AddTransition(kSM_WaitingRun, fTransWait, kSM_NightlyOpen)
     612                AddEvent(kSM_WaitingRun, fTransWait, kSM_NightlyOpen)
    613613                    (boost::bind(&DataLogger::NightlyToWaitRunPlease, this));
    614614
    615615                /*Add the possible configurations for this machine*/
    616                 AddConfiguration(fConfigDay, "C", kSM_Ready, kSM_BadNightlyConfig)
     616                AddEvent(fConfigDay, "C", kSM_Ready, kSM_BadNightlyConfig)
    617617                    (boost::bind(&DataLogger::ConfigureNightlyFileName, this, _1))
    618618                    ("Configure the folder for the nightly files."
    619619                     "|Path[string]:Absolute or relative path name where the nightly files should be stored.");
    620620
    621                 AddConfiguration(fConfigRun, "C", kSM_Ready, kSM_BadNightlyConfig, kSM_NightlyOpen, kSM_WaitingRun, kSM_BadRunConfig)
     621                AddEvent(fConfigRun, "C", kSM_Ready, kSM_BadNightlyConfig, kSM_NightlyOpen, kSM_WaitingRun, kSM_BadRunConfig)
    622622                    (boost::bind(&DataLogger::ConfigureRunFileName, this, _1))
    623623                    ("Configure the folder for the run files."
    624624                     "|Path[string]:Absolute or relative path name where the run files should be stored.");
    625625
    626                 AddConfiguration(fConfigRunNumber, "I", kSM_Ready, kSM_BadNightlyConfig, kSM_NightlyOpen, kSM_WaitingRun, kSM_BadRunConfig)
     626                AddEvent(fConfigRunNumber, "I", kSM_Ready, kSM_BadNightlyConfig, kSM_NightlyOpen, kSM_WaitingRun, kSM_BadRunConfig)
    627627                    (boost::bind(&DataLogger::ConfigureRunNumber, this, _1))
    628628                    ("configure the run number. cannot be done in logging state");
     
    633633                //is already done in StateMachineImp.cc
    634634                //Thus I'll simply add a configuration, which I will treat as the logging command
    635                 AddConfiguration(fConfigLog, "C", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_BadRunConfig)
     635                AddEvent(fConfigLog, "C", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_BadRunConfig)
    636636                    (boost::bind(&DataLogger::LogMessagePlease, this, _1))
    637637                    ("Log a single message to the log-files."
     
    643643                str << " " << kSM_BadRunConfig;
    644644
    645                                 AddConfiguration(fPrintCommand, str.str().c_str(), "")
    646 //                AddConfiguration(fPrintCommand, kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_BadNightlyConfig, kSM_BadRunConfig)
     645                                AddEvent(fPrintCommand, str.str().c_str(), "")
     646//                AddEvent(fPrintCommand, kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_BadNightlyConfig, kSM_BadRunConfig)
    647647                    (boost::bind(&DataLogger::PrintStatePlease, this, _1))
    648648                    ("Print information about the internal status of the data logger.");
     
    688688
    689689                //provide services control commands
    690                 AddConfiguration(fDebugOnOff, "B:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)
     690                AddEvent(fDebugOnOff, "B:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)
    691691                    (boost::bind(&DataLogger::SetDebugOnOff, this, _1))
    692692                    ("Switch debug mode on off. Debug mode prints ifnormation about every service written to a file."
    693693                     "|Enable[bool]:Enable of disable debuig mode (yes/no).");
    694694
    695                 AddConfiguration(fStatsPeriod, "F", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)
     695                AddEvent(fStatsPeriod, "F", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)
    696696                    (boost::bind(&DataLogger::SetStatsPeriod, this, _1))
    697697                    ("Interval in which the data-logger statitistics service (STATS) is updated."
    698698                     "Interval[s]:Floating point value in seconds.");
    699699
    700                 AddConfiguration(fStartStopOpenedFiles, "B:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)
     700                AddEvent(fStartStopOpenedFiles, "B:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)
    701701                    (boost::bind(&DataLogger::SetOpenedFilesOnOff ,this, _1))
    702702                    ("Can be used to switch the service off which distributes information about the open files.");
    703703
    704                 AddConfiguration(fStartStopNumSubsAndFits, "B:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)
     704                AddEvent(fStartStopNumSubsAndFits, "B:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)
    705705                    (boost::bind(&DataLogger::SetNumSubsAndFitsOnOff, this, _1))
    706706                    ("Can be used to switch the service off which distributes information about the number of subscriptions and open files.");
Note: See TracChangeset for help on using the changeset viewer.