added new tcs commands
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
import enum
|
||||
|
||||
from config.definitions import CustomServiceList
|
||||
from tmtccmd.config import TmTcDefWrapper, OpCodeEntry
|
||||
from tmtccmd.tc import DefaultPusQueueHelper
|
||||
from tmtccmd.tc.pus_200_fsfw_modes import Modes
|
||||
from tmtccmd.tc.pus_3_fsfw_hk import (
|
||||
@ -15,7 +17,7 @@ from config.object_ids import TCS_BOARD_ASS_ID, TCS_CONTROLLER
|
||||
class OpCodes:
|
||||
TCS_BOARD_ASS_NORMAL = ["0", "tcs-normal"]
|
||||
TCS_BOARD_ASS_OFF = ["1", "tcs-off"]
|
||||
REQUEST_ALL_TEMP_HK = ["temp-hk"]
|
||||
REQUEST_SENSOR_TEMP_SET = ["2", "temp-hk"]
|
||||
|
||||
|
||||
class Info:
|
||||
@ -30,11 +32,33 @@ class SetIds(enum.IntEnum):
|
||||
SUS_TEMP_SENSORS = 2
|
||||
|
||||
|
||||
def add_tcs_cmds(defs: TmTcDefWrapper):
|
||||
oce = OpCodeEntry()
|
||||
oce.add(
|
||||
keys=OpCodes.TCS_BOARD_ASS_NORMAL,
|
||||
info=Info.TCS_BOARD_ASS_NORMAL,
|
||||
)
|
||||
oce.add(
|
||||
keys=OpCodes.TCS_BOARD_ASS_OFF,
|
||||
info=Info.TCS_BOARD_ASS_OFF,
|
||||
)
|
||||
oce.add(keys=OpCodes.REQUEST_SENSOR_TEMP_SET, info=Info.REQUEST_SENSOR_TEMP_SET)
|
||||
defs.add_service(
|
||||
name=CustomServiceList.TCS.value,
|
||||
info="TCS Board Assembly",
|
||||
op_code_entry=oce,
|
||||
)
|
||||
|
||||
|
||||
def pack_tcs_sys_commands(q: DefaultPusQueueHelper, op_code: str):
|
||||
if op_code in OpCodes.REQUEST_ALL_TEMP_HK:
|
||||
if op_code in OpCodes.REQUEST_SENSOR_TEMP_SET:
|
||||
sensor_set_sid = make_sid(TCS_CONTROLLER, SetIds.PRIMARY_SENSORS)
|
||||
q.add_log_cmd(Info.REQUEST_SENSOR_TEMP_SET)
|
||||
q.add_pus_tc(generate_one_hk_command(sensor_set_sid))
|
||||
pack_tcs_ass_cmds(q, op_code)
|
||||
|
||||
|
||||
def pack_tcs_ass_cmds(q: DefaultPusQueueHelper, op_code: str):
|
||||
if op_code in OpCodes.TCS_BOARD_ASS_NORMAL:
|
||||
command_mode(
|
||||
object_id=TCS_BOARD_ASS_ID,
|
||||
|
Reference in New Issue
Block a user