Package joy :: Module plans :: Class NBRPlan
[hide private]
[frames] | no frames]

Class NBRPlan

source code



NBRPlan concrete class for non-blocking file reader

Reads file (typically a serial port) until no data available
by using non-blocking IO.

The contents are then available in self.ln (a list) and the timestamp
of the read operation is in self.ts

ATTRIBUTES:
  .ts -- timestamps of lines read (from self.app.now)
  .ln -- list of lines read
  .iterLimit -- maximum number of lines that will be read at once

Instance Methods [hide private]
 
__init__(self, app, fn="/dev/ttyACM0")
INPUT:...
source code
 
clear(self)
Clear recorded data
source code
 
__reopen(self)
(PRIVATE) reopen the file in non-blocking mode
source code
 
behavior(self)
(default)
source code

Inherited from Plan: forDuration, isRunning, onEvent, onStart, onStop, push, start, step, stop, untilTime

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, app, fn="/dev/ttyACM0")
(Constructor)

source code 

INPUT:
  fn -- filename of file to read

Overrides: object.__init__

behavior(self)

source code 

(default)

Override this method to implement the sequential behavior of a Plan

This method MUST be a python iterator, i.e. must contain a "yield" statement

Overrides: Plan.behavior
(inherited documentation)