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

Class ExecStringController

source code

object --+    
         |    
Controller --+
             |
            ExecStringController

Set parameters using potentially complex Python string.

You can execute arbitrarily complex Python code with this
controller.  The return value must be contained within the
variable "x".  In other words, this string must assign the
variable x, so setting the string to "x=1.0" would set the
parameter under control to 1.0.

To increase speed, the string is compiled to Python's
bytecode format.

The string can make use of temporal variables, which are made
available 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    variable  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



Instance Methods
 
__init__(self, during_go_exec_string=None, between_go_exec_string=None, restricted_namespace=1, **kw)
Create instance of Controller.
source code
 
set_during_go_exec_string(self, during_go_exec_string) source code
 
get_during_go_exec_string(self) source code
 
set_between_go_exec_string(self, between_go_exec_string) source code
 
get_between_go_exec_string(self) source code
 
during_go_eval(self)
Called by Presentation.
source code
 
between_go_eval(self)
Called by Presentation.
source code

Inherited from Controller: evaluate_now, returns_type, set_eval_frequency

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

Class Variables

Inherited from Controller: EVERY_FRAME, FRAMES_ABSOLUTE, FRAMES_SINCE_GO, NEVER, NOT_BETWEEN_GO, NOT_DURING_GO, ONCE, TIME_INDEPENDENT, TIME_SEC_ABSOLUTE, TIME_SEC_SINCE_GO, TRANSITIONS, flag_dictionary

Properties

Inherited from object: __class__

Method Details

__init__(self, during_go_exec_string=None, between_go_exec_string=None, restricted_namespace=1, **kw)
(Constructor)

source code 
Create instance of Controller.

Arguments:

eval_frequency -- Int, bitwise "or" of flags
temporal_variables -- Int, bitwise "or" of flags
return_type -- Set to type() of the parameter under control

Overrides: Controller.__init__
(inherited documentation)

during_go_eval(self)

source code 
Called by Presentation. Overrides method in Controller base class.

Overrides: Controller.during_go_eval

between_go_eval(self)

source code 
Called by Presentation. Overrides method in Controller base class.

Overrides: Controller.between_go_eval