add better op codes
This commit is contained in:
parent
b6e95317b1
commit
f3ccbf0418
@ -18,6 +18,12 @@ from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes
|
|||||||
from tmtccmd.util import ObjectIdU32
|
from tmtccmd.util import ObjectIdU32
|
||||||
|
|
||||||
|
|
||||||
|
class OpCodes:
|
||||||
|
ON = ["on"]
|
||||||
|
NORMAL = ["normal"]
|
||||||
|
OFF = ["off"]
|
||||||
|
|
||||||
|
|
||||||
class ImtqSetIds:
|
class ImtqSetIds:
|
||||||
ENG_HK_SET = 1
|
ENG_HK_SET = 1
|
||||||
CAL_MTM_SET = 2
|
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}"
|
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")
|
q.add_log_cmd("IMTQ: Set mode off")
|
||||||
command = pack_mode_data(object_id.as_bytes, Modes.OFF, 0)
|
command = pack_mode_data(object_id.as_bytes, Modes.OFF, 0)
|
||||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
|
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")
|
q.add_log_cmd("IMTQ: Set mode on")
|
||||||
command = pack_mode_data(object_id.as_bytes, Modes.ON, 0)
|
command = pack_mode_data(object_id.as_bytes, Modes.ON, 0)
|
||||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
|
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")
|
q.add_log_cmd("IMTQ: Mode Normal")
|
||||||
command = pack_mode_data(object_id.as_bytes, Modes.NORMAL, 0)
|
command = pack_mode_data(object_id.as_bytes, Modes.NORMAL, 0)
|
||||||
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
|
q.add_pus_tc(PusTelecommand(service=200, subservice=1, app_data=command))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user