Changeset 10688 for trunk/FACT++
- Timestamp:
- 05/12/11 21:52:22 (14 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/StateMachineImp.cc
r10657 r10688 109 109 //! Subsequent, i.e. derived classes should setup all allowed state 110 110 //! transitions as well as all allowed configuration event by 111 //! Add Transition, AddConfigurationand AddStateName.111 //! AddEvent and AddStateName. 112 112 //! 113 113 //! @param out … … 492 492 //! greater or equal zero. A negative target state is used to flag 493 493 //! commands which do not initiate a state transition. If this is 494 //! desired use Add Configurationinstead.494 //! desired use AddEvent instead. 495 495 //! 496 496 //! @param name … … 523 523 //! greater or equal zero. A negative target state is used to flag 524 524 //! commands which do not initiate a state transition. If this is 525 //! desired use Add Configurationinstead.525 //! desired use AddEvent instead. 526 526 //! 527 527 //! @param name … … 540 540 //! received commands is properly extracted. No check is done. 541 541 // 542 EventImp &StateMachineImp::Add Transition(int targetstate, const char *name, const char *states, const char *fmt)542 EventImp &StateMachineImp::AddEvent(int targetstate, const char *name, const char *states, const char *fmt) 543 543 { 544 544 EventImp *evt = CreateEvent(targetstate, name, fmt); … … 564 564 //! greater or equal zero. A negative target state is used to flag 565 565 //! commands which do not initiate a state transition. If this is 566 //! desired use Add Configurationinstead.566 //! desired use AddEvent instead. 567 567 //! 568 568 //! @param name … … 575 575 //! by this command. 576 576 // 577 EventImp &StateMachineImp::Add Transition(int targetstate, const char *name, int s1, int s2, int s3, int s4, int s5)577 EventImp &StateMachineImp::AddEvent(int targetstate, const char *name, int s1, int s2, int s3, int s4, int s5) 578 578 { 579 579 ostringstream str; 580 580 str << s1 << ' ' << s2 << ' ' << s3 << ' ' << s4 << ' ' << s5; 581 return Add Transition(targetstate, name, str.str().c_str(), "");581 return AddEvent(targetstate, name, str.str().c_str(), ""); 582 582 } 583 583 … … 592 592 //! greater or equal zero. A negative target state is used to flag 593 593 //! commands which do not initiate a state transition. If this is 594 //! desired use Add Configurationinstead.594 //! desired use AddEvent instead. 595 595 //! 596 596 //! @param name … … 609 609 //! by this command. 610 610 // 611 EventImp &StateMachineImp::Add Transition(int targetstate, const char *name, const char *fmt, int s1, int s2, int s3, int s4, int s5)611 EventImp &StateMachineImp::AddEvent(int targetstate, const char *name, const char *fmt, int s1, int s2, int s3, int s4, int s5) 612 612 { 613 613 ostringstream str; 614 614 str << s1 << ' ' << s2 << ' ' << s3 << ' ' << s4 << ' ' << s5; 615 return Add Transition(targetstate, name, str.str().c_str(), fmt);616 } 617 618 // -------------------------------------------------------------------------- 619 // 620 //! This function calls Add Transitionwith a target-state of -1 which means615 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 621 621 //! that the command will not change the state at all. This shell be used 622 //! for configuration commands. As well as in Add Transitionthe states in622 //! for configuration commands. As well as in AddEvent the states in 623 623 //! which such a configuration command is accepted can be given. 624 624 //! … … 638 638 //! received commands is properly extracted. No check is done. 639 639 //! 640 EventImp &StateMachineImp::Add Configuration(const char *name, const char *states, const char *fmt)641 { 642 return Add Transition(-1, name, states, fmt);643 } 644 645 // -------------------------------------------------------------------------- 646 // 647 //! This function calls Add Transitionwith a target-state of -1 which means640 EventImp &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 648 648 //! that the command will not change the state at all. This shell be used 649 //! for configuration commands. As well as in Add Transitionthe states in649 //! for configuration commands. As well as in AddEvent the states in 650 650 //! which such a configuration command is accepted can be given. 651 651 //! … … 659 659 //! by this command. 660 660 // 661 EventImp &StateMachineImp::Add Configuration(const char *name, int s1, int s2, int s3, int s4, int s5)662 { 663 return Add Transition(-1, name, s1, s2, s3, s4, s5);664 } 665 666 // -------------------------------------------------------------------------- 667 // 668 //! This function calls Add Transitionwith a target-state of -1 which means661 EventImp &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 669 669 //! that the command will not change the state at all. This shell be used 670 //! for configuration commands. As well as in Add Transitionthe states in670 //! for configuration commands. As well as in AddEvent the states in 671 671 //! which such a configuration command is accepted can be given. 672 672 //! … … 686 686 //! by this command. 687 687 // 688 EventImp &StateMachineImp::Add Configuration(const char *name, const char *fmt, int s1, int s2, int s3, int s4, int s5)689 { 690 return Add Transition(-1, name, fmt, s1, s2, s3, s4, s5);688 EventImp &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); 691 691 } 692 692 -
trunk/FACT++/src/StateMachineImp.h
r10385 r10688 72 72 virtual std::string SetCurrentState(int state, const char *txt="", const std::string &cmd=""); 73 73 74 EventImp &Add Transition(int targetstate, const char *name, const char *states, const char *fmt);75 EventImp &Add Transition(int targetstate, const char *name, int s1=-1, int s2=-1, int s3=-1, int s4=-1, int s5=-1);76 EventImp &Add Transition(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 &Add Configuration(const char *name, const char *states, const char *fmt);79 EventImp &Add Configuration(const char *name, int s1=-1, int s2=-1, int s3=-1, int s4=-1, int s5=-1);80 EventImp &Add Configuration(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); 81 81 82 82 virtual void AddStateName(const int state, const std::string &name, const std::string &doc=""); -
trunk/FACT++/src/dataLogger.cc
r10676 r10688 590 590 591 591 /*Add the possible transitions for this machine*/ 592 Add Transition(kSM_NightlyOpen, fTransStart, kSM_Ready, kSM_BadNightlyConfig)592 AddEvent(kSM_NightlyOpen, fTransStart, kSM_Ready, kSM_BadNightlyConfig) 593 593 (boost::bind(&DataLogger::StartPlease, this)) 594 594 ("Start the nightly logging. Nightly file location must be specified already"); 595 595 596 Add Transition(kSM_Ready, fTransStop, kSM_NightlyOpen, kSM_WaitingRun, kSM_Logging)596 AddEvent(kSM_Ready, fTransStop, kSM_NightlyOpen, kSM_WaitingRun, kSM_Logging) 597 597 (boost::bind(&DataLogger::GoToReadyPlease, this)) 598 598 ("Stop all data logging, close all files."); 599 599 600 Add Transition(kSM_Logging, fTransStartRun, kSM_WaitingRun, kSM_BadRunConfig)600 AddEvent(kSM_Logging, fTransStartRun, kSM_WaitingRun, kSM_BadRunConfig) 601 601 (boost::bind(&DataLogger::StartRunPlease, this)) 602 602 ("Start the run logging. Run file location must be specified already."); 603 603 604 Add Transition(kSM_WaitingRun, fTransStopRun, kSM_Logging)604 AddEvent(kSM_WaitingRun, fTransStopRun, kSM_Logging) 605 605 (boost::bind(&DataLogger::StopRunPlease, this)) 606 606 ("Wait for a run to be started, open run-files as soon as a run number arrives."); 607 607 608 Add Transition(kSM_Ready, fTransReset, kSM_Error, kSM_BadNightlyConfig, kSM_BadRunConfig, kSM_Error)608 AddEvent(kSM_Ready, fTransReset, kSM_Error, kSM_BadNightlyConfig, kSM_BadRunConfig, kSM_Error) 609 609 (boost::bind(&DataLogger::GoToReadyPlease, this)) 610 610 ("Transition to exit error states. Closes the nightly file if already opened."); 611 611 612 Add Transition(kSM_WaitingRun, fTransWait, kSM_NightlyOpen)612 AddEvent(kSM_WaitingRun, fTransWait, kSM_NightlyOpen) 613 613 (boost::bind(&DataLogger::NightlyToWaitRunPlease, this)); 614 614 615 615 /*Add the possible configurations for this machine*/ 616 Add Configuration(fConfigDay, "C", kSM_Ready, kSM_BadNightlyConfig)616 AddEvent(fConfigDay, "C", kSM_Ready, kSM_BadNightlyConfig) 617 617 (boost::bind(&DataLogger::ConfigureNightlyFileName, this, _1)) 618 618 ("Configure the folder for the nightly files." 619 619 "|Path[string]:Absolute or relative path name where the nightly files should be stored."); 620 620 621 Add Configuration(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) 622 622 (boost::bind(&DataLogger::ConfigureRunFileName, this, _1)) 623 623 ("Configure the folder for the run files." 624 624 "|Path[string]:Absolute or relative path name where the run files should be stored."); 625 625 626 Add Configuration(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) 627 627 (boost::bind(&DataLogger::ConfigureRunNumber, this, _1)) 628 628 ("configure the run number. cannot be done in logging state"); … … 633 633 //is already done in StateMachineImp.cc 634 634 //Thus I'll simply add a configuration, which I will treat as the logging command 635 Add Configuration(fConfigLog, "C", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_BadRunConfig)635 AddEvent(fConfigLog, "C", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_BadRunConfig) 636 636 (boost::bind(&DataLogger::LogMessagePlease, this, _1)) 637 637 ("Log a single message to the log-files." … … 643 643 str << " " << kSM_BadRunConfig; 644 644 645 Add Configuration(fPrintCommand, str.str().c_str(), "")646 // Add Configuration(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) 647 647 (boost::bind(&DataLogger::PrintStatePlease, this, _1)) 648 648 ("Print information about the internal status of the data logger."); … … 688 688 689 689 //provide services control commands 690 Add Configuration(fDebugOnOff, "B:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)690 AddEvent(fDebugOnOff, "B:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready) 691 691 (boost::bind(&DataLogger::SetDebugOnOff, this, _1)) 692 692 ("Switch debug mode on off. Debug mode prints ifnormation about every service written to a file." 693 693 "|Enable[bool]:Enable of disable debuig mode (yes/no)."); 694 694 695 Add Configuration(fStatsPeriod, "F", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)695 AddEvent(fStatsPeriod, "F", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready) 696 696 (boost::bind(&DataLogger::SetStatsPeriod, this, _1)) 697 697 ("Interval in which the data-logger statitistics service (STATS) is updated." 698 698 "Interval[s]:Floating point value in seconds."); 699 699 700 Add Configuration(fStartStopOpenedFiles, "B:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)700 AddEvent(fStartStopOpenedFiles, "B:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready) 701 701 (boost::bind(&DataLogger::SetOpenedFilesOnOff ,this, _1)) 702 702 ("Can be used to switch the service off which distributes information about the open files."); 703 703 704 Add Configuration(fStartStopNumSubsAndFits, "B:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)704 AddEvent(fStartStopNumSubsAndFits, "B:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready) 705 705 (boost::bind(&DataLogger::SetNumSubsAndFitsOnOff, this, _1)) 706 706 ("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 255 255 AddStateName(kSM_Stopping, "Stopping"); 256 256 257 Add Transition(kSM_Running, "START", kSM_Connected).257 AddEvent(kSM_Running, "START", kSM_Connected). 258 258 AssignFunction(boost::bind(&StateMachineFAD::Start, this, _1, 5)); 259 Add Transition(kSM_Connected, "STOP", kSM_Running);260 261 Add Configuration("TIME", kSM_Running);262 Add Configuration("LED", kSM_Connected);263 264 T::Add Configuration("TESTI", "I");265 T::Add Configuration("TESTI2", "I:2");266 T::Add Configuration("TESTIF", "I:2;F:2");267 T::Add Configuration("TESTIC", "I:2;C");268 269 T::Add Configuration("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"). 270 270 AssignFunction(boost::bind(&StateMachineFAD::Command, this, _1)); 271 271 272 Add Transition(kSM_Reconnect, "RECONNECT");273 274 Add Transition(kSM_SetUrl, "SETURL", "C");272 AddEvent(kSM_Reconnect, "RECONNECT"); 273 274 AddEvent(kSM_SetUrl, "SETURL", "C"); 275 275 } 276 276 -
trunk/FACT++/src/ftmctrl.cc
r10679 r10688 1401 1401 1402 1402 // FTM Commands 1403 Add Configuration("TOGGLE_LED", kStateIdle)1403 AddEvent("TOGGLE_LED", kStateIdle) 1404 1404 (Wrapper(boost::bind(&ConnectionFTM::CmdToggleLed, &fFTM))) 1405 1405 ("toggle led"); 1406 1406 1407 Add Configuration("PING", kStateIdle)1407 AddEvent("PING", kStateIdle) 1408 1408 (Wrapper(boost::bind(&ConnectionFTM::CmdPing, &fFTM))) 1409 1409 ("send ping"); 1410 1410 1411 Add Configuration("REQUEST_DYNAMIC_DATA", kStateIdle)1411 AddEvent("REQUEST_DYNAMIC_DATA", kStateIdle) 1412 1412 (Wrapper(boost::bind(&ConnectionFTM::CmdReqDynDat, &fFTM))) 1413 1413 ("request transmission of dynamic data block"); 1414 1414 1415 Add Configuration("REQUEST_STATIC_DATA", kStateIdle)1415 AddEvent("REQUEST_STATIC_DATA", kStateIdle) 1416 1416 (Wrapper(boost::bind(&ConnectionFTM::CmdReqStatDat, &fFTM))) 1417 1417 ("request transmission of static data from FTM to memory"); 1418 1418 1419 Add Configuration("GET_REGISTER", "I", kStateIdle)1419 AddEvent("GET_REGISTER", "I", kStateIdle) 1420 1420 (boost::bind(&StateMachineFTM::GetRegister, this, _1)) 1421 1421 ("read register from address addr" 1422 1422 "|addr[short]:Address of register"); 1423 1423 1424 Add Configuration("SET_REGISTER", "I:2", kStateIdle)1424 AddEvent("SET_REGISTER", "I:2", kStateIdle) 1425 1425 (boost::bind(&StateMachineFTM::SetRegister, this, _1)) 1426 1426 ("set register to value" … … 1428 1428 "|val[short]:Value to be set"); 1429 1429 1430 Add Configuration("START_RUN", kStateIdle)1430 AddEvent("START_RUN", kStateIdle) 1431 1431 (Wrapper(boost::bind(&ConnectionFTM::CmdStartRun, &fFTM))) 1432 1432 ("start a run (start distributing triggers)"); 1433 1433 1434 Add Configuration("STOP_RUN", kStateTakingData)1434 AddEvent("STOP_RUN", kStateTakingData) 1435 1435 (Wrapper(boost::bind(&ConnectionFTM::CmdStopRun, &fFTM))) 1436 1436 ("stop a run (stop distributing triggers)"); 1437 1437 1438 Add Configuration("TAKE_N_EVENTS", "I", kStateIdle)1438 AddEvent("TAKE_N_EVENTS", "I", kStateIdle) 1439 1439 (boost::bind(&StateMachineFTM::TakeNevents, this, _1)) 1440 1440 ("take n events (distribute n triggers)|number[int]:Number of events to be taken"); 1441 1441 1442 Add Configuration("DISABLE_REPORTS", "B", kStateIdle)1442 AddEvent("DISABLE_REPORTS", "B", kStateIdle) 1443 1443 (boost::bind(&StateMachineFTM::DisableReports, this, _1)) 1444 1444 ("disable sending rate reports" 1445 1445 "|status[bool]:disable or enable that the FTM sends rate reports (yes/no)"); 1446 1446 1447 Add Configuration("SET_THRESHOLD", "I:2", kStateIdle)1447 AddEvent("SET_THRESHOLD", "I:2", kStateIdle) 1448 1448 (boost::bind(&StateMachineFTM::SetThreshold, this, _1)) 1449 1449 ("Set the comparator threshold" … … 1451 1451 "|Threshold[counts]:Threshold to be set in binary counts"); 1452 1452 1453 Add Configuration("SET_PRESCALING", "I:1", kStateIdle)1453 AddEvent("SET_PRESCALING", "I:1", kStateIdle) 1454 1454 (boost::bind(&StateMachineFTM::SetPrescaling, this, _1)) 1455 1455 ("" 1456 1456 "|[]:"); 1457 1457 1458 Add Configuration("ENABLE_FTU", "I:1;B:1", kStateIdle)1458 AddEvent("ENABLE_FTU", "I:1;B:1", kStateIdle) 1459 1459 (boost::bind(&StateMachineFTM::EnableFTU, this, _1)) 1460 1460 ("Enable or disable FTU" … … 1462 1462 "|Enable[bool]:Whether FTU should be enabled or disabled (yes/no)"); 1463 1463 1464 Add Configuration("TOGGLE_FTU", "I:1", kStateIdle)1464 AddEvent("TOGGLE_FTU", "I:1", kStateIdle) 1465 1465 (boost::bind(&StateMachineFTM::ToggleFTU, this, _1)) 1466 1466 ("Toggle status of FTU (this is mainly meant to be used in the GUI)" 1467 1467 "|Board[idx]:Index of the board (0-39)"); 1468 1468 1469 Add Configuration("SET_TRIGGER_INTERVAL", "I:1", kStateIdle)1469 AddEvent("SET_TRIGGER_INTERVAL", "I:1", kStateIdle) 1470 1470 (boost::bind(&StateMachineFTM::SetTriggerInterval, this, _1)) 1471 1471 ("Sets the trigger interval which is the distance between two consecutive artificial triggers." 1472 1472 "|interval[int]:The applied trigger interval is: interval*4ns+8ns"); 1473 1473 1474 Add Configuration("SET_TRIGGER_DELAY", "I:1", kStateIdle)1474 AddEvent("SET_TRIGGER_DELAY", "I:1", kStateIdle) 1475 1475 (boost::bind(&StateMachineFTM::SetTriggerDelay, this, _1)) 1476 1476 ("" 1477 1477 "|delay[int]:The applied trigger delay is: delay*4ns+8ns"); 1478 1478 1479 Add Configuration("SET_TIME_MARKER_DELAY", "I:1", kStateIdle)1479 AddEvent("SET_TIME_MARKER_DELAY", "I:1", kStateIdle) 1480 1480 (boost::bind(&StateMachineFTM::SetTimeMarkerDelay, this, _1)) 1481 1481 ("" 1482 1482 "|delay[int]:The applied time marker delay is: delay*4ns+8ns"); 1483 1483 1484 Add Configuration("SET_DEAD_TIME", "I:1", kStateIdle)1484 AddEvent("SET_DEAD_TIME", "I:1", kStateIdle) 1485 1485 (boost::bind(&StateMachineFTM::SetDeadTime, this, _1)) 1486 1486 ("" 1487 1487 "|dead_time[int]:The applied dead time is: dead_time*4ns+8ns"); 1488 1488 1489 Add Configuration("ENABLE_TRIGGER", "B:1", kStateIdle)1489 AddEvent("ENABLE_TRIGGER", "B:1", kStateIdle) 1490 1490 (boost::bind(&StateMachineFTM::Enable, this, _1, FTM::StaticData::kTrigger)) 1491 1491 ("Switch on the physics trigger" … … 1493 1493 1494 1494 // FIXME: Switch on/off depending on sequence 1495 Add Configuration("ENABLE_EXT1", "B:1", kStateIdle)1495 AddEvent("ENABLE_EXT1", "B:1", kStateIdle) 1496 1496 (boost::bind(&StateMachineFTM::Enable, this, _1, FTM::StaticData::kExt1)) 1497 1497 ("Switch on the triggers through the first external line" … … 1499 1499 1500 1500 // FIXME: Switch on/off depending on sequence 1501 Add Configuration("ENABLE_EXT2", "B:1", kStateIdle)1501 AddEvent("ENABLE_EXT2", "B:1", kStateIdle) 1502 1502 (boost::bind(&StateMachineFTM::Enable, this, _1, FTM::StaticData::kExt2)) 1503 1503 ("Switch on the triggers through the second external line" 1504 1504 "|Enable[bool]:Enable ext2 trigger (yes/no)"); 1505 1505 1506 Add Configuration("ENABLE_VETO", "B:1", kStateIdle)1506 AddEvent("ENABLE_VETO", "B:1", kStateIdle) 1507 1507 (boost::bind(&StateMachineFTM::Enable, this, _1, FTM::StaticData::kVeto)) 1508 1508 ("Enable veto line" 1509 1509 "|Enable[bool]:Enable veto (yes/no)"); 1510 1510 1511 Add Configuration("SET_TRIGGER_SEQUENCE", "C:3", kStateIdle)1511 AddEvent("SET_TRIGGER_SEQUENCE", "C:3", kStateIdle) 1512 1512 (boost::bind(&StateMachineFTM::SetTriggerSeq, this, _1)) 1513 1513 ("Setup the sequence of artificial triggers produced by the FTM" … … 1516 1516 "|LPext[int]:number of triggers of the external light pulser"); 1517 1517 1518 Add Configuration("SET_TRIGGER_COINCIDENCE", "S:1", kStateIdle)1518 AddEvent("SET_TRIGGER_COINCIDENCE", "S:1", kStateIdle) 1519 1519 (boost::bind(&StateMachineFTM::SetTriggerCoincidence, this, _1)) 1520 1520 ("Setup the coincidence condition for physcis triggers" 1521 1521 "|N[int]:Number of requirered coincident triggers from sum-patches (1-40)"); 1522 1522 1523 Add Configuration("SET_TRIGGER_WINDOW", "S:1", kStateIdle)1523 AddEvent("SET_TRIGGER_WINDOW", "S:1", kStateIdle) 1524 1524 (boost::bind(&StateMachineFTM::SetTriggerWindow, this, _1)) 1525 1525 (""); 1526 1526 1527 Add Configuration("SET_CALIBRATION_COINCIDENCE", "S:1", kStateIdle)1527 AddEvent("SET_CALIBRATION_COINCIDENCE", "S:1", kStateIdle) 1528 1528 (boost::bind(&StateMachineFTM::SetCalibCoincidence, this, _1)) 1529 1529 ("Setup the coincidence condition for artificial (calibration) triggers" 1530 1530 "|N[int]:Number of requirered coincident triggers from sum-patches (1-40)"); 1531 1531 1532 Add Configuration("SET_CALIBRATION_WINDOW", "S:1", kStateIdle)1532 AddEvent("SET_CALIBRATION_WINDOW", "S:1", kStateIdle) 1533 1533 (boost::bind(&StateMachineFTM::SetCalibWindow, this, _1)) 1534 1534 (""); … … 1536 1536 1537 1537 // Load/save static data block 1538 T::Add Configuration("SAVE", "C", kStateIdle)1538 T::AddEvent("SAVE", "C", kStateIdle) 1539 1539 (boost::bind(&StateMachineFTM::SaveStaticData, this, _1)) 1540 1540 ("Saves the static data (FTM configuration) from memory to a file" 1541 1541 "|filename[string]:Filename (can include a path), .bin is automatically added"); 1542 1542 1543 T::Add Configuration("LOAD", "C", kStateIdle)1543 T::AddEvent("LOAD", "C", kStateIdle) 1544 1544 (boost::bind(&StateMachineFTM::LoadStaticData, this, _1)) 1545 1545 ("Loads the static data (FTM configuration) from a file into memory and sends it to the FTM" … … 1549 1549 1550 1550 // Verbosity commands 1551 T::Add Configuration("SET_VERBOSE", "B")1551 T::AddEvent("SET_VERBOSE", "B") 1552 1552 (boost::bind(&StateMachineFTM::SetVerbosity, this, _1)) 1553 1553 ("set verbosity state" 1554 1554 "|verbosity[bool]:disable or enable verbosity for received data (yes/no), except dynamic data"); 1555 1555 1556 T::Add Configuration("SET_HEX_OUTPUT", "B")1556 T::AddEvent("SET_HEX_OUTPUT", "B") 1557 1557 (boost::bind(&StateMachineFTM::SetHexOutput, this, _1)) 1558 1558 ("enable or disable hex output for received data" 1559 1559 "|hexout[bool]:disable or enable hex output for received data (yes/no)"); 1560 1560 1561 T::Add Configuration("SET_DYNAMIC_OUTPUT", "B")1561 T::AddEvent("SET_DYNAMIC_OUTPUT", "B") 1562 1562 (boost::bind(&StateMachineFTM::SetDynamicOut, this, _1)) 1563 1563 ("enable or disable output for received dynamic data (data is still broadcasted via Dim)" … … 1566 1566 1567 1567 // Conenction commands 1568 Add Configuration("DISCONNECT", kStateConnected, kStateIdle)1568 AddEvent("DISCONNECT", kStateConnected, kStateIdle) 1569 1569 (boost::bind(&StateMachineFTM::Disconnect, this)) 1570 1570 ("disconnect from ethernet"); 1571 1571 1572 Add Configuration("RECONNECT", "O", kStateDisconnected, kStateConnected, kStateIdle)1572 AddEvent("RECONNECT", "O", kStateDisconnected, kStateConnected, kStateIdle) 1573 1573 (boost::bind(&StateMachineFTM::Reconnect, this, _1)) 1574 1574 ("(Re)connect ethernet connection to FTM, a new address can be given" … … 1576 1576 1577 1577 // Other 1578 Add Transition(kCmdTest, "TEST", "O")1578 AddEvent(kCmdTest, "TEST", "O") 1579 1579 (boost::bind(&StateMachineFTM::Test, this, _1)) 1580 1580 ("Just for test purpose, do not use"); -
trunk/FACT++/src/scheduler.cc
r10624 r10688 638 638 //AddStateName(kSM_Comitting, "Comitting"); 639 639 640 Add Transition(kSM_Scheduling, "SCHEDULE", T::kSM_Ready);641 //Add Transition(kSM_Comitting, "COMMIT", T::kSM_Ready);640 AddEvent(kSM_Scheduling, "SCHEDULE", T::kSM_Ready); 641 //AddEvent(kSM_Comitting, "COMMIT", T::kSM_Ready); 642 642 643 643 T::PrintListOfEvents();
Note:
See TracChangeset
for help on using the changeset viewer.