Changeset 10555 for trunk/FACT++/src
- Timestamp:
- 05/04/11 10:21:41 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/ftmctrl.cc
r10542 r10555 574 574 fStaticData[patch/4].fDAC[patch%4] = value; 575 575 576 // Maybe move to a "COMMIT" command? 577 CmdSendStatDat(); 578 579 return true; 580 } 581 582 bool EnableFTU(int32_t board, bool enable) 583 { 584 if (board>39) 585 return false; 586 587 if (board<0) 588 { 589 if (enable) 590 fStaticData.EnableAllFTU(); 591 else 592 fStaticData.DisableAllFTU(); 593 } 594 else 595 { 596 if (enable) 597 fStaticData.EnableFTU(board); 598 else 599 fStaticData.DisableFTU(board); 600 601 } 602 603 // Maybe move to a "COMMIT" command? 604 CmdSendStatDat(); 605 606 return true; 607 } 608 609 bool ToggleFTU(uint32_t board) 610 { 611 if (board>39) 612 return false; 613 614 fStaticData.ToggleFTU(board); 615 616 // Maybe move to a "COMMIT" command? 576 617 CmdSendStatDat(); 577 618 … … 838 879 } 839 880 881 int EnableFTU(const EventImp &evt) 882 { 883 if (!CheckEventSize(evt.GetSize(), "EnableFTU", 5)) 884 return T::kSM_FatalError; 885 886 const int32_t &board = *reinterpret_cast<const int32_t*>(evt.GetText()); 887 const int8_t &enable = *reinterpret_cast<const int8_t*>(evt.GetText()+4); 888 889 if (!fFTM.EnableFTU(board, enable)) 890 T::Warn("EnableFTU - Board number must be <40."); 891 892 return T::GetCurrentState(); 893 } 894 895 int ToggleFTU(const EventImp &evt) 896 { 897 if (!CheckEventSize(evt.GetSize(), "ToggleFTU", 4)) 898 return T::kSM_FatalError; 899 900 if (!fFTM.ToggleFTU(evt.GetInt())) 901 T::Warn("ToggleFTU - Allowed range of boards 0-39."); 902 903 return T::GetCurrentState(); 904 } 905 840 906 int Disconnect() 841 907 { … … 899 965 fFTM(*this, *this) 900 966 { 901 cout << "FTM" << endl;902 903 967 // ba::io_service::work is a kind of keep_alive for the loop. 904 968 // It prevents the io_service to go to stopped state, which … … 969 1033 (boost::bind(&StateMachineFTM::SetThreshold, this, _1)) 970 1034 ("Set the comparator threshold" 971 "|Patch[idx]:Index of the patch "1035 "|Patch[idx]:Index of the patch (0-159), -1 for all" 972 1036 "|Threshold[counts]:Threshold to be set in binary counts"); 1037 1038 AddConfiguration("ENABLE_FTU", "I:1;B:1", kStateIdle) 1039 (boost::bind(&StateMachineFTM::EnableFTU, this, _1)) 1040 ("Enable or disable FTU" 1041 "|Board[idx]:Index of the board (0-39), -1 for all" 1042 "|Enable[bool]:Whether FTU should be enabled or disabled (yes/no)"); 1043 1044 AddConfiguration("TOGGLE_FTU", "I:1", kStateIdle) 1045 (boost::bind(&StateMachineFTM::ToggleFTU, this, _1)) 1046 ("Toggle status of FTU (this is mainly meant to be used in the GUI)" 1047 "|Board[idx]:Index of the board (0-39)"); 973 1048 974 1049 T::AddConfiguration("SET_VERBOSE", "B") … … 1004 1079 fFTM.StartConnect(); 1005 1080 1006 1007 // SET_THRESHOLD idx val1008 // ---> SetThreshold(idx==-1, val)1009 1081 1010 1082 // ENABLE_FTU idx bool
Note:
See TracChangeset
for help on using the changeset viewer.