GE Device

Connect and request Subrecord and Waveform:

device = GEDevice()
device.connect('/dev/ttyUSB0')

device.request(subtype=device.DISPL, waveform_set=['PLETH', 'ECG1'])

device.collect(True)

To clear the buffer input:

device.clear_buffer()

To stop the data collecting:

device.collect(False)
class pycollect.device.FakeDevice(raw_file)[source]

Bases: object

Debugger class for simulate the input data.

__init__(raw_file)[source]

Establish the connection and handle the data input from monitor.

Parameters:raw_file (str, optional) – Input file with raw data.
__read_raw__()[source]

Return generator with the input raw data.

Returns:Generator for single bytes.
Return type:Generator
close()[source]

Close the serial port.

connect(port, timeout)[source]

Establish the connection and debug an unrelated serial device.

Parameters:
  • port (str) – Serial port.
  • timeout (integer) – Timeout for serial comunication.
read(size)[source]

Return the input raw file one byte at time.

Parameters:size (int) – Buffer input size to read.
Returns:Array with raw data.
Return type:list
writable()[source]

Check if serial port is writable..

Returns:Port writable.
Return type:bool
write(data)[source]

Write on serial port if available.

Parameters:data (bytes) – Desired object to write in serial port.
class pycollect.device.GEDevice(raw_file=None)[source]

Bases: object

Establish the connection and handle the data input from monitor.

__init__(raw_file=None)[source]

Establish the connection and handle the data input from monitor.

Parameters:raw_file (str, optional) – Read from local file, no serial.
clear_buffer()[source]

Crear the data buffer, not the serial input buffer.

close()[source]

Close serial port

collect(flag=True, size=4096)[source]

Enable or disable the continuous data reading.

Parameters:
  • flag (bool, True) – Enable or disable the continuous data reading.
  • size (integer, 2**12) – Input buffer size.
connect(port, timeout=1)[source]

Establish the connection with the CARESCAPE Monitor Bx50.

  • Baudrate: 19200
  • Parity: even
  • Stop bits: 1
  • bytesize: 8 bits
  • rtscts: True
Parameters:
  • port (str) – Serial port address.
  • timeout (int, in secods) – Serial port read and write timeout.
create_waveform_set(waveform_set)[source]

Generate Waveform set.

Parameters:waveform_set (array) – List of waveform types.
Returns:A list of integer that represent the waveforms desired.
Return type:list
on_connection_loss()[source]

Overwritable method.

read(size=4096)[source]

Write into the data buffer the bytes readed from serial port.

Parameters:size (integer, 2**12) – Input buffer size.
request(subtype=None, waveform_set=None, interval=1)[source]

Create and send a data request of Subrecord or/and Waveform type.

Parameters:
  • subtype (subrecord type object) – DISPL, TREND_10S or TREND_60S
  • waveform_set (array) – List of waveform types.
  • interval (int, in seconds) – If subtype is DISPL interval is accepted and must be an integer equal or greater to 1.
request_multiple_wave_transfer(wave_set, transmission_type)[source]

Create and send header of Waveform type.

Parameters:
  • wave_set (array) – List of constants that represents each waveform type requested, if list lenghth is less than 8, the last integer must be 255.
  • transmission_type (transmission type object) – WF_REQ_CONT_START for start start transmission, WF_REQ_CONT_STOP for stop it and WF_REQ_TIMED_START for request a timed transmission.
request_transfer(subtype, interval)[source]

Create and send header of Subrecord type.

Parameters:
  • subtype (subrecord type object) – DISPL, TREND_10S or TREND_60S
  • interval (int, in seconds) – If subtype is DISPL interval is accepted and must be an integer equal or greater to 5
stop()[source]

Send the request for stop the Subrecords and Waveform transmission.

stop_transfer()[source]

Send the request for stop the Subrecords transmission.

stop_wave_transfer()[source]

Send the request for stop the Waveform transmission.

write_buffer(data)[source]

Check if device is writeble and send the data.

Parameters:data (bytes array) – Bytes with the header that bust sent to the device.