From a276b6b7f5bccd57383fb5388e794d508e2c304f Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Thu, 18 May 2017 10:53:29 +0200 Subject: [PATCH] fixed bug rx_hostname being hostname or ip in zmqsockt, and num packets correctly reflects num good frames --- slsReceiverSoftware/include/ZmqSocket.h | 1 - slsReceiverSoftware/src/DataProcessor.cpp | 9 +++++++-- slsReceiverSoftware/src/UDPStandardImplementation.cpp | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/slsReceiverSoftware/include/ZmqSocket.h b/slsReceiverSoftware/include/ZmqSocket.h index 05a366e65..5083d3298 100644 --- a/slsReceiverSoftware/include/ZmqSocket.h +++ b/slsReceiverSoftware/include/ZmqSocket.h @@ -53,7 +53,6 @@ public: if (ptr == NULL) return; strcpy(ip, ptr); - delete ptr; } sprintf (serverAddress, "tcp://%s:%d", ip, portno); diff --git a/slsReceiverSoftware/src/DataProcessor.cpp b/slsReceiverSoftware/src/DataProcessor.cpp index 3f507c93d..c0346c508 100644 --- a/slsReceiverSoftware/src/DataProcessor.cpp +++ b/slsReceiverSoftware/src/DataProcessor.cpp @@ -300,11 +300,16 @@ void DataProcessor::StopProcessing(char* buf) { /** buf includes only the standard header */ void DataProcessor::ProcessAnImage(char* buf) { - numFramesCaught++; - numTotalFramesCaught++; sls_detector_header* header = (sls_detector_header*) (buf); uint64_t fnum = header->frameNumber; + uint32_t nump = header->packetNumber; + if (nump == generalData->packetsPerFrame) { + numFramesCaught++; + numTotalFramesCaught++; + } + + #ifdef VERBOSE if (!index) cprintf(BLUE,"DataProcessing %d: fnum:%lu\n", index, fnum); #endif diff --git a/slsReceiverSoftware/src/UDPStandardImplementation.cpp b/slsReceiverSoftware/src/UDPStandardImplementation.cpp index 9e912e1af..ee95cab5f 100644 --- a/slsReceiverSoftware/src/UDPStandardImplementation.cpp +++ b/slsReceiverSoftware/src/UDPStandardImplementation.cpp @@ -519,12 +519,12 @@ void UDPStandardImplementation::stopReceiver(){ if (missingpackets) { cprintf(RED, "\n[Port %d]\n",udpPortNum[i]); cprintf(RED, "Missing Packets\t\t: %lld\n",(long long int)missingpackets); - cprintf(RED, "Frames Processed\t: %lld\n",(long long int)dataProcessor[i]->GetNumFramesCaught()); + cprintf(RED, "Complete Frames\t: %lld\n",(long long int)dataProcessor[i]->GetNumFramesCaught()); cprintf(RED, "Last Frame Caught\t: %lld\n",(long long int)listener[i]->GetLastFrameIndexCaught()); }else{ cprintf(GREEN, "\n[Port %d]\n",udpPortNum[i]); cprintf(GREEN, "Missing Packets\t\t: %lld\n",(long long int)missingpackets); - cprintf(GREEN, "Frames Processed\t: %lld\n",(long long int)dataProcessor[i]->GetNumFramesCaught()); + cprintf(GREEN, "Complete Frames\t: %lld\n",(long long int)dataProcessor[i]->GetNumFramesCaught()); cprintf(GREEN, "Last Frame Caught\t: %lld\n",(long long int)listener[i]->GetLastFrameIndexCaught()); } }