Skip to content
Snippets Groups Projects
Commit 00d57656 authored by Pieter Donker's avatar Pieter Donker
Browse files

Task #10073: changed dumping procedure in TBBDriver

parent adc8ea24
No related branches found
No related tags found
No related merge requests found
...@@ -226,19 +226,19 @@ void ReadCmd::saveTpAckEvent(GCFEvent& event) ...@@ -226,19 +226,19 @@ void ReadCmd::saveTpAckEvent(GCFEvent& event)
NsTimestamp firstSampleTime((double)lastSampleTime - (TS->getChPageSize(getChannelNr()) * itsLastSavedNrOfSamples * sampletime)); NsTimestamp firstSampleTime((double)lastSampleTime - (TS->getChPageSize(getChannelNr()) * itsLastSavedNrOfSamples * sampletime));
// calculate start and stop time // calculate start and stop time
NsTimestamp startTimestamp(itsTimestamp - itsTimeBefore); NsTimestamp startTimestamp((double)itsTimestamp - (double)itsTimeBefore);
NsTimestamp stopTimestamp(itsTimestamp + itsTimeAfter); NsTimestamp stopTimestamp((double)itsTimestamp + (double)itsTimeAfter);
#if 1 #if 1
//LOG_DEBUG_STR(formatString("Timestamp = %lu seconds %lu nseconds", itsTimestamp.sec(), itsTimestamp.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("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("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("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("stopTimestamp = %lu seconds %lu nseconds", stopTimestamp.sec(), stopTimestamp.nsec()));
#endif #endif
// to get last part of recording // to get last part of recording
if (itsTimestamp == 0.0) { if ((double)itsTimestamp == 0.0) {
itsTimestamp = lastSampleTime; itsTimestamp = lastSampleTime;
} }
...@@ -265,15 +265,15 @@ void ReadCmd::saveTpAckEvent(GCFEvent& event) ...@@ -265,15 +265,15 @@ void ReadCmd::saveTpAckEvent(GCFEvent& event)
setDone(true); setDone(true);
} }
itsTimeBefore.set(itsTimestamp - startTimestamp); itsTimeBefore.set((double)itsTimestamp - (double)startTimestamp);
itsTimeAfter.set(stopTimestamp - itsTimestamp); itsTimeAfter.set((double)stopTimestamp - (double)itsTimestamp);
// convert it to board units // convert it to board units
itsSecondstime = (uint32)itsTimestamp.sec(); itsSecondstime = (uint32)itsTimestamp.sec();
itsSampleNr = (uint32)(itsTimestamp.nsec() / (sampletime * 1E9)); itsSampleNr = (uint32)(itsTimestamp.nsec() / (sampletime * 1E9));
itsPrepages = (uint32)ceil(((double)(itsTimestamp - startTimestamp) / sampletime) / itsLastSavedNrOfSamples); itsPrepages = (uint32)ceil((((double)itsTimestamp - (double)startTimestamp) / sampletime) / itsLastSavedNrOfSamples);
itsPostpages = (uint32)ceil(((double)(stopTimestamp - itsTimestamp) / sampletime) / itsLastSavedNrOfSamples); itsPostpages = (uint32)ceil((((double)stopTimestamp - (double)itsTimestamp) / sampletime) / itsLastSavedNrOfSamples);
//if (itsPostpages == 0) { itsPostpages = 1; } //if (itsPostpages == 0) { itsPostpages = 1; }
LOG_DEBUG_STR(formatString("Read request time=%lu samplenr=%lu prepages=%lu postpages=%lu", LOG_DEBUG_STR(formatString("Read request time=%lu samplenr=%lu prepages=%lu postpages=%lu",
itsSecondstime, itsSampleNr, itsPrepages, itsPostpages)); itsSecondstime, itsSampleNr, itsPrepages, itsPostpages));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment