LArPix IO¶
-
class
larpix.io.
IO
[source]¶ Base class for IO objects that explicitly describes the necessary functions required by any IO class implementation. Additional functions are not used by the larpix core classes.
-
__init__
()[source]¶ Declaration of IO object
Variables: is_listening – flag for start_listening
andstop_listening
-
load
(filepath=None)[source]¶ Loads a specified IO configuration
Parameters: filepath – path to io configuration file (JSON)
-
encode
(packets)[source]¶ Encodes a list of packets into a list of IO message objects
Parameters: packets – list
of larpixPacket
objects to encode into IO messagesReturns: list
of IO messages
-
decode
(msgs, **kwargs)[source]¶ Decodes a list of IO message objects into respective larpix
Packet
objectsParameters: - msgs –
list
of IO messages - kwargs – additional contextual information required to decode messages (implementation specific)
Returns: list
of larpixPacket
objects- msgs –
-
send
(packets)[source]¶ Function for sending larpix packet objects
Parameters: packets – list
of larpixPacket
objects to send via IOReturns: None
-
empty_queue
()[source]¶ Read and remove the current items in the internal queue. The details of the queue implementation is left up to the specific IO class. Generally returns all packets that have been read since last call to
start_listening
orempty_queue
, whichever was most recent.Returns: tuple
of (list
ofPacket
objects, raw bytestream)
-