From 5c0b1a3256ee0e3fab3442f688349508c9a9e431 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 10 Apr 2024 15:44:39 +0200 Subject: [PATCH] some minor fixes for python client --- pytmtc/pus_tc.py | 34 ++-------------------------------- src/controller.rs | 10 ++++++++-- 2 files changed, 10 insertions(+), 34 deletions(-) diff --git a/pytmtc/pus_tc.py b/pytmtc/pus_tc.py index b0febdc..3a8e83d 100644 --- a/pytmtc/pus_tc.py +++ b/pytmtc/pus_tc.py @@ -10,7 +10,6 @@ from tmtccmd.tmtc import DefaultPusQueueHelper from tmtccmd.pus.s11_tc_sched import create_time_tagged_cmd from tmtccmd.pus.s200_fsfw_mode import Subservice as ModeSubservice -from common import AcsId, Apid _LOGGER = logging.getLogger(__name__) @@ -66,14 +65,6 @@ def create_cmd_definition_tree() -> CmdTreeNode: ) root_node.add_child(scheduler_node) - acs_node = CmdTreeNode("acs", "ACS Subsystem Node") - mgm_node = CmdTreeNode("mgms", "MGM devices node") - mgm_node.add_child(mode_node) - mgm_node.add_child(hk_node) - - acs_node.add_child(mgm_node) - root_node.add_child(acs_node) - return root_node @@ -87,14 +78,10 @@ def pack_pus_telecommands(q: DefaultPusQueueHelper, cmd_path: str): assert len(cmd_path_list) >= 2 if cmd_path_list[1] == "ping": q.add_log_cmd("Sending PUS ping telecommand") - return q.add_pus_tc( - PusTelecommand(apid=Apid.GENERIC_PUS, service=17, subservice=1) - ) + return q.add_pus_tc(PusTelecommand(service=17, subservice=1)) elif cmd_path_list[1] == "trigger_event": q.add_log_cmd("Triggering test event") - return q.add_pus_tc( - PusTelecommand(apid=Apid.GENERIC_PUS, service=17, subservice=128) - ) + return q.add_pus_tc(PusTelecommand(service=17, subservice=128)) if cmd_path_list[0] == "scheduler": assert len(cmd_path_list) >= 2 if cmd_path_list[1] == "schedule_ping_10_secs_ahead": @@ -106,27 +93,10 @@ def pack_pus_telecommands(q: DefaultPusQueueHelper, cmd_path: str): create_time_tagged_cmd( time_stamp, PusTelecommand(service=17, subservice=1), - apid=Apid.SCHED, ) ) if cmd_path_list[0] == "acs": assert len(cmd_path_list) >= 2 - if cmd_path_list[1] == "mgms": - assert len(cmd_path_list) >= 3 - if cmd_path_list[2] == "hk": - if cmd_path_list[3] == "one_shot_hk": - q.add_log_cmd("Sending HK one shot request") - # TODO: Fix - # q.add_pus_tc( - # create_request_one_hk_command( - # make_addressable_id(Apid.ACS, AcsId.MGM_SET) - # ) - # ) - if cmd_path_list[2] == "mode": - if cmd_path_list[3] == "set_mode": - handle_set_mode_cmd( - q, "MGM 0", cmd_path_list[4], Apid.ACS, AcsId.MGM_0 - ) def handle_set_mode_cmd( diff --git a/src/controller.rs b/src/controller.rs index 75385c0..52cb30e 100644 --- a/src/controller.rs +++ b/src/controller.rs @@ -28,12 +28,18 @@ impl ExperimentController { pub fn perform_operation(&mut self) { match self.composite_request_rx.try_recv() { Ok(msg) => match msg.message { - CompositeRequest::Hk(_) => todo!(), + CompositeRequest::Hk(_) => { + log::warn!("hk request handling unimplemented") + } CompositeRequest::Action(action_req) => { self.handle_action_request(msg.requestor_info, action_req); } }, - Err(_) => todo!(), + Err(e) => { + if e != mpsc::TryRecvError::Empty { + log::error!("composite request rx error: {:?}", e); + } + } } self.check_stop_file(); }