Added TCs to command Thermal Controller (to be continued)
This commit is contained in:
@ -3,8 +3,7 @@ from tmtccmd.tc.definitions import TcQueueT
|
||||
from tmtccmd.tc.pus_200_fsfw_modes import Modes
|
||||
from config.object_ids import ACS_BOARD_ASS_ID, SUS_BOARD_ASS_ID
|
||||
|
||||
from .common import command_assembly
|
||||
|
||||
from .common import command_mode
|
||||
|
||||
class AcsOpCodes:
|
||||
ACS_ASS_A_SIDE = ["0", "acs-a"]
|
||||
@ -31,7 +30,7 @@ class DualSideSubmodes(enum.IntEnum):
|
||||
|
||||
def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
if op_code in AcsOpCodes.ACS_ASS_A_SIDE:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=Modes.NORMAL,
|
||||
submode=DualSideSubmodes.A_SIDE,
|
||||
@ -39,7 +38,7 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
info="Switching to ACS board assembly A side",
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_B_SIDE:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=Modes.NORMAL,
|
||||
submode=DualSideSubmodes.B_SIDE,
|
||||
@ -47,7 +46,7 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
info="Switching to ACS board assembly B side",
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_DUAL_MODE:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=Modes.NORMAL,
|
||||
submode=DualSideSubmodes.DUAL_SIDE,
|
||||
@ -55,7 +54,7 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
info="Switching to ACS board assembly dual mode",
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_A_ON:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=Modes.ON,
|
||||
submode=DualSideSubmodes.A_SIDE,
|
||||
@ -63,7 +62,7 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
info="Switching ACS board assembly A side on",
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_B_ON:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=Modes.ON,
|
||||
submode=DualSideSubmodes.B_SIDE,
|
||||
@ -71,7 +70,7 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
info="Switching ACS board assembly B side on",
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_DUAL_ON:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=Modes.ON,
|
||||
submode=DualSideSubmodes.B_SIDE,
|
||||
@ -79,7 +78,7 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
info="Switching ACS board assembly dual side on",
|
||||
)
|
||||
if op_code in AcsOpCodes.ACS_ASS_OFF:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=ACS_BOARD_ASS_ID,
|
||||
mode=Modes.OFF,
|
||||
submode=0,
|
||||
@ -90,7 +89,7 @@ def pack_acs_command(tc_queue: TcQueueT, op_code: str):
|
||||
|
||||
def pack_sus_cmds(tc_queue: TcQueueT, op_code: str):
|
||||
if op_code in SusOpCodes.SUS_ASS_NOM_SIDE:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=SUS_BOARD_ASS_ID,
|
||||
mode=Modes.NORMAL,
|
||||
submode=DualSideSubmodes.A_SIDE,
|
||||
@ -98,7 +97,7 @@ def pack_sus_cmds(tc_queue: TcQueueT, op_code: str):
|
||||
info="Switching to SUS board to nominal side",
|
||||
)
|
||||
if op_code in SusOpCodes.SUS_ASS_RED_SIDE:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=SUS_BOARD_ASS_ID,
|
||||
mode=Modes.NORMAL,
|
||||
submode=DualSideSubmodes.B_SIDE,
|
||||
@ -106,7 +105,7 @@ def pack_sus_cmds(tc_queue: TcQueueT, op_code: str):
|
||||
info="Switching to SUS board to redundant side",
|
||||
)
|
||||
if op_code in SusOpCodes.SUS_ASS_OFF:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=SUS_BOARD_ASS_ID,
|
||||
mode=Modes.OFF,
|
||||
submode=0,
|
||||
@ -114,7 +113,7 @@ def pack_sus_cmds(tc_queue: TcQueueT, op_code: str):
|
||||
info="Switching SUS board off",
|
||||
)
|
||||
if op_code in SusOpCodes.SUS_ASS_DUAL_MODE:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=SUS_BOARD_ASS_ID,
|
||||
mode=Modes.NORMAL,
|
||||
submode=DualSideSubmodes.DUAL_SIDE,
|
||||
|
@ -3,7 +3,7 @@ from spacepackets.ecss.tc import PusTelecommand
|
||||
from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes, Subservices
|
||||
|
||||
|
||||
def command_assembly(
|
||||
def command_mode(
|
||||
object_id: bytes, mode: Modes, submode: int, tc_queue: TcQueueT, info: str
|
||||
):
|
||||
tc_queue.appendleft((QueueCommands.PRINT, info))
|
||||
|
35
pus_tc/system/controllers.py
Normal file
35
pus_tc/system/controllers.py
Normal file
@ -0,0 +1,35 @@
|
||||
from tmtccmd.tc.definitions import TcQueueT, QueueCommands
|
||||
from tmtccmd.tc.pus_200_fsfw_modes import Modes
|
||||
|
||||
from .common import command_mode
|
||||
import config.object_ids as obj_ids
|
||||
|
||||
|
||||
class OpCodes:
|
||||
THERMAL_CONTROLLER_NORMAL = ["0", "thermal-normal"]
|
||||
THERMAL_CONTROLLER_OFF = ["1", "thermal-off"]
|
||||
|
||||
|
||||
class Info:
|
||||
THERMAL_CONTROLLER_NORMAL = "Switching Thermal Controller into normal"
|
||||
THERMAL_CONTROLLER_OFF = "Switching Thermal Controller off"
|
||||
|
||||
|
||||
def pack_controller_commands(tc_queue: TcQueueT, op_code: str):
|
||||
if op_code in OpCodes.THERMAL_CONTROLLER_NORMAL:
|
||||
command_mode(
|
||||
object_id=obj_ids.THERMAL_CONTROLLER_ID,
|
||||
mode=Modes.NORMAL,
|
||||
submode=0,
|
||||
tc_queue=tc_queue,
|
||||
info=Info.THERMAL_CONTROLLER_NORMAL,
|
||||
)
|
||||
if op_code in OpCodes.THERMAL_CONTROLLER_OFF:
|
||||
command_mode(
|
||||
object_id=obj_ids.THERMAL_CONTROLLER_ID,
|
||||
mode=Modes.OFF,
|
||||
submode=0,
|
||||
tc_queue=tc_queue,
|
||||
info=Info.THERMAL_CONTROLLER_OFF,
|
||||
)
|
||||
|
@ -1,7 +1,7 @@
|
||||
from tmtccmd.tc.definitions import TcQueueT, QueueCommands
|
||||
from tmtccmd.tc.pus_200_fsfw_modes import Modes
|
||||
|
||||
from .common import command_assembly
|
||||
from .common import command_mode
|
||||
from config.object_ids import TCS_BOARD_ASS_ID
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ class Info:
|
||||
|
||||
def pack_tcs_sys_commands(tc_queue: TcQueueT, op_code: str):
|
||||
if op_code in OpCodes.TCS_BOARD_ASS_NORMAL:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=TCS_BOARD_ASS_ID,
|
||||
mode=Modes.NORMAL,
|
||||
submode=0,
|
||||
@ -25,7 +25,7 @@ def pack_tcs_sys_commands(tc_queue: TcQueueT, op_code: str):
|
||||
info=Info.TCS_BOARD_ASS_NORMAL,
|
||||
)
|
||||
if op_code in OpCodes.TCS_BOARD_ASS_OFF:
|
||||
command_assembly(
|
||||
command_mode(
|
||||
object_id=TCS_BOARD_ASS_ID,
|
||||
mode=Modes.OFF,
|
||||
submode=0,
|
||||
|
Reference in New Issue
Block a user