Classes and functions for using trigger boxes.
Trigger boxes are used to send electrical signals to external devices. They are typically used to synchronize the presentation of stimuli with the recording of physiological data. This module provides a common interface for accessing trigger boxes from within PsychoPy.
This module serves as the entry point for plugin classes implementing
third-party trigger box interfaces. All installed interfaces are discoverable
by calling the getAllTriggerBoxes()
function. To have your trigger box
interface discovered by PsychoPy, you need to create a Python module that
defines a class inheriting from BaseTriggerBox
and set its entry point
to psychopy.hardware.triggerbox
in your plugin setup script or configuration
file.
|
Base class for trigger box interfaces. |
Get the name of the trigger box. |
|
Get the name of the manufacturer. |
|
|
Get the capabilities of the trigger box. |
|
Open a connection to the trigger box. |
|
Close the trigger box. |
Check if the trigger box connection is open. |
|
|
Set the data to be sent. |
|
Get the data to be sent. |
|
Set the value of a pin. |
|
Read the value of a pin. |
Get all trigger box interface classes. |
Base class for trigger box interfaces.
This class defines the minimal interface for trigger box implementations. All trigger box implementations should inherit from this class and override its methods.
Initialize the trigger box interface.
Get the name of the trigger box.
Name of the trigger box.
Get the name of the manufacturer.
Name of the manufacturer.
Get all available devices of this type.
Get the capabilities of the trigger box.
The returned dictionary contains information about the capabilities of the trigger box. The strutcture of the dictionary may vary between trigger box implementations, so it is recommended to check if a key exists before accessing it.
Capabilities of the trigger box. The names of the capabilities are the keys of the dictionary. The values are information realted to the specified capability.
Examples
Check what the required baudrate of the device is:
useBaudrate = getCapabilities()[‘baudrate’]
Generate a dictionary describing this device by finding the profile from getAvailableDevices which represents the same physical device as this object.
Dictionary representing this device
Convert the output of getDeviceProfile to a JSON string.
Check if the trigger box connection is open.
True if the trigger box is open, False otherwise.
Determine whether this object represents the same physical device as a given other object.