Changeset 11200 for trunk/FACT++/gui/FactGui.h
- Timestamp:
- 06/27/11 16:59:40 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r11196 r11200 383 383 DimStampedInfo fDimFtmCounter; 384 384 385 DimStampedInfo fDimFadFiles;386 385 DimStampedInfo fDimFadRuns; 387 386 DimStampedInfo fDimFadEvents; … … 390 389 DimStampedInfo fDimFadConnections; 391 390 DimStampedInfo fDimFadFwVersion; 391 DimStampedInfo fDimFadRunNumber; 392 392 DimStampedInfo fDimFadDNA; 393 393 DimStampedInfo fDimFadStatus; … … 930 930 // ===================== FAD ============================================ 931 931 932 void handleFadFiles(const DimData &d)933 {934 if (!CheckSize(d, 8))935 return;936 937 fEvtBuilderOpenFiles->setValue(d.get<uint64_t>());938 }939 940 932 void handleFadRuns(const DimData &d) 941 933 { 942 if (!CheckSize(d, 4)) 943 return; 944 945 fEvtsRunMax->setValue(d.get<uint32_t>()); 934 if (!CheckSize(d, 12)) 935 return; 936 937 const uint32_t *ptr = d.ptr<uint32_t>(); 938 939 fEvtBldRunNumberMin->setValue(ptr[1]); 940 fEvtBldRunNumberMax->setValue(ptr[2]); 941 fEvtBldOpenFiles->setValue(ptr[0]); 946 942 } 947 943 … … 1078 1074 fFadConnections.assign(ptr, ptr+40); 1079 1075 } 1080 /* 1081 template<typename T> 1082 bool CheckConsistency(const T *v) 1083 { 1084 for (int i=1; i<40; i++) 1085 if (fFadConnections[i]==10 && v[i]!=v[0]) 1086 return false; 1087 1088 return true; 1089 } 1090 1091 template<typename T> 1092 T GetFirst(const T *v) 1093 { 1094 for (int i=0; i<40; i++) 1095 if (fFadConnections[i]==9) 1096 return v[i]; 1097 1098 return T(); 1099 } 1100 */ 1101 void handleFadFwVersion(const DimData &d) 1102 { 1103 if (!CheckSize(d, 43*sizeof(float))) 1104 return; 1105 1106 const float *ptr = d.ptr<float>(); 1107 fFadFwVersion->setValue(ptr[1]); 1076 1077 template<typename T, class S> 1078 void handleFadMinMax(const DimData &d, QPushButton *led, S *wmin, S *wmax=0) 1079 { 1080 if (!CheckSize(d, 42*sizeof(T))) 1081 return; 1082 1083 const T *ptr = d.ptr<T>(); 1084 const T min = ptr[40]; 1085 const T max = ptr[41]; 1086 1087 if (max<min) 1088 SetLedColor(led, kLedGray, d.time); 1089 else 1090 SetLedColor(led, min==max?kLedGreen: kLedOrange, d.time); 1091 1092 if (!wmax && max!=min) 1093 wmin->setValue(0); 1094 else 1095 wmin->setValue(min); 1096 1097 if (wmax) 1098 wmax->setValue(max); 1108 1099 1109 1100 ostringstream tip; … … 1117 1108 tip << "<tr><th>" << c << "</th>"; 1118 1109 for (int b=0; b<10; b++) 1119 tip << "<td>" << ptr[c*10+b +3] << "</td>";1110 tip << "<td>" << ptr[c*10+b] << "</td>"; 1120 1111 tip << "</tr>"; 1121 1112 } 1122 1113 tip << "</table>"; 1123 1114 1124 fFadFwVersion->setToolTip(tip.str().c_str()); 1125 1126 SetLedColor(fFadLedFwVersion, d.qos?kLedGreen:kLedOrange, d.time); 1115 led->setToolTip(tip.str().c_str()); 1116 } 1117 1118 void handleFadFwVersion(const DimData &d) 1119 { 1120 handleFadMinMax<float, QDoubleSpinBox>(d, fFadLedFwVersion, fFadFwVersion); 1121 } 1122 1123 void handleFadRunNumber(const DimData &d) 1124 { 1125 handleFadMinMax<uint32_t, QSpinBox>(d, fFadLedRunNumber, fFadRunNumber); 1127 1126 } 1128 1127 … … 1199 1198 SetFadLed(fFadLedSocket, d, FAD::EventHeader::kSock17); 1200 1199 SetFadLed(fFadLedPllLock, d, 0xf000); 1201 1202 1203 1200 } 1204 1201 … … 2001 1998 return PostInfoHandler(&FactGui::handleLoggerStats); 2002 1999 2003 if (getInfo()==&fDimFadFiles)2004 return PostInfoHandler(&FactGui::handleFadFiles);2000 // if (getInfo()==&fDimFadFiles) 2001 // return PostInfoHandler(&FactGui::handleFadFiles); 2005 2002 2006 2003 if (getInfo()==&fDimFadConnections) … … 2009 2006 if (getInfo()==&fDimFadFwVersion) 2010 2007 return PostInfoHandler(&FactGui::handleFadFwVersion); 2008 2009 if (getInfo()==&fDimFadRunNumber) 2010 return PostInfoHandler(&FactGui::handleFadRunNumber); 2011 2011 2012 2012 if (getInfo()==&fDimFadDNA) … … 2065 2065 return PostInfoHandler(&FactGui::handleFtmError); 2066 2066 2067 if (getInfo()==&fDimFadFiles)2068 return PostInfoHandler(&FactGui::handleFadFiles);2067 // if (getInfo()==&fDimFadFiles) 2068 // return PostInfoHandler(&FactGui::handleFadFiles); 2069 2069 2070 2070 for (map<string,DimInfo*>::iterator i=fServices.begin(); i!=fServices.end(); i++) … … 2450 2450 fDimFtmDynamicData ("FTM_CONTROL/DYNAMIC_DATA", (void*)NULL, 0, this), 2451 2451 fDimFtmCounter ("FTM_CONTROL/COUNTER", (void*)NULL, 0, this), 2452 fDimFadFiles ("FAD_CONTROL/FILES", (void*)NULL, 0, this),2453 2452 fDimFadRuns ("FAD_CONTROL/RUNS", (void*)NULL, 0, this), 2454 2453 fDimFadEvents ("FAD_CONTROL/EVENTS", (void*)NULL, 0, this), … … 2457 2456 fDimFadConnections ("FAD_CONTROL/CONNECTIONS", (void*)NULL, 0, this), 2458 2457 fDimFadFwVersion ("FAD_CONTROL/FIRMWARE_VERSION", (void*)NULL, 0, this), 2458 fDimFadRunNumber ("FAD_CONTROL/RUN_NUMBER", (void*)NULL, 0, this), 2459 2459 fDimFadDNA ("FAD_CONTROL/DNA", (void*)NULL, 0, this), 2460 2460 fDimFadStatus ("FAD_CONTROL/STATUS", (void*)NULL, 0, this),
Note:
See TracChangeset
for help on using the changeset viewer.