eive-tmtc/eive_tmtc/pus_tm/hk.py

19 lines
422 B
Python
Raw Normal View History

2023-11-13 14:50:49 +01:00
import uuid
import dataclasses
import datetime
import sqlite3
2024-05-06 11:23:31 +02:00
from spacepackets.ecss.tm import CdsShortTimestamp, PusTm
2023-11-13 14:50:49 +01:00
@dataclasses.dataclass
class HkTmInfo:
packet_uuid: uuid.UUID
2024-05-06 11:23:31 +02:00
hk_packet: PusTm
set_id: int
2023-11-13 14:50:49 +01:00
db_con: sqlite3.Connection
hk_data: bytes
@property
def packet_datetime(self) -> datetime.datetime:
2024-05-06 11:23:31 +02:00
return CdsShortTimestamp.unpack(self.hk_packet.timestamp).as_datetime()