eive-tmtc/pus_tc/system/controllers.py

36 lines
1.0 KiB
Python

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,
)