add STR assy cmds

This commit is contained in:
Robin Müller 2023-04-04 01:24:33 +02:00
parent 5f87092465
commit 0202c93252
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 14 additions and 5 deletions

View File

@ -21,6 +21,7 @@ from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode
from tmtccmd.util import ObjectIdU32
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
from eive_tmtc.config.object_ids import STR_ASSEMBLY, STAR_TRACKER_ID
_LOGGER = logging.getLogger(__name__)
@ -188,6 +189,14 @@ class Submode(enum.IntEnum):
FIRMWARE = 2
def prompt_object_id_mode_cmd() -> bytes:
cmd_assy = input("Command Assembly (0) or Device Handler (1) ?: ")
if cmd_assy == "0":
return STR_ASSEMBLY
else:
return STAR_TRACKER_ID
def pack_star_tracker_commands(
object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str
):
@ -197,19 +206,19 @@ def pack_star_tracker_commands(
obyt = object_id.as_bytes
if op_code == OpCodes.ON_BOOTLOADER:
q.add_log_cmd("Star tracker: Mode On, Submode Bootloader")
data = pack_mode_data(obyt, Mode.ON, Submode.BOOTLOADER)
data = pack_mode_data(prompt_object_id_mode_cmd(), Mode.ON, Submode.BOOTLOADER)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
if op_code == OpCodes.ON_FIRMWARE:
q.add_log_cmd("Star tracker: Mode On, Submode Firmware")
data = pack_mode_data(obyt, Mode.ON, Submode.FIRMWARE)
data = pack_mode_data(prompt_object_id_mode_cmd(), Mode.ON, Submode.FIRMWARE)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
if op_code == OpCodes.NORMAL:
q.add_log_cmd("Star tracker: Mode Normal")
data = pack_mode_data(obyt, Mode.NORMAL, 0)
data = pack_mode_data(prompt_object_id_mode_cmd(), Mode.NORMAL, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
if op_code == OpCodes.OFF:
q.add_log_cmd("Star tracker: Mode Off")
data = pack_mode_data(obyt, Mode.OFF, 0)
data = pack_mode_data(prompt_object_id_mode_cmd(), Mode.OFF, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=data))
if op_code == OpCodes.REQUEST_SOLUTION_SET_HK:
q.add_log_cmd(Info.REQUEST_SOLUTION_SET_HK)

View File

@ -29,7 +29,7 @@ ACS_OBJ_DICT = {
6: ("GYR 1 L3G", GYRO_1_L3G_HANDLER_ID),
7: ("MGM 0 LIS3", MGM_0_LIS3_HANDLER_ID),
8: ("MGM 1 RM3100", MGM_1_RM3100_HANDLER_ID),
9: ("GPS 0 Health Device", GPS_0_HEALTH_DEV)
9: ("GPS 0 Health Device", GPS_0_HEALTH_DEV),
}