From e7cb7ca0963663a9674591c2945c5f24647cb00c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 23 May 2022 18:34:28 +0200 Subject: [PATCH] run afmt --- config/object_ids.py | 2 +- pus_tc/devs/rtd.py | 52 +++++++++++++++++----------------------- pus_tc/tc_packer_hook.py | 4 +++- 3 files changed, 26 insertions(+), 32 deletions(-) diff --git a/config/object_ids.py b/config/object_ids.py index 045d671..c2c25b1 100644 --- a/config/object_ids.py +++ b/config/object_ids.py @@ -79,7 +79,7 @@ HEATER_7_HPA = bytes([0x60, 0x00, 0x00, 0x07]) # RTDs RTD_0_PLOC_HSPD = bytes([0x44, 0x42, 0x00, 0x16]) -RTD_1_PLOC_MISSIONBRD= bytes([0x44, 0x42, 0x00, 0x17]) +RTD_1_PLOC_MISSIONBRD = bytes([0x44, 0x42, 0x00, 0x17]) RTD_2_4K_CAM = bytes([0x44, 0x42, 0x00, 0x18]) RTD_3_DAC_HSPD = bytes([0x44, 0x42, 0x00, 0x19]) RTD_4_STR = bytes([0x44, 0x42, 0x00, 0x20]) diff --git a/pus_tc/devs/rtd.py b/pus_tc/devs/rtd.py index f15dc32..531989e 100644 --- a/pus_tc/devs/rtd.py +++ b/pus_tc/devs/rtd.py @@ -2,7 +2,11 @@ from typing import Optional from config.definitions import CustomServiceList from spacepackets.ecss import PusTelecommand -from tmtccmd.config import ServiceOpCodeDictT, add_op_code_entry, add_service_op_code_entry +from tmtccmd.config import ( + ServiceOpCodeDictT, + add_op_code_entry, + add_service_op_code_entry, +) from tmtccmd.tc.definitions import TcQueueT from tmtccmd.utility import ObjectId from tmtccmd.tc.pus_200_fsfw_modes import Modes, pack_mode_data, Subservices @@ -25,7 +29,7 @@ RTD_IDS = [ oids.RTD_12_ACU, oids.RTD_13_PLPCDU_HSPD, oids.RTD_14_TCS_BRD, - oids.RTD_15_IMTQ + oids.RTD_15_IMTQ, ] @@ -43,26 +47,14 @@ class Info: def specify_rtd_cmds(cmd_dict: ServiceOpCodeDictT): op_code_dict = dict() - add_op_code_entry( - op_code_dict=op_code_dict, - keys=OpCodes.ON, - info=Info.ON - ) - add_op_code_entry( - op_code_dict=op_code_dict, - keys=OpCodes.NORMAL, - info=Info.NORMAL - ) - add_op_code_entry( - op_code_dict=op_code_dict, - keys=OpCodes.OFF, - info=Info.OFF - ) + add_op_code_entry(op_code_dict=op_code_dict, keys=OpCodes.ON, info=Info.ON) + add_op_code_entry(op_code_dict=op_code_dict, keys=OpCodes.NORMAL, info=Info.NORMAL) + add_op_code_entry(op_code_dict=op_code_dict, keys=OpCodes.OFF, info=Info.OFF) add_service_op_code_entry( srv_op_code_dict=cmd_dict, op_code_entry=op_code_dict, name=CustomServiceList.RTD.value, - info="RTD commands" + info="RTD commands", ) @@ -75,27 +67,27 @@ def pack_rtd_commands(op_code: str, object_id: Optional[ObjectId], tc_queue: TcQ object_id_dict = get_object_ids() object_id = object_id_dict.get(RTD_IDS[tgt_rtd_idx]) if op_code in OpCodes.ON: - app_data = pack_mode_data(object_id=object_id.as_bytes, mode=Modes.ON, submode=0) + app_data = pack_mode_data( + object_id=object_id.as_bytes, mode=Modes.ON, submode=0 + ) cmd = PusTelecommand( - service=200, - subservice=Subservices.TC_MODE_COMMAND, - app_data=app_data + service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=app_data ) tc_queue.appendleft(cmd.pack_command_tuple()) if op_code in OpCodes.NORMAL: - app_data = pack_mode_data(object_id=object_id.as_bytes, mode=Modes.NORMAL, submode=0) + app_data = pack_mode_data( + object_id=object_id.as_bytes, mode=Modes.NORMAL, submode=0 + ) cmd = PusTelecommand( - service=200, - subservice=Subservices.TC_MODE_COMMAND, - app_data=app_data + service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=app_data ) tc_queue.appendleft(cmd.pack_command_tuple()) if op_code in OpCodes.OFF: - app_data = pack_mode_data(object_id=object_id.as_bytes, mode=Modes.OFF, submode=0) + app_data = pack_mode_data( + object_id=object_id.as_bytes, mode=Modes.OFF, submode=0 + ) cmd = PusTelecommand( - service=200, - subservice=Subservices.TC_MODE_COMMAND, - app_data=app_data + service=200, subservice=Subservices.TC_MODE_COMMAND, app_data=app_data ) tc_queue.appendleft(cmd.pack_command_tuple()) diff --git a/pus_tc/tc_packer_hook.py b/pus_tc/tc_packer_hook.py index e9a860d..049667e 100644 --- a/pus_tc/tc_packer_hook.py +++ b/pus_tc/tc_packer_hook.py @@ -115,7 +115,9 @@ def pack_service_queue_user( object_id=object_id, tc_queue=service_queue, op_code=op_code ) if service == CustomServiceList.RTD.value: - return pack_rtd_commands(object_id=None, tc_queue=service_queue, op_code=op_code) + return pack_rtd_commands( + object_id=None, tc_queue=service_queue, op_code=op_code + ) if service == CustomServiceList.PDU1.value: object_id = PDU_1_HANDLER_ID return pack_pdu1_commands(