diff --git a/pus_tc/cmd_definitions.py b/pus_tc/cmd_definitions.py index 49253b3..0eb6b74 100644 --- a/pus_tc/cmd_definitions.py +++ b/pus_tc/cmd_definitions.py @@ -348,7 +348,10 @@ def add_imtq_cmds(cmd_dict: ServiceOpCodeDictT): "9": ("IMTQ command dipole", {OpCodeDictKeys.TIMEOUT: 2.0}), "10": ("IMTQ get commanded dipole", {OpCodeDictKeys.TIMEOUT: 2.0}), "11": ("IMTQ get engineering hk set", {OpCodeDictKeys.TIMEOUT: 2.0}), - "12": ("IMTQ get calibrated MTM measurement one shot", {OpCodeDictKeys.TIMEOUT: 2.0}), + "12": ( + "IMTQ get calibrated MTM measurement one shot", + {OpCodeDictKeys.TIMEOUT: 2.0}, + ), "13": ("IMTQ get raw MTM measurement one shot", {OpCodeDictKeys.TIMEOUT: 2.0}), } service_imtq_tuple = ("IMTQ Device", op_code_dict_srv_imtq) diff --git a/pus_tc/devs/gps.py b/pus_tc/devs/gps.py index 4d5824f..c7577fc 100644 --- a/pus_tc/devs/gps.py +++ b/pus_tc/devs/gps.py @@ -38,7 +38,7 @@ def add_gps_cmds(cmd_dict: ServiceOpCodeDictT): srv_op_code_dict=cmd_dict, op_code_entry=op_code_dict, name=CustomServiceList.GPS_CTRL.value, - info="GPS/GNSS Controller" + info="GPS/GNSS Controller", ) @@ -48,5 +48,7 @@ def pack_gps_command(object_id: bytes, tc_queue: TcQueueT, op_code: str): LOGGER.warning("Reset pin handling needs to be re-implemented") if op_code in OpCodes.REQ_OS_HK: tc_queue.appendleft((QueueCommands.PRINT, f"GMSS: {Info.REQ_OS_HK}")) - cmd = generate_one_hk_command(sid=make_sid(object_id=object_id, set_id=SetIds.HK), ssc=0) + cmd = generate_one_hk_command( + sid=make_sid(object_id=object_id, set_id=SetIds.HK), ssc=0 + ) tc_queue.appendleft(cmd.pack_command_tuple()) diff --git a/pus_tc/devs/imtq.py b/pus_tc/devs/imtq.py index 754c8a6..f71de6b 100644 --- a/pus_tc/devs/imtq.py +++ b/pus_tc/devs/imtq.py @@ -9,7 +9,11 @@ from tmtccmd.config.definitions import QueueCommands from tmtccmd.tc.packer import TcQueueT from spacepackets.ecss.tc import PusTelecommand -from tmtccmd.tc.pus_3_fsfw_hk import make_sid, generate_one_diag_command, generate_one_hk_command +from tmtccmd.tc.pus_3_fsfw_hk import ( + make_sid, + generate_one_diag_command, + generate_one_hk_command, +) from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes diff --git a/pus_tm/devs/gps.py b/pus_tm/devs/gps.py index fdeaa4b..070a7d6 100644 --- a/pus_tm/devs/gps.py +++ b/pus_tm/devs/gps.py @@ -24,14 +24,16 @@ def handle_gps_data(printer: FsfwTmTcPrinter, hk_data: bytes): hours, minutes, seconds, - unix_seconds - ) = struct.unpack(fmt_str, hk_data[current_idx: current_idx + inc_len]) + unix_seconds, + ) = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len]) current_idx += inc_len date_string = f"{day}.{month}.{year} {hours}:{minutes}:{seconds}" pw.dlog(f"Lat: {lat} deg") pw.dlog(f"Long: {long} deg") pw.dlog(f"Altitude: {alt} m | Speed: {speed} m/s") - pw.dlog(f"Fix Type: {fix} | Sats in View {sats_in_view} | Sats in Use {sats_in_use}") + pw.dlog( + f"Fix Type: {fix} | Sats in View {sats_in_view} | Sats in Use {sats_in_use}" + ) pw.dlog(f"GNSS Date: {date_string}") pw.dlog(f"Unix seconds {unix_seconds}") printer.print_validity_buffer(validity_buffer=hk_data[current_idx:], num_vars=14) diff --git a/pus_tm/devs/imtq_mgt.py b/pus_tm/devs/imtq_mgt.py index 6277f2d..6a3aae4 100644 --- a/pus_tm/devs/imtq_mgt.py +++ b/pus_tm/devs/imtq_mgt.py @@ -44,7 +44,7 @@ def handle_eng_set(printer: FsfwTmTcPrinter, hk_data: bytes): coil_x_temperature, coil_y_temperature, coil_z_temperature, - mcu_temperature + mcu_temperature, ] num_of_vars = len(header_list) pw.dlog(str(header_list)) @@ -58,19 +58,14 @@ def handle_calibrated_mtm_measurement(printer: FsfwTmTcPrinter, hk_data: bytes): "Calibrated MTM X [nT]", "Calibrated MTM Y [nT]", "Calibrated MTM Z [nT]", - "Coild actuation status" + "Coild actuation status", ] mtm_x = struct.unpack("!I", hk_data[0:4])[0] mtm_y = struct.unpack("!I", hk_data[4:8])[0] mtm_z = struct.unpack("!I", hk_data[8:12])[0] coil_actuation_status = hk_data[12] validity_buffer = hk_data[12:] - content_list = [ - mtm_x, - mtm_y, - mtm_z, - coil_actuation_status - ] + content_list = [mtm_x, mtm_y, mtm_z, coil_actuation_status] num_of_vars = len(header_list) pw.dlog(str(header_list)) pw.dlog(str(content_list)) @@ -83,19 +78,14 @@ def handle_raw_mtm_measurement(printer: FsfwTmTcPrinter, hk_data: bytes): "Raw MTM X [nT]", "Raw MTM Y [nT]", "Raw MTM Z [nT]", - "Coild actuation status" + "Coild actuation status", ] mtm_x = struct.unpack("!f", hk_data[0:4])[0] mtm_y = struct.unpack("!f", hk_data[4:8])[0] mtm_z = struct.unpack("!f", hk_data[8:12])[0] coil_actuation_status = hk_data[12] validity_buffer = hk_data[12:] - content_list = [ - mtm_x, - mtm_y, - mtm_z, - coil_actuation_status - ] + content_list = [mtm_x, mtm_y, mtm_z, coil_actuation_status] num_of_vars = len(header_list) pw.dlog(str(header_list)) pw.dlog(str(content_list)) diff --git a/pus_tm/hk_handling.py b/pus_tm/hk_handling.py index a6b9ebc..9f16c3b 100644 --- a/pus_tm/hk_handling.py +++ b/pus_tm/hk_handling.py @@ -15,8 +15,12 @@ from tmtccmd.logging import get_console_logger from pus_tm.devs.bpx_bat import handle_bpx_hk_data from pus_tm.devs.gps import handle_gps_data from pus_tm.devs.gyros import handle_gyros_hk_data -from pus_tm.devs.imtq_mgt import handle_self_test_data, handle_eng_set, handle_calibrated_mtm_measurement, \ - handle_raw_mtm_measurement +from pus_tm.devs.imtq_mgt import ( + handle_self_test_data, + handle_eng_set, + handle_calibrated_mtm_measurement, + handle_raw_mtm_measurement, +) from pus_tm.devs.pcdu import handle_pdu_data, handle_p60_hk_data, handle_acu_hk_data from pus_tm.devs.syrlinks import handle_syrlinks_hk_data from pus_tc.devs.imtq import ImtqSetIds @@ -140,5 +144,7 @@ def handle_regular_hk_print( object_id=object_id, printer=printer, set_id=set_id, hk_data=hk_data ) else: - LOGGER.info(f"Service 3 TM: Parsing for object {object_id} and set ID {set_id} " - f"has not been implemented.") + LOGGER.info( + f"Service 3 TM: Parsing for object {object_id} and set ID {set_id} " + f"has not been implemented." + )