added command to request switcher set

This commit is contained in:
Robin Müller 2023-01-24 13:06:08 +01:00
parent f8299b91cd
commit 5a05eb4825
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
3 changed files with 22 additions and 4 deletions

View File

@ -53,6 +53,7 @@ class PowerInfo:
INFO_CORE = "Core Information"
INFO_AUX = "Auxiliary Information"
INFO_ALL = "All Information"
REQUEST_SWITCHER_SET = "Request Switcher Information"
ENABLE_INFO_HK = "Enable Core Info HK"
DISABLE_INFO_HK = "Disable Core Info HK"
RESET_ALL_GND_WDTS = "Reset all Ground Watchdogs"
@ -101,6 +102,7 @@ class PowerOpCodes:
REBOOT = ["reboot"]
INFO_CORE = ["info"]
REQUEST_SWITCHER_SET = ["request_switchers"]
ENABLE_INFO_HK = ["info_hk_on"]
DISABLE_INFO_HK = ["info_hk_off"]
INFO_AUX = ["info_aux"]

View File

@ -79,7 +79,7 @@ class PDU2TestProcedure:
def pack_pdu2_commands(object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str):
q.add_log_cmd("Testing PDU2")
objb = object_id.as_bytes
pdu2_cmds(q, op_code)
pdu2_switch_cmds(q, op_code)
pdu2_req_hk_cmds(q, op_code)
pack_common_power_cmds("PDU2", object_id, q, op_code)
pack_common_gomspace_cmds("PDU2", object_id, q, op_code)
@ -159,7 +159,7 @@ def add_pdu2_cmds(defs: TmtcDefinitionWrapper):
)
def pdu2_cmds(q: DefaultPusQueueHelper, op_code: str):
def pdu2_switch_cmds(q: DefaultPusQueueHelper, op_code: str):
if op_code in PowerOpCodes.PL_PCDU_VBAT_NOM_ON:
pl_pcdu_bat_nom_on_cmd(q)
elif op_code in PowerOpCodes.PL_PCDU_VBAT_NOM_OFF:

View File

@ -1,3 +1,5 @@
import enum
from eive_tmtc.tmtc.power.common_power import (
PowerOpCodes,
PowerInfo,
@ -10,6 +12,7 @@ from eive_tmtc.config.object_ids import (
ACU_HANDLER_ID,
PDU_1_HANDLER_ID,
PDU_2_HANDLER_ID,
PCDU_HANDLER_ID,
get_object_ids,
)
from eive_tmtc.tmtc.power.pdu1 import (
@ -21,7 +24,7 @@ from eive_tmtc.tmtc.power.pdu1 import (
from eive_tmtc.tmtc.power.pdu2 import (
pdu2_req_hk_cmds,
add_pdu2_common_defs,
pdu2_cmds,
pdu2_switch_cmds,
add_pdu2_cmds,
)
from tmtccmd import get_console_logger
@ -29,6 +32,7 @@ from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
from eive_tmtc.tmtc.power.p60dock import P60OpCode, P60Info, p60_dock_req_hk_cmds
from eive_tmtc.tmtc.power.acu import add_acu_cmds, acu_req_hk_cmds
from tmtccmd.tc.pus_3_fsfw_hk import create_request_one_diag_command, make_sid
from tmtccmd.config.tmtc import tmtc_definitions_provider
from tmtccmd.tc import DefaultPusQueueHelper
@ -36,9 +40,13 @@ from tmtccmd.tc import DefaultPusQueueHelper
LOGGER = get_console_logger()
class SetId(enum.IntEnum):
SWITCHER_SET = 0
def pack_power_commands(q: DefaultPusQueueHelper, op_code: str):
pdu1_switch_cmds(q, op_code)
pdu2_cmds(q, op_code)
pdu2_switch_cmds(q, op_code)
if op_code in PowerOpCodes.INFO_CORE:
pdu1_req_hk_cmds(q, PowerOpCodes.REQUEST_CORE_HK_ONCE[0])
pdu2_req_hk_cmds(q, PowerOpCodes.REQUEST_CORE_HK_ONCE[0])
@ -68,6 +76,13 @@ def pack_power_commands(q: DefaultPusQueueHelper, op_code: str):
pack_reset_gnd_wdt_cmd(q, "PDU1", oids[PDU_1_HANDLER_ID])
pack_reset_gnd_wdt_cmd(q, "PDU2", oids[PDU_2_HANDLER_ID])
q.add_wait_seconds(5.0)
elif op_code in PowerOpCodes.REQUEST_SWITCHER_SET:
q.add_log_cmd("PCDU: Requesting Switcher Set")
q.add_pus_tc(
create_request_one_diag_command(
make_sid(PCDU_HANDLER_ID, SetId.SWITCHER_SET)
)
)
if q.empty():
LOGGER.info(f"Queue is empty, no stack for op code {op_code}")
@ -94,6 +109,7 @@ def add_power_cmd_defs(defs: TmtcDefinitionWrapper):
oce.add(keys=PowerOpCodes.INFO_ALL, info=PowerInfo.INFO_ALL)
oce.add(keys=PowerOpCodes.INFO_CORE, info=PowerInfo.INFO_CORE)
oce.add(keys=PowerOpCodes.INFO_AUX, info=PowerInfo.INFO_AUX)
oce.add(keys=PowerOpCodes.REQUEST_SWITCHER_SET, info=PowerInfo.REQUEST_SWITCHER_SET)
oce.add(keys=PowerOpCodes.RESET_ALL_GND_WDTS, info=PowerInfo.RESET_ALL_GND_WDTS)
defs.add_service(
name=CustomServiceList.POWER.value,