From 00d57656e8905de7fdfa98611a9de651bf9bdbc2 Mon Sep 17 00:00:00 2001
From: Pieter Donker <donker@astron.nl>
Date: Tue, 8 Nov 2016 11:34:48 +0000
Subject: [PATCH] Task #10073: changed dumping procedure in TBBDriver

---
 MAC/APL/PIC/TBB_Driver/src/ReadCmd.cc | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/MAC/APL/PIC/TBB_Driver/src/ReadCmd.cc b/MAC/APL/PIC/TBB_Driver/src/ReadCmd.cc
index ba92ba03919..53407542edb 100644
--- a/MAC/APL/PIC/TBB_Driver/src/ReadCmd.cc
+++ b/MAC/APL/PIC/TBB_Driver/src/ReadCmd.cc
@@ -226,19 +226,19 @@ void ReadCmd::saveTpAckEvent(GCFEvent& event)
 				NsTimestamp firstSampleTime((double)lastSampleTime - (TS->getChPageSize(getChannelNr()) * itsLastSavedNrOfSamples * sampletime));
 
 				// calculate start and stop time
-				NsTimestamp startTimestamp(itsTimestamp - itsTimeBefore);
-				NsTimestamp stopTimestamp(itsTimestamp + itsTimeAfter);
+				NsTimestamp startTimestamp((double)itsTimestamp - (double)itsTimeBefore);
+				NsTimestamp stopTimestamp((double)itsTimestamp + (double)itsTimeAfter);
 
 				#if 1
-			//LOG_DEBUG_STR(formatString("Timestamp      =  %lu seconds  %lu nseconds", itsTimestamp.sec(), itsTimestamp.nsec()));
-			LOG_DEBUG_STR(formatString("firstSampleTime=  %lu seconds  %lu nseconds", firstSampleTime.sec(), firstSampleTime.nsec()));
-			LOG_DEBUG_STR(formatString("lastSampleTime =  %lu seconds  %lu nseconds", lastSampleTime.sec(), lastSampleTime.nsec()));
-			LOG_DEBUG_STR(formatString("startTimestamp =  %lu seconds  %lu nseconds", startTimestamp.sec(), startTimestamp.nsec()));
-			LOG_DEBUG_STR(formatString("stopTimestamp  =  %lu seconds  %lu nseconds", stopTimestamp.sec(), stopTimestamp.nsec()));
+                //LOG_DEBUG_STR(formatString("Timestamp      =  %lu seconds  %lu nseconds", itsTimestamp.sec(), itsTimestamp.nsec()));
+                LOG_DEBUG_STR(formatString("firstSampleTime=  %lu seconds  %lu nseconds", firstSampleTime.sec(), firstSampleTime.nsec()));
+                LOG_DEBUG_STR(formatString("lastSampleTime =  %lu seconds  %lu nseconds", lastSampleTime.sec(), lastSampleTime.nsec()));
+                LOG_DEBUG_STR(formatString("startTimestamp =  %lu seconds  %lu nseconds", startTimestamp.sec(), startTimestamp.nsec()));
+                LOG_DEBUG_STR(formatString("stopTimestamp  =  %lu seconds  %lu nseconds", stopTimestamp.sec(), stopTimestamp.nsec()));
 				#endif
 
                 // to get last part of recording
-				if (itsTimestamp == 0.0) {
+				if ((double)itsTimestamp == 0.0) {
 				    itsTimestamp = lastSampleTime;
 				}
 
@@ -265,15 +265,15 @@ void ReadCmd::saveTpAckEvent(GCFEvent& event)
 					setDone(true);
 				}
 
-                itsTimeBefore.set(itsTimestamp - startTimestamp);
-                itsTimeAfter.set(stopTimestamp - itsTimestamp);
+                itsTimeBefore.set((double)itsTimestamp - (double)startTimestamp);
+                itsTimeAfter.set((double)stopTimestamp - (double)itsTimestamp);
 
 				// convert it to board units
 
 				itsSecondstime = (uint32)itsTimestamp.sec();
 				itsSampleNr    = (uint32)(itsTimestamp.nsec() / (sampletime * 1E9));
-				itsPrepages    = (uint32)ceil(((double)(itsTimestamp - startTimestamp) / sampletime) / itsLastSavedNrOfSamples);
-				itsPostpages   = (uint32)ceil(((double)(stopTimestamp - itsTimestamp) / sampletime) / itsLastSavedNrOfSamples);
+				itsPrepages    = (uint32)ceil((((double)itsTimestamp - (double)startTimestamp) / sampletime) / itsLastSavedNrOfSamples);
+				itsPostpages   = (uint32)ceil((((double)stopTimestamp - (double)itsTimestamp) / sampletime) / itsLastSavedNrOfSamples);
 				//if (itsPostpages == 0) { itsPostpages = 1; }
 				LOG_DEBUG_STR(formatString("Read request time=%lu samplenr=%lu prepages=%lu postpages=%lu",
 				                           itsSecondstime, itsSampleNr, itsPrepages, itsPostpages));
-- 
GitLab