Changeset 11169
- Timestamp:
- 06/24/11 13:16:04 (13 years ago)
- Location:
- trunk/FACT++
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r11166 r11169 391 391 DimStampedInfo fDimFadFwVersion; 392 392 DimStampedInfo fDimFadPllLock; 393 DimStampedInfo fDimFadDrsEnabled; 393 394 DimStampedInfo fDimFadStatistics; 394 395 … … 1116 1117 void handleFadPllLock(const DimData &d) 1117 1118 { 1118 if (!CheckSize(d, 4 3*sizeof(uint8_t)))1119 if (!CheckSize(d, 41*sizeof(uint8_t))) 1119 1120 return; 1120 1121 … … 1135 1136 { 1136 1137 tip << "<td>" 1137 << (int)(ptr[c*10+b+ 3]&8)1138 << (int)(ptr[c*10+b+ 3]&4)1139 << (int)(ptr[c*10+b+ 3]&2)1140 << (int)(ptr[c*10+b+ 3]&1)1138 << (int)(ptr[c*10+b+1]&8) 1139 << (int)(ptr[c*10+b+1]&4) 1140 << (int)(ptr[c*10+b+1]&2) 1141 << (int)(ptr[c*10+b+1]&1) 1141 1142 << "</td>"; 1142 1143 } … … 1146 1147 1147 1148 fFadLedPllLock->setToolTip(tip.str().c_str()); 1149 } 1150 1151 void handleFadDrsEnabled(const DimData &d) 1152 { 1153 if (!CheckSize(d, 41*sizeof(uint8_t))) 1154 return; 1155 1156 const uint8_t *ptr = d.ptr<uint8_t>(); 1157 1158 SetLedColor(fFadLedDrsEnabled, d.qos?(ptr[0]?kLedGreen:kLedRed):kLedOrange, d.time); 1159 1160 ostringstream tip; 1161 tip << "<table border='1'><tr><th colspan='11'>" << Time().GetAsStr() << "</th></tr><tr><th></th>"; 1162 for (int b=0; b<10; b++) 1163 tip << "<th>" << b << "</th>"; 1164 tip << "</tr>"; 1165 1166 for (int c=0; c<4; c++) 1167 { 1168 tip << "<tr><th>" << c << "</th>"; 1169 for (int b=0; b<10; b++) 1170 { 1171 tip << "<td>" 1172 << (ptr[c*10+b+1]?"on":"off") 1173 << "</td>"; 1174 } 1175 tip << "</tr>"; 1176 } 1177 tip << "</table>"; 1178 1179 fFadLedDrsEnabled->setToolTip(tip.str().c_str()); 1180 1148 1181 } 1149 1182 … … 1946 1979 return PostInfoHandler(&FactGui::handleFadPllLock); 1947 1980 1981 if (getInfo()==&fDimFadDrsEnabled) 1982 return PostInfoHandler(&FactGui::handleFadDrsEnabled); 1983 1948 1984 if (getInfo()==&fDimFadStatistics) 1949 1985 return PostInfoHandler(&FactGui::handleFadStatistics); … … 2388 2424 fDimFadFwVersion ("FAD_CONTROL/FIRMWARE_VERSION", (void*)NULL, 0, this), 2389 2425 fDimFadPllLock ("FAD_CONTROL/PLL_LOCK", (void*)NULL, 0, this), 2426 fDimFadDrsEnabled ("FAD_CONTROL/DRS_ENABLED", (void*)NULL, 0, this), 2390 2427 fDimFadStatistics ("FAD_CONTROL/STATISTICS", (void*)NULL, 0, this) 2391 2428 { -
trunk/FACT++/gui/design.ui
r11167 r11169 3088 3088 <layout class="QGridLayout" name="gridLayout_37"> 3089 3089 <item row="1" column="0"> 3090 <widget class="QPushButton" name="fFadLedD enable">3090 <widget class="QPushButton" name="fFadLedDrsEnabled"> 3091 3091 <property name="enabled"> 3092 3092 <bool>true</bool> -
trunk/FACT++/src/EventBuilderWrapper.h
r11166 r11169 722 722 DimDescribedService fDimFwVersion; 723 723 DimDescribedService fDimPllLock; 724 DimDescribedService fDimDrsEnabled; 724 725 DimDescribedService fDimStatistics; 725 726 … … 741 742 fDimEventData("FAD_CONTROL/EVENT_DATA", "S:1;I:1;S:1;I:2;S:1;S", ""), 742 743 fDimFwVersion("FAD_CONTROL/FIRMWARE_VERSION", "F:43", ""), 743 fDimPllLock("FAD_CONTROL/PLL_LOCK", "C:43", ""), 744 fDimPllLock("FAD_CONTROL/PLL_LOCK", "C:41", ""), 745 fDimDrsEnabled("FAD_CONTROL/DRS_ENABLED", "C:41", ""), 744 746 fDimStatistics("FAD_CONTROL/STATISTICS", "X:8", ""), 745 747 fDebugStream(false), fDebugRead(false) … … 1353 1355 const T *ref = reinterpret_cast<const T*>(base+offset); 1354 1356 1355 vec[i+3] = *ref;1357 vec[i+3] = (*ref&mask)>>shift; 1356 1358 1357 1359 // if (gi_NumConnect[i/7]!=7) … … 1378 1380 return make_pair(false, vec); 1379 1381 1380 vec[0] = *min;1382 vec[0] = (*min&mask)>>shift; 1381 1383 vec[1] = (*val&mask)>>shift; 1382 vec[2] = *max;1384 vec[2] = (*max&mask)>>shift; 1383 1385 1384 1386 return make_pair(rc, vec); 1385 1387 } 1386 1388 1387 template<typename T >1388 void Update(DimDescribedService &svc, const pair<bool,boost::array<T, 43>> &data)1389 template<typename T, size_t N> 1390 void Update(DimDescribedService &svc, const pair<bool,boost::array<T, N>> &data) 1389 1391 { 1390 1392 svc.setQuality(data.first); 1391 svc.setData(const_cast<T*>(data.second.data()), sizeof(T)* 43);1393 svc.setData(const_cast<T*>(data.second.data()), sizeof(T)*N); 1392 1394 svc.updateService(); 1393 1395 } … … 1444 1446 { 1445 1447 const pair<bool, boost::array<uint16_t,43>> pll = Compare(&h, &h.fStatus, 0xf<<12, 12); 1448 pair<bool, boost::array<uint8_t,41>> data; 1449 data.first = pll.first; 1450 data.second[0] = pll.second[1]; 1451 for (int i=0; i<40; i++) 1452 data.second[i+1] = pll.second[i+3]; 1453 Update(fDimPllLock, data); 1454 } 1455 1456 if (old.HasDenable() != h.HasDenable()) 1457 { 1458 const pair<bool, boost::array<uint16_t,43>> drs = Compare(&h, &h.fStatus, FAD::EventHeader::kDenable); 1446 1459 pair<bool, boost::array<uint8_t,43>> data; 1447 data.first = pll.first; 1448 1449 for (int i=0; i<43; i++) 1450 data.second[i] = (pll.second[i]>>12)&0xf; 1451 Update(fDimPllLock, data); 1452 } 1453 1454 if (old.HasDenable() != h.HasDenable()) 1455 { 1456 const pair<bool, boost::array<uint16_t,43>> drs = Compare(&h, &h.fStatus, FAD::EventHeader::kDenable); 1457 Print("Drs", drs); 1460 data.first = drs.first; 1461 data.second[0] = drs.second[1]; 1462 for (int i=0; i<40; i++) 1463 data.second[i+1] = drs.second[i+3]; 1464 Update(fDimDrsEnabled, data); 1458 1465 } 1459 1466
Note:
See TracChangeset
for help on using the changeset viewer.