Package VisionEgg :: Module FlowControl :: Class FunctionController
[frames | no frames]

Class FunctionController

object --+    
         |    
Controller --+
             |
            FunctionController


Set parameters using a Python function.

This is a very commonly used subclass of Controller, because it is
very intuitive and requires a minimum of code to set up.  Many of
the Vision Egg demo programs create instances of
FunctionController.

A number of parameters are passed to the function depending on the
value of temporal_variables:

The function can make use of temporal variables, which are made
available by passingkeyword argument(s) depending on the
controller's temporal_variables attribute. Note that only the
absolute temporal variables are available when the go loop is not
running.

flag(s) present    argument  description
-----------------  --------  ----------------------------------
TIME_SEC_ABSOLUTE  t_abs     seconds, continuously increasing
TIME_SEC_SINCE_GO  t         seconds, reset to 0.0 each go loop
FRAMES_ABSOLUTE    f_abs     frames, continuously increasing
FRAMES_SINCE_GO    f         frames, reset to 0 each go loop

Method Summary
  __init__(self, during_go_func, between_go_func, **kw)
Create an instance of FunctionController.
  between_go_eval(self)
Called by Presentation.
  during_go_eval(self)
Called by Presentation.
    Inherited from Controller
  evaluate_now(self)
Call this after updating the values of a controller if it's not evaluated EVERY_FRAME.
  returns_type(self)
Called by Presentation.
  set_eval_frequency(self, eval_frequency)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name...
  __getattribute__(...)
x.__getattribute__('name') <==> x.name...
  __hash__(x)
x.__hash__() <==> hash(x)...
  __reduce__(...)
helper for pickle...
  __reduce_ex__(...)
helper for pickle...
  __repr__(x)
x.__repr__() <==> repr(x)...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value...
  __str__(x)
x.__str__() <==> str(x)...
    Inherited from type
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T...

Class Variable Summary
    Inherited from Controller
int EVERY_FRAME = 1                                                                     
dict flag_dictionary = {'EVERY_FRAME': 1, 'NOT_BETWEEN_GO': 1...
int FRAMES_ABSOLUTE = 4                                                                     
int FRAMES_SINCE_GO = 8                                                                     
int NEVER = 0                                                                     
int NOT_BETWEEN_GO = 16                                                                    
int NOT_DURING_GO = 8                                                                     
int ONCE = 4                                                                     
int TIME_INDEPENDENT = 0                                                                     
int TIME_SEC_ABSOLUTE = 1                                                                     
int TIME_SEC_SINCE_GO = 2                                                                     
int TRANSITIONS = 2                                                                     

Method Details

__init__(self, during_go_func=None, between_go_func=None, **kw)
(Constructor)

Create an instance of FunctionController.

Arguments:

during_go_func -- function evaluted during go loop
between_go_func -- function evaluted not during go loop
Overrides:
VisionEgg.FlowControl.Controller.__init__

between_go_eval(self)

Called by Presentation. Overrides method in Controller base class.
Overrides:
VisionEgg.FlowControl.Controller.between_go_eval

during_go_eval(self)

Called by Presentation. Overrides method in Controller base class.
Overrides:
VisionEgg.FlowControl.Controller.during_go_eval

Generated by Epydoc 2.0 on Fri Sep 19 18:29:37 2003 http://epydoc.sf.net