LArPix IO¶
Implementations¶
Here is the documentation for various implemented IO classes.
IO Class API¶
-
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_listeningandstop_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 – listof larpixPacketobjects to encode into IO messagesReturns: listof IO messages
-
decode(msgs, **kwargs)[source]¶ Decodes a list of IO message objects into respective larpix
PacketobjectsParameters: - msgs –
listof IO messages - kwargs – additional contextual information required to decode messages (implementation specific)
Returns: listof larpixPacketobjects- msgs –
-
send(packets)[source]¶ Function for sending larpix packet objects
Parameters: packets – listof larpixPacketobjects 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_listeningorempty_queue, whichever was most recent.Returns: tupleof (listofPacketobjects, raw bytestream)
-