clean up TCS server printout
This commit is contained in:
parent
52d91fe857
commit
c8eaf180dc
@ -1,5 +1,5 @@
|
||||
"""HK Handling for EIVE OBSW"""
|
||||
from pus_tm.tcp_server_objects import tcp_server_sensor_temperatures
|
||||
# from pus_tm.tcp_server_objects import TCP_SEVER_SENSOR_TEMPERATURES
|
||||
from tmtc.acs_ctrl import handle_acs_ctrl_mgm_data
|
||||
from pus_tm.devs.plpcdu import handle_plpcdu_hk
|
||||
from pus_tm.devs.rad_sensor import handle_rad_sensor_data
|
||||
@ -51,9 +51,11 @@ def handle_hk_packet(
|
||||
if tm_packet.subservice == 25 or tm_packet.subservice == 26:
|
||||
hk_data = tm_packet.tm_data[8:]
|
||||
if FORWARD_SENSOR_TEMPS:
|
||||
tcp_server_sensor_temperatures.report_raw_hk_data(
|
||||
object_id=named_obj_id, set_id=tm_packet.set_id, hk_data=hk_data
|
||||
)
|
||||
# TODO: Maybe use singleton?
|
||||
# TCP_SEVER_SENSOR_TEMPERATURES.report_raw_hk_data(
|
||||
# object_id=named_obj_id, set_id=tm_packet.set_id, hk_data=hk_data
|
||||
# )
|
||||
pass
|
||||
printer.generic_hk_tm_print(
|
||||
content_type=HkContentType.HK,
|
||||
object_id=named_obj_id,
|
||||
|
@ -1,12 +1,8 @@
|
||||
import enum
|
||||
import pprint
|
||||
import struct
|
||||
|
||||
from pus_tm.defs import PrintWrapper
|
||||
from pus_tm.tcp_server_objects import (
|
||||
tcp_server_sensor_temperatures,
|
||||
tcp_server_device_temperatures,
|
||||
)
|
||||
from pus_tm.tm_tcp_server import TmTcpServer
|
||||
from tmtccmd.util import ObjectIdU32
|
||||
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
|
||||
|
||||
@ -20,10 +16,13 @@ class SetIds(enum.IntEnum):
|
||||
def handle_thermal_controller_hk_data(
|
||||
object_id: ObjectIdU32, printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes
|
||||
):
|
||||
if tcp_server_sensor_temperatures is None:
|
||||
tcp_server_sensor_temperatures = TmTcpServer("localhost", 7305)
|
||||
if tcp_server_device_temperatures is None:
|
||||
tcp_server_device_temperatures = TmTcpServer("localhost", 7306)
|
||||
# need a better solutuon for this is this is used again..
|
||||
"""
|
||||
if TCP_TEMP_SENS_SERVER is None:
|
||||
TCP_TEMP_SENS_SERVER = TmTcpServer("localhost", 7305)
|
||||
if TCP_TEMP_DEV_SERVER:
|
||||
TCP_TEMP_DEV_SERVER = TmTcpServer("localhost", 7306)
|
||||
"""
|
||||
if set_id == SetIds.SENSOR_TEMPERATURE_SET:
|
||||
pw = PrintWrapper(printer)
|
||||
pw.dlog("Received sensor temperature data")
|
||||
@ -51,9 +50,11 @@ def handle_thermal_controller_hk_data(
|
||||
"TMP1075 2": tm_data[17],
|
||||
}
|
||||
printer.file_logger.info(str(parsed_data))
|
||||
tcp_server_sensor_temperatures.report_parsed_hk_data(
|
||||
object_id, set_id, parsed_data
|
||||
)
|
||||
pp = pprint.PrettyPrinter(depth=4)
|
||||
pp.pprint(parsed_data)
|
||||
# tcp_server_sensor_temperatures.report_parsed_hk_data(
|
||||
# object_id, set_id, parsed_data
|
||||
# )
|
||||
elif set_id == SetIds.DEVICE_TEMPERATURE_SET:
|
||||
pw = PrintWrapper(printer)
|
||||
pw.dlog("Received device temperature data")
|
||||
@ -88,10 +89,13 @@ def handle_thermal_controller_hk_data(
|
||||
"MGM_1_TEMPERATURE": tm_data[25],
|
||||
"ADC_PL_PCDU_TEMPERATURE": tm_data[26],
|
||||
}
|
||||
printer.file_logger.info(str(parsed_data))
|
||||
pp = pprint.PrettyPrinter(depth=4)
|
||||
pp.pprint(parsed_data)
|
||||
# print(parsed_data)
|
||||
tcp_server_device_temperatures.report_parsed_hk_data(
|
||||
object_id, set_id, parsed_data
|
||||
)
|
||||
# tcp_server_device_temperatures.report_parsed_hk_data(
|
||||
# object_id, set_id, parsed_data
|
||||
# )
|
||||
elif set_id == SetIds.SUS_TEMPERATURE_SET:
|
||||
pass
|
||||
# pw = PrintWrapper(printer)
|
||||
|
@ -2,5 +2,5 @@ from typing import Optional
|
||||
|
||||
from pus_tm.tm_tcp_server import TmTcpServer
|
||||
|
||||
tcp_server_sensor_temperatures: Optional[TmTcpServer] = None
|
||||
tcp_server_device_temperatures: Optional[TmTcpServer] = None
|
||||
TCP_SERVER_SENSOR_TEMPERATURES: Optional[TmTcpServer] = None
|
||||
TCP_SERVER_DEVICE_TEMPERATURES: Optional[TmTcpServer] = None
|
||||
|
Loading…
Reference in New Issue
Block a user