From b06211d0865f5d904572635340303d8b4aec30eb Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 27 Jan 2022 16:38:20 +0100 Subject: [PATCH] applied black again --- config/hook_implementations.py | 5 ++++- pus_tc/ccsds_handler.py | 12 +++++++---- pus_tc/star_tracker.py | 37 +++++++++++++++++++++++----------- 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/config/hook_implementations.py b/config/hook_implementations.py index cd4064d..15d0831 100644 --- a/config/hook_implementations.py +++ b/config/hook_implementations.py @@ -520,7 +520,10 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT): "36": ("Star Tracker: Get checksum", {OpCodeDictKeys.TIMEOUT: 2.0}), "37": ("Star Tracker: Set time", {OpCodeDictKeys.TIMEOUT: 2.0}), "38": ("Star Tracker: Download centroid", {OpCodeDictKeys.TIMEOUT: 2.0}), - "39": ("Star Tracker: Upload centroid (not implemented?)", {OpCodeDictKeys.TIMEOUT: 2.0}), + "39": ( + "Star Tracker: Upload centroid (not implemented?)", + {OpCodeDictKeys.TIMEOUT: 2.0}, + ), "40": ("Star Tracker: Download matched star", {OpCodeDictKeys.TIMEOUT: 2.0}), "41": ("Star Tracker: Download DB Image", {OpCodeDictKeys.TIMEOUT: 2.0}), "42": ("Star Tracker: Download Blob Pixel", {OpCodeDictKeys.TIMEOUT: 2.0}), diff --git a/pus_tc/ccsds_handler.py b/pus_tc/ccsds_handler.py index f255276..07dea55 100644 --- a/pus_tc/ccsds_handler.py +++ b/pus_tc/ccsds_handler.py @@ -30,8 +30,10 @@ def pack_ccsds_handler_test( object_id: bytearray, tc_queue: TcQueueT, op_code: str ) -> TcQueueT: tc_queue.appendleft( - (QueueCommands.PRINT, - "Testing CCSDS handler with object id: 0x" + object_id.hex()) + ( + QueueCommands.PRINT, + "Testing CCSDS handler with object id: 0x" + object_id.hex(), + ) ) if op_code == "0": tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Set low rate")) @@ -58,9 +60,11 @@ def pack_ccsds_handler_test( command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if op_code == "4": - tc_queue.appendleft((QueueCommands.PRINT, "CCSDS Handler: Set arbitrary bitrate")) + tc_queue.appendleft( + (QueueCommands.PRINT, "CCSDS Handler: Set arbitrary bitrate") + ) bitrate = int(input("Specify bit rate (bps): ")) - command = object_id + CommandIds.ARBITRARY_BITRATE + struct.pack('!I', bitrate) + command = object_id + CommandIds.ARBITRARY_BITRATE + struct.pack("!I", bitrate) command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) diff --git a/pus_tc/star_tracker.py b/pus_tc/star_tracker.py index b34deff..742fc56 100644 --- a/pus_tc/star_tracker.py +++ b/pus_tc/star_tracker.py @@ -436,15 +436,24 @@ def pack_star_tracker_commands( tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Download FPGA Image")) position = int(input("Start position: ")) length = int(input("Size to download: ")) - command = object_id + struct.pack('!I', StarTrackerActionIds.DOWNLOAD_FPGA_IMAGE) + \ - struct.pack('!I', position) + struct.pack('!I', length) + bytearray( - ImagePathDefs.downloadFpgaImagePath, 'utf-8') + command = ( + object_id + + struct.pack("!I", StarTrackerActionIds.DOWNLOAD_FPGA_IMAGE) + + struct.pack("!I", position) + + struct.pack("!I", length) + + bytearray(ImagePathDefs.downloadFpgaImagePath, "utf-8") + ) command = PusTelecommand(service=8, subservice=128, ssc=66, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if op_code == "44": - tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Change donwload FPGA image file name")) - command = object_id + struct.pack('!I', StarTrackerActionIds.CHANGE_FPGA_DOWNLOAD_FILE) + \ - bytearray(ImagePathDefs.downloadFpgaImageName, 'utf-8') + tc_queue.appendleft( + (QueueCommands.PRINT, "Star tracker: Change donwload FPGA image file name") + ) + command = ( + object_id + + struct.pack("!I", StarTrackerActionIds.CHANGE_FPGA_DOWNLOAD_FILE) + + bytearray(ImagePathDefs.downloadFpgaImageName, "utf-8") + ) command = PusTelecommand(service=8, subservice=128, ssc=67, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if op_code == "45": @@ -468,22 +477,26 @@ def pack_star_tracker_commands( tc_queue.appendleft(command.pack_command_tuple()) if op_code == "47": tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Unlock")) - command = object_id + struct.pack('!I', StarTrackerActionIds.UNLOCK) + command = object_id + struct.pack("!I", StarTrackerActionIds.UNLOCK) command = PusTelecommand(service=8, subservice=128, ssc=70, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if op_code == "48": - tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request camera parameters")) - command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_CAMERA_PARAMS) + tc_queue.appendleft( + (QueueCommands.PRINT, "Star tracker: Request camera parameters") + ) + command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_CAMERA_PARAMS) command = PusTelecommand(service=8, subservice=128, ssc=71, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if op_code == "49": tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request limits")) - command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_LIMITS) + command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_LIMITS) command = PusTelecommand(service=8, subservice=128, ssc=72, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) if op_code == "50": - tc_queue.appendleft((QueueCommands.PRINT, "Star tracker: Request blob parameters")) - command = object_id + struct.pack('!I', StarTrackerActionIds.REQ_BLOB_PARAMS) + tc_queue.appendleft( + (QueueCommands.PRINT, "Star tracker: Request blob parameters") + ) + command = object_id + struct.pack("!I", StarTrackerActionIds.REQ_BLOB_PARAMS) command = PusTelecommand(service=8, subservice=128, ssc=73, app_data=command) tc_queue.appendleft(command.pack_command_tuple())