health and system cmds
EIVE/-/pipeline/pr-main This commit looks good Details

This commit is contained in:
Robin Müller 2023-11-22 19:42:26 +01:00
parent 756944cae3
commit 77c2c91539
Signed by: muellerr
GPG Key ID: A649FB78196E3849
3 changed files with 56 additions and 52 deletions

View File

@ -1,74 +1,72 @@
"""Hook function which packs telecommands based on service and operation code string """Hook function which packs telecommands based on service and operation code string
""" """
import logging import logging
from typing import cast, List from typing import List, cast
from eive_tmtc.tmtc.acs.gyros import handle_gyr_cmd
from eive_tmtc.tmtc.acs.acs_ctrl import pack_acs_ctrl_command
from eive_tmtc.tmtc.com.subsystem import build_com_subsystem_procedure
from eive_tmtc.tmtc.test import pack_test_command
from eive_tmtc.tmtc.acs.mgms import handle_mgm_cmd
from eive_tmtc.tmtc.power.power import pack_power_commands
from eive_tmtc.tmtc.tcs.ctrl import pack_tcs_ctrl_commands
from eive_tmtc.tmtc.tcs.rtd import pack_rtd_commands
from eive_tmtc.tmtc.payload.scex import pack_scex_cmds
from eive_tmtc.tmtc.tcs.subsystem import pack_tcs_sys_commands
from eive_tmtc.tmtc.time import pack_time_management_cmd
from tmtccmd import DefaultProcedureInfo from tmtccmd import DefaultProcedureInfo
from tmtccmd.tmtc import DefaultPusQueueHelper from tmtccmd.tmtc import DefaultPusQueueHelper
from tmtccmd.util import ObjectIdU32
from eive_tmtc.tmtc.power.p60dock import pack_p60dock_cmds import eive_tmtc.config.object_ids as oids
from eive_tmtc.tmtc.power.pdu2 import pack_pdu2_commands
from eive_tmtc.tmtc.power.pdu1 import pack_pdu1_commands
from eive_tmtc.tmtc.power.acu import pack_acu_commands
from eive_tmtc.tmtc.acs.imtq import create_imtq_command
from eive_tmtc.tmtc.tcs.heater import pack_heater_cmds
from eive_tmtc.tmtc.acs.reaction_wheels import (
create_single_rw_cmd,
pack_rw_ass_cmds,
)
from eive_tmtc.tmtc.com.ccsds_handler import pack_ccsds_handler_command
from eive_tmtc.tmtc.core import pack_core_commands
from eive_tmtc.tmtc.acs.star_tracker import pack_star_tracker_commands
from eive_tmtc.tmtc.com.syrlinks_handler import pack_syrlinks_command
from eive_tmtc.tmtc.com.pdec_handler import pack_pdec_handler_commands
from eive_tmtc.tmtc.wdt import pack_wdt_commands
from eive_tmtc.tmtc.acs.acs_board import pack_acs_command
from eive_tmtc.config.object_ids import ( from eive_tmtc.config.object_ids import (
P60_DOCK_HANDLER,
PDU_1_HANDLER_ID,
PDU_2_HANDLER_ID,
ACU_HANDLER_ID, ACU_HANDLER_ID,
TMP1075_HANDLER_TCS_BRD_0_ID, CCSDS_HANDLER_ID,
TMP1075_HANDLER_TCS_BRD_1_ID,
TMP1075_HANDLER_PLPCDU_0_ID,
TMP1075_HANDLER_IF_BRD_ID,
HEATER_CONTROLLER_ID, HEATER_CONTROLLER_ID,
IMTQ_HANDLER_ID, IMTQ_HANDLER_ID,
P60_DOCK_HANDLER,
PDEC_HANDLER_ID,
PDU_1_HANDLER_ID,
PDU_2_HANDLER_ID,
RAD_SENSOR_ID,
RW1_ID, RW1_ID,
RW2_ID, RW2_ID,
RW3_ID, RW3_ID,
RW4_ID, RW4_ID,
RAD_SENSOR_ID, RW_ASSEMBLY,
STAR_TRACKER_ID, STAR_TRACKER_ID,
CCSDS_HANDLER_ID,
PDEC_HANDLER_ID,
STR_IMG_HELPER_ID, STR_IMG_HELPER_ID,
SYRLINKS_HANDLER_ID, SYRLINKS_HANDLER_ID,
RW_ASSEMBLY, TMP1075_HANDLER_IF_BRD_ID,
TMP1075_HANDLER_PLPCDU_0_ID,
TMP1075_HANDLER_TCS_BRD_0_ID,
TMP1075_HANDLER_TCS_BRD_1_ID,
get_object_ids, get_object_ids,
) )
from eive_tmtc.tmtc.acs.acs_board import pack_acs_command
from eive_tmtc.tmtc.tcs.tmp1075 import pack_tmp1075_test_into from eive_tmtc.tmtc.acs.acs_ctrl import pack_acs_ctrl_command
from eive_tmtc.tmtc.acs.gps import pack_gps_command from eive_tmtc.tmtc.acs.gps import pack_gps_command
from eive_tmtc.tmtc.payload.rad_sensor import create_rad_sensor_cmd from eive_tmtc.tmtc.acs.gyros import handle_gyr_cmd
from eive_tmtc.tmtc.payload.plpcdu import pack_pl_pcdu_commands from eive_tmtc.tmtc.acs.imtq import create_imtq_command
from eive_tmtc.tmtc.acs.mgms import handle_mgm_cmd
from eive_tmtc.tmtc.acs.reaction_wheels import (
create_single_rw_cmd,
pack_rw_ass_cmds,
)
from eive_tmtc.tmtc.acs.star_tracker import pack_star_tracker_commands
from eive_tmtc.tmtc.acs.str_img_helper import pack_str_img_helper_command from eive_tmtc.tmtc.acs.str_img_helper import pack_str_img_helper_command
from eive_tmtc.tmtc.com.ccsds_handler import pack_ccsds_handler_command
import eive_tmtc.config.object_ids as oids from eive_tmtc.tmtc.com.pdec_handler import pack_pdec_handler_commands
from tmtccmd.util import ObjectIdU32 from eive_tmtc.tmtc.com.subsystem import build_com_subsystem_procedure
from eive_tmtc.tmtc.com.syrlinks_handler import pack_syrlinks_command
from eive_tmtc.tmtc.core import pack_core_commands
from eive_tmtc.tmtc.health import build_health_cmds
from eive_tmtc.tmtc.payload.plpcdu import pack_pl_pcdu_commands
from eive_tmtc.tmtc.payload.rad_sensor import create_rad_sensor_cmd
from eive_tmtc.tmtc.payload.scex import pack_scex_cmds
from eive_tmtc.tmtc.power.acu import pack_acu_commands
from eive_tmtc.tmtc.power.p60dock import pack_p60dock_cmds
from eive_tmtc.tmtc.power.pdu1 import pack_pdu1_commands
from eive_tmtc.tmtc.power.pdu2 import pack_pdu2_commands
from eive_tmtc.tmtc.power.power import pack_power_commands
from eive_tmtc.tmtc.system import build_system_cmds
from eive_tmtc.tmtc.tcs.ctrl import pack_tcs_ctrl_commands
from eive_tmtc.tmtc.tcs.heater import pack_heater_cmds
from eive_tmtc.tmtc.tcs.rtd import pack_rtd_commands
from eive_tmtc.tmtc.tcs.subsystem import pack_tcs_sys_commands
from eive_tmtc.tmtc.tcs.tmp1075 import pack_tmp1075_test_into
from eive_tmtc.tmtc.test import build_test_commands
from eive_tmtc.tmtc.time import pack_time_management_cmd
from eive_tmtc.tmtc.wdt import pack_wdt_commands
from eive_tmtc.utility.input_helper import InputHelper from eive_tmtc.utility.input_helper import InputHelper
@ -85,6 +83,12 @@ def handle_pus_procedure( # noqa C901: Complexity okay here.
raise ValueError( raise ValueError(
"command path list empty. Full command path {cmd_path} might have invalid format" "command path list empty. Full command path {cmd_path} might have invalid format"
) )
if cmd_path_list[0] == "system":
assert len(cmd_path_list) >= 1
return build_system_cmds(queue_helper, cmd_path_list[1])
if cmd_path_list[0] == "health":
assert len(cmd_path_list) >= 1
return build_health_cmds(queue_helper, cmd_path_list[1])
if cmd_path_list[0] == "eps": if cmd_path_list[0] == "eps":
return handle_eps_procedure(queue_helper, cmd_path_list[1:]) return handle_eps_procedure(queue_helper, cmd_path_list[1:])
if cmd_path_list[0] == "tcs": if cmd_path_list[0] == "tcs":
@ -97,7 +101,7 @@ def handle_pus_procedure( # noqa C901: Complexity okay here.
return handle_obdh_procedure(queue_helper, cmd_path_list[1:]) return handle_obdh_procedure(queue_helper, cmd_path_list[1:])
if cmd_path_list[0] == "test": if cmd_path_list[0] == "test":
assert len(cmd_path_list) >= 1 assert len(cmd_path_list) >= 1
return pack_test_command(queue_helper, cmd_path_list[1]) return build_test_commands(queue_helper, cmd_path_list[1])
if cmd_path_list[0] == "com": if cmd_path_list[0] == "com":
return handle_com_procedure(queue_helper, cmd_path_list[1:]) return handle_com_procedure(queue_helper, cmd_path_list[1:])
logging.getLogger(__name__).warning( logging.getLogger(__name__).warning(

View File

@ -28,7 +28,7 @@ def prompt_health() -> FsfwHealth:
return FsfwHealth(health_idx) return FsfwHealth(health_idx)
def pack_health_cmd(q: DefaultPusQueueHelper, cmd_str: str): def build_health_cmds(q: DefaultPusQueueHelper, cmd_str: str):
if cmd_str == OpCode.SET_HEALTH: if cmd_str == OpCode.SET_HEALTH:
app_data = bytearray(prompt_object()) app_data = bytearray(prompt_object())
health = prompt_health() health = prompt_health()

View File

@ -24,7 +24,7 @@ def create_test_node() -> CmdTreeNode:
return node return node
def pack_test_command(q: DefaultPusQueueHelper, cmd_path: str): def build_test_commands(q: DefaultPusQueueHelper, cmd_path: str):
if cmd_path == OpCode.PING: if cmd_path == OpCode.PING:
q.add_log_cmd("Sending PUS TC [17,1]") q.add_log_cmd("Sending PUS TC [17,1]")
q.add_pus_tc(create_service_17_ping_command()) q.add_pus_tc(create_service_17_ping_command())