OTBMuovi(BaseDevice)

Device class for real-time interfacing the Muovi device. Developer: Dominik I. Braun Contact: dome.braun@fau.de Last Update: 2024-06-05

class biosignal_device_interface.devices.otb.otb_muovi.OTBMuovi(parent=None, is_muovi_plus=False)[source]

Bases: BaseDevice

Muovi device class derived from BaseDevice class.

Parameters:
  • parent (Union[QMainWindow, QWidget], optional) – Parent widget to which the device is assigned to. Defaults to None.

  • is_muovi_plus (bool) – True if the device is a Muovi Plus, False if not.

The Muovi class is using a TCP/IP protocol to communicate with the device.

Initialize the Muovi device.

Parameters:
  • parent (Union[QMainWindow, QWidget], optional) – Parent widget. Defaults to None.

  • is_muovi_plus (bool, optional) – Boolean to initialize the Muovi device as Muovi+ (64 biosignal channels) or Muovi (32 biosignal channels). Defaults to False (Muovi).

_connect_to_device()[source]

Function to attempt a connection to the devices.

Returns:

Success of the connection attempt.

Return type:

bool

_disconnect_from_device()[source]

Closes the connection to the device.

self.interface closes and is set to None. Device state is_connected is set to False. Signal connected_signal emits False.

Returns:

Success of the disconnection attempt.

Return type:

bool

_make_request()[source]

Requests a connection or checks if someone connected to the server. After connection is successful, the Signal connected_signal emits True and sets the current state is_connected to True.

Returns:

Returns True if request was successfully. False if not.

Return type:

bool

_process_data(input)[source]

Decodes the transmitted bytes and convert them to respective output format (e.g., mV).

Emits the processed data through the Signal data_available_signal which can be connected to a function using: {self.device}.data_available_signal.connect(your_custom_function).

This works perfectly fine outside of this class.

Your custom function your_custom_function needs to have a parameter “data” which is of type np.ndarray.

In case that the current configuration of the device was requested, the configuration is provided through the Signal configuration_available_signal that emits the current parameters in a dictionary.

Parameters:

input (bytearray) – Bytearray of the transmitted raw data.

Return type:

None

_read_data()[source]

This function is called when bytes are ready to be read in the buffer. After reading the bytes from the buffer, _process_data is called to decode and process the raw data.

Return type:

None

_start_streaming()[source]

Sends the command to start the streaming to the device.

if successful:

Device state is_streaming is set to True. Signal streaming_signal emits True.

Return type:

None

_stop_streaming()[source]

Sends the command to stop the streaing to the device

if successful:

Device state is_streaming is set to False. Signal streaming_signal emits False.

Return type:

None

clear_socket()[source]

Reads all the bytes from the buffer.

Return type:

None

configure_device(params)[source]

Sends a configuration byte sequence based on selected params to the device. An overview of possible configurations can be seen in biosignal_device_interface/constants/{device}.py.

E.g., enums/sessantaquattro.py

Parameters:

params (Dict[str, Union[Enum, Dict[str, Enum]]]) –

Dictionary that holds the configuration settings to which the device should be configured to.

The first one should be the attributes (configuration mode) name, and the second its respective value. Orient yourself on the enums of the device to choose the correct configuration settings.

Return type:

None