Source code for rewrite.lib.common.Record

from enum import IntEnum


[docs]class RecordType(IntEnum): """ Enum of the possible types of Records between DAQ and analysis. Enum for "type-safety" """ CONTROL = 0 DATA = 1 TEMPERATURE = 2 PRESSURE = 3 COUNTER = 4 GPS = 5
[docs]class Record(object): """ The basic data-structure used to communicate between DAQ and analysis VERY EARLY STAGE! Everything is subject to change! :param packageNumber: A sequential number of all packages send by a DAQ server :param RecType: Type of the record :param timestamp: Unixtimestamp :param payload: Payload to be send """ def __init__(self, packageNumber, RecType, timestamp, payload): self.packageNumber = packageNumber self.type = RecType self.timestamp = timestamp self.payload = payload def __repr__(self): return f"{self.packageNumber} {RecordType(self.type).name} {self.timestamp} {self.payload}" __str__ = __repr__