From bccffa5c3d67a145d34077560c1ec734e6227f22 Mon Sep 17 00:00:00 2001 From: l_maliakal_d Date: Wed, 15 May 2013 15:08:21 +0000 Subject: [PATCH] if file write not enabled, writing out packet loss and file name removed git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@554 951219d9-93cf-4727-9268-0efd64621fa3 --- .../slsDetector/slsDetectorUtils.cpp | 5 ++++- .../slsReceiver/slsReceiverFunctionList.cpp | 18 ++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp b/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp index 4739f7992..3de9d09a1 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp @@ -465,11 +465,14 @@ void slsDetectorUtils::acquire(int delflag){ if (eclog) delete eclog; +#ifdef VERBOSE cout << "acquisition finished callback " << endl; +#endif if (acquisition_finished) acquisition_finished(getCurrentProgress(),getDetectorStatus(),acqFinished_p); - +#ifdef VERBOSE cout << "acquisition finished callback done " << endl; +#endif } diff --git a/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.cpp b/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.cpp index d75cdd4c8..c5f0dde4c 100644 --- a/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.cpp +++ b/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.cpp @@ -492,16 +492,18 @@ int slsReceiverFunctionList::startWriting(){ address = mmap(NULL,memsize,PROT_READ|PROT_WRITE,MAP_SHARED,fileno(sfilefd),0); if(address == MAP_FAILED) perror("Error: Could not map file to memory:"); + + + //printing packet losses and file names + if(prevframenum == 0) + cout << savefilename << endl; + else{ + cout << savefilename << "\tpacket loss " << fixed << setprecision(4) << ((currframenum-prevframenum-(packetsPerFrame*framesInFile))/(double)(packetsPerFrame*framesInFile))*100.000 << "%\t\t" + "framenum " << currframenum << endl; + } } - //printing packet losses and file names - if(prevframenum == 0) - cout << savefilename << endl; - else{ - cout << savefilename << "\tpacket loss " << fixed << setprecision(4) << ((currframenum-prevframenum-(packetsPerFrame*framesInFile))/(double)(packetsPerFrame*framesInFile))*100.000 << "%\t\t" - "framenum " << currframenum << "\t\t" - "p " << prevframenum << endl; - + if(prevframenum != 0){ prevframenum=currframenum; framesInFile = 0; }