OOF3
All checks were successful
EIVE/-/pipeline/head This commit looks good

This commit is contained in:
2023-11-22 13:51:33 +01:00
parent 02d9d6adfc
commit d640d547bd
15 changed files with 300 additions and 347 deletions

View File

@ -151,10 +151,10 @@ def create_ploc_mpsoc_node() -> CmdTreeNode:
]
info_strs = [getattr(Info, key) for key in dir(OpCode) if not key.startswith("__")]
combined_dict = dict(zip(op_code_strs, info_strs))
ploc_mpsoc = CmdTreeNode("ploc_mpsoc", "PLOC MPSoC")
node = CmdTreeNode("ploc_mpsoc", "PLOC MPSoC")
for op_code, info in combined_dict.items():
ploc_mpsoc.add_child(CmdTreeNode(op_code, info))
return ploc_mpsoc
node.add_child(CmdTreeNode(op_code, info))
return node
@tmtc_definitions_provider
@ -679,7 +679,9 @@ def handle_mpsoc_data_reply(action_id: int, pw: PrintWrapper, custom_data: bytea
current_idx = 0
dir_name_short = custom_data[current_idx : current_idx + 12].decode("utf-8")
current_idx += 12
num_elements = struct.unpack("!I", custom_data[current_idx : current_idx + 4])[0]
num_elements = struct.unpack("!I", custom_data[current_idx : current_idx + 4])[
0
]
elem_names = []
elem_attrs = []
elem_sizes = []

View File

@ -1,14 +1,11 @@
import enum
from typing import Dict, Tuple
from eive_tmtc.config.definitions import CustomServiceList
from eive_tmtc.config.object_ids import PL_SUBSYSTEM_ID
from spacepackets.ecss import PusTelecommand
from eive_tmtc.tmtc.common import pack_mode_cmd_with_info
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
from tmtccmd.config.tmtc import tmtc_definitions_provider
from tmtccmd.tmtc import service_provider
from tmtccmd.tmtc.decorator import ServiceProviderParams
from tmtccmd.config import CmdTreeNode
from tmtccmd.tmtc import DefaultPusQueueHelper
from tmtccmd.pus.s200_fsfw_mode import Subservice as ModeSubservice
@ -36,12 +33,9 @@ HANDLER_LIST: Dict[str, Tuple[int, str]] = {
}
@service_provider(CustomServiceList.PL_SS)
def build_acs_subsystem_cmd(p: ServiceProviderParams):
op_code = p.op_code
q = p.queue_helper
def build_acs_subsystem_cmd(q: DefaultPusQueueHelper, cmd_str: str):
info_prefix = "ACS Subsystem"
if op_code in OpCode.REPORT_ALL_MODES:
if cmd_str == OpCode.REPORT_ALL_MODES:
q.add_log_cmd(f"{info_prefix}: {Info.REPORT_ALL_MODES}")
q.add_pus_tc(
PusTelecommand(
@ -50,7 +44,7 @@ def build_acs_subsystem_cmd(p: ServiceProviderParams):
app_data=PL_SUBSYSTEM_ID,
)
)
mode_info_tup = HANDLER_LIST.get(op_code)
mode_info_tup = HANDLER_LIST.get(cmd_str)
if mode_info_tup is None:
return
pack_mode_cmd_with_info(
@ -62,9 +56,8 @@ def build_acs_subsystem_cmd(p: ServiceProviderParams):
)
@tmtc_definitions_provider
def add_payload_subsystem_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(OpCode.OFF, Info.OFF)
oce.add(OpCode.REPORT_ALL_MODES, Info.REPORT_ALL_MODES)
defs.add_service(CustomServiceList.PL_SS, "Payload Subsystem", oce)
def create_payload_subsystem_node() -> CmdTreeNode:
payload_node = CmdTreeNode("payload", "Payload Subsystem")
payload_node.add_child(CmdTreeNode(OpCode.OFF, Info.OFF))
payload_node.add_child(CmdTreeNode(OpCode.REPORT_ALL_MODES, Info.REPORT_ALL_MODES))
return payload_node