Changeset 13914 for trunk/FACT++
- Timestamp:
- 05/26/12 14:33:13 (12 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/fscctrl.cc
r13819 r13914 13 13 #include "tools.h" 14 14 15 #include "HeadersState.h" 16 15 17 namespace ba = boost::asio; 16 18 namespace bs = boost::system; … … 18 20 19 21 using namespace std; 22 using namespace FSC; 20 23 21 24 // ------------------------------------------------------------------------ … … 672 675 "|T_sens[deg C]:Sensor compartment temperatures" 673 676 "|T_crate[deg C]:Temperatures crate 0 (back/front), 1 (b/f), 2 (b/f), 3 (b/f)" 674 677 "|T_ps[deg C]:Temp power supplies crate 0 (back/front), 1, 2, 3" 675 678 "|T_aux[deg C]:Auxiliary power supply temperatures FTM (top/bottom), FSC (t/b)" 676 679 "|T_back[deg C]:FTM backpanel temperatures FTM (top/bottom), FSC (top/bottom)" … … 715 718 class StateMachineFSC : public T, public ba::io_service, public ba::io_service::work 716 719 { 717 int Wrap(boost::function<void()> f)718 {719 f();720 return T::GetCurrentState();721 }722 723 function<int(const EventImp &)> Wrapper(function<void()> func)724 {725 return bind(&StateMachineFSC::Wrap, this, func);726 }727 728 720 private: 729 721 S fFSC; 730 731 enum states_t732 {733 kStateDisconnected = 1,734 kStateConnected = 2,735 };736 722 737 723 int Disconnect() … … 776 762 poll_one(); 777 763 778 return fFSC.IsConnected() ? kStateConnected : kStateDisconnected;764 return fFSC.IsConnected() ? State::kConnected : State::kDisconnected; 779 765 } 780 766 … … 823 809 824 810 // State names 825 AddStateName(kStateDisconnected, "Disconnected",811 T::AddStateName(State::kDisconnected, "Disconnected", 826 812 "FSC board not connected via ethernet."); 827 813 828 AddStateName(kStateConnected, "Connected",814 T::AddStateName(State::kConnected, "Connected", 829 815 "Ethernet connection to FSC established."); 830 816 … … 841 827 842 828 // Conenction commands 843 AddEvent("DISCONNECT", kStateConnected)829 T::AddEvent("DISCONNECT", State::kConnected) 844 830 (bind(&StateMachineFSC::Disconnect, this)) 845 831 ("disconnect from ethernet"); 846 832 847 AddEvent("RECONNECT", "O", kStateDisconnected, kStateConnected)833 T::AddEvent("RECONNECT", "O", State::kDisconnected, State::kConnected) 848 834 (bind(&StateMachineFSC::Reconnect, this, placeholders::_1)) 849 835 ("(Re)connect ethernet connection to FTM, a new address can be given"
Note:
See TracChangeset
for help on using the changeset viewer.