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/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");
Note: See TracChangeset for help on using the changeset viewer.