Changeset 11294
- Timestamp:
- 07/08/11 15:41:15 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r11279 r11294 535 535 void RemoveService(const std::string &server, const std::string &service, bool iscmd) 536 536 { 537 UnsubscribeService(server+'/'+service );537 UnsubscribeService(server+'/'+service, true); 538 538 539 539 QApplication::postEvent(this, … … 634 634 } 635 635 636 void UnsubscribeService(const string &service )636 void UnsubscribeService(const string &service, bool allow_unsubscribed) 637 637 { 638 638 const map<string,DimInfo*>::iterator i=fServices.find(service); … … 640 640 if (i==fServices.end()) 641 641 { 642 cout << "ERROR - We are not subscribed to " << service << endl; 642 if (!allow_unsubscribed) 643 cout << "ERROR - We are not subscribed to " << service << endl; 643 644 return; 644 645 } … … 892 893 void handleFadRuns(const DimData &d) 893 894 { 894 if (!CheckSize(d, 20)) 895 return; 895 if (d.size()<20) 896 { 897 cout << "Size mismatch in " << d.name << ": Found=" << d.size() << " Expected>=20" << endl; 898 return; 899 } 896 900 897 901 const uint32_t *ptr = d.ptr<uint32_t>(); … … 903 907 fEvtBldLastOpened->setValue(ptr[3]); 904 908 fEvtBldLastClosed->setValue(ptr[4]); 909 910 if (d.size()>=20) 911 fEvtBldFilename->setText(d.ptr<char>(20)); 912 913 if (ptr[0]==0) 914 fEvtBldFilename->setText(""); 915 905 916 } 906 917 … … 1288 1299 int32_t procStat ; //processing thread(s) 1289 1300 int32_t writStat ; //write thread 1290 1291 //info about some rates1292 int32_t deltaT ; //time in milli-seconds for rates1293 int32_t readEvt ; //#events read1294 int32_t procEvt ; //#events processed1295 int32_t writEvt ; //#events written1296 int32_t skipEvt ; //#events skipped1297 1298 //some info about current state of event buffer (snapspot)1299 int32_t evtBuf; //#Events currently waiting in Buffer1300 uint64_t totMem; //#Bytes available in Buffer1301 uint64_t usdMem; //#Bytes currently used1302 uint64_t maxMem; //max #Bytes used during past Second1303 1301 */ 1304 1302 1305 1303 fFadBufferMax->setValue(stat.totMem/1000000); 1306 1304 fFadBuffer->setMaximum(stat.totMem/100); 1307 fFadBuffer->setValue(stat.maxMem/100); 1308 1309 cout << stat.totMem << " " << stat.maxMem << endl; 1310 1311 /* 1312 fFadEvtWait->setValue(stat[1]); 1313 fFadEvtSkip->setValue(stat[2]); 1314 fFadEvtDel->setValue(stat[3]); 1315 fFadEvtTot->setValue(stat[4]); 1316 fFadEthernetRateTot->setValue(stat[6]/1024.); 1317 fFadEthernetRateAvg->setValue(stat[6]/1024./stat[7]); 1318 fFadEvtConn->setValue(stat[7]); 1319 */ 1305 fFadBuffer->setValue(stat.maxMem/100); // Max mem used in last second 1306 1307 uint32_t sum = 0; 1308 int32_t min = 0x7fffff; 1309 int32_t max = 0; 1310 1311 int cnt = 0; 1312 int err = 0; 1313 1314 for (int i=0; i<40; i++) 1315 { 1316 if (stat.numConn[i]!=7) 1317 continue; 1318 1319 cnt++; 1320 1321 sum += stat.rateBytes[i]; 1322 err += stat.errConn[i]; 1323 1324 if (stat.rateBytes[i]<min) 1325 min = stat.rateBytes[i]; 1326 if (stat.rateBytes[i]>max) 1327 max = stat.rateBytes[i]; 1328 } 1329 1330 fFadEvtConn->setValue(cnt); 1331 fFadEvtConnErr->setValue(err); 1332 1333 fFadEvtBufNew->setValue(stat.bufNew); // Incomplete in buffer 1334 fFadEvtBufEvt->setValue(stat.bufEvt); // Complete in buffer 1335 fFadEvtWrite->setValue(stat.evtWrite-stat.evtSkip-stat.evtErr); 1336 fFadEvtSkip->setValue(stat.evtSkip); 1337 fFadEvtErr->setValue(stat.evtErr); 1338 1339 if (stat.deltaT==0) 1340 return; 1341 1342 fFadEthernetRateMin->setValue(min/stat.deltaT); 1343 fFadEthernetRateMax->setValue(max/stat.deltaT); 1344 fFadEthernetRateTot->setValue(sum/stat.deltaT); 1345 fFadEthernetRateAvg->setValue(cnt==0 ? 0 : sum/cnt/stat.deltaT); 1346 fFadEvtRateNew->setValue(1000*stat.rateNew/stat.deltaT); 1347 fFadEvtRateWrite->setValue(1000*stat.rateWrite/stat.deltaT); 1320 1348 } 1321 1349 … … 1325 1353 return; 1326 1354 1327 const EVT_STAT &stat = d.ref<EVT_STAT>();1355 //const EVT_STAT &stat = d.ref<EVT_STAT>(); 1328 1356 1329 1357 /* … … 1849 1877 bool enable = false; 1850 1878 1851 if (s.index<FTM:: kDisconnected) // No Dim connection1879 if (s.index<FTM::StateMachine::kDisconnected) // No Dim connection 1852 1880 SetLedColor(fStatusFTMLed, kLedGray, time); 1853 if (s.index==FTM:: kDisconnected) // Dim connection / FTM disconnected1881 if (s.index==FTM::StateMachine::kDisconnected) // Dim connection / FTM disconnected 1854 1882 SetLedColor(fStatusFTMLed, kLedYellow, time); 1855 if (s.index==FTM::kConnected || s.index==FTM::kIdle || s.index==FTM::kTakingData) // Dim connection / FTM connected 1883 if (s.index==FTM::StateMachine::kConnected || 1884 s.index==FTM::StateMachine::kIdle || 1885 s.index==FTM::StateMachine::kConfiguring1 || 1886 s.index==FTM::StateMachine::kConfiguring2 || 1887 s.index==FTM::StateMachine::kConfigured || 1888 s.index==FTM::StateMachine::kTakingData) // Dim connection / FTM connected 1856 1889 SetLedColor(fStatusFTMLed, kLedGreen, time); 1857 1890 1858 if (s.index==FTM::kConnected || s.index==FTM::kIdle) // Dim connection / FTM connected 1891 if (s.index==FTM::StateMachine::kConnected || 1892 s.index==FTM::StateMachine::kIdle) // Dim connection / FTM connected 1859 1893 enable = true; 1860 1894 … … 1863 1897 fRatesWidget->setEnabled(enable); 1864 1898 1865 if (s.index>=FTM:: kConnected)1899 if (s.index>=FTM::StateMachine::kConnected) 1866 1900 SetFtuStatusLed(time); 1867 1901 else
Note:
See TracChangeset
for help on using the changeset viewer.