Changeset 11174
- Timestamp:
- 06/24/11 14:17:49 (14 years ago)
- Location:
- trunk/FACT++
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r11169 r11174 392 392 DimStampedInfo fDimFadPllLock; 393 393 DimStampedInfo fDimFadDrsEnabled; 394 DimStampedInfo fDimFadStatus; 394 395 DimStampedInfo fDimFadStatistics; 395 396 … … 1114 1115 SetLedColor(fFadLedFwVersion, d.qos?kLedGreen:kLedOrange, d.time); 1115 1116 } 1116 1117 /* 1117 1118 void handleFadPllLock(const DimData &d) 1118 1119 { … … 1120 1121 return; 1121 1122 1122 SetLedColor(fFadLedPllLock, d.qos?kLedGreen:kLedOrange, d.time);1123 // SetLedColor(fFadLedPllLock, d.qos?kLedGreen:kLedOrange, d.time); 1123 1124 1124 1125 const uint8_t *ptr = d.ptr<uint8_t>(); … … 1156 1157 const uint8_t *ptr = d.ptr<uint8_t>(); 1157 1158 1158 SetLedColor(fFadLedDrsEnabled, d.qos?(ptr[0]?kLedGreen:kLedRed):kLedOrange, d.time);1159 // SetLedColor(fFadLedDrsEnabled, d.qos?(ptr[0]?kLedGreen:kLedRed):kLedOrange, d.time); 1159 1160 1160 1161 ostringstream tip; … … 1178 1179 1179 1180 fFadLedDrsEnabled->setToolTip(tip.str().c_str()); 1181 1182 } 1183 */ 1184 void SetFadLed(QPushButton *led, const DimData &d, uint16_t bitmask) 1185 { 1186 const uint16_t quality = d.ptr<uint16_t>()[0]; 1187 const uint16_t value = d.ptr<uint16_t>()[1]; 1188 const uint16_t *ptr = d.ptr<uint16_t>()+2; 1189 1190 SetLedColor(led, quality&bitmask?(value&bitmask?kLedGreen:kLedRed):kLedOrange, d.time); 1191 1192 ostringstream tip; 1193 tip << "<table border='1'><tr><th colspan='11'>" << d.time.GetAsStr() << "</th></tr><tr><th></th>"; 1194 for (int b=0; b<10; b++) 1195 tip << "<th>" << b << "</th>"; 1196 tip << "</tr>"; 1197 1198 for (int c=0; c<4; c++) 1199 { 1200 tip << "<tr><th>" << dec << c << "</th>" << hex; 1201 for (int b=0; b<10; b++) 1202 { 1203 tip << "<td>" 1204 << (ptr[c*10+b]&bitmask) 1205 << "</td>"; 1206 } 1207 tip << "</tr>"; 1208 } 1209 tip << "</table>"; 1210 1211 led->setToolTip(tip.str().c_str()); 1212 } 1213 1214 void handleFadStatus(const DimData &d) 1215 { 1216 if (!CheckSize(d, 42*sizeof(uint16_t))) 1217 return; 1218 1219 SetFadLed(fFadLedDrsEnabled, d, FAD::EventHeader::kDenable); 1220 SetFadLed(fFadLedDrsWrite, d, FAD::EventHeader::kDwrite); 1221 SetFadLed(fFadLedRefClockTooLow, d, FAD::EventHeader::kRefClkTooLow); 1222 SetFadLed(fFadLedBusy, d, FAD::EventHeader::kBusy); 1223 SetFadLed(fFadLedTriggerLine, d, FAD::EventHeader::kTriggerLine); 1224 SetFadLed(fFadLedContTrigger, d, FAD::EventHeader::kContTrigger); 1225 SetFadLed(fFadLedSocket, d, FAD::EventHeader::kSock17); 1226 SetFadLed(fFadLedPllLock, d, 0xf000); 1227 1180 1228 1181 1229 } … … 1976 2024 return PostInfoHandler(&FactGui::handleFadFwVersion); 1977 2025 1978 if (getInfo()==&fDimFadPllLock) 1979 return PostInfoHandler(&FactGui::handleFadPllLock); 1980 1981 if (getInfo()==&fDimFadDrsEnabled) 1982 return PostInfoHandler(&FactGui::handleFadDrsEnabled); 2026 // if (getInfo()==&fDimFadPllLock) 2027 // return PostInfoHandler(&FactGui::handleFadPllLock); 2028 2029 // if (getInfo()==&fDimFadDrsEnabled) 2030 // return PostInfoHandler(&FactGui::handleFadDrsEnabled); 2031 2032 if (getInfo()==&fDimFadStatus) 2033 return PostInfoHandler(&FactGui::handleFadStatus); 1983 2034 1984 2035 if (getInfo()==&fDimFadStatistics) … … 2425 2476 fDimFadPllLock ("FAD_CONTROL/PLL_LOCK", (void*)NULL, 0, this), 2426 2477 fDimFadDrsEnabled ("FAD_CONTROL/DRS_ENABLED", (void*)NULL, 0, this), 2478 fDimFadStatus ("FAD_CONTROL/STATUS", (void*)NULL, 0, this), 2427 2479 fDimFadStatistics ("FAD_CONTROL/STATISTICS", (void*)NULL, 0, this) 2428 2480 { -
trunk/FACT++/gui/design.ui
r11172 r11174 3126 3126 </item> 3127 3127 <item row="2" column="0"> 3128 <widget class="QPushButton" name="fFadLedD write">3128 <widget class="QPushButton" name="fFadLedDrsWrite"> 3129 3129 <property name="enabled"> 3130 3130 <bool>true</bool> … … 3498 3498 </item> 3499 3499 <item row="7" column="0"> 3500 <widget class="QPushButton" name="fFadLedCont inousTrigger">3500 <widget class="QPushButton" name="fFadLedContTrigger"> 3501 3501 <property name="enabled"> 3502 3502 <bool>true</bool> … … 3897 3897 </item> 3898 3898 <item row="4" column="1"> 3899 <widget class="QPushButton" name="f StatusDNSLed_11">3899 <widget class="QPushButton" name="fFadLedRefClockTooLow"> 3900 3900 <property name="enabled"> 3901 3901 <bool>true</bool> -
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.