eive-tmtc/pus_tc/devs/power.py

99 lines
3.1 KiB
Python
Raw Normal View History

2022-08-11 18:10:15 +02:00
from gomspace.gomspace_common import GsInfo
from pus_tc.devs.common_power import (
PowerOpCodes,
Pdu1InfoBase,
Pdu2InfoBase,
add_pdu1_common_defs,
add_pdu2_common_defs,
PowerInfo,
)
2022-08-11 15:40:38 +02:00
from config.definitions import CustomServiceList
from tmtccmd.config import TmTcDefWrapper, OpCodeEntry
2022-08-11 18:10:15 +02:00
from pus_tc.devs.p60dock import P60OpCodes, GomspaceOpCodes, P60Info
2022-08-11 15:40:38 +02:00
from pus_tc.devs.acu import add_acu_cmds
def add_p60_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
2022-08-11 18:10:15 +02:00
oce.add(keys=P60OpCodes.STACK_3V3_ON, info=P60Info.STACK_3V3_ON)
oce.add(keys=P60OpCodes.STACK_3V3_OFF, info=P60Info.STACK_3V3_OFF)
oce.add(keys=P60OpCodes.STACK_5V_ON, info=P60Info.STACK_5V_ON)
oce.add(keys=P60OpCodes.STACK_5V_OFF, info=P60Info.STACK_5V_OFF)
2022-08-11 15:40:38 +02:00
oce.add(keys=GomspaceOpCodes.REQUEST_CORE_HK_ONCE, info=GsInfo.REQUEST_CORE_HK_ONCE)
oce.add(keys=GomspaceOpCodes.REQUEST_AUX_HK_ONCE, info=GsInfo.REQUEST_AUX_HK_ONCE)
oce.add(
keys=GomspaceOpCodes.PRINT_SWITCH_V_I,
info="P60 Dock: Print Switches, Voltages, Currents",
)
oce.add(keys=GomspaceOpCodes.PRINT_LATCHUPS, info="P60 Dock: Print Latchups")
oce.add(keys=P60OpCodes.TEST, info="P60 Tests")
defs.add_service(
name=CustomServiceList.P60DOCK.value, info="P60 Device", op_code_entry=oce
)
2022-08-11 14:45:24 +02:00
2022-08-11 18:10:15 +02:00
def add_power_cmd_defs(defs: TmTcDefWrapper):
oce = OpCodeEntry()
add_pdu1_common_defs(oce)
add_pdu2_common_defs(oce)
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)
defs.add_service(
name=CustomServiceList.POWER.value,
info="Power Subsystem",
op_code_entry=oce,
)
2022-08-11 15:40:38 +02:00
def add_pdu1_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
2022-08-11 18:10:15 +02:00
add_pdu1_common_defs(oce)
2022-08-11 15:40:38 +02:00
oce.add(keys=GomspaceOpCodes.REQUEST_CORE_HK_ONCE, info=GsInfo.REQUEST_CORE_HK_ONCE)
oce.add(keys=GomspaceOpCodes.REQUEST_AUX_HK_ONCE, info=GsInfo.REQUEST_AUX_HK_ONCE)
oce.add(
keys=GomspaceOpCodes.PRINT_SWITCH_V_I,
info="PDU1: Print Switches, Voltages, Currents",
)
oce.add(keys=GomspaceOpCodes.PRINT_LATCHUPS, info="PDU1: Print Latchups")
oce.add(keys=GomspaceOpCodes.SET_PARAM, info="Set parameter")
defs.add_service(
name=CustomServiceList.PDU1.value,
info="PDU1 Device",
op_code_entry=oce,
)
2022-08-11 14:45:24 +02:00
2022-08-11 15:40:38 +02:00
def add_pdu2_cmds(defs: TmTcDefWrapper):
oce = OpCodeEntry()
2022-08-11 18:10:15 +02:00
add_pdu2_common_defs(oce)
2022-08-11 15:40:38 +02:00
oce.add(
keys=GomspaceOpCodes.REQUEST_CORE_HK_ONCE,
info=GsInfo.REQUEST_CORE_HK_ONCE,
)
oce.add(
keys=GomspaceOpCodes.REQUEST_AUX_HK_ONCE,
info=GsInfo.REQUEST_AUX_HK_ONCE,
)
oce.add(
keys=GomspaceOpCodes.PRINT_SWITCH_V_I,
info="PDU2: Print Switches, Voltages, Currents",
)
oce.add(
keys=GomspaceOpCodes.PRINT_LATCHUPS,
info="PDU2: Print Latchups",
)
defs.add_service(
name="pdu2",
info="PDU2 Device",
op_code_entry=oce,
2022-08-11 14:45:24 +02:00
)
2022-08-11 15:40:38 +02:00
def add_pcdu_cmds(defs: TmTcDefWrapper):
add_p60_cmds(defs)
add_pdu1_cmds(defs)
add_pdu2_cmds(defs)
add_acu_cmds(defs)