eive-tmtc/pus_tc/system/proc.py

43 lines
1.4 KiB
Python
Raw Normal View History

2022-05-18 18:39:18 +02:00
from tmtccmd.config import QueueCommands
from tmtccmd.tc.definitions import TcQueueT
2022-05-18 20:00:59 +02:00
from tmtccmd.tc.pus_3_fsfw_hk import *
from config.object_ids import BPX_HANDLER_ID
from pus_tc.devs.bpx_batt import BpxSetIds
2022-05-18 18:39:18 +02:00
class OpCodes:
HEATER = ["0", "heater"]
2022-05-18 20:00:59 +02:00
BAT_FT = ["bat-ft"]
2022-05-18 18:39:18 +02:00
class Info:
HEATER = "heater procedure"
2022-05-18 20:00:59 +02:00
BAT_FT = "battery functional test"
2022-05-18 18:39:18 +02:00
def pack_proc_commands(tc_queue: TcQueueT, op_code: str):
2022-05-18 20:00:59 +02:00
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()
)
2022-05-18 18:39:18 +02:00
pass