Changeset 11133
- Timestamp:
- 06/23/11 15:54:18 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r11127 r11133 389 389 DimStampedInfo fDimFadEventData; 390 390 DimStampedInfo fDimFadConnections; 391 DimStampedInfo fDimFadFwVersion; 392 DimStampedInfo fDimFadStatistics; 391 393 392 394 map<string, DimInfo*> fServices; … … 1040 1042 } 1041 1043 1044 vector<uint8_t> fFadConnections; 1045 1042 1046 void handleFadConnections(const DimData &d) 1043 1047 { … … 1058 1062 1059 1063 SetLedColor(fFadLEDEventBuilder, ptr[40]==0?kLedRed:kLedGreen, d.time); 1060 } 1064 1065 fFadConnections.assign(ptr, ptr+40); 1066 } 1067 1068 template<typename T> 1069 bool CheckConsistency(const T *v) 1070 { 1071 for (int i=1; i<40; i++) 1072 if (fFadConnections[i]==9 && v[i]!=v[0]) 1073 return false; 1074 1075 return true; 1076 } 1077 1078 template<typename T> 1079 T GetFirst(const T *v) 1080 { 1081 for (int i=0; i<40; i++) 1082 if (fFadConnections[i]==9) 1083 return v[i]; 1084 1085 return T(); 1086 } 1087 1088 void handleFadFwVersion(const DimData &d) 1089 { 1090 if (!CheckSize(d, 40*sizeof(float))) 1091 return; 1092 1093 const float *ptr = d.ptr<float>(); 1094 fFadFwVersion->setValue(GetFirst(ptr)); 1095 1096 ostringstream tip; 1097 tip << "<table border='1'><tr><th colspan='11'>" << Time().GetAsStr() << "</th></tr><tr><th></th>"; 1098 for (int b=0; b<10; b++) 1099 tip << "<th>" << b << "</th>"; 1100 tip << "</tr>"; 1101 1102 for (int c=0; c<4; c++) 1103 { 1104 tip << "<tr><th>" << c << "</th>"; 1105 for (int b=0; b<10; b++) 1106 tip << "<td>" << ptr[c*10+b] << "</td>"; 1107 tip << "</tr>"; 1108 } 1109 tip << "</table>"; 1110 1111 fFadFwVersion->setToolTip(tip.str().c_str()); 1112 } 1113 1114 void handleFadStatistics(const DimData &d) 1115 { 1116 if (!CheckSize(d, 8*sizeof(int64_t))) 1117 return; 1118 1119 const int64_t *stat = d.ptr<int64_t>(); 1120 1121 fFadBufferMax->setMaximum(stat[0]/1000000); 1122 fFadBuffer->setMaximum(stat[0]); 1123 fFadBuffer->setValue(stat[5]); 1124 1125 fFadEvtWait->setValue(stat[1]); 1126 fFadEvtSkip->setValue(stat[2]); 1127 fFadEvtDel->setValue(stat[3]); 1128 fFadEvtTot->setValue(stat[4]); 1129 fFadEvtRead->setValue(stat[6]); 1130 fFadEvtConn->setValue(stat[7]); 1131 } 1132 1061 1133 1062 1134 // ===================== FTM ============================================ … … 1832 1904 return PostInfoHandler(&FactGui::handleFadConnections); 1833 1905 1906 if (getInfo()==&fDimFadFwVersion) 1907 return PostInfoHandler(&FactGui::handleFadFwVersion); 1908 1909 if (getInfo()==&fDimFadStatistics) 1910 return PostInfoHandler(&FactGui::handleFadStatistics); 1911 1834 1912 if (getInfo()==&fDimFadEvents) 1835 1913 return PostInfoHandler(&FactGui::handleFadEvents); … … 2256 2334 fDimLoggerNumSubs ("DATA_LOGGER/NUM_SUBS", const_cast<char*>(""), 0, this), 2257 2335 2258 fDimFtmPassport ("FTM_CONTROL/PASSPORT", (void*)NULL, 0, this), 2259 fDimFtmTriggerCounter("FTM_CONTROL/TRIGGER_COUNTER", (void*)NULL, 0, this), 2260 fDimFtmError ("FTM_CONTROL/ERROR", (void*)NULL, 0, this), 2261 fDimFtmFtuList ("FTM_CONTROL/FTU_LIST", (void*)NULL, 0, this), 2262 fDimFtmStaticData ("FTM_CONTROL/STATIC_DATA", (void*)NULL, 0, this), 2263 fDimFtmDynamicData ("FTM_CONTROL/DYNAMIC_DATA", (void*)NULL, 0, this), 2264 fDimFtmCounter ("FTM_CONTROL/COUNTER", (void*)NULL, 0, this), 2265 fDimFadFiles ("FAD_CONTROL/FILES", (void*)NULL, 0, this), 2266 fDimFadRuns ("FAD_CONTROL/RUNS", (void*)NULL, 0, this), 2267 fDimFadEvents ("FAD_CONTROL/EVENTS", (void*)NULL, 0, this), 2268 fDimFadCurrentEvent ("FAD_CONTROL/CURRENT_EVENT", (void*)NULL, 0, this), 2269 fDimFadEventData ("FAD_CONTROL/EVENT_DATA", (void*)NULL, 0, this), 2270 fDimFadConnections ("FAD_CONTROL/CONNECTIONS", (void*)NULL, 0, this) 2336 fDimFtmPassport ("FTM_CONTROL/PASSPORT", (void*)NULL, 0, this), 2337 fDimFtmTriggerCounter("FTM_CONTROL/TRIGGER_COUNTER", (void*)NULL, 0, this), 2338 fDimFtmError ("FTM_CONTROL/ERROR", (void*)NULL, 0, this), 2339 fDimFtmFtuList ("FTM_CONTROL/FTU_LIST", (void*)NULL, 0, this), 2340 fDimFtmStaticData ("FTM_CONTROL/STATIC_DATA", (void*)NULL, 0, this), 2341 fDimFtmDynamicData ("FTM_CONTROL/DYNAMIC_DATA", (void*)NULL, 0, this), 2342 fDimFtmCounter ("FTM_CONTROL/COUNTER", (void*)NULL, 0, this), 2343 fDimFadFiles ("FAD_CONTROL/FILES", (void*)NULL, 0, this), 2344 fDimFadRuns ("FAD_CONTROL/RUNS", (void*)NULL, 0, this), 2345 fDimFadEvents ("FAD_CONTROL/EVENTS", (void*)NULL, 0, this), 2346 fDimFadCurrentEvent ("FAD_CONTROL/CURRENT_EVENT", (void*)NULL, 0, this), 2347 fDimFadEventData ("FAD_CONTROL/EVENT_DATA", (void*)NULL, 0, this), 2348 fDimFadConnections ("FAD_CONTROL/CONNECTIONS", (void*)NULL, 0, this), 2349 fDimFadStatistics ("FAD_CONTROL/STATISTICS", (void*)NULL, 0, this) 2271 2350 { 2272 2351 fClockCondFreq->addItem("--- Hz", QVariant(-1));
Note:
See TracChangeset
for help on using the changeset viewer.