add better op codes

This commit is contained in:
Robin Müller 2022-10-18 17:10:33 +02:00
parent b6e95317b1
commit f3ccbf0418
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -18,6 +18,12 @@ from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
from tmtccmd.util import ObjectIdU32
class OpCodes:
ON = ["on"]
NORMAL = ["normal"]
OFF = ["off"]
class ImtqSetIds:
ENG_HK_SET = 1
CAL_MTM_SET = 2
@ -49,15 +55,15 @@ def pack_imtq_test_into(object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_cod
f"Testing ISIS IMTQ handler with object id: {object_id.as_hex_string}"
)
if op_code == "0":
if op_code in OpCodes.OFF:
q.add_log_cmd("IMTQ: Set mode off")
command = pack_mode_data(object_id.as_bytes, Modes.OFF, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
if op_code == "1":
if op_code in OpCodes.ON:
q.add_log_cmd("IMTQ: Set mode on")
command = pack_mode_data(object_id.as_bytes, Modes.ON, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
if op_code == "2":
if op_code in OpCodes.NORMAL:
q.add_log_cmd("IMTQ: Mode Normal")
command = pack_mode_data(object_id.as_bytes, Modes.NORMAL, 0)
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))