def next_chunk(self): """ :returns: The next chunk of data points in the form of a SignalWave :rtype: :class:`tendril.utils.types.signalbase.SignalWave` """ rval = copy.copy(self.point_buffer) self.point_buffer = SignalWave(rval.unitclass, points=deque([rval.pop()], maxlen=rval._buffer_size), spacing=rval._spacing, ts0=rval._ts0, buffer_size=rval._buffer_size, use_point_ts=rval._use_point_ts) return rval
def reset_buffer(self, unitclass=DummyUnit): """ Resets the point buffer to a new :class:`tendril.utils.types.signalbase.SignalWave` with the unitclass as specified by the parameter. Any data presently within it will be lost. :param unitclass: Class of Unit that the Wave points are composed of. """ # logger.debug("Resetting buffer to type : " + repr(unitclass)) self.point_buffer = SignalWave(unitclass, spacing=TimeDelta(microseconds=100000), ts0=timestamp_factory.now(), buffer_size=1000, use_point_ts=False)