From 6282686f2f384ae6f2a9d0f54ceecac62df1f583 Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 9 Apr 2024 13:29:01 +0200 Subject: [PATCH 1/2] lets just change the tmtc structure he said. everything will still work he said --- eive_tmtc/tmtc/acs/gps.py | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/eive_tmtc/tmtc/acs/gps.py b/eive_tmtc/tmtc/acs/gps.py index a99a7f0..7c309c7 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,11 @@ class GpsInfo: MAX_SATELLITES = 30 +class GnssChip(enum.IntEnum): + A_SIDE = 0 + B_SIDE = 1 + + class OpCode: OFF = "off" ON = "on" @@ -59,36 +65,25 @@ 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_devs", "GNSS Controller", 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 + for val in GnssChip: + print("{:<2}: {:<20}".format(val, val.name)) + chip: str = "" + while chip not in ["0", "1"]: + chip = input("Please specify which chip to reset: ") + q.add_log_cmd(f"gps: {Info.DISABLE_CORE_HK}") + q.add_pus_tc( + create_action_cmd(object_id=object_id, action_id=5, user_data=chip.encode()) + ) _LOGGER.warning("Reset pin handling needs to be re-implemented") if cmd_str == OpCode.ENABLE_CORE_HK: interval = float(input("Please specify interval in floating point seconds: ")) From a880db5655abf90d00fd44b175f75e778b78a75f Mon Sep 17 00:00:00 2001 From: meggert Date: Tue, 9 Apr 2024 14:34:23 +0200 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2142692..07db8a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ list yields a list of all related PRs for each release. ## Fixed - EPS power commands working again. +- GNSS commands working again. # [v6.1.1] 2024-03-06