add command to load table
This commit is contained in:
@ -142,6 +142,34 @@ def pack_gomspace_cmds(
|
||||
user_data=bytes([source_table]),
|
||||
)
|
||||
)
|
||||
if op_code in GomspaceOpCodes.LOAD_TABLE:
|
||||
target_table = int(
|
||||
input(
|
||||
"Target table ID [0: Board Config, 1: Module Config, 2: Calibration Parameter, "
|
||||
"value + 4 for default table]: "
|
||||
)
|
||||
)
|
||||
if target_table not in [0, 1, 2, 4]:
|
||||
raise ValueError("Invalid source table index")
|
||||
if target_table != 4:
|
||||
source_table = int(
|
||||
input(
|
||||
"Source table (file or default) [0: Board Config, 1: Module Config, "
|
||||
"2: Calibration Parameter, value + 4 for default table]: "
|
||||
)
|
||||
)
|
||||
if source_table not in [0, 1, 2, 4, 5, 6]:
|
||||
raise ValueError("Invalid source table index")
|
||||
else:
|
||||
# Will be ignored
|
||||
source_table = 4
|
||||
q.add_pus_tc(
|
||||
make_fsfw_action_cmd(
|
||||
object_id=object_id.as_bytes,
|
||||
action_id=GomspaceDeviceActionIds.LOAD_TABLE,
|
||||
user_data=bytes([source_table, target_table]),
|
||||
)
|
||||
)
|
||||
if op_code in GomspaceOpCodes.RESET_GND_WATCHDOG:
|
||||
q.add_log_cmd(f"{prefix}: {GsInfo.RESET_GND_WATCHDOG}")
|
||||
q.add_pus_tc(pack_gnd_wdt_reset_command(object_id))
|
||||
@ -216,4 +244,5 @@ def add_gomspace_cmd_defs(oce: OpCodeEntry):
|
||||
oce.add(keys=GomspaceOpCodes.REQUEST_CONFIG_TABLE, info=GsInfo.REQUEST_CONFIG_TABLE)
|
||||
oce.add(keys=GomspaceOpCodes.SAVE_TABLE, info=GsInfo.SAVE_TABLE)
|
||||
oce.add(keys=GomspaceOpCodes.SAVE_TABLE_DEFAULT, info=GsInfo.SAVE_TABLE_DEFAULT)
|
||||
oce.add(keys=GomspaceOpCodes.LOAD_TABLE, info=GsInfo.LOAD_TABLE)
|
||||
oce.add(keys=GomspaceOpCodes.RESET_GND_WATCHDOG, info=GsInfo.RESET_GND_WATCHDOG)
|
||||
|
Reference in New Issue
Block a user