mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-07 02:20:42 +02:00
debugging
This commit is contained in:
parent
1a64fc30ca
commit
b8ffe24c5f
@ -1139,7 +1139,7 @@ void UDPStandardImplementation::startReadout(){
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
usleep(5*1000);/* Need to find optimal time (exposure time and acquisition period) **/
|
usleep(5*1000*1000);/* Need to find optimal time (exposure time and acquisition period) **/
|
||||||
prev = totalP;
|
prev = totalP;
|
||||||
totalP = 0;
|
totalP = 0;
|
||||||
for(i=0; i<numberofListeningThreads; ++i)
|
for(i=0; i<numberofListeningThreads; ++i)
|
||||||
@ -2124,7 +2124,7 @@ int UDPStandardImplementation::prepareAndListenBuffer(int ithread, int cSize, ch
|
|||||||
return receivedSize;
|
return receivedSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(status != TRANSMITTING){
|
|
||||||
if(myDetectorType == JUNGFRAU){
|
if(myDetectorType == JUNGFRAU){
|
||||||
|
|
||||||
jfrau_packet_header_t* header;
|
jfrau_packet_header_t* header;
|
||||||
@ -2134,7 +2134,9 @@ int UDPStandardImplementation::prepareAndListenBuffer(int ithread, int cSize, ch
|
|||||||
int currentfnum=-1;
|
int currentfnum=-1;
|
||||||
|
|
||||||
//read first packet
|
//read first packet
|
||||||
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + offset);
|
receivedSize=0;
|
||||||
|
if(status != TRANSMITTING)
|
||||||
|
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + offset);
|
||||||
if(!receivedSize) return 0;
|
if(!receivedSize) return 0;
|
||||||
header = (jfrau_packet_header_t*)(buffer[ithread] + offset);
|
header = (jfrau_packet_header_t*)(buffer[ithread] + offset);
|
||||||
currentpnum = (*( (uint8_t*) header->packetNumber));
|
currentpnum = (*( (uint8_t*) header->packetNumber));
|
||||||
@ -2159,7 +2161,9 @@ int UDPStandardImplementation::prepareAndListenBuffer(int ithread, int cSize, ch
|
|||||||
break;
|
break;
|
||||||
pnum --;
|
pnum --;
|
||||||
|
|
||||||
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + offset);
|
receivedSize=0;
|
||||||
|
if(status != TRANSMITTING)
|
||||||
|
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + offset);
|
||||||
if(!receivedSize){
|
if(!receivedSize){
|
||||||
totalIgnoredPacketCount[ithread] += (packetsPerFrame - pnum);
|
totalIgnoredPacketCount[ithread] += (packetsPerFrame - pnum);
|
||||||
return 0;
|
return 0;
|
||||||
@ -2181,7 +2185,10 @@ int UDPStandardImplementation::prepareAndListenBuffer(int ithread, int cSize, ch
|
|||||||
//find the start of next image
|
//find the start of next image
|
||||||
while(currentpnum != pnum){
|
while(currentpnum != pnum){
|
||||||
totalIgnoredPacketCount[ithread]++;
|
totalIgnoredPacketCount[ithread]++;
|
||||||
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + offset);
|
|
||||||
|
receivedSize=0;
|
||||||
|
if(status != TRANSMITTING)
|
||||||
|
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + offset);
|
||||||
if(!receivedSize) return 0;
|
if(!receivedSize) return 0;
|
||||||
totalListeningPacketCount[ithread]++;
|
totalListeningPacketCount[ithread]++;
|
||||||
header = (jfrau_packet_header_t*)(buffer[ithread] + offset);
|
header = (jfrau_packet_header_t*)(buffer[ithread] + offset);
|
||||||
@ -2198,16 +2205,16 @@ int UDPStandardImplementation::prepareAndListenBuffer(int ithread, int cSize, ch
|
|||||||
|
|
||||||
|
|
||||||
//other detectors
|
//other detectors
|
||||||
else{
|
if(status != TRANSMITTING){
|
||||||
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + fifoBufferHeaderSize + cSize, (bufferSize * numberofJobsPerBuffer) - cSize);
|
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + fifoBufferHeaderSize + cSize, (bufferSize * numberofJobsPerBuffer) - cSize);
|
||||||
//eiger returns 0 when header packet caught
|
//eiger returns 0 when header packet caught
|
||||||
while(receivedSize < onePacketSize && status != TRANSMITTING)
|
while(receivedSize < onePacketSize && status != TRANSMITTING)
|
||||||
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + fifoBufferHeaderSize + cSize, (bufferSize * numberofJobsPerBuffer) - cSize);
|
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + fifoBufferHeaderSize + cSize, (bufferSize * numberofJobsPerBuffer) - cSize);
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
totalListeningPacketCount[ithread] += (receivedSize/onePacketSize);
|
}
|
||||||
|
|
||||||
|
totalListeningPacketCount[ithread] += (receivedSize/onePacketSize);
|
||||||
|
|
||||||
|
|
||||||
#ifdef MANUALDEBUG
|
#ifdef MANUALDEBUG
|
||||||
@ -2741,12 +2748,11 @@ void UDPStandardImplementation::stopWriting(int ithread, char* wbuffer){
|
|||||||
|
|
||||||
//Print packet loss
|
//Print packet loss
|
||||||
if(totalWritingPacketCountFromLastCheck[ithread]){
|
if(totalWritingPacketCountFromLastCheck[ithread]){
|
||||||
printf("\nThread:%d"
|
thread/****/
|
||||||
"\t\tPackets Lost:%d"
|
printf("\nPackets Lost:%d"
|
||||||
"\tPacketsFromLastCheck:%lld"
|
"\tPacketsFromLastCheck:%lld"
|
||||||
"\tCurrentFrameNumber:%lld"
|
"\tCurrentFrameNumber:%lld"
|
||||||
"\tPreviousFrameNumber:%lld\n",
|
"\tPreviousFrameNumber:%lld\n",
|
||||||
ithread,
|
|
||||||
( ((int)(currentFrameNumber[ithread]-frameNumberInPreviousCheck[ithread])*packetsPerFrame) - totalWritingPacketCountFromLastCheck[ithread]),
|
( ((int)(currentFrameNumber[ithread]-frameNumberInPreviousCheck[ithread])*packetsPerFrame) - totalWritingPacketCountFromLastCheck[ithread]),
|
||||||
totalWritingPacketCountFromLastCheck[ithread],
|
totalWritingPacketCountFromLastCheck[ithread],
|
||||||
currentFrameNumber[ithread],
|
currentFrameNumber[ithread],
|
||||||
@ -2910,7 +2916,7 @@ void UDPStandardImplementation::handleWithoutMissingPackets(int ithread, char* w
|
|||||||
|
|
||||||
//Print packet loss and filenames
|
//Print packet loss and filenames
|
||||||
if(tempframenumber && (tempframenumber%(maxFramesPerFile/10)) == 0){
|
if(tempframenumber && (tempframenumber%(maxFramesPerFile/10)) == 0){
|
||||||
printf("\nTThread:%d"
|
cprintf(BLUE,"\nThread:%d"
|
||||||
"\t\tPackets Lost:%d"
|
"\t\tPackets Lost:%d"
|
||||||
"\tPacketsFromLastCheck:%lld"
|
"\tPacketsFromLastCheck:%lld"
|
||||||
"\tCurrentFrameNumber:%lld"
|
"\tCurrentFrameNumber:%lld"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user