| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
ClassWithParameters --+
|
Presentation
Handles the timing and coordination of stimulus presentation.
This class is the key to the real-time operation of the Vision
Egg. It contains the main 'go' loop, and maintains the association
between 'controllers', instances of the Controller class, and the
parameters they control.
During the main 'go' loop and at other specific times, the
parameters are updated via function calls to the controllers.
Between entries into the 'go' loop, a Vision Egg application
should call the method between_presentations as often as possible
to ensure parameter values are kept up to date and any
housekeeping done by controllers is done.
No OpenGL environment I know of can guarantee that a new frame is
drawn and the double buffers swapped before the monitor's next
vertical retrace sync pulse. Still, although one can worry
endlessly about this problem, it works. In other words, on a fast
computer with a fast graphics card running even a pre-emptive
multi-tasking operating system (see below for specific
information), a new frame is drawn before every monitor update. If
this did become a problem, the go() method could be re-implemented
in C, along with the functions it calls. This would probably
result in speed gains, but without skipping frames at 200 Hz, why
bother?
Parameters
==========
check_events -- allow input event checking during 'go' loop? (Boolean)
Default: True
collect_timing_info -- log timing statistics during go loop? (Boolean)
Default: True
enter_go_loop -- test used by run_forever() to enter go loop (Boolean)
Default: False
go_duration -- Tuple to specify 'go' loop duration. Either (value,units) or ('forever',) (Sequence of AnyOf(Real or String))
Default: (5.0, 'seconds')
handle_event_callbacks -- List of tuples to handle events. (event_type,event_callback_func) (Sequence of Sequence2 of AnyOf(Integer or Callable))
Default: (determined at runtime)
override_t_abs_sec -- Override t_abs. Set only when reconstructing experiments. (units: seconds) (Real)
Default: (determined at runtime)
quit -- quit the run_forever loop? (Boolean)
Default: False
trigger_armed -- test trigger on go loop? (Boolean)
Default: True
trigger_go_if_armed -- trigger go loop? (Boolean)
Default: True
viewports -- list of Viewport instances to draw. Order is important. (Sequence of Instance of <class 'VisionEgg.ClassWithParameters'>)
Default: (determined at runtime)
warn_longest_frame_threshold -- threshold to print frame skipped warning (units: factor of inter-frame-interval) (Real)
Default: 2.0
warn_mean_fps_threshold -- threshold to print observered vs. expected frame rate warning (fraction units) (Real)
Default: 0.01
| Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from |
|||
| Class Variables | |
parameters_and_defaults = {'viewports':(None, ve_types.Sequenc
|
|
|
Inherited from |
|
| Properties | |
|
Inherited from |
| Method Details |
Create self.parameters and set values.
|
Remove one (or more--see below) controller(s). If controller is None, all controllers affecting the specified parameter are removed. If class_with_parameters and paramter_name are None, the controller is removed completely If class_with_parameters, paramter_name, and controller are all None, all controllers are removed. |
Queries if the presentation is in a go loop. This is useful to check the state of the Vision Egg application from a remote client over Pyro. |
Main control loop during stimulus presentation. This is the heart of realtime control in the Vision Egg, and contains the main loop during a stimulus presentation. This coordinates the timing of calling the controllers. In the main loop, the current time (in absolute seconds, go-loop-start-relative seconds, and go-loop-start-relative frames) is computed, the appropriate controllers are called with this information, the screen is cleared, each viewport is drawn to the back buffer (while the video card continues painting the front buffer on the display), and the buffers are swapped. |
Maintain display while between stimulus presentations. This function gets called as often as possible when in the 'run_forever' loop except when execution has shifted to the 'go' loop. Other than the difference in the time variable passed to the controllers, this routine is very similar to the inside of the main loop in the go method. |
| Class Variable Details |
parameters_and_defaults
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0beta1 on Sat Jun 7 09:06:46 2008 | http://epydoc.sourceforge.net |