Merge branch 'main' into petri_dev

This commit is contained in:
Robin Müller 2022-10-04 13:17:56 +02:00
commit bcdc0615c1
5 changed files with 39 additions and 33 deletions

View File

@ -36,11 +36,11 @@ class CustomServiceList(str, enum.Enum):
PCDU = "pcdu"
PL_PCDU = "plpcdu"
SA_DEPLYOMENT = "sa_depl"
REACTION_WHEEL_1 = "rw-1"
REACTION_WHEEL_2 = "rw-2"
REACTION_WHEEL_3 = "rw-3"
REACTION_WHEEL_4 = "rw-4"
RW_ASSEMBLY = "rw-ass"
REACTION_WHEEL_1 = "rw_1"
REACTION_WHEEL_2 = "rw_2"
REACTION_WHEEL_3 = "rw_3"
REACTION_WHEEL_4 = "rw_4"
RW_ASSEMBLY = "rw_ass"
RAD_SENSOR = "rad_sensor"
GPS_CTRL = "gnss-ctrl"
PLOC_MEMORY_DUMPER = "ploc_memory_dumper"
@ -50,11 +50,11 @@ class CustomServiceList(str, enum.Enum):
PDEC_HANDLER = "pdec_handler"
STR_IMG_HELPER = "str_img_helper"
SYRLINKS = "syrlinks"
ACS_CTRL = "acs-ctrl"
ACS_ASS = "acs-ass"
SUS_ASS = "sus-ass"
ACS_CTRL = "acs_ctrl"
ACS_ASS = "acs_ass"
SUS_ASS = "sus_ass"
TCS = "tcs"
TCS_ASS = "tcs-ass"
TCS_ASS = "tcs_ass"
TIME = "time"
PROCEDURE = "proc"
RTD = "rtd"

View File

@ -16,9 +16,9 @@ from config.object_ids import TCS_BOARD_ASS_ID, TCS_CONTROLLER
class OpCodes:
TCS_BOARD_ASS_NORMAL = ["0", "tcs-normal"]
TCS_BOARD_ASS_OFF = ["1", "tcs-off"]
REQUEST_SENSOR_TEMP_SET = ["2", "temp-hk"]
TCS_BOARD_ASS_NORMAL = ["0", "normal"]
TCS_BOARD_ASS_OFF = ["1", "off"]
REQUEST_SENSOR_TEMP_SET = ["2", "temps"]
class Info:

View File

@ -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,

View File

@ -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)

View File

@ -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