Changeset 15428 for trunk/FACT++
- Timestamp:
- 04/24/13 21:58:51 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/EventBuilder.c
r15413 r15428 1279 1279 continue; 1280 1280 1281 const int b = i / 7 ;1281 const int board = i / 7 ; 1282 1282 //const int p = i % 7 ; 1283 1283 … … 1298 1298 // Success (rd[i].sockStat == 0) 1299 1299 1300 if (sockDef[b ] > 0)1300 if (sockDef[board] > 0) 1301 1301 { 1302 1302 rd[i].bufTyp = 0; // expect a header … … 1312 1312 rd[i].skip = 0; // start empty 1313 1313 1314 gi_NumConnect[b ] += cntsock;1314 gi_NumConnect[board] += cntsock; 1315 1315 1316 1316 //gi.numConn[b]++; 1317 gj.numConn[b ]++;1318 1319 factPrintf(kInfo, -1, "New connection %d (number of connections: %d)", b , gj.numConn[b]);1317 gj.numConn[board]++; 1318 1319 factPrintf(kInfo, -1, "New connection %d (number of connections: %d)", board, gj.numConn[board]); 1320 1320 } 1321 1321 … … 1352 1352 factPrintf(kInfo, 441, "Socket %d closed by FAD", i); 1353 1353 1354 const int s0 = sockDef[b ] > 0 ? +1 : -1;1354 const int s0 = sockDef[board] > 0 ? +1 : -1; 1355 1355 GenSock(s0, i, 0, NULL, &rd[i]); 1356 1356 1357 1357 //gi.gotErr[b]++; 1358 1358 1359 gi_NumConnect[b ]-= cntsock ;1359 gi_NumConnect[board]-= cntsock ; 1360 1360 //gi.numConn[b]--; 1361 gj.numConn[b ]--;1361 gj.numConn[board]--; 1362 1362 1363 1363 continue; … … 1365 1365 // Success (jrd > 0) 1366 1366 1367 gj.rateBytes[b ] += jrd;1367 gj.rateBytes[board] += jrd; 1368 1368 1369 1369 // are we skipping this board ... … … 1412 1412 1413 1413 // no free entry in mBuffer, retry later 1414 if (evID < 0)1414 if (evID == -1) 1415 1415 continue; 1416 1416 1417 // If memory has not been allocated yet, allocate it1418 if (evID > 0 && mBuffer[evID].FADhead == NULL)1417 // We have a valid entry, but no memory has yet been allocated 1418 if (evID >= 0 && mBuffer[evID].FADhead == NULL) 1419 1419 { 1420 // Try to get memory from the big buffer 1420 1421 mBuffer[evID].FADhead = TGB_Malloc(); 1421 1422 if (mBuffer[evID].FADhead == NULL) … … 1429 1430 } 1430 1431 1432 // Initialice mBuffer[evID]->fEvent 1431 1433 initEvent(evID); 1432 1434 … … 1463 1465 1464 1466 //we have a valid entry in mBuffer[]; fill it 1465 const int boardId = b;1466 1467 const int fadBoard = rd[i].rBuf->S[12]; 1467 const int fadCrate = fadBoard / 256;1468 1469 if (board Id != (fadCrate * 10 + fadBoard % 256))1468 const int fadCrate = fadBoard>>8; 1469 1470 if (board != (fadCrate * 10 + (fadBoard&0xff))) 1470 1471 { 1471 1472 factPrintf(kWarn, 301, "Board ID mismatch. Expected %d, got %d (C=%d, B=%d)", 1472 board Id, fadBoard, fadCrate, fadBoard % 256);1473 board, fadBoard, fadCrate, fadBoard&0xff); 1473 1474 } 1474 1475 1475 if (mBuffer[evID].board[board Id] != -1)1476 if (mBuffer[evID].board[board] != -1) 1476 1477 { 1477 1478 factPrintf(kWarn, 501, "Got event %5d from board %3d (i=%3d, len=%5d) twice: Starts with %3d %3d - ends with %3d %3d", 1478 evID, board Id, i, rd[i].fadLen,1479 evID, board, i, rd[i].fadLen, 1479 1480 rd[i].rBuf->B[0], rd[i].rBuf->B[1], 1480 1481 rd[i].rBuf->B[rd[i].fadLen - 2], … … 1484 1485 1485 1486 // Copy data from rd[i] to mBuffer[evID] 1486 copyData(i, evID, board Id);1487 copyData(i, evID, board); 1487 1488 1488 1489 // now we have stored a new board contents into Event structure … … 1494 1495 1495 1496 mBuffer[evID].fEvent->NumBoards++; 1496 mBuffer[evID].board[board Id] = boardId;1497 mBuffer[evID].board[board] = board; 1497 1498 mBuffer[evID].nBoard++; 1498 1499
Note:
See TracChangeset
for help on using the changeset viewer.