Merge remote-tracking branch 'origin/develop' into mohr/looooop
This commit is contained in:
0
pus_tm/system/__init__.py
Normal file
0
pus_tm/system/__init__.py
Normal file
21
pus_tm/system/core.py
Normal file
21
pus_tm/system/core.py
Normal file
@ -0,0 +1,21 @@
|
||||
import struct
|
||||
|
||||
from pus_tm.defs import PrintWrapper
|
||||
from pus_tc.system.core import SetIds
|
||||
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
|
||||
|
||||
|
||||
def handle_core_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
|
||||
if set_id == SetIds.HK:
|
||||
pw = PrintWrapper(printer)
|
||||
fmt_str = "!fff"
|
||||
inc_len = struct.calcsize(fmt_str)
|
||||
(temperature, ps_voltage, pl_voltage) = struct.unpack(
|
||||
fmt_str, hk_data[0 : 0 + inc_len]
|
||||
)
|
||||
printout = (
|
||||
f"Chip Temperature [°C] {temperature} | PS Voltage [mV] {ps_voltage} | "
|
||||
f"PL Voltage [mV] {pl_voltage}"
|
||||
)
|
||||
pw.dlog(printout)
|
||||
printer.print_validity_buffer(validity_buffer=hk_data[inc_len:], num_vars=3)
|
41
pus_tm/system/tcs.py
Normal file
41
pus_tm/system/tcs.py
Normal file
@ -0,0 +1,41 @@
|
||||
import struct
|
||||
|
||||
from pus_tm.defs import PrintWrapper
|
||||
from pus_tm.tm_tcp_server import TmTcpServer
|
||||
from tmtccmd.utility import ObjectId
|
||||
from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter
|
||||
|
||||
|
||||
TM_TCP_SERVER = TmTcpServer.getInstance()
|
||||
|
||||
|
||||
def handle_thermal_controller_hk_data(
|
||||
object_id: ObjectId, printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes
|
||||
):
|
||||
if set_id == 0:
|
||||
pw = PrintWrapper(printer)
|
||||
pw.dlog("Received Sensor Temperature data")
|
||||
|
||||
# get all the floats
|
||||
tm_data = struct.unpack("!ffffffffffffffff", hk_data[: 16 * 4])
|
||||
parsed_data = {}
|
||||
|
||||
# put them into an nice dictionary
|
||||
parsed_data["SENSOR_PLOC_HEATSPREADER"] = tm_data[0]
|
||||
parsed_data["SENSOR_PLOC_MISSIONBOARD"] = tm_data[1]
|
||||
parsed_data["SENSOR_4K_CAMERA"] = tm_data[2]
|
||||
parsed_data["SENSOR_DAC_HEATSPREADER"] = tm_data[3]
|
||||
parsed_data["SENSOR_STARTRACKER"] = tm_data[4]
|
||||
parsed_data["SENSOR_RW1"] = tm_data[5]
|
||||
parsed_data["SENSOR_DRO"] = tm_data[6]
|
||||
parsed_data["SENSOR_SCEX"] = tm_data[7]
|
||||
parsed_data["SENSOR_X8"] = tm_data[8]
|
||||
parsed_data["SENSOR_HPA"] = tm_data[9]
|
||||
parsed_data["SENSOR_TX_MODUL"] = tm_data[10]
|
||||
parsed_data["SENSOR_MPA"] = tm_data[11]
|
||||
parsed_data["SENSOR_ACU"] = tm_data[12]
|
||||
parsed_data["SENSOR_PLPCDU_HEATSPREADER"] = tm_data[13]
|
||||
parsed_data["SENSOR_TCS_BOARD"] = tm_data[14]
|
||||
parsed_data["SENSOR_MAGNETTORQUER"] = tm_data[15]
|
||||
|
||||
TM_TCP_SERVER.report_parsed_hk_data(object_id, set_id, parsed_data)
|
Reference in New Issue
Block a user