Changeset 10688 for trunk


Ignore:
Timestamp:
05/12/11 21:52:22 (14 years ago)
Author:
tbretz
Message:
Renamed AddConfiguration and AddTransition to AddEvent
Location:
trunk/FACT++/src
Files:
6 edited

Legend:

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

    r10657 r10688  
    109109//! Subsequent, i.e. derived classes should setup all allowed state
    110110//! transitions as well as all allowed configuration event by
    111 //! AddTransition, AddConfiguration and AddStateName.
     111//! AddEvent and AddStateName.
    112112//!
    113113//! @param out
     
    492492//!    greater or equal zero. A negative target state is used to flag
    493493//!    commands which do not initiate a state transition. If this is
    494 //!    desired use AddConfiguration instead.
     494//!    desired use AddEvent instead.
    495495//!
    496496//! @param name
     
    523523//!    greater or equal zero. A negative target state is used to flag
    524524//!    commands which do not initiate a state transition. If this is
    525 //!    desired use AddConfiguration instead.
     525//!    desired use AddEvent instead.
    526526//!
    527527//! @param name
     
    540540//!    received commands is properly extracted. No check is done.
    541541//
    542 EventImp &StateMachineImp::AddTransition(int targetstate, const char *name, const char *states, const char *fmt)
     542EventImp &StateMachineImp::AddEvent(int targetstate, const char *name, const char *states, const char *fmt)
    543543{
    544544    EventImp *evt = CreateEvent(targetstate, name, fmt);
     
    564564//!    greater or equal zero. A negative target state is used to flag
    565565//!    commands which do not initiate a state transition. If this is
    566 //!    desired use AddConfiguration instead.
     566//!    desired use AddEvent instead.
    567567//!
    568568//! @param name
     
    575575//!    by this command.
    576576//
    577 EventImp &StateMachineImp::AddTransition(int targetstate, const char *name, int s1, int s2, int s3, int s4, int s5)
     577EventImp &StateMachineImp::AddEvent(int targetstate, const char *name, int s1, int s2, int s3, int s4, int s5)
    578578{
    579579    ostringstream str;
    580580    str << s1 << ' '  << s2 << ' ' << s3 << ' ' << s4 << ' ' << s5;
    581     return AddTransition(targetstate, name, str.str().c_str(), "");
     581    return AddEvent(targetstate, name, str.str().c_str(), "");
    582582}
    583583
     
    592592//!    greater or equal zero. A negative target state is used to flag
    593593//!    commands which do not initiate a state transition. If this is
    594 //!    desired use AddConfiguration instead.
     594//!    desired use AddEvent instead.
    595595//!
    596596//! @param name
     
    609609//!    by this command.
    610610//
    611 EventImp &StateMachineImp::AddTransition(int targetstate, const char *name, const char *fmt, int s1, int s2, int s3, int s4, int s5)
     611EventImp &StateMachineImp::AddEvent(int targetstate, const char *name, const char *fmt, int s1, int s2, int s3, int s4, int s5)
    612612{
    613613    ostringstream str;
    614614    str << s1 << ' '  << s2 << ' ' << s3 << ' ' << s4 << ' ' << s5;
    615     return AddTransition(targetstate, name, str.str().c_str(), fmt);
    616 }
    617 
    618 // --------------------------------------------------------------------------
    619 //
    620 //! This function calls AddTransition with a target-state of -1 which means
     615    return AddEvent(targetstate, name, str.str().c_str(), fmt);
     616}
     617
     618// --------------------------------------------------------------------------
     619//
     620//! This function calls AddEvent with a target-state of -1 which means
    621621//! that the command will not change the state at all. This shell be used
    622 //! for configuration commands. As well as in AddTransition the states in
     622//! for configuration commands. As well as in AddEvent the states in
    623623//! which such a configuration command is accepted can be given.
    624624//!
     
    638638//!    received commands is properly extracted. No check is done.
    639639//!
    640 EventImp &StateMachineImp::AddConfiguration(const char *name, const char *states, const char *fmt)
    641 {
    642     return AddTransition(-1, name, states, fmt);
    643 }
    644 
    645 // --------------------------------------------------------------------------
    646 //
    647 //! This function calls AddTransition with a target-state of -1 which means
     640EventImp &StateMachineImp::AddEvent(const char *name, const char *states, const char *fmt)
     641{
     642    return AddEvent(-1, name, states, fmt);
     643}
     644
     645// --------------------------------------------------------------------------
     646//
     647//! This function calls AddEvent with a target-state of -1 which means
    648648//! that the command will not change the state at all. This shell be used
    649 //! for configuration commands. As well as in AddTransition the states in
     649//! for configuration commands. As well as in AddEvent the states in
    650650//! which such a configuration command is accepted can be given.
    651651//!
     
    659659//!    by this command.
    660660//
    661 EventImp &StateMachineImp::AddConfiguration(const char *name, int s1, int s2, int s3, int s4, int s5)
    662 {
    663     return AddTransition(-1, name, s1, s2, s3, s4, s5);
    664 }
    665 
    666 // --------------------------------------------------------------------------
    667 //
    668 //! This function calls AddTransition with a target-state of -1 which means
     661EventImp &StateMachineImp::AddEvent(const char *name, int s1, int s2, int s3, int s4, int s5)
     662{
     663    return AddEvent(-1, name, s1, s2, s3, s4, s5);
     664}
     665
     666// --------------------------------------------------------------------------
     667//
     668//! This function calls AddEvent with a target-state of -1 which means
    669669//! that the command will not change the state at all. This shell be used
    670 //! for configuration commands. As well as in AddTransition the states in
     670//! for configuration commands. As well as in AddEvent the states in
    671671//! which such a configuration command is accepted can be given.
    672672//!
     
    686686//!    by this command.
    687687//
    688 EventImp &StateMachineImp::AddConfiguration(const char *name, const char *fmt, int s1, int s2, int s3, int s4, int s5)
    689 {
    690     return AddTransition(-1, name, fmt, s1, s2, s3, s4, s5);
     688EventImp &StateMachineImp::AddEvent(const char *name, const char *fmt, int s1, int s2, int s3, int s4, int s5)
     689{
     690    return AddEvent(-1, name, fmt, s1, s2, s3, s4, s5);
    691691}
    692692
  • trunk/FACT++/src/StateMachineImp.h

    r10385 r10688  
    7272    virtual std::string SetCurrentState(int state, const char *txt="", const std::string &cmd="");
    7373
    74     EventImp &AddTransition(int targetstate, const char *name, const char *states, const char *fmt);
    75     EventImp &AddTransition(int targetstate, const char *name, int s1=-1, int s2=-1, int s3=-1, int s4=-1, int s5=-1);
    76     EventImp &AddTransition(int targetstate, const char *name, const char *fmt, int s1=-1, int s2=-1, int s3=-1, int s4=-1, int s5=-1);
    77 
    78     EventImp &AddConfiguration(const char *name, const char *states, const char *fmt);
    79     EventImp &AddConfiguration(const char *name, int s1=-1, int s2=-1, int s3=-1, int s4=-1, int s5=-1);
    80     EventImp &AddConfiguration(const char *name, const char *fmt, int s1=-1, int s2=-1, int s3=-1, int s4=-1, int s5=-1);
     74    EventImp &AddEvent(int targetstate, const char *name, const char *states, const char *fmt);
     75    EventImp &AddEvent(int targetstate, const char *name, int s1=-1, int s2=-1, int s3=-1, int s4=-1, int s5=-1);
     76    EventImp &AddEvent(int targetstate, const char *name, const char *fmt, int s1=-1, int s2=-1, int s3=-1, int s4=-1, int s5=-1);
     77
     78    EventImp &AddEvent(const char *name, const char *states, const char *fmt);
     79    EventImp &AddEvent(const char *name, int s1=-1, int s2=-1, int s3=-1, int s4=-1, int s5=-1);
     80    EventImp &AddEvent(const char *name, const char *fmt, int s1=-1, int s2=-1, int s3=-1, int s4=-1, int s5=-1);
    8181
    8282    virtual void AddStateName(const int state, const std::string &name, const std::string &doc="");
  • 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.");
  • trunk/FACT++/src/dclient5.cc

    r10612 r10688  
    255255        AddStateName(kSM_Stopping,      "Stopping");
    256256
    257         AddTransition(kSM_Running,   "START", kSM_Connected).
     257        AddEvent(kSM_Running,   "START", kSM_Connected).
    258258            AssignFunction(boost::bind(&StateMachineFAD::Start, this, _1, 5));
    259         AddTransition(kSM_Connected, "STOP",  kSM_Running);
    260 
    261         AddConfiguration("TIME", kSM_Running);
    262         AddConfiguration("LED",  kSM_Connected);
    263 
    264         T::AddConfiguration("TESTI",    "I");
    265         T::AddConfiguration("TESTI2",   "I:2");
    266         T::AddConfiguration("TESTIF",   "I:2;F:2");
    267         T::AddConfiguration("TESTIC",   "I:2;C");
    268 
    269         T::AddConfiguration("CMD", "C").
     259        AddEvent(kSM_Connected, "STOP",  kSM_Running);
     260
     261        AddEvent("TIME", kSM_Running);
     262        AddEvent("LED",  kSM_Connected);
     263
     264        T::AddEvent("TESTI",    "I");
     265        T::AddEvent("TESTI2",   "I:2");
     266        T::AddEvent("TESTIF",   "I:2;F:2");
     267        T::AddEvent("TESTIC",   "I:2;C");
     268
     269        T::AddEvent("CMD", "C").
    270270            AssignFunction(boost::bind(&StateMachineFAD::Command, this, _1));
    271271
    272         AddTransition(kSM_Reconnect, "RECONNECT");
    273 
    274         AddTransition(kSM_SetUrl, "SETURL", "C");
     272        AddEvent(kSM_Reconnect, "RECONNECT");
     273
     274        AddEvent(kSM_SetUrl, "SETURL", "C");
    275275    }
    276276
  • trunk/FACT++/src/ftmctrl.cc

    r10679 r10688  
    14011401
    14021402        // FTM Commands
    1403         AddConfiguration("TOGGLE_LED", kStateIdle)
     1403        AddEvent("TOGGLE_LED", kStateIdle)
    14041404            (Wrapper(boost::bind(&ConnectionFTM::CmdToggleLed, &fFTM)))
    14051405            ("toggle led");
    14061406
    1407         AddConfiguration("PING", kStateIdle)
     1407        AddEvent("PING", kStateIdle)
    14081408            (Wrapper(boost::bind(&ConnectionFTM::CmdPing, &fFTM)))
    14091409            ("send ping");
    14101410
    1411         AddConfiguration("REQUEST_DYNAMIC_DATA", kStateIdle)
     1411        AddEvent("REQUEST_DYNAMIC_DATA", kStateIdle)
    14121412            (Wrapper(boost::bind(&ConnectionFTM::CmdReqDynDat, &fFTM)))
    14131413            ("request transmission of dynamic data block");
    14141414
    1415         AddConfiguration("REQUEST_STATIC_DATA", kStateIdle)
     1415        AddEvent("REQUEST_STATIC_DATA", kStateIdle)
    14161416            (Wrapper(boost::bind(&ConnectionFTM::CmdReqStatDat, &fFTM)))
    14171417            ("request transmission of static data from FTM to memory");
    14181418
    1419         AddConfiguration("GET_REGISTER", "I", kStateIdle)
     1419        AddEvent("GET_REGISTER", "I", kStateIdle)
    14201420            (boost::bind(&StateMachineFTM::GetRegister, this, _1))
    14211421            ("read register from address addr"
    14221422            "|addr[short]:Address of register");
    14231423
    1424         AddConfiguration("SET_REGISTER", "I:2", kStateIdle)
     1424        AddEvent("SET_REGISTER", "I:2", kStateIdle)
    14251425            (boost::bind(&StateMachineFTM::SetRegister, this, _1))
    14261426            ("set register to value"
     
    14281428            "|val[short]:Value to be set");
    14291429
    1430         AddConfiguration("START_RUN", kStateIdle)
     1430        AddEvent("START_RUN", kStateIdle)
    14311431            (Wrapper(boost::bind(&ConnectionFTM::CmdStartRun, &fFTM)))
    14321432            ("start a run (start distributing triggers)");
    14331433
    1434         AddConfiguration("STOP_RUN", kStateTakingData)
     1434        AddEvent("STOP_RUN", kStateTakingData)
    14351435            (Wrapper(boost::bind(&ConnectionFTM::CmdStopRun, &fFTM)))
    14361436            ("stop a run (stop distributing triggers)");
    14371437
    1438         AddConfiguration("TAKE_N_EVENTS", "I", kStateIdle)
     1438        AddEvent("TAKE_N_EVENTS", "I", kStateIdle)
    14391439            (boost::bind(&StateMachineFTM::TakeNevents, this, _1))
    14401440            ("take n events (distribute n triggers)|number[int]:Number of events to be taken");
    14411441
    1442         AddConfiguration("DISABLE_REPORTS", "B", kStateIdle)
     1442        AddEvent("DISABLE_REPORTS", "B", kStateIdle)
    14431443            (boost::bind(&StateMachineFTM::DisableReports, this, _1))
    14441444            ("disable sending rate reports"
    14451445             "|status[bool]:disable or enable that the FTM sends rate reports (yes/no)");
    14461446
    1447         AddConfiguration("SET_THRESHOLD", "I:2", kStateIdle)
     1447        AddEvent("SET_THRESHOLD", "I:2", kStateIdle)
    14481448            (boost::bind(&StateMachineFTM::SetThreshold, this, _1))
    14491449            ("Set the comparator threshold"
     
    14511451             "|Threshold[counts]:Threshold to be set in binary counts");
    14521452
    1453         AddConfiguration("SET_PRESCALING", "I:1", kStateIdle)
     1453        AddEvent("SET_PRESCALING", "I:1", kStateIdle)
    14541454            (boost::bind(&StateMachineFTM::SetPrescaling, this, _1))
    14551455            (""
    14561456             "|[]:");
    14571457
    1458         AddConfiguration("ENABLE_FTU", "I:1;B:1", kStateIdle)
     1458        AddEvent("ENABLE_FTU", "I:1;B:1", kStateIdle)
    14591459            (boost::bind(&StateMachineFTM::EnableFTU, this, _1))
    14601460            ("Enable or disable FTU"
     
    14621462             "|Enable[bool]:Whether FTU should be enabled or disabled (yes/no)");
    14631463
    1464         AddConfiguration("TOGGLE_FTU", "I:1", kStateIdle)
     1464        AddEvent("TOGGLE_FTU", "I:1", kStateIdle)
    14651465            (boost::bind(&StateMachineFTM::ToggleFTU, this, _1))
    14661466            ("Toggle status of FTU (this is mainly meant to be used in the GUI)"
    14671467             "|Board[idx]:Index of the board (0-39)");
    14681468
    1469         AddConfiguration("SET_TRIGGER_INTERVAL", "I:1", kStateIdle)
     1469        AddEvent("SET_TRIGGER_INTERVAL", "I:1", kStateIdle)
    14701470            (boost::bind(&StateMachineFTM::SetTriggerInterval, this, _1))
    14711471            ("Sets the trigger interval which is the distance between two consecutive artificial triggers."
    14721472             "|interval[int]:The applied trigger interval is: interval*4ns+8ns");
    14731473
    1474         AddConfiguration("SET_TRIGGER_DELAY", "I:1", kStateIdle)
     1474        AddEvent("SET_TRIGGER_DELAY", "I:1", kStateIdle)
    14751475            (boost::bind(&StateMachineFTM::SetTriggerDelay, this, _1))
    14761476            (""
    14771477             "|delay[int]:The applied trigger delay is: delay*4ns+8ns");
    14781478
    1479         AddConfiguration("SET_TIME_MARKER_DELAY", "I:1", kStateIdle)
     1479        AddEvent("SET_TIME_MARKER_DELAY", "I:1", kStateIdle)
    14801480            (boost::bind(&StateMachineFTM::SetTimeMarkerDelay, this, _1))
    14811481            (""
    14821482            "|delay[int]:The applied time marker delay is: delay*4ns+8ns");
    14831483
    1484         AddConfiguration("SET_DEAD_TIME", "I:1", kStateIdle)
     1484        AddEvent("SET_DEAD_TIME", "I:1", kStateIdle)
    14851485            (boost::bind(&StateMachineFTM::SetDeadTime, this, _1))
    14861486            (""
    14871487            "|dead_time[int]:The applied dead time is: dead_time*4ns+8ns");
    14881488
    1489         AddConfiguration("ENABLE_TRIGGER", "B:1", kStateIdle)
     1489        AddEvent("ENABLE_TRIGGER", "B:1", kStateIdle)
    14901490            (boost::bind(&StateMachineFTM::Enable, this, _1, FTM::StaticData::kTrigger))
    14911491            ("Switch on the physics trigger"
     
    14931493
    14941494        // FIXME: Switch on/off depending on sequence
    1495         AddConfiguration("ENABLE_EXT1", "B:1", kStateIdle)
     1495        AddEvent("ENABLE_EXT1", "B:1", kStateIdle)
    14961496            (boost::bind(&StateMachineFTM::Enable, this, _1, FTM::StaticData::kExt1))
    14971497            ("Switch on the triggers through the first external line"
     
    14991499
    15001500        // FIXME: Switch on/off depending on sequence
    1501         AddConfiguration("ENABLE_EXT2", "B:1", kStateIdle)
     1501        AddEvent("ENABLE_EXT2", "B:1", kStateIdle)
    15021502            (boost::bind(&StateMachineFTM::Enable, this, _1, FTM::StaticData::kExt2))
    15031503            ("Switch on the triggers through the second external line"
    15041504             "|Enable[bool]:Enable ext2 trigger (yes/no)");
    15051505
    1506         AddConfiguration("ENABLE_VETO", "B:1", kStateIdle)
     1506        AddEvent("ENABLE_VETO", "B:1", kStateIdle)
    15071507            (boost::bind(&StateMachineFTM::Enable, this, _1, FTM::StaticData::kVeto))
    15081508            ("Enable veto line"
    15091509             "|Enable[bool]:Enable veto (yes/no)");
    15101510
    1511         AddConfiguration("SET_TRIGGER_SEQUENCE", "C:3", kStateIdle)
     1511        AddEvent("SET_TRIGGER_SEQUENCE", "C:3", kStateIdle)
    15121512            (boost::bind(&StateMachineFTM::SetTriggerSeq, this, _1))
    15131513            ("Setup the sequence of artificial triggers produced by the FTM"
     
    15161516             "|LPext[int]:number of triggers of the external light pulser");
    15171517
    1518         AddConfiguration("SET_TRIGGER_COINCIDENCE", "S:1", kStateIdle)
     1518        AddEvent("SET_TRIGGER_COINCIDENCE", "S:1", kStateIdle)
    15191519            (boost::bind(&StateMachineFTM::SetTriggerCoincidence, this, _1))
    15201520            ("Setup the coincidence condition for physcis triggers"
    15211521             "|N[int]:Number of requirered coincident triggers from sum-patches (1-40)");
    15221522
    1523         AddConfiguration("SET_TRIGGER_WINDOW", "S:1", kStateIdle)
     1523        AddEvent("SET_TRIGGER_WINDOW", "S:1", kStateIdle)
    15241524            (boost::bind(&StateMachineFTM::SetTriggerWindow, this, _1))
    15251525            ("");
    15261526
    1527         AddConfiguration("SET_CALIBRATION_COINCIDENCE", "S:1", kStateIdle)
     1527        AddEvent("SET_CALIBRATION_COINCIDENCE", "S:1", kStateIdle)
    15281528            (boost::bind(&StateMachineFTM::SetCalibCoincidence, this, _1))
    15291529            ("Setup the coincidence condition for artificial (calibration) triggers"
    15301530             "|N[int]:Number of requirered coincident triggers from sum-patches (1-40)");
    15311531
    1532         AddConfiguration("SET_CALIBRATION_WINDOW", "S:1", kStateIdle)
     1532        AddEvent("SET_CALIBRATION_WINDOW", "S:1", kStateIdle)
    15331533            (boost::bind(&StateMachineFTM::SetCalibWindow, this, _1))
    15341534            ("");
     
    15361536
    15371537        // Load/save static data block
    1538         T::AddConfiguration("SAVE", "C", kStateIdle)
     1538        T::AddEvent("SAVE", "C", kStateIdle)
    15391539            (boost::bind(&StateMachineFTM::SaveStaticData, this, _1))
    15401540            ("Saves the static data (FTM configuration) from memory to a file"
    15411541             "|filename[string]:Filename (can include a path), .bin is automatically added");
    15421542
    1543         T::AddConfiguration("LOAD", "C", kStateIdle)
     1543        T::AddEvent("LOAD", "C", kStateIdle)
    15441544            (boost::bind(&StateMachineFTM::LoadStaticData, this, _1))
    15451545            ("Loads the static data (FTM configuration) from a file into memory and sends it to the FTM"
     
    15491549
    15501550        // Verbosity commands
    1551         T::AddConfiguration("SET_VERBOSE", "B")
     1551        T::AddEvent("SET_VERBOSE", "B")
    15521552            (boost::bind(&StateMachineFTM::SetVerbosity, this, _1))
    15531553            ("set verbosity state"
    15541554             "|verbosity[bool]:disable or enable verbosity for received data (yes/no), except dynamic data");
    15551555
    1556         T::AddConfiguration("SET_HEX_OUTPUT", "B")
     1556        T::AddEvent("SET_HEX_OUTPUT", "B")
    15571557            (boost::bind(&StateMachineFTM::SetHexOutput, this, _1))
    15581558            ("enable or disable hex output for received data"
    15591559             "|hexout[bool]:disable or enable hex output for received data (yes/no)");
    15601560
    1561         T::AddConfiguration("SET_DYNAMIC_OUTPUT", "B")
     1561        T::AddEvent("SET_DYNAMIC_OUTPUT", "B")
    15621562            (boost::bind(&StateMachineFTM::SetDynamicOut, this, _1))
    15631563            ("enable or disable output for received dynamic data (data is still broadcasted via Dim)"
     
    15661566
    15671567        // Conenction commands
    1568         AddConfiguration("DISCONNECT", kStateConnected, kStateIdle)
     1568        AddEvent("DISCONNECT", kStateConnected, kStateIdle)
    15691569            (boost::bind(&StateMachineFTM::Disconnect, this))
    15701570            ("disconnect from ethernet");
    15711571
    1572         AddConfiguration("RECONNECT", "O", kStateDisconnected, kStateConnected, kStateIdle)
     1572        AddEvent("RECONNECT", "O", kStateDisconnected, kStateConnected, kStateIdle)
    15731573            (boost::bind(&StateMachineFTM::Reconnect, this, _1))
    15741574            ("(Re)connect ethernet connection to FTM, a new address can be given"
     
    15761576
    15771577        // Other
    1578         AddTransition(kCmdTest, "TEST", "O")
     1578        AddEvent(kCmdTest, "TEST", "O")
    15791579            (boost::bind(&StateMachineFTM::Test, this, _1))
    15801580            ("Just for test purpose, do not use");
  • trunk/FACT++/src/scheduler.cc

    r10624 r10688  
    638638        //AddStateName(kSM_Comitting,   "Comitting");
    639639
    640         AddTransition(kSM_Scheduling, "SCHEDULE", T::kSM_Ready);
    641         //AddTransition(kSM_Comitting,  "COMMIT",   T::kSM_Ready);
     640        AddEvent(kSM_Scheduling, "SCHEDULE", T::kSM_Ready);
     641        //AddEvent(kSM_Comitting,  "COMMIT",   T::kSM_Ready);
    642642
    643643        T::PrintListOfEvents();
Note: See TracChangeset for help on using the changeset viewer.