Changeset 17679 for trunk/FACT++/src
- Timestamp:
- 04/22/14 14:55:54 (11 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/EventBuilder.cc
r17678 r17679 357 357 factPrintf(MessageImp::kInfo, "Closed socket %d (%d)", sockId, socket); 358 358 359 // Set the socket to "not connected" 359 360 socket = -1; 360 361 connected = false; 361 362 activeSockets--; 363 bufLen = 0; 362 364 } 363 365 … … 645 647 evt->nRoi = nRoi[0]; 646 648 evt->nRoiTM = nRoi[8]; 649 650 //evt->firstBoard = rd.sockId; 647 651 648 652 const bool newrun = actrun->runId != rd.H.runnumber; … … 1308 1312 { 1309 1313 factPrintf(MessageImp::kError, "Got event %5d from board %3d (i=%3d, len=%5d) twice.", 1310 evt->evNum, rs->sockId, rs->sockId, rs->len());1314 evt->evNum, rs->sockId, jj, rs->len()); 1311 1315 // FIXME: What to do with the validity flag? 1312 1316 continue; // Continue reading next header … … 1354 1358 rd[ib].relBytes += uint32_t((*it)->FADhead[ib].package_length)*2; 1355 1359 1360 // The counter must be increased _before_ the pop_front, 1361 // otherwise the counter is invalidated by the pop_front! 1356 1362 it++; 1357 1363 evtCtrl.pop_front(); … … 1416 1422 const shared_ptr<EVT_CTRL2> &evt = *it; 1417 1423 1418 // If there was no memory, it is possible that no header has been processed yet1419 // but the event already exists. What we want to check here are only1420 // if from partially complete events a baord is missing, not1421 // whether the whole event is missing1422 if (!evt->valid())1423 continue;1424 1425 1424 // The first event is the oldest. If the first event within the 1426 1425 // timeout window was received, we can stop searching further. 1427 1426 if (evt->time.tv_sec+g_evtTimeout>=actTime) 1428 1427 break; 1428 1429 // The counter must be increased _before_ the pop_front, 1430 // otherwise the counter is invalidated by the pop_front! 1431 it++; 1432 1433 // This timeout is caused because complete data from one or more 1434 // boards has been received, but the memory could not be allocated. 1435 // There is no reason why we should not go on waiting for 1436 // memory to become free. However, the FADs will disconnect 1437 // after 60s due to their keep-alive timeout, but the event builder 1438 // will still wait for memory to become available. 1439 // Currently, the only possibility to free the memory from the 1440 // evtCtrl to restart the event builder (STOP/START). 1441 if (!evt->valid()) 1442 continue; 1429 1443 1430 1444 // This will result in the emission of a dim service. … … 1434 1448 factReportIncomplete(rep); 1435 1449 1450 // At least the data from one boards is complete... 1436 1451 // package_len is 0 when nothing was received from this board 1437 1452 for (int ib=0; ib<40; ib++) 1438 rd[ib].relBytes += uint32_t((*it)->FADhead[ib].package_length)*2; 1439 1440 it++; 1453 rd[ib].relBytes += uint32_t(evt->FADhead[ib].package_length)*2; 1454 1441 1455 evtCtrl.pop_front(); 1442 1456 } -
trunk/FACT++/src/EventBuilder.h
r17658 r17679 120 120 uint32_t fadLen; 121 121 122 //uint16_t firstBoard; // first board from which data was received 122 123 uint16_t nBoard; 123 124 int16_t board[NBOARDS];
Note:
See TracChangeset
for help on using the changeset viewer.