extend power commands

This commit is contained in:
Robin Müller 2022-08-29 13:20:44 +02:00
parent e402b456bf
commit 729e945013
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 15 additions and 7 deletions

View File

@ -64,8 +64,8 @@ class PowerOpCodes:
PL_CAM_OFF = ["cam-off"]
INFO_CORE = ["info"]
INFO_AUX = ["info-aux"]
INFO_ALL = ["info-all"]
INFO_AUX = ["info_aux"]
INFO_ALL = ["info_all"]
def add_gomspace_cmds(

View File

@ -10,8 +10,8 @@ from tmtc.power.pdu2 import pdu2_req_hk_cmds, add_pdu2_common_defs, pdu2_cmds
from tmtccmd import get_console_logger
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
from tmtc.power.p60dock import P60OpCodes, P60Info
from tmtc.power.acu import add_acu_cmds
from tmtc.power.p60dock import P60OpCodes, P60Info, p60_dock_req_hk_cmds
from tmtc.power.acu import add_acu_cmds, acu_req_hk_cmds
from tmtccmd.config.tmtc import tmtc_definitions_provider
from tmtccmd.tc import DefaultPusQueueHelper
@ -25,17 +25,25 @@ def pack_power_commands(q: DefaultPusQueueHelper, op_code: str):
if op_code in PowerOpCodes.INFO_CORE:
pdu1_req_hk_cmds(q, GomspaceOpCodes.REQUEST_CORE_HK_ONCE[0])
pdu2_req_hk_cmds(q, GomspaceOpCodes.REQUEST_CORE_HK_ONCE[0])
q.add_wait_seconds(3.0)
p60_dock_req_hk_cmds(q, GomspaceOpCodes.REQUEST_CORE_HK_ONCE[0])
acu_req_hk_cmds(q, GomspaceOpCodes.REQUEST_CORE_HK_ONCE[0])
q.add_wait_seconds(8.0)
elif op_code in PowerOpCodes.INFO_AUX:
pdu1_req_hk_cmds(q, GomspaceOpCodes.REQUEST_AUX_HK_ONCE[0])
pdu2_req_hk_cmds(q, GomspaceOpCodes.REQUEST_AUX_HK_ONCE[0])
q.add_wait_seconds(3.0)
p60_dock_req_hk_cmds(q, GomspaceOpCodes.REQUEST_AUX_HK_ONCE[0])
acu_req_hk_cmds(q, GomspaceOpCodes.REQUEST_AUX_HK_ONCE[0])
q.add_wait_seconds(8.0)
elif op_code in PowerOpCodes.INFO_ALL:
pdu1_req_hk_cmds(q, GomspaceOpCodes.REQUEST_CORE_HK_ONCE[0])
pdu2_req_hk_cmds(q, GomspaceOpCodes.REQUEST_CORE_HK_ONCE[0])
pdu1_req_hk_cmds(q, GomspaceOpCodes.REQUEST_AUX_HK_ONCE[0])
pdu2_req_hk_cmds(q, GomspaceOpCodes.REQUEST_AUX_HK_ONCE[0])
q.add_wait_seconds(3.0)
p60_dock_req_hk_cmds(q, GomspaceOpCodes.REQUEST_CORE_HK_ONCE[0])
p60_dock_req_hk_cmds(q, GomspaceOpCodes.REQUEST_AUX_HK_ONCE[0])
acu_req_hk_cmds(q, GomspaceOpCodes.REQUEST_CORE_HK_ONCE[0])
acu_req_hk_cmds(q, GomspaceOpCodes.REQUEST_AUX_HK_ONCE[0])
q.add_wait_seconds(8.0)
if q.empty():
LOGGER.info(f"Queue is empty, no stack for op code {op_code}")