- Timestamp:
- 10/13/11 09:09:22 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/ftmctrl.cc
r12125 r12177 1106 1106 1107 1107 for (int i=0; i<=FTM::StaticData::kMaxPixelIdx; i++) 1108 data.EnablePixel(i, i<0 || i/9==idx); 1108 data.EnablePixel(i, i/9==idx); 1109 1110 CmdSendStatDat(data); 1111 1112 return true; 1113 } 1114 1115 bool EnablePatch(int16_t idx, bool enable) 1116 { 1117 if (idx>FTM::StaticData::kMaxPatchIdx) 1118 return false; 1119 1120 FTM::StaticData data(fStaticData); 1121 1122 for (int i=0; i<=FTM::StaticData::kMaxPixelIdx; i++) 1123 if (i/9==idx) 1124 data.EnablePixel(i, enable); 1109 1125 1110 1126 CmdSendStatDat(data); … … 1703 1719 } 1704 1720 1721 int EnablePatch(const EventImp &evt, bool enable) 1722 { 1723 if (!CheckEventSize(evt.GetSize(), "EnablePatch", 2)) 1724 return T::kSM_FatalError; 1725 1726 if (!fFTM.EnablePatch(evt.GetUShort(), enable)) 1727 T::Warn("EnablePatch - Value out of range."); 1728 1729 return T::GetCurrentState(); 1730 } 1731 1705 1732 int TogglePixel(const EventImp &evt) 1706 1733 { … … 2000 2027 T::AddEvent("DISABLE_ALL_PATCHES_EXCEPT", "S:1", FTM::kIdle) 2001 2028 (bind(&StateMachineFTM::DisableAllPatchesExcept, this, placeholders::_1)) 2029 (""); 2030 2031 T::AddEvent("ENABLE_PATCH", "S:1", FTM::kIdle) 2032 (bind(&StateMachineFTM::EnablePatch, this, placeholders::_1, true)) 2033 (""); 2034 2035 T::AddEvent("DISABLE_PATCH", "S:1", FTM::kIdle) 2036 (bind(&StateMachineFTM::EnablePatch, this, placeholders::_1, false)) 2002 2037 (""); 2003 2038
Note:
See TracChangeset
for help on using the changeset viewer.