TCS CTRL Info Set #215

Merged
meggert merged 6 commits from tcs-ctrl-info-set into main 2023-07-11 09:31:50 +02:00
2 changed files with 28 additions and 15 deletions
Showing only changes of commit ba47757b50 - Show all commits

View File

@ -2,7 +2,6 @@ from eive_tmtc.config.definitions import CustomServiceList
from eive_tmtc.config.object_ids import TCS_CONTROLLER
from eive_tmtc.tmtc.tcs import CtrlSetId
from eive_tmtc.tmtc.tcs.brd_assy import pack_tcs_ass_cmds
from eive_tmtc.tmtc.tcs.subsystem import InfoSys
from tmtccmd.config.tmtc import (
tmtc_definitions_provider,
TmtcDefinitionWrapper,
@ -14,6 +13,7 @@ from tmtccmd.tc.pus_3_fsfw_hk import (
generate_one_hk_command,
create_request_one_diag_command,
create_enable_periodic_hk_command_with_interval,
create_request_one_hk_command,
)
@ -23,32 +23,49 @@ class OpCode:
REQUEST_DEVICE_TEMP_SET = "temp_devs"
REQUEST_DEVICE_SUS_SET = "temp_sus"
REQUEST_HEATER_INFO = "heater_info"
REQUEST_TCS_CTRL_INFO = "tcs_ctrl_info"
class Info:
ENABLE_TEMP_SET = "Enable Primary Temperature Set"
REQUEST_PRIMARY_TEMP_SET = "Request HK set of primary sensor temperatures"
REQUEST_DEVICE_TEMP_SET = "Request HK set of device sensor temperatures"
REQUEST_DEVICE_SUS_SET = "Request HK set of the SUS temperatures"
REQUEST_HEATER_INFO = "Request heater information"
REQUEST_TCS_CTRL_INFO = "Request TCS controller information"
def pack_tcs_ctrl_commands(q: DefaultPusQueueHelper, op_code: str):
if op_code == OpCode.REQUEST_PRIMARY_TEMP_SET:
sensor_set_sid = make_sid(TCS_CONTROLLER, CtrlSetId.PRIMARY_SENSORS)
q.add_log_cmd(InfoSys.REQUEST_PRIMARY_TEMP_SET)
q.add_log_cmd(Info.REQUEST_PRIMARY_TEMP_SET)
q.add_pus_tc(generate_one_hk_command(sensor_set_sid))
if op_code == OpCode.REQUEST_DEVICE_TEMP_SET:
q.add_log_cmd(InfoSys.REQUEST_DEVICE_TEMP_SET)
q.add_log_cmd(Info.REQUEST_DEVICE_TEMP_SET)
q.add_pus_tc(
generate_one_hk_command(make_sid(TCS_CONTROLLER, CtrlSetId.DEVICE_SENSORS))
)
if op_code == OpCode.REQUEST_DEVICE_SUS_SET:
q.add_log_cmd(InfoSys.REQUEST_DEVICE_SUS_SET)
q.add_log_cmd(Info.REQUEST_DEVICE_SUS_SET)
q.add_pus_tc(
generate_one_hk_command(
make_sid(TCS_CONTROLLER, CtrlSetId.SUS_TEMP_SENSORS)
)
)
if op_code == OpCode.REQUEST_HEATER_INFO:
q.add_log_cmd(InfoSys.REQUEST_HEATER_INFO)
q.add_log_cmd(Info.REQUEST_HEATER_INFO)
q.add_pus_tc(
create_request_one_diag_command(
make_sid(TCS_CONTROLLER, CtrlSetId.HEATER_INFO)
)
)
if op_code == OpCode.REQUEST_TCS_CTRL_INFO:
q.add_log_cmd(Info.REQUEST_TCS_CTRL_INFO)
q.add_pus_tc(
create_request_one_hk_command(
make_sid(TCS_CONTROLLER, CtrlSetId.TCS_CTRL_INFO)
)
)
if op_code == OpCode.ENABLE_TEMP_SET:
interval_seconds = float(input("Please specify interval in seconds: "))
cmds = create_enable_periodic_hk_command_with_interval(
@ -62,11 +79,12 @@ def pack_tcs_ctrl_commands(q: DefaultPusQueueHelper, op_code: str):
@tmtc_definitions_provider
def add_tcs_ctrl_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(keys=OpCode.ENABLE_TEMP_SET, info=InfoSys.ENABLE_TEMP_SET)
oce.add(keys=OpCode.REQUEST_PRIMARY_TEMP_SET, info=InfoSys.REQUEST_PRIMARY_TEMP_SET)
oce.add(keys=OpCode.REQUEST_DEVICE_TEMP_SET, info=InfoSys.REQUEST_DEVICE_TEMP_SET)
oce.add(keys=OpCode.REQUEST_DEVICE_SUS_SET, info=InfoSys.REQUEST_DEVICE_SUS_SET)
oce.add(keys=OpCode.REQUEST_HEATER_INFO, info=InfoSys.REQUEST_HEATER_INFO)
oce.add(keys=OpCode.ENABLE_TEMP_SET, info=Info.ENABLE_TEMP_SET)
oce.add(keys=OpCode.REQUEST_PRIMARY_TEMP_SET, info=Info.REQUEST_PRIMARY_TEMP_SET)
oce.add(keys=OpCode.REQUEST_DEVICE_TEMP_SET, info=Info.REQUEST_DEVICE_TEMP_SET)
oce.add(keys=OpCode.REQUEST_DEVICE_SUS_SET, info=Info.REQUEST_DEVICE_SUS_SET)
oce.add(keys=OpCode.REQUEST_HEATER_INFO, info=Info.REQUEST_HEATER_INFO)
oce.add(keys=OpCode.REQUEST_TCS_CTRL_INFO, info=Info.REQUEST_TCS_CTRL_INFO)
defs.add_service(
name=CustomServiceList.TCS_CTRL,
info="TCS controller",

View File

@ -20,11 +20,6 @@ class OpCode:
class InfoSys:
OFF = "Switch TCS subsystem OFF"
NML = "Switch TCS subsystem NORMAL (nominal)"
ENABLE_TEMP_SET = "Enable Primary Temperature Set"
REQUEST_PRIMARY_TEMP_SET = "Request HK set of primary sensor temperatures"
REQUEST_DEVICE_TEMP_SET = "Request HK set of device sensor temperatures"
REQUEST_DEVICE_SUS_SET = "Request HK set of the SUS temperatures"
REQUEST_HEATER_INFO = "Request heater information"
ANNOUNCE_MODES = "Announce Modes recursively"