Package joy :: Module scope :: Class DataWindow
[hide private]
[frames] | no frames]

Class DataWindow

source code


Concrete class DataWindow represents a sliding window of data through time

Instance Methods [hide private]
 
__init__(self, duration=1)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
clear(self)
Empty the window.
source code
 
setDuration(self, duration)
Change the duration of data allowed in the window.
source code
 
_trim(self)
(private) trim any entries outside the most recent window of self.duration time units
source code
 
_firstPush(self, t, val)
Push data at the end of the window INPUTS: t -- timestamp val -- data record to append / replace
source code
 
_push(self, t, val)
Push data at the end of the window INPUTS: t -- timestamp val -- data record to append / replace
source code
 
push(self, t, val)
Fake placeholder -- modified by __init__, _firstPush
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, duration=1)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

setDuration(self, duration)

source code 

Change the duration of data allowed in the window. This may discard existing data if duration was made smaller

_firstPush(self, t, val)

source code 

Push data at the end of the window
INPUTS:
  t -- timestamp
  val -- data record to append / replace

If t equals last timestamp, last entry in window is replaced. Otherwise,
entry is appended and window is trimmed to duration limit.

(private) first push operation on an empty window

_push(self, t, val)

source code 

Push data at the end of the window
INPUTS:
  t -- timestamp
  val -- data record to append / replace

If t equals last timestamp, last entry in window is replaced. Otherwise,
entry is appended and window is trimmed to duration limit.