| Home | Trees | Index | Help |
|
|---|
| Package VisionEgg :: Module FlowControl :: Class Controller |
|
object --+
|
Controller
ConstantController,
EncapsulatedController,
EvalStringController,
ExecStringController,
FunctionController,
LPTTriggerInController,
LPTTriggerOutController,
PyroListenController,
SocketListenController
Control parameters.
This abstract base class defines the interface to any controller.
Methods:
returns_type() -- Get the type of the value returned by the eval functions
during_go_eval() -- Evaluate controller during the main 'go' loop.
between_go_eval() -- Evaluate controller between runs of the main 'go' loop.
The during_go_eval() and between_go_eval() methods are called to
update a particular parameter such as the position of a stimulus
on the screen. These methods must return a value specified by the
returns_type() method. These methods are called at particular
intervals as specified by eval_frequency and with temporal
parameters specified by temporal_variables (see below for more
details). Also, see the documentation for the Presentation class.
Attributes:
return_type -- type of the value returned by the eval functions
eval_frequency -- when eval functions called (see above)
temporal_variables -- what time variables used (see above)
A Controller instance's attribute "eval_frequency" controls when a
controller is evaluated. This variable is a bitwise "or" of the
following flags:
Controller.EVERY_FRAME -- every frame
Controller.TRANSITIONS -- on enter and exit from go loop
Controller.ONCE -- as above and at the next chance possible
Controller.NOT_DURING_GO -- as above, but never during go loop
Controller.NOT_BETWEEN_GO -- as above, but never between go loops
If none of these flags is set, the value is:
Controller.NEVER -- this controller is never called
The Controller.ONCE flag is automatically unset after evaluation,
hence its name. As an example, if eval_frequency is set to
Controller.ONCE | Controller.TRANSITIONS (the bitwise "or"), it
will be evaluated before drawing the next frame and then only
before and after the go loop.
A Controller instance's attribute "temporal_variables" controls
what time variables are set for use. This variable is a bitwise
"or" of the following flags:
Controller.TIME_SEC_ABSOLUTE -- seconds, continuously increasing
Controller.TIME_SEC_SINCE_GO -- seconds, reset to 0.0 each go loop
Controller.FRAMES_ABSOLUTE -- frames, continuously increasing
Controller.FRAMES_SINCE_GO -- frames, reset to 0 each go loop
If none of these flags is set, the value is:
Controller.TIME_INDEPENDENT -- No temporal variables.
When the eval methods (during_go_eval and between_go_eval) are
called, attributes are set depending on the temporal variables
used:
temporal_variable attribute set
----------------- -------------
TIME_SEC_ABSOLUTE self.time_sec_absolute
TIME_SEC_SINCE_GO self.time_sec_since_go
FRAMES_ABSOLUTE self.frames_absolute
FRAMES_SINCE_GO self.frames_since_go
Other information:
Instances of Controller are called by instances of the
Presentation class. during_go_eval() is called during a go()
loop, and between_go_eval() is called by between_presentations()
(during run_forever(), for example). Before calling these
methods, attributes of the controller are set accoring to
ttribute{temporal_variables}.
| Method Summary | |
|---|---|
Create instance of Controller. | |
Called by Presentation. | |
Called by Presentation. | |
Call this after updating the values of a controller if it's not evaluated EVERY_FRAME. | |
Called by Presentation. | |
set_eval_frequency(self,
eval_frequency)
| |
| Inherited from object | |
x.__delattr__('name') <==> del x.name... | |
x.__getattribute__('name') <==> x.name... | |
x.__hash__() <==> hash(x)... | |
helper for pickle... | |
helper for pickle... | |
x.__repr__() <==> repr(x)... | |
x.__setattr__('name', value) <==> x.name = value... | |
x.__str__() <==> str(x)... | |
| Inherited from type | |
T.__new__(S, ...) -> a new object with type S, a subtype of T... | |
| Class Variable Summary | |
|---|---|
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,
eval_frequency=1,
temporal_variables=2,
return_type=None)
|
between_go_eval(self)Called by Presentation. Evaluate between runs of the main 'go' loop. Override this method in subclasses. |
during_go_eval(self)Called by Presentation. Evaluate during the main 'go' loop. Override this method in subclasses. |
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. Get the return type of this controller. |
| Class Variable Details |
|---|
EVERY_FRAME
|
flag_dictionary
|
FRAMES_ABSOLUTE
|
FRAMES_SINCE_GO
|
NEVER
|
NOT_BETWEEN_GO
|
NOT_DURING_GO
|
ONCE
|
TIME_INDEPENDENT
|
TIME_SEC_ABSOLUTE
|
TIME_SEC_SINCE_GO
|
TRANSITIONS
|
| Home | Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.0 on Fri Sep 19 18:29:40 2003 | http://epydoc.sf.net |