Changeset 11174 for trunk/FACT++/src
- Timestamp:
- 06/24/11 14:17:49 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/EventBuilderWrapper.h
r11169 r11174 721 721 DimDescribedService fDimEventData; 722 722 DimDescribedService fDimFwVersion; 723 DimDescribedService fDimPllLock; 724 DimDescribedService fDimDrsEnabled; 723 //DimDescribedService fDimPllLock; 724 //DimDescribedService fDimDrsEnabled; 725 //DimDescribedService fDimTriggerLine; 726 //DimDescribedService fDimContinousTrigger; 727 //DimDescribedService fDimSocket; 728 DimDescribedService fDimStatus; 725 729 DimDescribedService fDimStatistics; 726 730 … … 742 746 fDimEventData("FAD_CONTROL/EVENT_DATA", "S:1;I:1;S:1;I:2;S:1;S", ""), 743 747 fDimFwVersion("FAD_CONTROL/FIRMWARE_VERSION", "F:43", ""), 744 fDimPllLock("FAD_CONTROL/PLL_LOCK", "C:41", ""), 745 fDimDrsEnabled("FAD_CONTROL/DRS_ENABLED", "C:41", ""), 748 //fDimPllLock("FAD_CONTROL/PLL_LOCK", "C:41", ""), 749 //fDimDrsEnabled("FAD_CONTROL/DRS_ENABLED", "C:41", ""), 750 //fDimTriggerLine("FAD_CONTROL/TRIGGER_LINE", "C:41", ""), 751 //fDimContinousTrigger("FAD_CONTROL/CONTINOUS_TRIGGER", "C:41", ""), 752 //fDimBusy("FAD_CONTROL/BUSY", "C:41", ""), 753 fDimStatus("FAD_CONTROL/STATUS", "S:42", ""), 746 754 fDimStatistics("FAD_CONTROL/STATISTICS", "X:8", ""), 747 755 fDebugStream(false), fDebugRead(false) … … 1387 1395 } 1388 1396 1397 template<typename T> 1398 boost::array<T, 42> CompareBits(const FAD::EventHeader *h, const T *t) 1399 { 1400 const int offset = reinterpret_cast<const char *>(t) - reinterpret_cast<const char *>(h); 1401 1402 T val; // All bits 0 1403 T rc; 1404 1405 boost::array<T, 42> vec; 1406 1407 bool first = true; 1408 1409 for (int i=0; i<40; i++) 1410 { 1411 const char *base = reinterpret_cast<const char*>(&fVecHeader[i]); 1412 const T *ref = reinterpret_cast<const T*>(base+offset); 1413 1414 vec[i+2] = *ref; 1415 1416 if (gi_NumConnect[i/7]!=7) 1417 continue; 1418 1419 if (first) 1420 { 1421 first = false; 1422 val = *ref; 1423 rc = ~0; 1424 } 1425 1426 rc |= val^*ref; 1427 } 1428 1429 vec[0] = rc; 1430 vec[1] = val; 1431 1432 return vec; 1433 } 1434 1389 1435 template<typename T, size_t N> 1390 1436 void Update(DimDescribedService &svc, const pair<bool,boost::array<T, N>> &data) … … 1442 1488 Print("Run", run); 1443 1489 } 1444 1490 /* 1445 1491 if (old.PLLLCK() != h.PLLLCK()) 1446 1492 { … … 1476 1522 Print("Owf", owf); 1477 1523 } 1478 1524 */ 1479 1525 if (old.IsDcmLocked() != h.IsDcmLocked()) 1480 1526 { … … 1494 1540 Print("Spi", spi); 1495 1541 } 1496 1542 /* 1497 1543 if (old.HasBusy() != h.HasBusy()) 1498 1544 { 1499 1545 const pair<bool, boost::array<uint16_t,43>> bsy = Compare(&h, &h.fStatus, FAD::EventHeader::kBusy); 1500 Print("Bsy", bsy); 1546 pair<bool, boost::array<uint8_t,43>> data; 1547 data.first = bsy.first; 1548 data.second[0] = bsy.second[1]; 1549 for (int i=0; i<40; i++) 1550 data.second[i+1] = bsy.second[i+3]; 1551 Update(fDimBusy, data); 1501 1552 } 1502 1553 … … 1504 1555 { 1505 1556 const pair<bool, boost::array<uint16_t,43>> trg = Compare(&h, &h.fStatus, FAD::EventHeader::kTriggerLine); 1506 Print("Trg", trg); 1557 pair<bool, boost::array<uint8_t,43>> data; 1558 data.first = trg.first; 1559 data.second[0] = trg.second[1]; 1560 for (int i=0; i<40; i++) 1561 data.second[i+1] = trg.second[i+3]; 1562 Update(fDimTriggerLine, data); 1507 1563 } 1508 1564 … … 1510 1566 { 1511 1567 const pair<bool, boost::array<uint16_t,43>> cnt = Compare(&h, &h.fStatus, FAD::EventHeader::kContTrigger); 1512 Print("Cnt", cnt); 1568 pair<bool, boost::array<uint8_t,43>> data; 1569 data.first = cnt.first; 1570 data.second[0] = cnt.second[1]; 1571 for (int i=0; i<40; i++) 1572 data.second[i+1] = cnt.second[i+3]; 1573 Update(fDimContinousTrigger, data); 1513 1574 } 1514 1575 … … 1518 1579 Print("Sck", sck); 1519 1580 } 1520 1581 */ 1582 if (old.fStatus != h.fStatus) 1583 { 1584 const boost::array<uint16_t,42> sts = CompareBits(&h, &h.fStatus); 1585 fDimStatus.setData(const_cast<uint16_t*>(sts.data()), 42*sizeof(uint16_t)); 1586 fDimStatus.updateService(); 1587 1588 cout << "EMMIT" << endl; 1589 } 1521 1590 1522 1591
Note:
See TracChangeset
for help on using the changeset viewer.