67 lines
2.1 KiB
Python
67 lines
2.1 KiB
Python
from tmtccmd.config.tmtc import (
|
|
CmdTreeNode,
|
|
)
|
|
from tmtccmd.pus.s200_fsfw_mode import Mode
|
|
from tmtccmd.tmtc import DefaultPusQueueHelper
|
|
|
|
from eive_tmtc.config.object_ids import SUS_BOARD_ASS_ID
|
|
from eive_tmtc.tmtc.acs.acs_board import DualSideSubmode
|
|
from eive_tmtc.tmtc.common import pack_mode_cmd_with_info
|
|
|
|
|
|
class SusOpCode:
|
|
SUS_ASS_NOM_SIDE = "nom"
|
|
SUS_ASS_RED_SIDE = "red"
|
|
SUS_ASS_DUAL_MODE = "dual"
|
|
SUS_ASS_OFF = "off"
|
|
|
|
|
|
def pack_sus_cmds(q: DefaultPusQueueHelper, op_code: str):
|
|
if op_code in SusOpCode.SUS_ASS_NOM_SIDE:
|
|
pack_mode_cmd_with_info(
|
|
object_id=SUS_BOARD_ASS_ID,
|
|
mode=Mode.NORMAL,
|
|
submode=DualSideSubmode.A_SIDE,
|
|
q=q,
|
|
info="Switching to SUS board to nominal side",
|
|
)
|
|
if op_code in SusOpCode.SUS_ASS_RED_SIDE:
|
|
pack_mode_cmd_with_info(
|
|
object_id=SUS_BOARD_ASS_ID,
|
|
mode=Mode.NORMAL,
|
|
submode=DualSideSubmode.B_SIDE,
|
|
q=q,
|
|
info="Switching to SUS board to redundant side",
|
|
)
|
|
if op_code in SusOpCode.SUS_ASS_OFF:
|
|
pack_mode_cmd_with_info(
|
|
object_id=SUS_BOARD_ASS_ID,
|
|
mode=Mode.OFF,
|
|
submode=0,
|
|
q=q,
|
|
info="Switching SUS board off",
|
|
)
|
|
if op_code in SusOpCode.SUS_ASS_DUAL_MODE:
|
|
pack_mode_cmd_with_info(
|
|
object_id=SUS_BOARD_ASS_ID,
|
|
mode=Mode.NORMAL,
|
|
submode=DualSideSubmode.DUAL_SIDE,
|
|
q=q,
|
|
info="Switching to SUS board to dual side",
|
|
)
|
|
|
|
|
|
def create_sus_board_node() -> CmdTreeNode:
|
|
node = CmdTreeNode("sus_brd_assy", "SUS board assembly")
|
|
node.add_child(
|
|
CmdTreeNode(SusOpCode.SUS_ASS_RED_SIDE, "Switch SUS board to nominal side")
|
|
)
|
|
node.add_child(
|
|
CmdTreeNode(SusOpCode.SUS_ASS_RED_SIDE, "Switch SUS board to redundant side")
|
|
)
|
|
node.add_child(CmdTreeNode(SusOpCode.SUS_ASS_OFF, "Switch SUS board off"))
|
|
node.add_child(
|
|
CmdTreeNode(SusOpCode.SUS_ASS_DUAL_MODE, "Switch SUS board to dual mode")
|
|
)
|
|
return node
|