Commit 2a40b16b authored by Javier Quinteros's avatar Javier Quinteros
Browse files

Bugfix: Flush output buffer after gap with proper number of points

parent 86abf016
......@@ -644,12 +644,14 @@ class TDMS(object):
# Flush outbuf?
if ch in outbuf:
leftover = len(nodecimation[ch]) % self.__decimate
# outbuf[ch]['stats']['starttime'] += 1/outbuf[ch]['stats']['sampling_rate']
outbuf[ch]['stats']['npts'] = 1
yield nodecimation[ch][-leftover::self.__decimate], outbuf[ch]['stats']
logs.debug('Flushing: %s %s' % (nodecimation[ch][-leftover::self.__decimate],
outbuf[ch]['stats']))
if 'data' in outbuf[ch]:
# Set number of points
outbuf[ch]['stats']['npts'] = len(outbuf[ch]['data'])
# outbuf[ch]['stats']['starttime'] += 1/outbuf[ch]['stats']['sampling_rate']
# outbuf[ch]['stats']['npts'] = 1
logs.debug('Flushing: %s %s' % (outbuf[ch]['stats'], outbuf[ch]['data']))
yield outbuf[ch]['data'], outbuf[ch]['stats']
# Remove all data and stats from the output buffer after a GAP
del outbuf[ch]
else:
logs.debug('Nothing to flush after GAP')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment