diff --git a/slsReceiverSoftware/include/UDPStandardImplementation.h b/slsReceiverSoftware/include/UDPStandardImplementation.h index 2a8a553c7..413d98147 100644 --- a/slsReceiverSoftware/include/UDPStandardImplementation.h +++ b/slsReceiverSoftware/include/UDPStandardImplementation.h @@ -636,6 +636,9 @@ private: /** Total packet Count listened to by listening threads */ int totalListeningPacketCount[MAX_NUMBER_OF_LISTENING_THREADS]; + /** Total packet Count ignored by listening threads */ + int totalIgnoredPacketCount[MAX_NUMBER_OF_LISTENING_THREADS]; + /** Pckets currently in current file, starts new file when it reaches max */ int64_t lastFrameNumberInFile[MAX_NUMBER_OF_WRITER_THREADS]; diff --git a/slsReceiverSoftware/src/UDPStandardImplementation.cpp b/slsReceiverSoftware/src/UDPStandardImplementation.cpp index 32bb47c54..d71d54a51 100644 --- a/slsReceiverSoftware/src/UDPStandardImplementation.cpp +++ b/slsReceiverSoftware/src/UDPStandardImplementation.cpp @@ -161,6 +161,7 @@ void UDPStandardImplementation::initializeMembers(){ for(int i = 0; i < MAX_NUMBER_OF_LISTENING_THREADS; ++i){ measurementStarted[i] = false; totalListeningPacketCount[i] = 0; + totalIgnoredPacketCount[i] = 0; } for(int i=0; iReceiveDataOnly(buffer[ithread] + offset, onePacketSize); if(!receivedSize) return 0; @@ -2136,6 +2137,7 @@ int UDPStandardImplementation::prepareAndListenBuffer(int ithread, int cSize, ch while(true){ + totalListeningPacketCount[ithread]++; //correct packet if(currentpnum == pnum){ @@ -2153,7 +2155,10 @@ int UDPStandardImplementation::prepareAndListenBuffer(int ithread, int cSize, ch pnum --; receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + offset, onePacketSize); - if(!receivedSize) return 0; + if(!receivedSize){ + totalIgnoredPacketCount[ithread] += (packetsPerFrame - pnum); + return 0; + } header = (jfrau_packet_header_t*)(buffer[ithread] + offset); currentpnum = (*( (uint8_t*) header->packetNumber)); //cout<<"next currentpnum :"<ReceiveDataOnly(buffer[ithread] + offset, onePacketSize); if(!receivedSize) return 0; header = (jfrau_packet_header_t*)(buffer[ithread] + offset); @@ -2177,7 +2185,11 @@ int UDPStandardImplementation::prepareAndListenBuffer(int ithread, int cSize, ch }//----- got a whole frame ------- receivedSize = oneDataSize * packetsPerFrame; + return receivedSize; } + + + //other detectors else{ receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + fifoBufferHeaderSize + cSize, (bufferSize * numberofJobsPerBuffer) - cSize); //eiger returns 0 when header packet caught @@ -2765,7 +2777,11 @@ void UDPStandardImplementation::stopWriting(int ithread, char* wbuffer){ if(totalWritingPacketCount[i] < ((uint64_t)numberOfFrames*packetsPerFrame)){ cprintf(RED, "\nPort %d\n",udpPortNum[i]); - cprintf(RED, "Missing Packets \t: %lld\n",(long long int)numberOfFrames*packetsPerFrame-totalWritingPacketCount[i]); + if(myDetectorType == JUNGFRAU){ + cprintf(RED, "Ignored Packets \t: %lld\n",(long long int)totalIgnoredPacketCount[i]); + cprintf(RED, "Missing Packets \t: %lld\n",(long long int)numberOfFrames*packetsPerFrame-totalWritingPacketCount[i]-totalIgnoredPacketCount[i]); + }else + cprintf(RED, "Missing Packets \t: %lld\n",(long long int)numberOfFrames*packetsPerFrame-totalWritingPacketCount[i]); cprintf(RED, "Packets Caught \t\t: %lld\n",(long long int)totalWritingPacketCount[i]); cprintf(RED, "Frames Caught \t\t: %lld\n",(long long int)(totalWritingPacketCount[i]/packetsPerFrame)); int64_t lastFrameNumber = 0;