Viewer widgets

Defines widgets used with the view module. These widgets are used to control and display the experiment on screen, both when playing the experiment for preview and when playing the experiment full-screen in a second process.

class ceed.view.view_widgets.ViewRootFocusBehavior(**kwargs)

Bases: kivy.uix.behaviors.focus.FocusBehavior

The root widget used for the second process when the experiment is played. It adds focus behavior to the viewer.

Whenever a key is pressed in the second process it is passed on to the controller in the main process who handles it as needed (possibly sending a message back to the second process).

keyboard_on_key_down(window, keycode, text, modifiers)

The method bound to the keyboard when the instance has focus.

When the instance becomes focused, this method is bound to the keyboard and will be called for every input press. The parameters are the same as kivy.core.window.WindowBase.on_key_down().

When overwriting the method in the derived widget, super should be called to enable tab cycling. If the derived widget wishes to use tab for its own purposes, it can call super after it has processed the character (if it does not wish to consume the tab).

Similar to other keyboard functions, it should return True if the key was consumed.

keyboard_on_key_up(window, keycode)

The method bound to the keyboard when the instance has focus.

When the instance becomes focused, this method is bound to the keyboard and will be called for every input release. The parameters are the same as kivy.core.window.WindowBase.on_key_up().

When overwriting the method in the derived widget, super should be called to enable de-focusing on escape. If the derived widget wishes to use escape for its own purposes, it can call super after it has processed the character (if it does not wish to consume the escape).

See keyboard_on_key_down()

class ceed.view.view_widgets.MEAArrayAlign(**kwargs)

Bases: kivy.uix.scatter.Scatter

The widget used during the experiment design to help align the MEA electrode array to the camera and projector.

It displays a grid of points that you can align to the real-world camera acquired picture of the electrode grid. See controller for more details.

num_rows

Number of rows.

See mea_num_rows

num_cols

Number of columns.

See mea_num_cols

pitch

The distance in pixels between the rows/columns.

See mea_pitch

diameter

Diameter of each electrode circle in pixels..

See mea_diameter

show

Whether the grid is currently shown.

color = None

The grid color.

label = None

The label that shows the “A1” corner electrode.

label2 = None

The label that shows the “M1” corner electrode.

update_graphics(*largs)

Automatic callback that updates the graphics whenever any parameter changes.

on_touch_down(touch)

Receive a touch down event.

Parameters
touch: MotionEvent class

Touch received. The touch is in parent coordinates. See relativelayout for a discussion on coordinate systems.

Returns

bool If True, the dispatching of the touch event will stop. If False, the event will continue to be dispatched to the rest of the widget tree.

on_touch_move(touch)

Receive a touch move event. The touch is in parent coordinates.

See on_touch_down() for more information.

on_touch_up(touch)

Receive a touch up event. The touch is in parent coordinates.

See on_touch_down() for more information.

static make_matrix(elems: List[List[float]]) kivy.graphics.transformation.Matrix

Converts a matrix represented as a 2D list to a kivy Matrix.

static compare_mat(mat: kivy.graphics.transformation.Matrix, mat_list: List[List[float]]) bool

Compares a matrix represented as a 2D list to a kivy Matrix object and returns whether they are equivalent.