rofunc.devices.emg.src.delsystream#

1.  Module Contents#

1.1.  Classes#

Controller

DataStreamer

Sensor

This class implements an abstraction for sensors. It is not used in the current implementation

1.2.  Functions#

command_escaper

All commands sent to the Delsys controller must be escaped properly

bytes_to_raw_array

Convert raw byte data from socket connection to floating point numbers

filename_formatter

Generates filenames from an instance of a sensor class. NOT used in the current implementation

open_JSON_settings

This function opens, reads, and returns a settings dict from the Delsys JSON preference file

json_parser

create_filnames

Creates timestamped filenames for EMG and accelerometer data streams

open_fds

Converts filenames to actual file descriptors used for writing

close_fds

Closes file descriptors at the end of an experiment

main

1.3.  API#

rofunc.devices.emg.src.delsystream.command_escaper(command)[source]#

All commands sent to the Delsys controller must be escaped properly

rofunc.devices.emg.src.delsystream.bytes_to_raw_array(data, format_str)[source]#

Convert raw byte data from socket connection to floating point numbers

rofunc.devices.emg.src.delsystream.filename_formatter(sensor_class)[source]#

Generates filenames from an instance of a sensor class. NOT used in the current implementation

rofunc.devices.emg.src.delsystream.open_JSON_settings()[source]#

This function opens, reads, and returns a settings dict from the Delsys JSON preference file

rofunc.devices.emg.src.delsystream.json_parser(json_setting_file)[source]#
rofunc.devices.emg.src.delsystream.create_filnames(sensor_types)[source]#

Creates timestamped filenames for EMG and accelerometer data streams

rofunc.devices.emg.src.delsystream.open_fds(filename_list)[source]#

Converts filenames to actual file descriptors used for writing

rofunc.devices.emg.src.delsystream.close_fds(fd_list)[source]#

Closes file descriptors at the end of an experiment

class rofunc.devices.emg.src.delsystream.Controller(address=None, run_duration=None, is_daemon=False)[source]#

Bases: threading.Thread

start_str = b'START'#
stop_str = b'STOP'#
run()[source]#
start_socket()[source]#
class rofunc.devices.emg.src.delsystream.DataStreamer(file_descriptor=None, address=None, byte_size=None, sensor_IDs=None, channel_labels=None, unpack_template=None, is_daemon=True)[source]#

Bases: threading.Thread

run()[source]#
prep_csv_writer()[source]#
write_data(data, time_stamp)[source]#
start_socket()[source]#
class rofunc.devices.emg.src.delsystream.Sensor(name, data_streams, byte_sizes, masks)[source]#

This class implements an abstraction for sensors. It is not used in the current implementation

Initialization

getMask()[source]#
getBytes()[source]#
getName()[source]#
getDataStreams()[source]#
generateFilnames()[source]#
rofunc.devices.emg.src.delsystream.main()[source]#