hopefully soon done
All checks were successful
EIVE/-/pipeline/pr-main This commit looks good

This commit is contained in:
2023-11-29 17:04:30 +01:00
parent 6f86e72042
commit 1660e27ec1
9 changed files with 266 additions and 41 deletions

View File

@ -19,6 +19,7 @@ from eive_tmtc.gomspace.gomspace_common import (
)
from eive_tmtc.gomspace.gomspace_pdu_definitions import PduHkTable, PduConfigTable
from eive_tmtc.tmtc.power.common_power import (
add_gomspace_nodes,
pack_common_gomspace_cmds,
req_hk_cmds,
PowerOpCodes,
@ -32,7 +33,7 @@ from eive_tmtc.tmtc.power.common_power import (
add_common_power_defs,
)
from spacepackets.ecss import PusTelecommand
from tmtccmd.config import OpCodeEntry, TmtcDefinitionWrapper
from tmtccmd.config import CmdTreeNode, OpCodeEntry, TmtcDefinitionWrapper
from tmtccmd.config.tmtc import tmtc_definitions_provider
from tmtccmd.tmtc import DefaultPusQueueHelper
from tmtccmd.util import ObjectIdU32
@ -171,6 +172,85 @@ def add_pdu2_cmds(defs: TmtcDefinitionWrapper):
)
def add_pdu2_subnodes(node: CmdTreeNode):
node.add_child(
CmdTreeNode(PowerOpCodes.ACS_B_ON[0], info_on_pdu2(Pdu2InfoBase.ACS_B))
)
node.add_child(
CmdTreeNode(PowerOpCodes.ACS_B_OFF[0], info_off_pdu2(Pdu2InfoBase.ACS_B))
)
node.add_child(
CmdTreeNode(PowerOpCodes.SUS_R_ON[0], info_on_pdu2(Pdu2InfoBase.SUS_R))
)
node.add_child(
CmdTreeNode(PowerOpCodes.SUS_R_OFF[0], info_off_pdu2(Pdu2InfoBase.SUS_R))
)
node.add_child(CmdTreeNode(PowerOpCodes.RW_ON[0], info_on_pdu2(Pdu2InfoBase.RW)))
node.add_child(CmdTreeNode(PowerOpCodes.RW_OFF[0], info_off_pdu2(Pdu2InfoBase.RW)))
node.add_child(
CmdTreeNode(
PowerOpCodes.PL_PCDU_VBAT_NOM_ON[0],
info_on_pdu2(Pdu2InfoBase.PL_PCDU_BAT_NOM),
)
)
node.add_child(
CmdTreeNode(
PowerOpCodes.PL_PCDU_VBAT_NOM_OFF[0],
info_off_pdu2(Pdu2InfoBase.PL_PCDU_BAT_NOM),
)
)
node.add_child(
CmdTreeNode(
PowerOpCodes.PL_PCDU_VBAT_RED_ON[0],
info_on_pdu2(Pdu2InfoBase.PL_PCDU_BAT_RED),
)
)
node.add_child(
CmdTreeNode(
PowerOpCodes.PL_PCDU_VBAT_RED_OFF[0],
info_off_pdu2(Pdu2InfoBase.PL_PCDU_BAT_RED),
)
)
node.add_child(
CmdTreeNode(PowerOpCodes.HEATER_ON[0], info_on_pdu2(Pdu2InfoBase.HEATER))
)
node.add_child(
CmdTreeNode(PowerOpCodes.HEATER_OFF[0], info_off_pdu2(Pdu2InfoBase.HEATER))
)
node.add_child(
CmdTreeNode(
PowerOpCodes.SOLAR_ARRAY_DEPL_ON[0],
info_on_pdu2(Pdu2InfoBase.SOLAR_ARRAY_DEPL),
)
)
node.add_child(
CmdTreeNode(
PowerOpCodes.SOLAR_ARRAY_DEPL_OFF[0],
info_off_pdu2(Pdu2InfoBase.SOLAR_ARRAY_DEPL),
)
)
node.add_child(
CmdTreeNode(PowerOpCodes.PL_CAM_ON[0], info_on_pdu2(Pdu2InfoBase.PL_CAM))
)
node.add_child(
CmdTreeNode(PowerOpCodes.PL_CAM_OFF[0], info_off_pdu2(Pdu2InfoBase.PL_CAM))
)
def create_pdu2_node() -> CmdTreeNode:
node = CmdTreeNode(
"pdu2", "P60 PCDU PDU2 device", hide_children_which_are_leaves=True
)
add_gomspace_nodes(node)
add_pdu2_subnodes(node)
node.add_child(
CmdTreeNode(
PowerOpCodes.PRINT_SWITCH_V_I[0], "PDU2: Print Switches, Voltages, Currents"
)
)
return node
def pdu2_switch_cmds(q: DefaultPusQueueHelper, op_code: str): # noqa C901
if op_code in PowerOpCodes.PL_PCDU_VBAT_NOM_ON:
pl_pcdu_bat_nom_on_cmd(q)