Changeset 11481 for trunk/FACT++/src
- Timestamp:
- 07/20/11 08:03:38 (13 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Configuration.cc
r11479 r11481 332 332 #include <iomanip> 333 333 334 #include <boost/bind.hpp>335 334 #include <boost/regex.hpp> 336 335 #include <boost/filesystem.hpp> … … 512 511 Configuration::Configuration(const string &prgname) : fName(UnLibToolize(prgname)), 513 512 fNameMapper(bind1st(mem_fun(&Configuration::DefaultMapper), this)), 514 fPrintUsage(b oost::bind(&Configuration::PrintUsage, this))513 fPrintUsage(bind(&Configuration::PrintUsage, this)) 515 514 { 516 515 po::options_description generic("Generic options"); … … 877 876 //! 878 877 // 879 void Configuration::SetNameMapper(const boost::function<string(string)> &func)878 void Configuration::SetNameMapper(const function<string(string)> &func) 880 879 { 881 880 fNameMapper = func; … … 887 886 } 888 887 889 void Configuration::SetPrintUsage(const boost::function<void(void)> &func)888 void Configuration::SetPrintUsage(const function<void(void)> &func) 890 889 { 891 890 fPrintUsage = func; … … 894 893 void Configuration::SetPrintUsage() 895 894 { 896 fPrintUsage = b oost::bind(&Configuration::PrintUsage, this);897 } 898 899 void Configuration::SetPrintVersion(const boost::function<void(const string&)> &func)895 fPrintUsage = bind(&Configuration::PrintUsage, this); 896 } 897 898 void Configuration::SetPrintVersion(const function<void(const string&)> &func) 900 899 { 901 900 fPrintVersion = func; … … 904 903 void Configuration::SetPrintVersion() 905 904 { 906 fPrintVersion = boost::function<void(const string&)>();905 fPrintVersion = function<void(const string&)>(); 907 906 } 908 907 … … 1310 1309 #endif 1311 1310 1312 if ( !fPrintVersion.empty())1311 if (fPrintVersion) 1313 1312 { 1314 1313 fPrintVersion(fName); -
trunk/FACT++/src/Configuration.h
r11387 r11481 46 46 47 47 /// Pointer to the mapper function for environment variables 48 boost::function<std::string(std::string)> fNameMapper;49 boost::function<void()> fPrintUsage;50 boost::function<void(const std::string&)> fPrintVersion;48 std::function<std::string(std::string)> fNameMapper; 49 std::function<void()> fPrintUsage; 50 std::function<void(const std::string&)> fPrintVersion; 51 51 52 52 /// Helper function which return the max of the two arguments in the first argument … … 95 95 void SetArgumentPositions(const po::positional_options_description &desc); 96 96 97 void SetNameMapper(const boost::function<std::string(std::string)> &func);97 void SetNameMapper(const std::function<std::string(std::string)> &func); 98 98 void SetNameMapper(); 99 99 100 void SetPrintUsage(const boost::function<void(void)> &func);100 void SetPrintUsage(const std::function<void(void)> &func); 101 101 void SetPrintUsage(); 102 102 103 void SetPrintVersion(const boost::function<void(const std::string &)> &func);103 void SetPrintVersion(const std::function<void(const std::string &)> &func); 104 104 void SetPrintVersion(); 105 105 -
trunk/FACT++/src/EventImp.h
r11246 r11481 5 5 #include <vector> 6 6 7 #include <boost/function.hpp> 8 //#include <boost/bind/arg.hpp> 7 #include <functional> 9 8 10 9 #include "Time.h" … … 16 15 17 16 /// http://www.boost.org/doc/libs/1_45_0/libs/bind/bind.html 18 boost::function<int(const EventImp &)> fFunction;17 std::function<int(const EventImp &)> fFunction; 19 18 20 19 public: … … 31 30 // Function handling 32 31 EventImp &AssignFunction(const boost::function<int(const EventImp &)> &func) { fFunction = func; return *this; } 33 bool HasFunc() const { return !fFunction.empty(); }34 int ExecFunc() const { return HasFunc()? fFunction(*this) : -1; }32 bool HasFunc() const { return fFunction; } 33 int ExecFunc() const { return fFunction ? fFunction(*this) : -1; } 35 34 36 35 // Configuration helper -
trunk/FACT++/src/Main.h
r11472 r11481 3 3 4 4 #include <thread> 5 #include < boost/bind.hpp>5 #include <functional> 6 6 7 7 #include "LocalControl.h" … … 83 83 84 84 // boost::thread t(boost::bind(&AutoScheduler<S>::Run, &io_service)); 85 thread t(b oost::bind(MainThread, &io_service, dummy));85 thread t(bind(MainThread, &io_service, dummy)); 86 86 87 87 const vector<string> v1 = conf.Vec<string>("cmd"); -
trunk/FACT++/src/biasctrl.cc
r11477 r11481 1 #include < boost/bind.hpp>1 #include <functional> 2 2 3 3 #include "Dim.h" … … 18 18 namespace dummy = ba::placeholders; 19 19 20 using namespace std::placeholders; 20 21 using namespace std; 21 22 … … 416 417 } 417 418 418 boost::function<int(const EventImp &)> Wrapper(boost::function<void()> func)419 { 420 return b oost::bind(&StateMachineBias::Wrap, this, func);419 function<int(const EventImp &)> Wrapper(function<void()> func) 420 { 421 return bind(&StateMachineBias::Wrap, this, func); 421 422 } 422 423 … … 516 517 // Verbosity commands 517 518 T::AddEvent("SET_VERBOSE", "B") 518 (b oost::bind(&StateMachineBias::SetVerbosity, this, _1))519 (bind(&StateMachineBias::SetVerbosity, this, _1)) 519 520 ("set verbosity state" 520 521 "|verbosity[bool]:disable or enable verbosity for received data (yes/no), except dynamic data"); … … 522 523 // Conenction commands 523 524 AddEvent("DISCONNECT", kStateConnected) 524 (b oost::bind(&StateMachineBias::Disconnect, this))525 (bind(&StateMachineBias::Disconnect, this)) 525 526 ("disconnect from ethernet"); 526 527 527 528 AddEvent("RECONNECT", "O", kStateDisconnected, kStateConnected) 528 (b oost::bind(&StateMachineBias::Reconnect, this, _1))529 (bind(&StateMachineBias::Reconnect, this, _1)) 529 530 ("(Re)connect ethernet connection to FTM, a new address can be given" 530 531 "|[host][string]:new ethernet address in the form <host:port>"); … … 605 606 shell.SetReceiver(io_service); 606 607 607 boost::thread t(b oost::bind(RunThread, &io_service));608 // boost::thread t(b oost::bind(&StateMachineBias<S>::Run, &io_service));608 boost::thread t(bind(RunThread, &io_service)); 609 // boost::thread t(bind(&StateMachineBias<S>::Run, &io_service)); 609 610 610 611 if (conf.Has("cmd")) -
trunk/FACT++/src/chatserv.cc
r11011 r11481 1 1 #include <iostream> 2 3 #include <boost/bind.hpp>4 2 5 3 #include "Dim.h" … … 68 66 { 69 67 AddEvent("MSG", "C") 70 (b oost::bind(&ChatServer::HandleMsg, this,_1))68 (bind(&ChatServer::HandleMsg, this, placeholders::_1)) 71 69 ("|msg[string]:message to be distributed"); 72 70 } -
trunk/FACT++/src/datalogger.cc
r11463 r11481 45 45 //#include <sys/stat.h> //for getting files sizes 46 46 #include <fstream> 47 48 #include <boost/bind.hpp> 47 #include <functional> 48 49 49 #include <boost/filesystem.hpp> 50 50 … … 389 389 } 390 390 else if (shouldBackLog) 391 391 { 392 392 ostringstream str; 393 393 MessageImp mimp(str); … … 580 580 bool DataLogger::OpenTextFilePlease(ofstream& stream, const string& name) 581 581 { 582 if (stream.is_open()) 583 return true; 584 582 585 errno = 0; 583 if (!stream.is_open())584 586 stream.open(name.c_str(), ios_base::out | ios_base::app); 585 587 if (!stream.is_open()) … … 806 808 // Add the possible transitions for this machine 807 809 AddEvent(kSM_NightlyOpen, "START", kSM_Ready, kSM_BadNightlyConfig) 808 (b oost::bind(&DataLogger::StartPlease, this))810 (bind(&DataLogger::StartPlease, this)) 809 811 ("Start the nightly logging. Nightly file location must be specified already"); 810 812 811 813 AddEvent(kSM_Ready, "STOP", kSM_NightlyOpen, kSM_WaitingRun, kSM_Logging, kSM_DailyWriteError, kSM_RunWriteError) 812 (b oost::bind(&DataLogger::GoToReadyPlease, this))814 (bind(&DataLogger::GoToReadyPlease, this)) 813 815 ("Stop all data logging, close all files."); 814 816 815 817 AddEvent(kSM_Logging, "START_RUN", kSM_WaitingRun, kSM_BadRunConfig) 816 (b oost::bind(&DataLogger::StartRunPlease, this))818 (bind(&DataLogger::StartRunPlease, this)) 817 819 ("Start the run logging. Run file location must be specified already."); 818 820 819 821 AddEvent(kSM_WaitingRun, "STOP_RUN", kSM_Logging) 820 (b oost::bind(&DataLogger::StopRunPlease, this))822 (bind(&DataLogger::StopRunPlease, this)) 821 823 ("Wait for a run to be started, open run-files as soon as a run number arrives."); 822 824 823 825 AddEvent(kSM_Ready, "RESET", kSM_Error, kSM_BadNightlyConfig, kSM_BadRunConfig, kSM_DailyWriteError, kSM_RunWriteError) 824 (b oost::bind(&DataLogger::GoToReadyPlease, this))826 (bind(&DataLogger::GoToReadyPlease, this)) 825 827 ("Transition to exit error states. Closes the any open file."); 826 828 827 829 AddEvent(kSM_WaitingRun, "WAIT_FOR_RUN_NUMBER", kSM_NightlyOpen, kSM_Ready) 828 (b oost::bind(&DataLogger::NightlyToWaitRunPlease, this))830 (bind(&DataLogger::NightlyToWaitRunPlease, this)) 829 831 ("Go to waiting for run number state. In this state with any received run-number a new file is opened."); 830 832 831 833 AddEvent(kSM_NightlyOpen, "BACK_TO_NIGHTLY_OPEN", kSM_WaitingRun) 832 (b oost::bind(&DataLogger::BackToNightlyOpenPlease, this))834 (bind(&DataLogger::BackToNightlyOpenPlease, this)) 833 835 ("Go from the wait for run to nightly open state."); 834 836 835 837 // Add the possible configurations for this machine 836 838 AddEvent("SET_NIGHTLY_FOLDER", "C", kSM_Ready, kSM_BadNightlyConfig) 837 (b oost::bind(&DataLogger::ConfigureNightlyFileName, this,_1))839 (bind(&DataLogger::ConfigureNightlyFileName, this, placeholders::_1)) 838 840 ("Configure the base folder for the nightly files." 839 841 "|Path[string]:Absolute or relative path name where the nightly files should be stored."); 840 842 841 843 AddEvent("SET_RUN_FOLDER", "C", kSM_Ready, kSM_BadNightlyConfig, kSM_NightlyOpen, kSM_WaitingRun, kSM_BadRunConfig) 842 (b oost::bind(&DataLogger::ConfigureRunFileName, this,_1))844 (bind(&DataLogger::ConfigureRunFileName, this, placeholders::_1)) 843 845 ("Configure the base folder for the run files." 844 846 "|Path[string]:Absolute or relative path name where the run files should be stored."); 845 847 846 848 AddEvent("SET_RUN_NUMBER", "X", kSM_Ready, kSM_NightlyOpen, kSM_WaitingRun, kSM_BadRunConfig, kSM_Logging) 847 (b oost::bind(&DataLogger::ConfigureRunNumber, this,_1))849 (bind(&DataLogger::ConfigureRunNumber, this, placeholders::_1)) 848 850 ("Configure the run number. Cannot be done in logging state"); 849 851 850 852 // Provide a print command 851 853 AddEvent("PRINT") 852 (b oost::bind(&DataLogger::PrintStatePlease, this,_1))854 (bind(&DataLogger::PrintStatePlease, this, placeholders::_1)) 853 855 ("Print information about the internal status of the data logger."); 854 856 … … 881 883 // provide services control commands 882 884 AddEvent("SET_DEBUG_MODE", "B:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready) 883 (b oost::bind(&DataLogger::SetDebugOnOff, this,_1))885 (bind(&DataLogger::SetDebugOnOff, this, placeholders::_1)) 884 886 ("Switch debug mode on or off. Debug mode prints information about every service written to a file." 885 887 "|Enable[bool]:Enable of disable debug mode (yes/no)."); 886 888 887 889 AddEvent("SET_STATISTICS_UPDATE_INTERVAL", "S:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready) 888 (b oost::bind(&DataLogger::SetStatsPeriod, this,_1))890 (bind(&DataLogger::SetStatsPeriod, this, placeholders::_1)) 889 891 ("Interval in which the data-logger statistics service (STATS) is updated." 890 892 "|Interval[ms]:Value in milliseconds (<=0: no update)."); 891 893 892 894 AddEvent("ENABLE_FILENAME_SERVICES", "B:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready) 893 (b oost::bind(&DataLogger::SetOpenedFilesOnOff ,this,_1))895 (bind(&DataLogger::SetOpenedFilesOnOff ,this, placeholders::_1)) 894 896 ("Switch service which distributes information about the open files on or off." 895 897 "|Enable[bool]:Enable of disable filename services (yes/no)."); 896 898 897 899 AddEvent("ENABLE_NUMSUBS_SERVICE", "B:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready) 898 (b oost::bind(&DataLogger::SetNumSubsAndFitsOnOff, this,_1))900 (bind(&DataLogger::SetNumSubsAndFitsOnOff, this, placeholders::_1)) 899 901 ("Switch the service which distributes information about the number of subscriptions and open files on or off." 900 902 "|Enable[bool]:Enable of disable NUM_SUBS service (yes/no)."); 901 903 902 904 AddEvent("SET_RUN_TIMEOUT", "L:1", kSM_Ready, kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun) 903 (b oost::bind(&DataLogger::SetRunTimeoutDelay, this,_1))905 (bind(&DataLogger::SetRunTimeoutDelay, this, placeholders::_1)) 904 906 ("Set the timeout delay for old run numbers." 905 907 "|timeout[min]:Time out in minutes after which files for expired runs are closed."); … … 2384 2386 { 2385 2387 NotifyOpenedFile(fFullNightlyLogFileName, 1, fOpenedNightlyFiles); 2386 for (vector<string>::iterator it=backLogBuffer.begin();it!=backLogBuffer.end();it++) 2387 fNightlyLogFile << *it << endl; 2388 for (vector<string>::iterator it=backLogBuffer.begin();it!=backLogBuffer.end();it++) 2389 { 2390 fNightlyLogFile << *it; 2391 } 2388 2392 } 2389 2393 } -
trunk/FACT++/src/drivectrl.cc
r11474 r11481 1 #include <boost/bind.hpp>2 3 1 #include "FACT.h" 4 2 #include "Dim.h" … … 412 410 { 413 411 boost::asio::async_read_until(*this, fBuffer, '\n', 414 b oost::bind(&ConnectionDrive::HandleReceivedReport, this,412 bind(&ConnectionDrive::HandleReceivedReport, this, 415 413 dummy::error, dummy::bytes_transferred)); 416 414 } … … 423 421 424 422 fKeepAlive.expires_from_now(boost::posix_time::seconds(10)); 425 fKeepAlive.async_wait(b oost::bind(&ConnectionDrive::HandleKeepAlive,423 fKeepAlive.async_wait(bind(&ConnectionDrive::HandleKeepAlive, 426 424 this, dummy::error)); 427 425 } … … 576 574 boost::function<int(const EventImp &)> Wrapper(boost::function<void()> func) 577 575 { 578 return b oost::bind(&StateMachineDrive::Wrap, this, func);576 return bind(&StateMachineDrive::Wrap, this, func); 579 577 } 580 578 … … 772 770 // Drive Commands 773 771 T::AddEvent("MOVE_TO", "D:2", kStateArmed) // ->ZDAZ 774 (b oost::bind(&StateMachineDrive::SendCoordinates, this,_1, kPoint))772 (bind(&StateMachineDrive::SendCoordinates, this, placeholders::_1, kPoint)) 775 773 ("" 776 774 "|zd[deg]:" … … 778 776 779 777 T::AddEvent("TRACK", "D:2", kStateArmed) // ->RADEC/GRB 780 (b oost::bind(&StateMachineDrive::SendCoordinates, this,_1, kTrackSlow))778 (bind(&StateMachineDrive::SendCoordinates, this, placeholders::_1, kTrackSlow)) 781 779 ("" 782 780 "|ra[h]:" … … 784 782 785 783 T::AddEvent("MOON", kStateArmed) 786 (b oost::bind(&StateMachineDrive::SendCommand, this, "MOON 0 0"))784 (bind(&StateMachineDrive::SendCommand, this, "MOON 0 0")) 787 785 (""); 788 786 T::AddEvent("VENUS", kStateArmed) 789 (b oost::bind(&StateMachineDrive::SendCommand, this, "CELEST 2 0 0"))787 (bind(&StateMachineDrive::SendCommand, this, "CELEST 2 0 0")) 790 788 (""); 791 789 T::AddEvent("MARS", kStateArmed) 792 (b oost::bind(&StateMachineDrive::SendCommand, this, "CELEST 4 0 0"))790 (bind(&StateMachineDrive::SendCommand, this, "CELEST 4 0 0")) 793 791 (""); 794 792 T::AddEvent("JUPITER", kStateArmed) 795 (b oost::bind(&StateMachineDrive::SendCommand, this, "CELEST 5 0 0"))793 (bind(&StateMachineDrive::SendCommand, this, "CELEST 5 0 0")) 796 794 (""); 797 795 T::AddEvent("SATURN", kStateArmed) 798 (b oost::bind(&StateMachineDrive::SendCommand, this, "CELEST 6 0 0"))796 (bind(&StateMachineDrive::SendCommand, this, "CELEST 6 0 0")) 799 797 (""); 800 798 801 799 T::AddEvent("TPOINT") 802 (b oost::bind(&StateMachineDrive::SendCommand, this, "TPOIN FACT 0"))800 (bind(&StateMachineDrive::SendCommand, this, "TPOIN FACT 0")) 803 801 (""); 804 802 805 803 T::AddEvent("STOP") 806 (b oost::bind(&StateMachineDrive::SendCommand, this, "STOP!"))804 (bind(&StateMachineDrive::SendCommand, this, "STOP!")) 807 805 (""); 808 806 809 807 T::AddEvent("ARM", kStateConnected) 810 (b oost::bind(&StateMachineDrive::SendCommand, this, "ARM lock"))808 (bind(&StateMachineDrive::SendCommand, this, "ARM lock")) 811 809 (""); 812 810 … … 814 812 // Verbosity commands 815 813 T::AddEvent("SET_VERBOSE", "B") 816 (b oost::bind(&StateMachineDrive::SetVerbosity, this,_1))814 (bind(&StateMachineDrive::SetVerbosity, this, placeholders::_1)) 817 815 ("set verbosity state" 818 816 "|verbosity[bool]:disable or enable verbosity for received data (yes/no), except dynamic data"); … … 820 818 // Conenction commands 821 819 AddEvent("DISCONNECT", kStateConnected, kStateArmed) 822 (b oost::bind(&StateMachineDrive::Disconnect, this))820 (bind(&StateMachineDrive::Disconnect, this)) 823 821 ("disconnect from ethernet"); 824 822 825 823 AddEvent("RECONNECT", "O", kStateDisconnected, kStateConnected, kStateArmed) 826 (b oost::bind(&StateMachineDrive::Reconnect, this,_1))824 (bind(&StateMachineDrive::Reconnect, this, placeholders::_1)) 827 825 ("(Re)connect ethernet connection to FTM, a new address can be given" 828 826 "|[host][string]:new ethernet address in the form <host:port>"); … … 903 901 shell.SetReceiver(io_service); 904 902 905 boost::thread t(b oost::bind(RunThread, &io_service));906 // boost::thread t(b oost::bind(&StateMachineDrive<S>::Run, &io_service));903 boost::thread t(bind(RunThread, &io_service)); 904 // boost::thread t(bind(&StateMachineDrive<S>::Run, &io_service)); 907 905 908 906 if (conf.Has("cmd")) -
trunk/FACT++/src/fadctrl.cc
r11480 r11481 1 #include <functional> 2 1 3 #include "Dim.h" 2 4 #include "Event.h" … … 1528 1530 // FAD Commands 1529 1531 T::AddEvent("SEND_CMD", "I:1") 1530 (b oost::bind(&StateMachineFAD::SendCmd, this,_1))1532 (bind(&StateMachineFAD::SendCmd, this, placeholders::_1)) 1531 1533 ("Send a command to the FADs. Values between 0 and 0xffff are allowed." 1532 1534 "|command[uint16]:Command to be transmittted."); 1533 1535 T::AddEvent("SEND_DATA", "I:2") 1534 (b oost::bind(&StateMachineFAD::SendCmdData, this,_1))1536 (bind(&StateMachineFAD::SendCmdData, this, placeholders::_1)) 1535 1537 ("Send a command with data to the FADs. Values between 0 and 0xffff are allowed." 1536 1538 "|command[uint16]:Command to be transmittted." … … 1538 1540 1539 1541 T::AddEvent("ENABLE_SRCLK", "B:1") 1540 (b oost::bind(&StateMachineFAD::CmdEnable, this,_1, FAD::kCmdSrclk))1542 (bind(&StateMachineFAD::CmdEnable, this, placeholders::_1, FAD::kCmdSrclk)) 1541 1543 ("Set SRCLK"); 1542 1544 T::AddEvent("ENABLE_BUSY", "B:1") 1543 (b oost::bind(&StateMachineFAD::CmdEnable, this,_1, FAD::kCmdBusy))1545 (bind(&StateMachineFAD::CmdEnable, this, placeholders::_1, FAD::kCmdBusy)) 1544 1546 ("Set BUSY"); 1545 1547 T::AddEvent("ENABLE_SCLK", "B:1") 1546 (b oost::bind(&StateMachineFAD::CmdEnable, this,_1, FAD::kCmdSclk))1548 (bind(&StateMachineFAD::CmdEnable, this, placeholders::_1, FAD::kCmdSclk)) 1547 1549 ("Set SCLK"); 1548 1550 T::AddEvent("ENABLE_DRS", "B:1") 1549 (b oost::bind(&StateMachineFAD::CmdEnable, this,_1, FAD::kCmdDrsEnable))1551 (bind(&StateMachineFAD::CmdEnable, this, placeholders::_1, FAD::kCmdDrsEnable)) 1550 1552 ("Switch Domino wave"); 1551 1553 T::AddEvent("ENABLE_DWRITE", "B:1") 1552 (b oost::bind(&StateMachineFAD::CmdEnable, this,_1, FAD::kCmdDwrite))1554 (bind(&StateMachineFAD::CmdEnable, this, placeholders::_1, FAD::kCmdDwrite)) 1553 1555 ("Set Dwrite (possibly high / always low)"); 1554 1556 T::AddEvent("ENABLE_CONTINOUS_TRIGGER", "B:1") 1555 (b oost::bind(&StateMachineFAD::CmdEnable, this,_1, FAD::kCmdContTrigger))1557 (bind(&StateMachineFAD::CmdEnable, this, placeholders::_1, FAD::kCmdContTrigger)) 1556 1558 ("Enable continous (internal) trigger."); 1557 1559 T::AddEvent("ENABLE_TRIGGER_LINE", "B:1") 1558 (b oost::bind(&StateMachineFAD::CmdEnable, this,_1, FAD::kCmdTriggerLine))1560 (bind(&StateMachineFAD::CmdEnable, this, placeholders::_1, FAD::kCmdTriggerLine)) 1559 1561 ("Incoming triggers can be accepted/will not be accepted"); 1560 1562 T::AddEvent("ENABLE_COMMAND_SOCKET_MODE", "B:1") 1561 (b oost::bind(&StateMachineFAD::CmdEnable, this,_1, FAD::kCmdSocket))1563 (bind(&StateMachineFAD::CmdEnable, this, placeholders::_1, FAD::kCmdSocket)) 1562 1564 ("Set debug mode (yes: dump events through command socket, no=dump events through other sockets)"); 1563 1565 1564 1566 T::AddEvent("SET_TRIGGER_RATE", "I:1") 1565 (b oost::bind(&StateMachineFAD::SetTriggerRate, this,_1))1567 (bind(&StateMachineFAD::SetTriggerRate, this, placeholders::_1)) 1566 1568 ("Enable continous trigger"); 1567 1569 T::AddEvent("SEND_SINGLE_TRIGGER") 1568 (b oost::bind(&StateMachineFAD::Trigger, this, 1))1570 (bind(&StateMachineFAD::Trigger, this, 1)) 1569 1571 ("Issue software triggers"); 1570 1572 T::AddEvent("SEND_N_TRIGGERS", "I") 1571 (b oost::bind(&StateMachineFAD::SendTriggers, this,_1))1573 (bind(&StateMachineFAD::SendTriggers, this, placeholders::_1)) 1572 1574 ("Issue software triggers"); 1573 1575 T::AddEvent("START_RUN", "") 1574 (b oost::bind(&StateMachineFAD::StartRun, this,_1, true))1576 (bind(&StateMachineFAD::StartRun, this, placeholders::_1, true)) 1575 1577 ("Set FAD DAQ mode. when started, no configurations must be send."); 1576 1578 T::AddEvent("STOP_RUN") 1577 (b oost::bind(&StateMachineFAD::StartRun, this,_1, false))1579 (bind(&StateMachineFAD::StartRun, this, placeholders::_1, false)) 1578 1580 (""); 1579 1581 T::AddEvent("PHASE_SHIFT", "S:1") 1580 (b oost::bind(&StateMachineFAD::PhaseShift, this,_1))1582 (bind(&StateMachineFAD::PhaseShift, this, placeholders::_1)) 1581 1583 ("Adjust ADC phase (in 'steps')"); 1582 1584 1583 1585 T::AddEvent("RESET_EVENT_COUNTER") 1584 (b oost::bind(&StateMachineFAD::Cmd, this, FAD::kCmdResetEventCounter))1586 (bind(&StateMachineFAD::Cmd, this, FAD::kCmdResetEventCounter)) 1585 1587 (""); 1586 1588 1587 1589 T::AddEvent("SET_RUN_NUMBER", "X:1") 1588 (b oost::bind(&StateMachineFAD::SetRunNumber, this,_1))1590 (bind(&StateMachineFAD::SetRunNumber, this, placeholders::_1)) 1589 1591 (""); 1590 1592 1591 1593 T::AddEvent("SET_MAX_MEMORY", "S:1") 1592 (b oost::bind(&StateMachineFAD::SetMaxMemoryBuffer, this,_1))1594 (bind(&StateMachineFAD::SetMaxMemoryBuffer, this, placeholders::_1)) 1593 1595 ("Set maximum memory buffer size allowed to be consumed by the EventBuilder to buffer events." 1594 1596 "|memory[short]:Buffer size in Mega-bytes."); 1595 1597 1596 1598 T::AddEvent("SET_REGISTER", "I:2") 1597 (b oost::bind(&StateMachineFAD::SetRegister, this,_1))1599 (bind(&StateMachineFAD::SetRegister, this, placeholders::_1)) 1598 1600 ("set register to value" 1599 1601 "|addr[short]:Address of register" … … 1602 1604 // FIXME: Maybe add a mask which channels should be set? 1603 1605 T::AddEvent("SET_REGION_OF_INTEREST", "I:2") 1604 (b oost::bind(&StateMachineFAD::SetRoi, this,_1))1606 (bind(&StateMachineFAD::SetRoi, this, placeholders::_1)) 1605 1607 ("Set region-of-interest to value" 1606 1608 "|addr[short]:Address of register" … … 1609 1611 // FIXME: Maybe add a mask which channels should be set? 1610 1612 T::AddEvent("SET_DAC_VALUE", "I:2") 1611 (b oost::bind(&StateMachineFAD::SetDac, this,_1))1613 (bind(&StateMachineFAD::SetDac, this, placeholders::_1)) 1612 1614 ("Set DAC numbers in range to value" 1613 1615 "|addr[short]:Address of register (-1 for all)" … … 1615 1617 1616 1618 T::AddEvent("CONFIGURE", "C", FAD::kConnected, FAD::kConfigured) 1617 (b oost::bind(&StateMachineFAD::StartConfigure, this,_1))1619 (bind(&StateMachineFAD::StartConfigure, this, placeholders::_1)) 1618 1620 (""); 1619 1621 1620 1622 T::AddEvent("RESET_CONFIGURE", FAD::kConfiguring, FAD::kConfigured) 1621 (b oost::bind(&StateMachineFAD::ResetConfig, this))1623 (bind(&StateMachineFAD::ResetConfig, this)) 1622 1624 (""); 1623 1625 1624 1626 // Verbosity commands 1625 1627 T::AddEvent("SET_VERBOSE", "B:1") 1626 (b oost::bind(&StateMachineFAD::SetVerbosity, this,_1))1628 (bind(&StateMachineFAD::SetVerbosity, this, placeholders::_1)) 1627 1629 ("Set verbosity state" 1628 1630 "|verbosity[bool]:disable or enable verbosity for received data (yes/no), except dynamic data"); 1629 1631 1630 1632 T::AddEvent("SET_HEX_OUTPUT", "B:1") 1631 (b oost::bind(&StateMachineFAD::SetHexOutput, this,_1))1633 (bind(&StateMachineFAD::SetHexOutput, this, placeholders::_1)) 1632 1634 ("Enable or disable hex output for received data" 1633 1635 "|hexout[bool]:disable or enable hex output for received data (yes/no)"); 1634 1636 1635 1637 T::AddEvent("SET_DATA_OUTPUT", "B:1") 1636 (b oost::bind(&StateMachineFAD::SetDataOutput, this,_1))1638 (bind(&StateMachineFAD::SetDataOutput, this, placeholders::_1)) 1637 1639 (""); 1638 1640 1639 1641 T::AddEvent("SET_DEBUG_TX", "B:1") 1640 (b oost::bind(&StateMachineFAD::SetDebugTx, this,_1))1642 (bind(&StateMachineFAD::SetDebugTx, this, placeholders::_1)) 1641 1643 ("Enable or disable the output of messages in case of successfull data transmission to the boards." 1642 1644 "|debug[bool]:disable or enable debug output for transmitted data (yes/no)"); 1643 1645 1644 1646 T::AddEvent("SET_DEBUG_EVENT_BUILDER_OUT", "B:1") 1645 (b oost::bind(&StateMachineFAD::SetDebugEb, this,_1))1647 (bind(&StateMachineFAD::SetDebugEb, this, placeholders::_1)) 1646 1648 (""); 1647 1649 1648 1650 T::AddEvent("PRINT_EVENT", "S:1") 1649 (b oost::bind(&StateMachineFAD::PrintEvent, this,_1))1651 (bind(&StateMachineFAD::PrintEvent, this, placeholders::_1)) 1650 1652 ("Print (last) event" 1651 1653 "|board[short]:slot from which the event should be printed (-1 for all)"); 1652 1654 1653 1655 T::AddEvent("DUMP_STREAM", "B:1") 1654 (b oost::bind(&StateMachineFAD::SetDumpStream, this,_1))1656 (bind(&StateMachineFAD::SetDumpStream, this, placeholders::_1)) 1655 1657 ("For debugging purpose: the binary data stream read from the sockets 0-7 can be dumped to files." 1656 1658 "|switch[bool]:Enable (yes) or disable (no)"); 1657 1659 1658 1660 T::AddEvent("DUMP_RECV", "B:1") 1659 (b oost::bind(&StateMachineFAD::SetDumpRecv, this,_1))1661 (bind(&StateMachineFAD::SetDumpRecv, this, placeholders::_1)) 1660 1662 ("For debugging purpose: the times when data has been receives are dumped to a file." 1661 1663 "|switch[bool]:Enable (yes) or disable (no)"); 1662 1664 1663 1665 T::AddEvent("BLOCK_TRANSMISSION", "S:1;B:1") 1664 (b oost::bind(&StateMachineFAD::SetBlockTransmission, this,_1))1666 (bind(&StateMachineFAD::SetBlockTransmission, this, placeholders::_1)) 1665 1667 ("Blocks the transmission of commands to the given slot. Use with care! For debugging pupose only!" 1666 1668 "|slot[short]:Slot to which the command transmission should be blocked (0-39)" … … 1668 1670 1669 1671 T::AddEvent("BLOCK_TRANSMISSION_RANGE", "S:2;B:1") 1670 (b oost::bind(&StateMachineFAD::SetBlockTransmissionRange, this,_1))1672 (bind(&StateMachineFAD::SetBlockTransmissionRange, this, placeholders::_1)) 1671 1673 ("Blocks the transmission of commands to the given range of slots. Use with care! For debugging pupose only!" 1672 1674 "|first[short]:First slot to which the command transmission should be blocked (0-39)" … … 1675 1677 1676 1678 T::AddEvent("IGNORE_EVENTS", "S:1;B:1") 1677 (b oost::bind(&StateMachineFAD::SetIgnoreSlot, this,_1))1679 (bind(&StateMachineFAD::SetIgnoreSlot, this, placeholders::_1)) 1678 1680 ("Instructs the event-builder to ignore events from the given slot but still read the data from the socket." 1679 1681 "|slot[short]:Slot from which the data should be ignored when building events" … … 1681 1683 1682 1684 T::AddEvent("IGNORE_EVENTS_RANGE", "S:2;B:1") 1683 (b oost::bind(&StateMachineFAD::SetIgnoreSlots, this,_1))1685 (bind(&StateMachineFAD::SetIgnoreSlots, this, placeholders::_1)) 1684 1686 ("Instructs the event-builder to ignore events from the given slot but still read the data from the socket." 1685 1687 "|first[short]:First slot from which the data should be ignored when building events" … … 1688 1690 1689 1691 T::AddEvent("CLOSE_OPEN_FILES", FAD::kConnecting, FAD::kConnected) 1690 (b oost::bind(&StateMachineFAD::CloseOpenFiles, this))1692 (bind(&StateMachineFAD::CloseOpenFiles, this)) 1691 1693 ("Close all run files opened by the EventBuilder."); 1692 1694 1693 1695 T::AddEvent("TEST", "S:1") 1694 (b oost::bind(&StateMachineFAD::Test, this,_1))1696 (bind(&StateMachineFAD::Test, this, placeholders::_1)) 1695 1697 (""); 1696 1698 … … 1699 1701 // Conenction commands 1700 1702 T::AddEvent("START", FAD::kOffline) 1701 (b oost::bind(&StateMachineFAD::StartConnection, this))1703 (bind(&StateMachineFAD::StartConnection, this)) 1702 1704 ("Start EventBuilder thread and connect all valid slots."); 1703 1705 1704 1706 T::AddEvent("STOP", FAD::kDisconnected, FAD::kConnecting, FAD::kConnected) 1705 (b oost::bind(&StateMachineFAD::StopConnection, this))1707 (bind(&StateMachineFAD::StopConnection, this)) 1706 1708 ("Stop EventBuilder thread (still write buffered events) and disconnect all slots."); 1707 1709 1708 1710 T::AddEvent("ABORT", FAD::kDisconnected, FAD::kConnecting, FAD::kConnected) 1709 (b oost::bind(&StateMachineFAD::AbortConnection, this))1711 (bind(&StateMachineFAD::AbortConnection, this)) 1710 1712 ("Immediately abort EventBuilder thread and disconnect all slots."); 1711 1713 1712 1714 T::AddEvent("SOFT_RESET", FAD::kConnected) 1713 (b oost::bind(&StateMachineFAD::Reset, this, true))1715 (bind(&StateMachineFAD::Reset, this, true)) 1714 1716 ("Wait for buffers to drain, close all files and reinitialize event builder thread."); 1715 1717 1716 1718 T::AddEvent("HARD_RESET", FAD::kConnected) 1717 (b oost::bind(&StateMachineFAD::Reset, this, false))1719 (bind(&StateMachineFAD::Reset, this, false)) 1718 1720 ("Free all buffers, close all files and reinitialize event builder thread."); 1719 1721 1720 1722 T::AddEvent("CONNECT", "S:1", FAD::kDisconnected, FAD::kConnecting, FAD::kConnected) 1721 (b oost::bind(&StateMachineFAD::EnableSlot, this,_1, true))1723 (bind(&StateMachineFAD::EnableSlot, this, placeholders::_1, true)) 1722 1724 ("Connect a disconnected slot."); 1723 1725 1724 1726 T::AddEvent("DISCONNECT", "S:1", FAD::kConnecting, FAD::kConnected) 1725 (b oost::bind(&StateMachineFAD::EnableSlot, this,_1, false))1727 (bind(&StateMachineFAD::EnableSlot, this, placeholders::_1, false)) 1726 1728 ("Disconnect a connected slot."); 1727 1729 1728 1730 T::AddEvent("TOGGLE", "S:1", FAD::kDisconnected, FAD::kConnecting, FAD::kConnected) 1729 (b oost::bind(&StateMachineFAD::ToggleSlot, this,_1))1731 (bind(&StateMachineFAD::ToggleSlot, this, placeholders::_1)) 1730 1732 (""); 1731 1733 1732 1734 T::AddEvent("SET_FILE_FORMAT", "S:1") 1733 (b oost::bind(&StateMachineFAD::SetFileFormat, this,_1))1735 (bind(&StateMachineFAD::SetFileFormat, this, placeholders::_1)) 1734 1736 (""); 1735 1737 1736 1738 1737 1739 T::AddEvent("ADD_ADDRESS", "C", FAD::kOffline) 1738 (b oost::bind(&StateMachineFAD::AddAddress, this,_1))1740 (bind(&StateMachineFAD::AddAddress, this, placeholders::_1)) 1739 1741 ("Add the address of a DRS4 board to the first free slot" 1740 1742 "|IP[string]:address in the format <address:port>"); 1741 1743 T::AddEvent("REMOVE_SLOT", "S:1", FAD::kOffline) 1742 (b oost::bind(&StateMachineFAD::RemoveSlot, this,_1))1744 (bind(&StateMachineFAD::RemoveSlot, this, placeholders::_1)) 1743 1745 ("Remove the Iaddress in slot n. For a list see LIST" 1744 1746 "|slot[short]:Remove the address in slot n from the list"); 1745 1747 T::AddEvent("LIST_SLOTS") 1746 (b oost::bind(&StateMachineFAD::ListSlots, this))1748 (bind(&StateMachineFAD::ListSlots, this)) 1747 1749 ("Print a list of all available board addressesa and whether they are enabled"); 1748 1750 } … … 2023 2025 shell.SetReceiver(io_service); 2024 2026 2025 boost::thread t(b oost::bind(RunThread, &io_service));2026 //boost::thread t(b oost::bind(&StateMachineFAD<S>::Run, &io_service));2027 boost::thread t(bind(RunThread, &io_service)); 2028 //boost::thread t(bind(&StateMachineFAD<S>::Run, &io_service)); 2027 2029 2028 2030 if (conf.Has("cmd")) -
trunk/FACT++/src/fscctrl.cc
r11479 r11481 1 #include < boost/bind.hpp>1 #include <functional> 2 2 3 3 #include "Dim.h" … … 11 11 12 12 #include "tools.h" 13 14 13 15 14 namespace ba = boost::asio; … … 370 369 } 371 370 372 boost::function<int(const EventImp &)> Wrapper(boost::function<void()> func)373 { 374 return b oost::bind(&StateMachineFSC::Wrap, this, func);371 function<int(const EventImp &)> Wrapper(function<void()> func) 372 { 373 return bind(&StateMachineFSC::Wrap, this, func); 375 374 } 376 375 … … 480 479 // Verbosity commands 481 480 T::AddEvent("SET_VERBOSE", "B:1") 482 (b oost::bind(&StateMachineFSC::SetVerbosity, this,_1))481 (bind(&StateMachineFSC::SetVerbosity, this, placeholders::_1)) 483 482 ("set verbosity state" 484 483 "|verbosity[bool]:disable or enable verbosity for received data (yes/no), except dynamic data"); 485 484 486 485 T::AddEvent("DUMP_STREAM", "B:1") 487 (b oost::bind(&StateMachineFSC::SetDumpStream, this,_1))486 (bind(&StateMachineFSC::SetDumpStream, this, placeholders::_1)) 488 487 ("" 489 488 ""); … … 491 490 // Conenction commands 492 491 AddEvent("DISCONNECT", kStateConnected) 493 (b oost::bind(&StateMachineFSC::Disconnect, this))492 (bind(&StateMachineFSC::Disconnect, this)) 494 493 ("disconnect from ethernet"); 495 494 496 495 AddEvent("RECONNECT", "O", kStateDisconnected, kStateConnected) 497 (b oost::bind(&StateMachineFSC::Reconnect, this,_1))496 (bind(&StateMachineFSC::Reconnect, this, placeholders::_1)) 498 497 ("(Re)connect ethernet connection to FTM, a new address can be given" 499 498 "|[host][string]:new ethernet address in the form <host:port>"); -
trunk/FACT++/src/ftmctrl.cc
r11480 r11481 19 19 20 20 using namespace std; 21 using namespace std::placeholders; 21 22 22 23 // ------------------------------------------------------------------------ … … 1135 1136 } 1136 1137 1137 boost::function<int(const EventImp &)> Wrapper(boost::function<void()> func)1138 { 1139 return b oost::bind(&StateMachineFTM::Wrap, this, func);1138 function<int(const EventImp &)> Wrapper(function<void()> func) 1139 { 1140 return bind(&StateMachineFTM::Wrap, this, func); 1140 1141 } 1141 1142 … … 1706 1707 // deletion and creation of threads and more. 1707 1708 1709 1708 1710 // State names 1709 1711 T::AddStateName(FTM::kDisconnected, "Disconnected", … … 1731 1733 // FTM Commands 1732 1734 T::AddEvent("TOGGLE_LED", FTM::kIdle) 1733 (Wrapper(b oost::bind(&ConnectionFTM::CmdToggleLed, &fFTM)))1735 (Wrapper(bind(&ConnectionFTM::CmdToggleLed, &fFTM))) 1734 1736 ("toggle led"); 1735 1737 1736 1738 T::AddEvent("PING", FTM::kIdle) 1737 (Wrapper(b oost::bind(&ConnectionFTM::CmdPing, &fFTM)))1739 (Wrapper(bind(&ConnectionFTM::CmdPing, &fFTM))) 1738 1740 ("send ping"); 1739 1741 1740 1742 T::AddEvent("REQUEST_DYNAMIC_DATA", FTM::kIdle) 1741 (Wrapper(b oost::bind(&ConnectionFTM::CmdReqDynDat, &fFTM)))1743 (Wrapper(bind(&ConnectionFTM::CmdReqDynDat, &fFTM))) 1742 1744 ("request transmission of dynamic data block"); 1743 1745 1744 1746 T::AddEvent("REQUEST_STATIC_DATA", FTM::kIdle) 1745 (Wrapper(b oost::bind(&ConnectionFTM::CmdReqStatDat, &fFTM)))1747 (Wrapper(bind(&ConnectionFTM::CmdReqStatDat, &fFTM))) 1746 1748 ("request transmission of static data from FTM to memory"); 1747 1749 1748 1750 T::AddEvent("GET_REGISTER", "I", FTM::kIdle) 1749 (b oost::bind(&StateMachineFTM::GetRegister, this,_1))1751 (bind(&StateMachineFTM::GetRegister, this, placeholders::_1)) 1750 1752 ("read register from address addr" 1751 1753 "|addr[short]:Address of register"); 1752 1754 1753 1755 T::AddEvent("SET_REGISTER", "I:2", FTM::kIdle) 1754 (b oost::bind(&StateMachineFTM::SetRegister, this,_1))1756 (bind(&StateMachineFTM::SetRegister, this, placeholders::_1)) 1755 1757 ("set register to value" 1756 1758 "|addr[short]:Address of register" … … 1758 1760 1759 1761 T::AddEvent("START_RUN", FTM::kIdle, FTM::kConfigured) 1760 (Wrapper(b oost::bind(&ConnectionFTM::CmdStartRun, &fFTM)))1762 (Wrapper(bind(&ConnectionFTM::CmdStartRun, &fFTM))) 1761 1763 ("start a run (start distributing triggers)"); 1762 1764 1763 1765 T::AddEvent("STOP_RUN", FTM::kTakingData) 1764 (Wrapper(b oost::bind(&ConnectionFTM::CmdStopRun, &fFTM)))1766 (Wrapper(bind(&ConnectionFTM::CmdStopRun, &fFTM))) 1765 1767 ("stop a run (stop distributing triggers)"); 1766 1768 1767 1769 T::AddEvent("TAKE_N_EVENTS", "I", FTM::kIdle) 1768 (b oost::bind(&StateMachineFTM::TakeNevents, this,_1))1770 (bind(&StateMachineFTM::TakeNevents, this, placeholders::_1)) 1769 1771 ("take n events (distribute n triggers)|number[int]:Number of events to be taken"); 1770 1772 1771 1773 T::AddEvent("DISABLE_REPORTS", "B", FTM::kIdle) 1772 (b oost::bind(&StateMachineFTM::DisableReports, this,_1))1774 (bind(&StateMachineFTM::DisableReports, this, placeholders::_1)) 1773 1775 ("disable sending rate reports" 1774 1776 "|status[bool]:disable or enable that the FTM sends rate reports (yes/no)"); 1775 1777 1776 1778 T::AddEvent("SET_THRESHOLD", "I:2", FTM::kIdle) 1777 (b oost::bind(&StateMachineFTM::SetThreshold, this,_1))1779 (bind(&StateMachineFTM::SetThreshold, this, placeholders::_1)) 1778 1780 ("Set the comparator threshold" 1779 1781 "|Patch[idx]:Index of the patch (0-159), -1 for all" … … 1781 1783 1782 1784 T::AddEvent("SET_PRESCALING", "I:1", FTM::kIdle) 1783 (b oost::bind(&StateMachineFTM::SetPrescaling, this,_1))1785 (bind(&StateMachineFTM::SetPrescaling, this, placeholders::_1)) 1784 1786 ("" 1785 1787 "|[]:"); 1786 1788 1787 1789 T::AddEvent("ENABLE_FTU", "I:1;B:1", FTM::kIdle) 1788 (b oost::bind(&StateMachineFTM::EnableFTU, this,_1))1790 (bind(&StateMachineFTM::EnableFTU, this, placeholders::_1)) 1789 1791 ("Enable or disable FTU" 1790 1792 "|Board[idx]:Index of the board (0-39), -1 for all" … … 1792 1794 1793 1795 T::AddEvent("DISABLE_PIXEL", "S:1", FTM::kIdle) 1794 (b oost::bind(&StateMachineFTM::EnablePixel, this,_1, false))1796 (bind(&StateMachineFTM::EnablePixel, this, placeholders::_1, false)) 1795 1797 ("(-1 or all)"); 1796 1798 1797 1799 T::AddEvent("ENABLE_PIXEL", "S:1", FTM::kIdle) 1798 (b oost::bind(&StateMachineFTM::EnablePixel, this,_1, true))1800 (bind(&StateMachineFTM::EnablePixel, this, placeholders::_1, true)) 1799 1801 ("(-1 or all)"); 1800 1802 1801 1803 T::AddEvent("DISABLE_ALL_PIXELS_EXCEPT", "S:1", FTM::kIdle) 1802 (b oost::bind(&StateMachineFTM::DisableAllPixelsExcept, this,_1))1804 (bind(&StateMachineFTM::DisableAllPixelsExcept, this, placeholders::_1)) 1803 1805 (""); 1804 1806 1805 1807 T::AddEvent("DISABLE_ALL_PATCHES_EXCEPT", "S:1", FTM::kIdle) 1806 (b oost::bind(&StateMachineFTM::DisableAllPatchesExcept, this,_1))1808 (bind(&StateMachineFTM::DisableAllPatchesExcept, this, placeholders::_1)) 1807 1809 (""); 1808 1810 1809 1811 T::AddEvent("TOGGLE_PIXEL", "S:1", FTM::kIdle) 1810 (b oost::bind(&StateMachineFTM::TogglePixel, this,_1))1812 (bind(&StateMachineFTM::TogglePixel, this, placeholders::_1)) 1811 1813 (""); 1812 1814 1813 1815 T::AddEvent("TOGGLE_FTU", "I:1", FTM::kIdle) 1814 (b oost::bind(&StateMachineFTM::ToggleFTU, this,_1))1816 (bind(&StateMachineFTM::ToggleFTU, this, placeholders::_1)) 1815 1817 ("Toggle status of FTU (this is mainly meant to be used in the GUI)" 1816 1818 "|Board[idx]:Index of the board (0-39)"); 1817 1819 1818 1820 T::AddEvent("SET_TRIGGER_INTERVAL", "I:1", FTM::kIdle) 1819 (b oost::bind(&StateMachineFTM::SetTriggerInterval, this,_1))1821 (bind(&StateMachineFTM::SetTriggerInterval, this, placeholders::_1)) 1820 1822 ("Sets the trigger interval which is the distance between two consecutive artificial triggers." 1821 1823 "|interval[int]:The applied trigger interval is: interval*4ns+8ns"); 1822 1824 1823 1825 T::AddEvent("SET_TRIGGER_DELAY", "I:1", FTM::kIdle) 1824 (b oost::bind(&StateMachineFTM::SetTriggerDelay, this,_1))1826 (bind(&StateMachineFTM::SetTriggerDelay, this, placeholders::_1)) 1825 1827 ("" 1826 1828 "|delay[int]:The applied trigger delay is: delay*4ns+8ns"); 1827 1829 1828 1830 T::AddEvent("SET_TIME_MARKER_DELAY", "I:1", FTM::kIdle) 1829 (b oost::bind(&StateMachineFTM::SetTimeMarkerDelay, this,_1))1831 (bind(&StateMachineFTM::SetTimeMarkerDelay, this, placeholders::_1)) 1830 1832 ("" 1831 1833 "|delay[int]:The applied time marker delay is: delay*4ns+8ns"); 1832 1834 1833 1835 T::AddEvent("SET_DEAD_TIME", "I:1", FTM::kIdle) 1834 (b oost::bind(&StateMachineFTM::SetDeadTime, this,_1))1836 (bind(&StateMachineFTM::SetDeadTime, this, placeholders::_1)) 1835 1837 ("" 1836 1838 "|dead_time[int]:The applied dead time is: dead_time*4ns+8ns"); 1837 1839 1838 1840 T::AddEvent("ENABLE_TRIGGER", "B:1", FTM::kIdle) 1839 (b oost::bind(&StateMachineFTM::Enable, this,_1, FTM::StaticData::kTrigger))1841 (bind(&StateMachineFTM::Enable, this, placeholders::_1, FTM::StaticData::kTrigger)) 1840 1842 ("Switch on the physics trigger" 1841 1843 "|Enable[bool]:Enable physics trigger (yes/no)"); … … 1843 1845 // FIXME: Switch on/off depending on sequence 1844 1846 T::AddEvent("ENABLE_EXT1", "B:1", FTM::kIdle) 1845 (b oost::bind(&StateMachineFTM::Enable, this,_1, FTM::StaticData::kExt1))1847 (bind(&StateMachineFTM::Enable, this, placeholders::_1, FTM::StaticData::kExt1)) 1846 1848 ("Switch on the triggers through the first external line" 1847 1849 "|Enable[bool]:Enable ext1 trigger (yes/no)"); … … 1849 1851 // FIXME: Switch on/off depending on sequence 1850 1852 T::AddEvent("ENABLE_EXT2", "B:1", FTM::kIdle) 1851 (b oost::bind(&StateMachineFTM::Enable, this,_1, FTM::StaticData::kExt2))1853 (bind(&StateMachineFTM::Enable, this, placeholders::_1, FTM::StaticData::kExt2)) 1852 1854 ("Switch on the triggers through the second external line" 1853 1855 "|Enable[bool]:Enable ext2 trigger (yes/no)"); 1854 1856 1855 1857 T::AddEvent("ENABLE_VETO", "B:1", FTM::kIdle) 1856 (b oost::bind(&StateMachineFTM::Enable, this,_1, FTM::StaticData::kVeto))1858 (bind(&StateMachineFTM::Enable, this, placeholders::_1, FTM::StaticData::kVeto)) 1857 1859 ("Enable veto line" 1858 1860 "|Enable[bool]:Enable veto (yes/no)"); 1859 1861 1860 1862 T::AddEvent("ENABLE_CLOCK_CONDITIONER", "B:1", FTM::kIdle) 1861 (b oost::bind(&StateMachineFTM::Enable, this,_1, FTM::StaticData::kClockConditioner))1863 (bind(&StateMachineFTM::Enable, this, placeholders::_1, FTM::StaticData::kClockConditioner)) 1862 1864 ("Enable clock conidtioner output in favor of time marker output" 1863 1865 "|Enable[bool]:Enable clock conditioner (yes/no)"); 1864 1866 1865 1867 T::AddEvent("SET_TRIGGER_SEQUENCE", "S:3", FTM::kIdle) 1866 (b oost::bind(&StateMachineFTM::SetTriggerSeq, this,_1))1868 (bind(&StateMachineFTM::SetTriggerSeq, this, placeholders::_1)) 1867 1869 ("Setup the sequence of artificial triggers produced by the FTM" 1868 1870 "|Ped[short]:number of pedestal triggers in a row" … … 1871 1873 1872 1874 T::AddEvent("SET_TRIGGER_MULTIPLICITY", "S:1", FTM::kIdle) 1873 (b oost::bind(&StateMachineFTM::SetTriggerMultiplicity, this,_1))1875 (bind(&StateMachineFTM::SetTriggerMultiplicity, this, placeholders::_1)) 1874 1876 ("Setup the Multiplicity condition for physcis triggers" 1875 1877 "|N[int]:Number of requirered coincident triggers from sum-patches (1-40)"); 1876 1878 1877 1879 T::AddEvent("SET_TRIGGER_WINDOW", "S:1", FTM::kIdle) 1878 (b oost::bind(&StateMachineFTM::SetTriggerWindow, this,_1))1880 (bind(&StateMachineFTM::SetTriggerWindow, this, placeholders::_1)) 1879 1881 (""); 1880 1882 1881 1883 T::AddEvent("SET_CALIBRATION_MULTIPLICITY", "S:1", FTM::kIdle) 1882 (b oost::bind(&StateMachineFTM::SetCalibMultiplicity, this,_1))1884 (bind(&StateMachineFTM::SetCalibMultiplicity, this, placeholders::_1)) 1883 1885 ("Setup the Multiplicity condition for artificial (calibration) triggers" 1884 1886 "|N[int]:Number of requirered coincident triggers from sum-patches (1-40)"); 1885 1887 1886 1888 T::AddEvent("SET_CALIBRATION_WINDOW", "S:1", FTM::kIdle) 1887 (b oost::bind(&StateMachineFTM::SetCalibWindow, this,_1))1889 (bind(&StateMachineFTM::SetCalibWindow, this, placeholders::_1)) 1888 1890 (""); 1889 1891 1890 1892 T::AddEvent("SET_CLOCK_FREQUENCY", "S:1", FTM::kIdle) 1891 (b oost::bind(&StateMachineFTM::SetClockFrequency, this,_1))1893 (bind(&StateMachineFTM::SetClockFrequency, this, placeholders::_1)) 1892 1894 (""); 1893 1895 1894 1896 T::AddEvent("SET_CLOCK_REGISTER", "X:8", FTM::kIdle) 1895 (b oost::bind(&StateMachineFTM::SetClockRegister, this,_1))1897 (bind(&StateMachineFTM::SetClockRegister, this, placeholders::_1)) 1896 1898 (""); 1897 1899 … … 1899 1901 // we can allow it in idle _and_ taking data 1900 1902 T::AddEvent("CONFIGURE", "C", FTM::kIdle, FTM::kTakingData) 1901 (b oost::bind(&StateMachineFTM::ConfigureFTM, this,_1))1903 (bind(&StateMachineFTM::ConfigureFTM, this, placeholders::_1)) 1902 1904 (""); 1903 1905 1904 1906 T::AddEvent("RESET_CONFIGURE", FTM::kConfiguring1, FTM::kConfiguring2, FTM::kConfigured, FTM::kConfigError1, FTM::kConfigError2) 1905 (b oost::bind(&StateMachineFTM::ResetConfig, this))1907 (bind(&StateMachineFTM::ResetConfig, this)) 1906 1908 (""); 1907 1909 … … 1909 1911 1910 1912 T::AddEvent("RESET_CRATE", "S:1", FTM::kIdle) 1911 (b oost::bind(&StateMachineFTM::ResetCrate, this,_1))1913 (bind(&StateMachineFTM::ResetCrate, this, placeholders::_1)) 1912 1914 ("Reset one of the crates 0-3" 1913 1915 "|crate[short]:Crate number to be reseted (0-3)"); 1914 1916 1915 1917 T::AddEvent("RESET_CAMERA", FTM::kIdle) 1916 (Wrapper(b oost::bind(&ConnectionFTM::CmdResetCamera, &fFTM)))1918 (Wrapper(bind(&ConnectionFTM::CmdResetCamera, &fFTM))) 1917 1919 ("Reset all crates. The commands are sent in the order 0,1,2,3"); 1918 1920 … … 1920 1922 // Load/save static data block 1921 1923 T::AddEvent("SAVE", "C", FTM::kIdle) 1922 (b oost::bind(&StateMachineFTM::SaveStaticData, this,_1))1924 (bind(&StateMachineFTM::SaveStaticData, this, placeholders::_1)) 1923 1925 ("Saves the static data (FTM configuration) from memory to a file" 1924 1926 "|filename[string]:Filename (can include a path), .bin is automatically added"); 1925 1927 1926 1928 T::AddEvent("LOAD", "C", FTM::kIdle) 1927 (b oost::bind(&StateMachineFTM::LoadStaticData, this,_1))1929 (bind(&StateMachineFTM::LoadStaticData, this, placeholders::_1)) 1928 1930 ("Loads the static data (FTM configuration) from a file into memory and sends it to the FTM" 1929 1931 "|filename[string]:Filename (can include a path), .bin is automatically added"); … … 1933 1935 // Verbosity commands 1934 1936 T::AddEvent("SET_VERBOSE", "B") 1935 (b oost::bind(&StateMachineFTM::SetVerbosity, this,_1))1937 (bind(&StateMachineFTM::SetVerbosity, this, placeholders::_1)) 1936 1938 ("set verbosity state" 1937 1939 "|verbosity[bool]:disable or enable verbosity for received data (yes/no), except dynamic data"); 1938 1940 1939 1941 T::AddEvent("SET_HEX_OUTPUT", "B") 1940 (b oost::bind(&StateMachineFTM::SetHexOutput, this,_1))1942 (bind(&StateMachineFTM::SetHexOutput, this, placeholders::_1)) 1941 1943 ("enable or disable hex output for received data" 1942 1944 "|hexout[bool]:disable or enable hex output for received data (yes/no)"); 1943 1945 1944 1946 T::AddEvent("SET_DYNAMIC_OUTPUT", "B") 1945 (b oost::bind(&StateMachineFTM::SetDynamicOut, this,_1))1947 (bind(&StateMachineFTM::SetDynamicOut, this, placeholders::_1)) 1946 1948 ("enable or disable output for received dynamic data (data is still broadcasted via Dim)" 1947 1949 "|dynout[bool]:disable or enable output for dynamic data (yes/no)"); … … 1950 1952 // Conenction commands 1951 1953 T::AddEvent("DISCONNECT", FTM::kConnected, FTM::kIdle) 1952 (b oost::bind(&StateMachineFTM::Disconnect, this))1954 (bind(&StateMachineFTM::Disconnect, this)) 1953 1955 ("disconnect from ethernet"); 1954 1956 1955 1957 T::AddEvent("RECONNECT", "O", FTM::kDisconnected, FTM::kConnected, FTM::kIdle, FTM::kConfigured) 1956 (b oost::bind(&StateMachineFTM::Reconnect, this,_1))1958 (bind(&StateMachineFTM::Reconnect, this, placeholders::_1)) 1957 1959 ("(Re)connect ethernet connection to FTM, a new address can be given" 1958 1960 "|[host][string]:new ethernet address in the form <host:port>"); … … 2238 2240 shell.SetReceiver(io_service); 2239 2241 2240 boost::thread t(b oost::bind(RunThread, &io_service));2241 // boost::thread t(b oost::bind(&StateMachineFTM<S>::Run, &io_service));2242 boost::thread t(bind(RunThread, &io_service)); 2243 // boost::thread t(bind(&StateMachineFTM<S>::Run, &io_service)); 2242 2244 2243 2245 if (conf.Has("cmd")) -
trunk/FACT++/src/mcp.cc
r11480 r11481 1 #include <boost/bind.hpp>2 3 1 #include "Dim.h" 4 2 #include "Event.h" … … 42 40 boost::function<int(const EventImp &)> Wrapper(boost::function<void()> func) 43 41 { 44 return b oost::bind(&StateMachineMCP::Wrap, this, func);42 return bind(&StateMachineMCP::Wrap, this, func); 45 43 }*/ 46 44 … … 332 330 333 331 AddEvent("START", kStateIdle) 334 (b oost::bind(&StateMachineMCP::StartRun, this,_1))332 (bind(&StateMachineMCP::StartRun, this, placeholders::_1)) 335 333 (""); 336 334 337 335 AddEvent("STOP") 338 (b oost::bind(&StateMachineMCP::StopRun, this,_1))336 (bind(&StateMachineMCP::StopRun, this, placeholders::_1)) 339 337 (""); 340 338 341 339 AddEvent("RESET", kStateConfiguring1, kStateConfiguring2, kStateConfigured) 342 (b oost::bind(&StateMachineMCP::Reset, this,_1))340 (bind(&StateMachineMCP::Reset, this, placeholders::_1)) 343 341 (""); 344 342 345 343 // Verbosity commands 346 344 AddEvent("SET_VERBOSE", "B:1") 347 (b oost::bind(&StateMachineMCP::SetVerbosity, this,_1))345 (bind(&StateMachineMCP::SetVerbosity, this, placeholders::_1)) 348 346 ("set verbosity state" 349 347 "|verbosity[bool]:disable or enable verbosity for received data (yes/no), except dynamic data"); 350 348 351 349 AddEvent("PRINT") 352 (b oost::bind(&StateMachineMCP::Print, this))350 (bind(&StateMachineMCP::Print, this)) 353 351 (""); 354 352 } … … 422 420 shell.SetReceiver(io_service); 423 421 424 boost::thread t(b oost::bind(RunThread, &io_service));425 // boost::thread t(b oost::bind(&StateMachineMCP<S>::Run, &io_service));422 boost::thread t(bind(RunThread, &io_service)); 423 // boost::thread t(bind(&StateMachineMCP<S>::Run, &io_service)); 426 424 427 425 if (conf.Has("cmd")) -
trunk/FACT++/src/scheduler.cc
r11479 r11481 1 1 #include <vector> 2 2 3 #include <boost/bind.hpp>4 3 #include <boost/regex.hpp> 5 4
Note:
See TracChangeset
for help on using the changeset viewer.