devices.base

Base device classes

class mio.devices.base.BufferHeader(*, linked_list: int, frame_num: int, buffer_count: int, frame_buffer_count: int, write_buffer_count: int, dropped_buffer_count: int, timestamp: int, write_timestamp: int)

Container for the data stream’s header, structured by MetadataHeaderFormat

POSITIONS: ClassVar[dict[str, int]] = {'buffer_count': 2, 'dropped_buffer_count': 5, 'frame_buffer_count': 3, 'frame_num': 1, 'linked_list': 0, 'timestamp': 6, 'write_buffer_count': 4, 'write_timestamp': 7}
buffer_count: int
dropped_buffer_count: int
frame_buffer_count: int
frame_num: int
classmethod from_sequence(vals: Sequence, construct: bool = False) Self

Instantiate a buffer header from linearized values (eg. in an ndarray or list) and an associated format that tells us what index the model values are found in that data.

Parameters:
  • vals (list, numpy.ndarray) – Indexable values to cast to the header model

  • format (BufferHeaderFormat) – Format used to index values

  • construct (bool) – If True , use model_construct() to create the model instance (ie. without validation, but faster). Default: False

Returns:

BufferHeader

linked_list: int
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

timestamp: int
write_buffer_count: int
write_timestamp: int
class mio.devices.base.Device

Abstract device parent class