Changeset 11253
- Timestamp:
- 07/05/11 10:24:02 (13 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Main.h
r11252 r11253 26 26 // Start io_service.run to only use the commandHandler command detaching 27 27 AutoScheduler<S> io_service(wout); 28 if (!io_service. SetConfiguration(conf))28 if (!io_service.EvalConfiguration(conf)) 29 29 return -1; 30 30 … … 48 48 49 49 S io_service(wout); 50 if (!io_service.SetConfiguration(conf)) 51 return -1; 50 const int rc = io_service.EvalConfiguration(conf); 51 if (rc>=0) 52 return rc; 52 53 53 54 shell.SetReceiver(io_service); -
trunk/FACT++/src/datalogger.cc
r11251 r11253 205 205 ~DataLogger(); 206 206 207 bool SetConfiguration(Configuration& conf);207 int EvalConfiguration(Configuration& conf); 208 208 209 209 private: … … 2440 2440 //! @param conf the configuration object that should be used 2441 2441 //! 2442 bool DataLogger::SetConfiguration(Configuration& conf)2442 int DataLogger::EvalConfiguration(Configuration& conf) 2443 2443 { 2444 2444 fDebugIsOn = conf.Get<bool>("debug"); … … 2482 2482 { 2483 2483 Error("Time out delay for old run numbers should be greater than 0 minute"); 2484 return false;2484 return 1; 2485 2485 } 2486 2486 fRunNumberTimeout = timeout; 2487 2487 } 2488 return true;2488 return -1; 2489 2489 } 2490 2490 … … 2505 2505 // Start io_service.run to only use the commandHandler command detaching 2506 2506 DataLogger logger(wout); 2507 if (!logger. SetConfiguration(conf))2507 if (!logger.EvalConfiguration(conf)) 2508 2508 return -1; 2509 2509 … … 2542 2542 DataLogger logger(wout); 2543 2543 2544 if (!logger. SetConfiguration(conf))2544 if (!logger.EvalConfiguration(conf)) 2545 2545 return -1; 2546 2546 -
trunk/FACT++/src/drivectrl.cc
r11251 r11253 847 847 } 848 848 849 bool SetConfiguration(const Configuration &conf)849 int EvalConfiguration(const Configuration &conf) 850 850 { 851 851 SetEndpoint(conf.Get<string>("addr")); … … 853 853 fDrive.SetVerbose(!conf.Get<bool>("quiet")); 854 854 855 return true;855 return -1; 856 856 } 857 857 }; … … 885 885 // Start io_service.run to only use the commandHandler command detaching 886 886 StateMachineDrive<S, T> io_service(wout); 887 if (!io_service. SetConfiguration(conf))887 if (!io_service.EvalConfiguration(conf)) 888 888 return -1; 889 889 … … 909 909 910 910 StateMachineDrive<S, R> io_service(wout); 911 if (!io_service. SetConfiguration(conf))911 if (!io_service.EvalConfiguration(conf)) 912 912 return -1; 913 913 -
trunk/FACT++/src/fadctrl.cc
r11251 r11253 1597 1597 } 1598 1598 1599 bool SetConfiguration(const Configuration &conf)1599 int EvalConfiguration(const Configuration &conf) 1600 1600 { 1601 1601 fIsVerbose = !conf.Get<bool>("quiet"); … … 1614 1614 const tcp::endpoint endpoint = GetEndpoint(addr); 1615 1615 if (endpoint==tcp::endpoint()) 1616 return false;1616 return 1; 1617 1617 1618 1618 for (int i=0; i<num; i++) … … 1620 1620 1621 1621 StartConnection(); 1622 return true;1622 return -1; 1623 1623 } 1624 1624 // ^^^^^ for debugging ^^^^^ … … 1626 1626 if (!(conf.Has("base-addr") ^ conf.Has("addr"))) 1627 1627 { 1628 T::Out() << kRed << " SetConfiguration - Only --base-addr or --addr allowed." << endl;1629 return false;1628 T::Out() << kRed << "EvalConfiguration - Only --base-addr or --addr allowed." << endl; 1629 return 2; 1630 1630 } 1631 1631 … … 1639 1639 const tcp::endpoint endpoint = GetEndpoint(base); 1640 1640 if (endpoint==tcp::endpoint()) 1641 return false;1641 return 1; 1642 1642 1643 1643 const ba::ip::address_v4::bytes_type ip = endpoint.address().to_v4().to_bytes(); … … 1645 1645 if (ip[2]>250 || ip[3]>244) 1646 1646 { 1647 T::Out() << kRed << " SetConfiguration - IP address given by --base-addr out-of-range." << endl;1648 return false;1647 T::Out() << kRed << "EvalConfiguration - IP address given by --base-addr out-of-range." << endl; 1648 return 3; 1649 1649 } 1650 1650 … … 1667 1667 const tcp::endpoint endpoint = GetEndpoint(*i); 1668 1668 if (endpoint==tcp::endpoint()) 1669 return false;1669 return 1; 1670 1670 1671 1671 AddEndpoint(endpoint); … … 1675 1675 StartConnection(); 1676 1676 1677 return true;1677 return -1; 1678 1678 } 1679 1679 … … 1708 1708 // Start io_service.run to only use the commandHandler command detaching 1709 1709 StateMachineFAD<S> io_service(wout); 1710 if (!io_service. SetConfiguration(conf))1710 if (!io_service.EvalConfiguration(conf)) 1711 1711 return -1; 1712 1712 … … 1732 1732 1733 1733 StateMachineFAD<S> io_service(wout); 1734 if (!io_service. SetConfiguration(conf))1734 if (!io_service.EvalConfiguration(conf)) 1735 1735 return -1; 1736 1736 -
trunk/FACT++/src/fscctrl.cc
r11251 r11253 518 518 } 519 519 520 bool SetConfiguration(const Configuration &conf)520 int EvalConfiguration(const Configuration &conf) 521 521 { 522 522 SetEndpoint(conf.Get<string>("addr")); … … 524 524 fFSC.SetVerbose(!conf.Get<bool>("quiet")); 525 525 526 return true;526 return -1; 527 527 } 528 528 }; … … 557 557 // Start io_service.run to only use the commandHandler command detaching 558 558 StateMachineFSC<S, T> io_service(wout); 559 if (!io_service. SetConfiguration(conf))559 if (!io_service.EvalConfiguration(conf)) 560 560 return -1; 561 561 … … 581 581 582 582 StateMachineFSC<S, R> io_service(wout); 583 if (!io_service. SetConfiguration(conf))583 if (!io_service.EvalConfiguration(conf)) 584 584 return -1; 585 585 -
trunk/FACT++/src/ftmctrl.cc
r11251 r11253 1828 1828 } 1829 1829 1830 bool SetConfiguration(const Configuration &conf)1830 int EvalConfiguration(const Configuration &conf) 1831 1831 { 1832 1832 SetEndpoint(conf.Get<string>("addr")); … … 1838 1838 // fFTM.SetDefaultSetup(conf.Get<string>("default-setup")); 1839 1839 1840 return true;1840 return -1; 1841 1841 } 1842 1842 }; … … 1870 1870 // Start io_service.run to only use the commandHandler command detaching 1871 1871 StateMachineFTM<S, T> io_service(wout); 1872 if (!io_service. SetConfiguration(conf))1872 if (!io_service.EvalConfiguration(conf)) 1873 1873 return -1; 1874 1874 … … 1894 1894 1895 1895 StateMachineFTM<S, R> io_service(wout); 1896 if (!io_service. SetConfiguration(conf))1896 if (!io_service.EvalConfiguration(conf)) 1897 1897 return -1; 1898 1898
Note:
See TracChangeset
for help on using the changeset viewer.