diff --git a/config/definitions.py b/config/definitions.py index 0445033..8f8507d 100644 --- a/config/definitions.py +++ b/config/definitions.py @@ -48,3 +48,4 @@ class CustomServiceList(enum.Enum): TCS_ASS = "tcs-ass" TIME = "time" PROCEDURE = "proc" + TVTTESTPROCEDURE = "tvtestproc" diff --git a/pus_tc/cmd_definitions.py b/pus_tc/cmd_definitions.py index ad4c3f3..8ca7c03 100644 --- a/pus_tc/cmd_definitions.py +++ b/pus_tc/cmd_definitions.py @@ -949,18 +949,23 @@ def add_ploc_supv_cmds(cmd_dict: ServiceOpCodeDictT): def add_proc_cmds(cmd_dict: ServiceOpCodeDictT): from pus_tc.system.proc import OpCodes, Info + op_code_dict = dict() - add_op_code_entry( - op_code_dict=op_code_dict, - keys=OpCodes.HEATER, - info=Info.HEATER - ) + add_op_code_entry(op_code_dict=op_code_dict, keys=OpCodes.HEATER, info=Info.HEATER) add_service_op_code_entry( srv_op_code_dict=cmd_dict, name=CustomServiceList.PROCEDURE.value, info="Procedures", op_code_entry=op_code_dict, ) + op_code_dict = dict() + add_op_code_entry(op_code_dict=op_code_dict, keys=OpCodes.BAT_FT, info=Info.BAT_FT) + add_service_op_code_entry( + srv_op_code_dict=cmd_dict, + name=CustomServiceList.PROCEDURE.value, + info="TV Test Procedures", + op_code_entry=op_code_dict, + ) def add_system_cmds(cmd_dict: ServiceOpCodeDictT): diff --git a/pus_tc/system/proc.py b/pus_tc/system/proc.py index 0544df0..0893469 100644 --- a/pus_tc/system/proc.py +++ b/pus_tc/system/proc.py @@ -1,24 +1,42 @@ from tmtccmd.config import QueueCommands from tmtccmd.tc.definitions import TcQueueT +from tmtccmd.tc.pus_3_fsfw_hk import * +from config.object_ids import BPX_HANDLER_ID +from pus_tc.devs.bpx_batt import BpxSetIds class OpCodes: HEATER = ["0", "heater"] + BAT_FT = ["bat-ft"] class Info: HEATER = "heater procedure" + BAT_FT = "battery functional test" def pack_proc_commands(tc_queue: TcQueueT, op_code: str): - testint = 10 - print(f"hello world{op_code} {testint}") - if op_code in OpCodes.HEATER: - tc_queue.appendleft((QueueCommands.PRINT, "TUrning heater 0 on")) - tc_queue.appendleft(heater1cmd_on.pack_command_tuple()) - tc_queue.appendleft((QueueCommands.PRINT, "TUrning heater 0 off")) - tc_queue.appendleft(heater1cmd_off.pack_command_tuple()) - tc_queue.appendleft(heater1cmd.pack_command_tuple()) - tc_queue.appendleft(heater1cmd.pack_command_tuple()) - + if op_code in OpCodes.BAT_FT: + tc_queue.appendleft( + ( + QueueCommands.PRINT, + f"Executing Battery functional test Procedure ({OpCodes.BAT_FT})", + ) + ) + tc_queue.appendleft((QueueCommands.PRINT, f"Enabling periodic HK for Battery")) + cmd_tuple = enable_periodic_hk_command_with_interval( + diag=False, + sid=make_sid(BPX_HANDLER_ID, BpxSetIds.GET_HK_SET), + interval_seconds=10.0, + ssc=0, + ) + for cmd in cmd_tuple: + tc_queue.appendleft(cmd.pack_command_tuple()) + tc_queue.appendleft((QueueCommands.WAIT, 120.0)) + tc_queue.appendleft((QueueCommands.PRINT, "Disabling periodic HK for Battery")) + tc_queue.appendleft( + disable_periodic_hk_command( + diag=False, sid=make_sid(BPX_HANDLER_ID, BpxSetIds.GET_HK_SET), ssc=0 + ).pack_command_tuple() + ) pass diff --git a/tmtc_conf.json b/tmtc_conf.json deleted file mode 100644 index e7b49d5..0000000 --- a/tmtc_conf.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "com_if": "dummy", - "tcpip_tcp_ip_addr": "127.0.0.1", - "tcpip_tcp_port": 1536, - "tcpip_tcp_recv_max_size": 1500 -} \ No newline at end of file diff --git a/tmtccmd b/tmtccmd index e81e6db..4433284 160000 --- a/tmtccmd +++ b/tmtccmd @@ -1 +1 @@ -Subproject commit e81e6dbd594c1cdf51cd355a724cbd267d9dee38 +Subproject commit 443328422a03395bd51d072d3360de3397e1d88b