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_listening and stop_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:packetslist of larpix Packet objects to encode into IO messages
Returns:list of IO messages
decode(msgs, **kwargs)[source]

Decodes a list of IO message objects into respective larpix Packet objects

Parameters:
  • msgslist of IO messages
  • kwargs – additional contextual information required to decode messages (implementation specific)
Returns:

list of larpix Packet objects

send(packets)[source]

Function for sending larpix packet objects

Parameters:packetslist of larpix Packet objects to send via IO
Returns:None
start_listening()[source]

Function for starting read communications on IO

Returns:None
stop_listening()[source]

Function for halting read communications on IO

Returns: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 or empty_queue, whichever was most recent.

Returns:tuple of (list of Packet objects, raw bytestream)

Index