add TMP1075 HK handling
All checks were successful
EIVE/-/pipeline/head This commit looks good

This commit is contained in:
Robin Müller 2023-06-18 13:30:45 +02:00
parent 936dcdf334
commit fd20a9fe3c
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
5 changed files with 21 additions and 1 deletions

View File

@ -70,7 +70,7 @@ class CustomServiceList(str, enum.Enum):
TIME = "time" TIME = "time"
PROCEDURE = "proc" PROCEDURE = "proc"
RTD = "rtd" RTD = "rtd"
TMP1075 = "tcs_tmp" TMP1075 = "tmp1075"
TVTTESTPROCEDURE = "tvtestproc" TVTTESTPROCEDURE = "tvtestproc"
SCEX = "scex" SCEX = "scex"
TM_STORE = "tm_store" TM_STORE = "tm_store"

View File

@ -13,6 +13,7 @@ from eive_tmtc.tmtc.payload.ploc_supervisor import handle_supv_hk_data
from eive_tmtc.tmtc.acs.reaction_wheels import handle_rw_hk_data from eive_tmtc.tmtc.acs.reaction_wheels import handle_rw_hk_data
from eive_tmtc.tmtc.com.syrlinks_handler import handle_syrlinks_hk_data from eive_tmtc.tmtc.com.syrlinks_handler import handle_syrlinks_hk_data
from eive_tmtc.tmtc.tcs import handle_thermal_controller_hk_data from eive_tmtc.tmtc.tcs import handle_thermal_controller_hk_data
from eive_tmtc.tmtc.tcs.tmp1075 import handle_tmp_1075_hk_data
from spacepackets.ecss import PusTelemetry from spacepackets.ecss import PusTelemetry
from tmtccmd.tm.pus_3_fsfw_hk import ( from tmtccmd.tm.pus_3_fsfw_hk import (
Service3Base, Service3Base,
@ -171,6 +172,13 @@ def handle_regular_hk_print( # noqa C901: Complexity okay here
return handle_str_hk_data(set_id=set_id, hk_data=hk_data, pw=pw) return handle_str_hk_data(set_id=set_id, hk_data=hk_data, pw=pw)
elif objb == obj_ids.PLOC_SUPV_ID: elif objb == obj_ids.PLOC_SUPV_ID:
return handle_supv_hk_data(set_id=set_id, hk_data=hk_data, pw=pw) return handle_supv_hk_data(set_id=set_id, hk_data=hk_data, pw=pw)
elif objb in [
obj_ids.TMP1075_HANDLER_TCS_BRD_0_ID,
obj_ids.TMP1075_HANDLER_TCS_BRD_1_ID,
obj_ids.TMP1075_HANDLER_IF_BRD_ID,
obj_ids.TMP1075_HANDLER_PLPCDU_0_ID,
]:
return handle_tmp_1075_hk_data(set_id=set_id, hk_data=hk_data, pw=pw)
elif objb == obj_ids.ACS_CONTROLLER: elif objb == obj_ids.ACS_CONTROLLER:
return handle_acs_ctrl_hk_data( return handle_acs_ctrl_hk_data(
pw=pw, set_id=set_id, hk_data=hk_data, packet_time=packet_dt pw=pw, set_id=set_id, hk_data=hk_data, packet_time=packet_dt

View File

@ -5,3 +5,4 @@ from .time import add_time_cmds
from .health import add_health_cmd_defs from .health import add_health_cmd_defs
from .system import add_system_cmd_defs from .system import add_system_cmd_defs
from .tm_store import add_persistent_tm_store_cmd_defs from .tm_store import add_persistent_tm_store_cmd_defs
from .tcs import add_tmp_sens_cmds

View File

@ -1 +1,2 @@
from .tm import * # noqa from .tm import * # noqa
from .tmp1075 import add_tmp_sens_cmds

View File

@ -6,14 +6,17 @@
@date 06.01.2021 @date 06.01.2021
""" """
import enum import enum
import struct
from eive_tmtc.config.definitions import CustomServiceList from eive_tmtc.config.definitions import CustomServiceList
from eive_tmtc.pus_tm.defs import PrintWrapper
from spacepackets.ecss.tc import PusTelecommand from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.config.tmtc import ( from tmtccmd.config.tmtc import (
tmtc_definitions_provider, tmtc_definitions_provider,
TmtcDefinitionWrapper, TmtcDefinitionWrapper,
OpCodeEntry, OpCodeEntry,
) )
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.tc import DefaultPusQueueHelper from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_200_fsfw_mode import Mode, pack_mode_data from tmtccmd.tc.pus_200_fsfw_mode import Mode, pack_mode_data
from tmtccmd.tc.pus_3_fsfw_hk import create_request_one_hk_command, make_sid from tmtccmd.tc.pus_3_fsfw_hk import create_request_one_hk_command, make_sid
@ -76,3 +79,10 @@ def add_tmp_sens_cmds(defs: TmtcDefinitionWrapper):
oce.add(OpCode.NML, Info.NML) oce.add(OpCode.NML, Info.NML)
oce.add(OpCode.HK, Info.HK) oce.add(OpCode.HK, Info.HK)
defs.add_service(CustomServiceList.TMP1075.value, "TMP1075 Temperature Sensor", oce) defs.add_service(CustomServiceList.TMP1075.value, "TMP1075 Temperature Sensor", oce)
def handle_tmp_1075_hk_data(set_id: int, hk_data: bytes, pw: PrintWrapper):
if set_id == SetId.TEMPERATURE:
temp = struct.unpack("!f", hk_data[0:4])[0]
pw.dlog(f"TMP1075 Temperature: {temp}")
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[4:], 1))