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
-
connect
(port, timeout)[source]¶ Establish the connection and debug an unrelated serial device.
Parameters: - port (str) – Serial port.
- timeout (integer) – Timeout for serial comunication.
-
-
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.
-
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
-
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.
-