From baf1b44d23258352492fd249fe68c8eac7d91411 Mon Sep 17 00:00:00 2001 From: meggert Date: Fri, 1 Mar 2024 10:20:07 +0100 Subject: [PATCH 1/3] added missing act cmd --- eive_tmtc/pus_tc/cmd_demux.py | 2 +- eive_tmtc/tmtc/acs/gps.py | 46 +++++++++++++++++------------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/eive_tmtc/pus_tc/cmd_demux.py b/eive_tmtc/pus_tc/cmd_demux.py index d379ebd..e45e6ff 100644 --- a/eive_tmtc/pus_tc/cmd_demux.py +++ b/eive_tmtc/pus_tc/cmd_demux.py @@ -225,7 +225,7 @@ def handle_acs_procedure(queue_helper: DefaultPusQueueHelper, cmd_path_list: Lis object_id=RW4_ID, rw_idx=4, q=queue_helper, cmd_str=cmd_path_list[2] ) - if cmd_path_list[0] == "gnss_devs": + if cmd_path_list[0] == "gnss_ctrl": return pack_gps_command( object_id=oids.GPS_CONTROLLER, q=queue_helper, cmd_str=cmd_path_list[1] ) diff --git a/eive_tmtc/tmtc/acs/gps.py b/eive_tmtc/tmtc/acs/gps.py index a99a7f0..86849ea 100644 --- a/eive_tmtc/tmtc/acs/gps.py +++ b/eive_tmtc/tmtc/acs/gps.py @@ -15,6 +15,7 @@ from tmtccmd.pus.tc.s3_fsfw_hk import ( create_enable_periodic_hk_command_with_interval_with_diag, create_disable_periodic_hk_command_with_diag, ) +from tmtccmd.pus.tc.s8_fsfw_action import create_action_cmd from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter _LOGGER = logging.getLogger(__name__) @@ -24,6 +25,15 @@ class GpsInfo: MAX_SATELLITES = 30 +class ActIds: + RESET_GNSS = 5 + + +class AcsBoardSides(enum.IntEnum): + A_SIDE = 0 + B_SIDE = 1 + + class OpCode: OFF = "off" ON = "on" @@ -33,7 +43,7 @@ class OpCode: REQ_SKYVIEW_HK = "skyview_hk_request" ENABLE_SKYVIEW_HK = "skyview_hk_enable" DISABLE_SKYVIEW_HK = "skyview_hk_disable" - RESET_GNSS = "reset" + RESET_GNSS = "reset_gnss" class Info: @@ -59,37 +69,27 @@ def create_gnss_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)) - node = CmdTreeNode("gnss", "GNSS device", hide_children_for_print=True) + node = CmdTreeNode("gnss_ctrl", "GNSS Ctrl", 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_gps_cmds(defs: TmtcDefinitionWrapper): - oce = OpCodeEntry() - oce.add(keys=OpCode.OFF, info=Info.OFF) - oce.add(keys=OpCode.ON, info=Info.ON) - oce.add(keys=OpCode.RESET_GNSS, info=Info.RESET_GNSS) - oce.add(keys=OpCode.REQ_CORE_HK, info=Info.REQ_CORE_HK) - oce.add(keys=OpCode.ENABLE_CORE_HK, info=Info.ENABLE_CORE_HK) - oce.add(keys=OpCode.DISABLE_CORE_HK, info=Info.DISABLE_CORE_HK) - oce.add(keys=OpCode.REQ_SKYVIEW_HK, info=Info.REQ_SKYVIEW_HK) - oce.add(keys=OpCode.ENABLE_SKYVIEW_HK, info=Info.ENABLE_SKYVIEW_HK) - oce.add(keys=OpCode.DISABLE_SKYVIEW_HK, info=Info.DISABLE_SKYVIEW_HK) - defs.add_service( - name=CustomServiceList.GPS_CTRL.value, - info="GPS/GNSS Controller", - op_code_entry=oce, - ) - - def pack_gps_command( # noqa: C901 object_id: bytes, q: DefaultPusQueueHelper, cmd_str: str ): # noqa: C901: if cmd_str == OpCode.RESET_GNSS: - # TODO: This needs to be re-implemented - _LOGGER.warning("Reset pin handling needs to be re-implemented") + for val in AcsBoardSides: + print("{:<2}: {:<20}".format(val, val.name)) + board_side = int(input("Select Board Side \n" "")) + q.add_log_cmd(f"GPS: {Info.RESET_GNSS}") + q.add_pus_tc( + create_action_cmd( + object_id=object_id, + action_id=ActIds.RESET_GNSS, + user_data=bytearray([board_side]), + ) + ) if cmd_str == OpCode.ENABLE_CORE_HK: interval = float(input("Please specify interval in floating point seconds: ")) if interval <= 0: -- 2.34.1 From ba0a3e35d2de9d32b2cb53da44def1ed38e127d5 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 29 Apr 2024 11:40:00 +0200 Subject: [PATCH 2/3] cleanup --- eive_tmtc/tmtc/acs/gps.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/eive_tmtc/tmtc/acs/gps.py b/eive_tmtc/tmtc/acs/gps.py index 86849ea..f80a5c9 100644 --- a/eive_tmtc/tmtc/acs/gps.py +++ b/eive_tmtc/tmtc/acs/gps.py @@ -3,10 +3,8 @@ import enum import logging import struct -from eive_tmtc.config.definitions import CustomServiceList from eive_tmtc.pus_tm.defs import PrintWrapper -from tmtccmd.config import CmdTreeNode, TmtcDefinitionWrapper, OpCodeEntry -from tmtccmd.config.tmtc import tmtc_definitions_provider +from tmtccmd.config import CmdTreeNode from tmtccmd.pus.s200_fsfw_mode import create_mode_command, Mode from tmtccmd.tmtc import DefaultPusQueueHelper from tmtccmd.pus.tc.s3_fsfw_hk import ( -- 2.34.1 From 8c7cbd1bd609e3b28924e6a3364c2df17844aca3 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 29 Apr 2024 11:41:03 +0200 Subject: [PATCH 3/3] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 029b509..aa37d93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ list yields a list of all related PRs for each release. # [unreleased] +## Fixed + +- GNSS commands working again (again). + ## Added - Added handling for new clock events. -- 2.34.1