The BCI module uses many functions that are actually written in C++ and implemented using a module called bci_source, generated with SWIG. In this chapter these functions are documented. If you are interested to develop the C++ part of the BCI, feel free to download the source code. The complete source code is explained in-code, with its documentation here.
Function to start the BCI. Has to be called in an seperate thread.
Parameters: |
|
---|
Sets the security mode.
Parameter: | mode (true or false(default)) – A warning is raised if the number of returned blocks is not equal to the received ones. That may be useful if you want to be sure not to miss samples/data blocks or to avoid reading blocks twice. |
---|
Resets the counters for read and returned data arrays.
This may be useful if you do not want to have all the data be returned since the Recorder is running and still be sure not to miss data while requesting it.
Resets the returning speed of data arrays.
Parameter: | level – Speed levels from -9 (very slow) to 9 (very fast) are possible, with possible exceptions of level -10 (slowest level that is possible) and 10 (as fast as possible). The speed is set on a pretty fast value by default. |
---|
May be used to check if the Recorder is running (just in that case data may be available to be returned) externally.
Rytpe: | 1 (running), otherwise 0 |
---|
Returns with 1 if data is available for returning and with 2 to ‘sign’ a stopped Recorder.
Note
Attention: This function has to be called before collecting data by return_samples. Otherwise you cannot be sure if a data array is filled ans therewith ready to be returned. When this function has returned you should call exactly every sample in one data array, that is, calling return_samples up to the number of samples in one data array as first argument.
Function to be called to get available data. Returns sample n from channel channel (range from 1 to numof_channels is possible).
Note
Attention: Call demanding_access first to make sure that there is data available for returning. The maximum value of n is numof_samples (consider calling get_numof_samples if unsure...).
Note
To ensure a working security mode, you have to collect at least the last sample point (this is numof_samples) of any channel and set lastone to True when you access the current data array for the last time.
Triggers a sign on a white background for the time time (milliseconds) in the shape form when mode is **signs_enabled’*. When the sign is shown a trigger (‘5’) is sent via the parallel port.
param time: Time to show the sign in milliseconds param form: 1 or TRIANGLES for triangles, 2 or QUADS for quads, 3 or FONT for text and 4 or BMP for bitmaps param col: color (0 for black, 1 for white, 2 for grey) param size: size of the sign type size: from 0 to 1 param texture: 0 (‘R’), 1(‘L’), 2(‘r’), 3 (‘l’) or 4 (grey background)