This commit is contained in:
parent
76fee820e9
commit
3cf312073a
@ -20,6 +20,7 @@ from eive_tmtc.tmtc.core import create_core_node
|
||||
from eive_tmtc.tmtc.health import create_global_health_node
|
||||
from eive_tmtc.tmtc.payload.ploc_mpsoc import create_ploc_mpsoc_node
|
||||
from eive_tmtc.tmtc.payload.ploc_supervisor import create_ploc_supv_node
|
||||
from eive_tmtc.tmtc.payload.plpcdu import create_pl_pcdu_node
|
||||
from eive_tmtc.tmtc.payload.scex import create_scex_node
|
||||
from eive_tmtc.tmtc.payload.subsystem import create_payload_subsystem_node
|
||||
from eive_tmtc.tmtc.power.bpx_batt import create_bpx_batt_node
|
||||
@ -31,6 +32,7 @@ from eive_tmtc.tmtc.tcs.heater import create_heater_node
|
||||
from eive_tmtc.tmtc.test import create_test_node
|
||||
from eive_tmtc.tmtc.time import create_time_node
|
||||
from eive_tmtc.tmtc.tm_store import create_persistent_tm_store_node
|
||||
from eive_tmtc.tmtc.wdt import create_wdt_node
|
||||
|
||||
|
||||
class EiveHookObject(HookBase):
|
||||
@ -117,15 +119,13 @@ class EiveHookObject(HookBase):
|
||||
eps_node.add_child(create_bpx_batt_node())
|
||||
|
||||
payload_node = create_payload_subsystem_node()
|
||||
pl_pcdu = CmdTreeNode("pl_pcdu", "Payload PCDU")
|
||||
payload_node.add_child(pl_pcdu)
|
||||
payload_node.add_child(create_pl_pcdu_node())
|
||||
payload_node.add_child(create_scex_node())
|
||||
payload_node.add_child(create_ploc_mpsoc_node())
|
||||
payload_node.add_child(create_ploc_supv_node())
|
||||
|
||||
obdh_node = CmdTreeNode("obdh", "OBDH Subsystem")
|
||||
xiphos_wdt = CmdTreeNode("wdt", "Xiphos WDT")
|
||||
obdh_node.add_child(xiphos_wdt)
|
||||
obdh_node.add_child(create_wdt_node())
|
||||
obdh_node.add_child(create_core_node())
|
||||
obdh_node.add_child(create_time_node())
|
||||
obdh_node.add_child(create_persistent_tm_store_node())
|
||||
|
@ -58,6 +58,7 @@ 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.power.pwr_ctrl import pack_power_ctrl_command
|
||||
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
|
||||
@ -114,9 +115,10 @@ def handle_eps_procedure(queue_helper: DefaultPusQueueHelper, cmd_path_list: Lis
|
||||
if len(cmd_path_list) == 1:
|
||||
return pack_power_commands(queue_helper, cmd_path_list[0])
|
||||
assert len(cmd_path_list) >= 2
|
||||
if cmd_path_list[0] == "pwr_ctrl":
|
||||
return pack_power_ctrl_command(queue_helper, cmd_path_list[1])
|
||||
if cmd_path_list[0] == "p60_dock":
|
||||
object_id = cast(ObjectIdU32, obj_id_man.get(P60_DOCK_HANDLER))
|
||||
assert len(cmd_path_list) >= 2
|
||||
return pack_p60dock_cmds(
|
||||
object_id=object_id, q=queue_helper, cmd_str=cmd_path_list[1]
|
||||
)
|
||||
|
@ -6,7 +6,7 @@ from typing import Optional
|
||||
|
||||
from eive_tmtc.config.definitions import CustomServiceList
|
||||
from eive_tmtc.pus_tm.defs import PrintWrapper
|
||||
from tmtccmd.config import TmtcDefinitionWrapper
|
||||
from tmtccmd.config import CmdTreeNode, TmtcDefinitionWrapper
|
||||
|
||||
from tmtccmd.config.tmtc import OpCodeEntry, tmtc_definitions_provider
|
||||
from tmtccmd.tmtc import DefaultPusQueueHelper
|
||||
@ -34,7 +34,6 @@ _LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class OpCode:
|
||||
SWITCH_HPA_ON_PROC = ["0", "proc_hpa"]
|
||||
SWITCH_ON = "on"
|
||||
SWITCH_OFF = "off"
|
||||
NORMAL_SSR = "nml_ssr"
|
||||
@ -52,12 +51,12 @@ class OpCode:
|
||||
UPDATE_V_LOWER_LIMIT = "update_v_lower_limit"
|
||||
UPDATE_V_UPPER_LIMIT = "update_v_upper_limit"
|
||||
|
||||
INJECT_SSR_TO_DRO_FAILURE = ["10", "inject_ssr_dro_fault"]
|
||||
INJECT_DRO_TO_X8_FAILURE = ["11", "inject_dro_x8_fault"]
|
||||
INJECT_X8_TO_TX_FAILURE = ["12", "inject_x8_tx_fault"]
|
||||
INJECT_TX_TO_MPA_FAILURE = ["13", "inject_tx_mpa_fault"]
|
||||
INJECT_MPA_TO_HPA_FAILURE = ["14", "inject_mpa_hpa_fault"]
|
||||
INJECT_ALL_ON_FAILURE = ["15", "inject_all_on_fault"]
|
||||
INJECT_SSR_TO_DRO_FAILURE = "inject_ssr_dro_fault"
|
||||
INJECT_DRO_TO_X8_FAILURE = "inject_dro_x8_fault"
|
||||
INJECT_X8_TO_TX_FAILURE = "inject_x8_tx_fault"
|
||||
INJECT_TX_TO_MPA_FAILURE = "inject_tx_mpa_fault"
|
||||
INJECT_MPA_TO_HPA_FAILURE = "inject_mpa_hpa_fault"
|
||||
INJECT_ALL_ON_FAILURE = "inject_all_on_fault"
|
||||
|
||||
|
||||
class Info:
|
||||
@ -71,12 +70,17 @@ class Info:
|
||||
NORMAL_MPA = f"{NORMAL}, MPA on"
|
||||
NORMAL_HPA = f"{NORMAL}, HPA on"
|
||||
REQ_OS_HK = "Request One Shot HK"
|
||||
SWITCH_HPA_ON_PROC = "Switch HPA on procedure"
|
||||
ENABLE_HK = "Enable HK"
|
||||
DISABLE_HK = "Disable HK"
|
||||
UPDATE_I_UPPER_LIMIT = "Update upper current parameter"
|
||||
UPDATE_V_LOWER_LIMIT = "Update lower voltage parameter"
|
||||
UPDATE_V_UPPER_LIMIT = "Update upper voltage parameter"
|
||||
INJECT_SSR_TO_DRO_FAILURE = "Inject SSR to DRO failure"
|
||||
INJECT_DRO_TO_X8_FAILURE = "Inject DRO to X8 failure"
|
||||
INJECT_X8_TO_TX_FAILURE = "Inject X8 to TX failure"
|
||||
INJECT_TX_TO_MPA_FAILURE = "Inject TX to MPA failure"
|
||||
INJECT_MPA_TO_HPA_FAILURE = "Inject MPA to HPA failure"
|
||||
INJECT_ALL_ON_FAILURE = "Inject all on failure"
|
||||
|
||||
|
||||
class SetId(enum.IntEnum):
|
||||
@ -173,10 +177,21 @@ class DevSelect(enum.IntEnum):
|
||||
HPA = 5
|
||||
|
||||
|
||||
def create_pl_pcdu_node() -> CmdTreeNode:
|
||||
op_code_strs = [
|
||||
getattr(OpCode, key) for key in dir(OpCode) if not key.startswith("__")
|
||||
]
|
||||
info_strs = [getattr(Info, key) for key in dir(OpCode) if not key.startswith("__")]
|
||||
combined_dict = dict(zip(op_code_strs, info_strs))
|
||||
node = CmdTreeNode("pl_pcdu", "Payload PCDU", hide_children_for_print=True)
|
||||
for op_code, info in combined_dict.items():
|
||||
node.add_child(CmdTreeNode(op_code, info))
|
||||
return node
|
||||
|
||||
|
||||
@tmtc_definitions_provider
|
||||
def add_pl_pcdu_cmds(defs: TmtcDefinitionWrapper):
|
||||
oce = OpCodeEntry()
|
||||
oce.add(keys=OpCode.SWITCH_HPA_ON_PROC, info=Info.SWITCH_HPA_ON_PROC)
|
||||
oce.add(keys=OpCode.SWITCH_ON, info=Info.SWITCH_ON)
|
||||
oce.add(keys=OpCode.SWITCH_OFF, info=Info.SWITCH_OFF)
|
||||
oce.add(keys=OpCode.NORMAL_SSR, info=Info.NORMAL_SSR)
|
||||
|
@ -83,7 +83,7 @@ def create_pwr_ctrl_node() -> CmdTreeNode:
|
||||
return node
|
||||
|
||||
|
||||
def pack_acs_ctrl_command(q: DefaultPusQueueHelper, cmd_str: str):
|
||||
def pack_power_ctrl_command(q: DefaultPusQueueHelper, cmd_str: str):
|
||||
if cmd_str == OpCode.OFF:
|
||||
q.add_log_cmd(f"{Info.OFF}")
|
||||
q.add_pus_tc(pack_mode_command(PWR_CONTROLLER, Mode.OFF, 0))
|
||||
|
@ -1,5 +1,6 @@
|
||||
import enum
|
||||
from tmtccmd.config.tmtc import (
|
||||
CmdTreeNode,
|
||||
OpCodeEntry,
|
||||
TmtcDefinitionWrapper,
|
||||
tmtc_definitions_provider,
|
||||
@ -33,6 +34,13 @@ def pack_wdt_commands(q: DefaultPusQueueHelper, cmd_str: str):
|
||||
q.add_pus_tc(create_action_cmd(XIPHOS_WDT_ID, ActionId.DISABLE))
|
||||
|
||||
|
||||
def create_wdt_node() -> CmdTreeNode:
|
||||
node = CmdTreeNode("xiphos_wdt", "Xiphos Watchdog Timer")
|
||||
node.add_child(CmdTreeNode(OpCode.ENABLE, Info.ENABLE))
|
||||
node.add_child(CmdTreeNode(OpCode.DISABLE, Info.DISABLE))
|
||||
return node
|
||||
|
||||
|
||||
@tmtc_definitions_provider
|
||||
def add_xiphos_wdt_defs(defs: TmtcDefinitionWrapper):
|
||||
oce = OpCodeEntry()
|
||||
|
Loading…
x
Reference in New Issue
Block a user