Changeset 10749
- Timestamp:
- 05/19/11 08:54:17 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/ftmctrl.cc
r10735 r10749 238 238 { 239 239 stringstream str; 240 str << "Invalid header received: start delimiter wrong, received " << hex << fHeader.fDelimiter << " expected " << FTM::kDelimiterStart << "."; 240 str << "Invalid header received: start delimiter wrong, received "; 241 str << hex << fHeader.fDelimiter << ", expected " << FTM::kDelimiterStart << "."; 241 242 Error(str); 242 243 PostClose(false); … … 298 299 stringstream str; 299 300 str << "Invalid data received: end delimiter wrong, received "; 300 str << hex << ntohs(fBuffer.back()) << " expected " << FTM::kDelimiterEnd << ".";301 str << hex << ntohs(fBuffer.back()) << ", expected " << FTM::kDelimiterEnd << "."; 301 302 Error(str); 302 303 PostClose(false); … … 484 485 public: 485 486 486 static const uint16_t kMaxAddr;487 // static const uint16_t kMaxAddr; 487 488 488 489 public: … … 549 550 bool CmdSetRegister(uint16_t addr, uint16_t val) 550 551 { 551 if (addr> kMaxAddr)552 if (addr>FTM::StaticData::kMaxAddr) 552 553 return false; 553 554 … … 564 565 bool CmdGetRegister(uint16_t addr) 565 566 { 566 if (addr> kMaxAddr)567 if (addr>FTM::StaticData::kMaxAddr) 567 568 return false; 568 569 … … 872 873 } 873 874 874 bool DisablePixel(uint16_t idx, bool disable)875 bool EnablePixel(uint16_t idx, bool enable) 875 876 { 876 877 if (idx>FTM::StaticData::kMaxPixelIdx) 877 878 return false; 878 879 879 fStaticData.EnablePixel(idx, !disable); 880 cout << "ENABLE " << idx << " " << enable << endl; 881 fStaticData.EnablePixel(idx, enable); 882 883 CmdSendStatDat(); 884 885 return true; 886 } 887 888 bool TogglePixel(uint16_t idx) 889 { 890 if (idx>FTM::StaticData::kMaxPixelIdx) 891 return false; 892 893 cout << "TOGGLE " << idx << endl; 894 895 fStaticData.EnablePixel(idx, !fStaticData.Enabled(idx)); 880 896 881 897 CmdSendStatDat(); … … 887 903 }; 888 904 889 const uint16_t ConnectionFTM::kMaxAddr = 0xfff;905 //const uint16_t ConnectionFTM::kMaxAddr = 0xfff; 890 906 891 907 // ------------------------------------------------------------------------ … … 1330 1346 } 1331 1347 1332 int DisablePixel(const EventImp &evt) 1333 { 1334 if (!CheckEventSize(evt.GetSize(), "DisablePixel", 3)) 1335 return T::kSM_FatalError; 1336 1337 fFTM.DisablePixel(evt.GetUShort(), evt.GetText()[2]!=0); 1348 int EnablePixel(const EventImp &evt, bool b) 1349 { 1350 if (!CheckEventSize(evt.GetSize(), "EnablePixel", 2)) 1351 return T::kSM_FatalError; 1352 1353 fFTM.EnablePixel(evt.GetUShort(), b); 1354 1355 return T::GetCurrentState(); 1356 } 1357 1358 int TogglePixel(const EventImp &evt) 1359 { 1360 if (!CheckEventSize(evt.GetSize(), "TogglePixel", 2)) 1361 return T::kSM_FatalError; 1362 1363 fFTM.TogglePixel(evt.GetUShort()); 1338 1364 1339 1365 return T::GetCurrentState(); … … 1483 1509 "|Enable[bool]:Whether FTU should be enabled or disabled (yes/no)"); 1484 1510 1485 AddEvent("DISABLE_PIXEL", "S:1;B:1", kStateIdle) 1486 (boost::bind(&StateMachineFTM::DisablePixel, this, _1)) 1511 AddEvent("DISABLE_PIXEL", "S:1", kStateIdle) 1512 (boost::bind(&StateMachineFTM::EnablePixel, this, _1, false)) 1513 (""); 1514 1515 AddEvent("ENABLE_PIXEL", "S:1", kStateIdle) 1516 (boost::bind(&StateMachineFTM::EnablePixel, this, _1, true)) 1517 (""); 1518 1519 AddEvent("TOGGLE_PIXEL", "S:1", kStateIdle) 1520 (boost::bind(&StateMachineFTM::TogglePixel, this, _1)) 1487 1521 (""); 1488 1522 … … 1533 1567 ("Enable veto line" 1534 1568 "|Enable[bool]:Enable veto (yes/no)"); 1569 1570 AddEvent("ENABLE_CLOCK_CONDITIONER", "B:1", kStateIdle) 1571 (boost::bind(&StateMachineFTM::Enable, this, _1, FTM::StaticData::kClockConditioner)) 1572 ("Enable clock conidtioner output in favor of time marker output" 1573 "|Enable[bool]:Enable clock conditioner (yes/no)"); 1535 1574 1536 1575 AddEvent("SET_TRIGGER_SEQUENCE", "C:3", kStateIdle)
Note:
See TracChangeset
for help on using the changeset viewer.