From 9fc90ba487adb165a62eb76cd3970054e9454f6c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 24 May 2022 01:34:33 +0200 Subject: [PATCH 1/6] update gps hk parsing --- config/definitions.py | 3 +- pus_tc/cmd_definitions.py | 11 +----- pus_tc/devs/gps.py | 53 +++++++++++++++++++++++---- pus_tm/devs/gps.py | 76 ++++++++++++++------------------------- 4 files changed, 76 insertions(+), 67 deletions(-) diff --git a/config/definitions.py b/config/definitions.py index 5aa4174..c12a6d2 100644 --- a/config/definitions.py +++ b/config/definitions.py @@ -34,8 +34,7 @@ class CustomServiceList(enum.Enum): REACTION_WHEEL_4 = "rw-4" RW_ASSEMBLY = "rw-ass" RAD_SENSOR = "rad_sensor" - GPS_0 = "gps0" - GPS_1 = "gps1" + GPS_CTRL = "gnss-ctrl" PLOC_MEMORY_DUMPER = "ploc_memory_dumper" CORE = "core" STAR_TRACKER = "star_tracker" diff --git a/pus_tc/cmd_definitions.py b/pus_tc/cmd_definitions.py index 6307702..a9f1764 100644 --- a/pus_tc/cmd_definitions.py +++ b/pus_tc/cmd_definitions.py @@ -1,4 +1,4 @@ -from pus_tc.devs.gps import GpsOpCodes +from pus_tc.devs.gps import OpCodes from pus_tc.devs.pcdu import add_pcdu_cmds from pus_tc.devs.rad_sensor import add_rad_sens_cmds from tmtccmd.config import ( @@ -89,15 +89,6 @@ def add_ccsds_cmds(cmd_dict: ServiceOpCodeDictT): cmd_dict[CustomServiceList.CCSDS_HANDLER.value] = service_ccsds_handler_tuple -def add_gps_cmds(cmd_dict: ServiceOpCodeDictT): - op_code_dict = { - GpsOpCodes.RESET_GNSS.value: ("Reset GPS", {OpCodeDictKeys.TIMEOUT: 2.0}) - } - service_tuple = ("GPS 0", op_code_dict) - cmd_dict[CustomServiceList.GPS_0.value] = service_tuple - cmd_dict[CustomServiceList.GPS_1.value] = service_tuple - - def add_str_cmds(cmd_dict: ServiceOpCodeDictT): op_code_dict_srv_star_tracker = { "0": ( diff --git a/pus_tc/devs/gps.py b/pus_tc/devs/gps.py index d0f3f21..db3d153 100644 --- a/pus_tc/devs/gps.py +++ b/pus_tc/devs/gps.py @@ -1,22 +1,63 @@ import enum -from tmtccmd.config.definitions import QueueCommands +from config.definitions import CustomServiceList +from tmtccmd.config import add_op_code_entry, add_service_op_code_entry +from tmtccmd.tc.pus_3_fsfw_hk import make_sid, generate_one_hk_command +from tmtccmd.config.definitions import QueueCommands, ServiceOpCodeDictT +from tmtccmd.logging import get_console_logger from tmtccmd.tc.definitions import TcQueueT from tmtccmd.tc.pus_8_funccmd import generate_action_command from config.object_ids import GPS_HANDLER_1_ID, GPS_HANDLER_0_ID +LOGGER = get_console_logger() -class GpsOpCodes(enum.Enum): - RESET_GNSS = "5" + +class OpCodes: + REQ_OS_HK = ["0", "hk-os"] + RESET_GNSS = ["5", "reset"] + + +class Info: + REQ_OS_HK = "Request One-Shot HK" + RESET_GNSS = "Reset GNSS using reset pin" + + +class SetIds: + HK = 0 + + +def add_gps_cmds(cmd_dict: ServiceOpCodeDictT): + op_code_dict = dict() + add_op_code_entry( + op_code_dict=op_code_dict, keys=OpCodes.RESET_GNSS, info=Info.RESET_GNSS + ) + add_op_code_entry( + op_code_dict=op_code_dict, keys=OpCodes.REQ_OS_HK, info=Info.REQ_OS_HK + ) + add_service_op_code_entry( + srv_op_code_dict=cmd_dict, + op_code_entry=op_code_dict, + name=CustomServiceList.GPS_CTRL.value, + info="GPS/GNSS Controller" + ) def pack_gps_command(object_id: bytes, tc_queue: TcQueueT, op_code: str): - if op_code == GpsOpCodes.RESET_GNSS.value: + if op_code in OpCodes.RESET_GNSS: if object_id == GPS_HANDLER_0_ID: - tc_queue.appendleft((QueueCommands.PRINT, "Resetting GPS device 0")) + # TODO: This needs to be re-implemented + LOGGER.warning("Reset pin handling needs to be re-implemented") + return + # tc_queue.appendleft((QueueCommands.PRINT, "Resetting GPS device 0")) elif object_id == GPS_HANDLER_1_ID: - tc_queue.appendleft((QueueCommands.PRINT, "Resetting GPS device 1")) + LOGGER.warning("Reset pin handling needs to be re-implemented") + return + # tc_queue.appendleft((QueueCommands.PRINT, "Resetting GPS device 1")) cmd = generate_action_command(object_id=object_id, action_id=int(op_code)) tc_queue.appendleft(cmd.pack_command_tuple()) + 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) + tc_queue.appendleft(cmd.pack_command_tuple()) diff --git a/pus_tm/devs/gps.py b/pus_tm/devs/gps.py index d60828d..fdeaa4b 100644 --- a/pus_tm/devs/gps.py +++ b/pus_tm/devs/gps.py @@ -1,6 +1,4 @@ -import os import struct -from datetime import datetime from pus_tm.defs import PrintWrapper from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter @@ -9,51 +7,31 @@ from tmtccmd.utility.tmtc_printer import FsfwTmTcPrinter def handle_gps_data(printer: FsfwTmTcPrinter, hk_data: bytes): pw = PrintWrapper(printer) pw.dlog(f"Received GPS data, HK data length {len(hk_data)}") - var_index = 0 - header_list = [ - "Latitude", - "Longitude", - "Altitude", - "Fix Mode", - "Sats in Use", - "Date", - "Unix Seconds", - ] - latitude = struct.unpack("!d", hk_data[0:8])[0] - longitude = struct.unpack("!d", hk_data[8:16])[0] - altitude = struct.unpack("!d", hk_data[16:24])[0] - fix_mode = hk_data[24] - sat_in_use = hk_data[25] - year = struct.unpack("!H", hk_data[26:28])[0] - month = hk_data[28] - day = hk_data[29] - hours = hk_data[30] - minutes = hk_data[31] - seconds = hk_data[32] + current_idx = 0 + fmt_str = "!ddddBBBHBBBBBI" + inc_len = struct.calcsize(fmt_str) + ( + lat, + long, + alt, + speed, + fix, + sats_in_use, + sats_in_view, + year, + month, + day, + hours, + minutes, + seconds, + 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}" - unix_seconds = struct.unpack("!I", hk_data[33:37])[0] - content_list = [ - latitude, - longitude, - altitude, - fix_mode, - sat_in_use, - date_string, - unix_seconds, - ] - var_index += 13 - if not os.path.isfile("gps_log.txt"): - with open("gps_log.txt", "w") as gps_file: - gps_file.write( - "Time, Latitude [deg], Longitude [deg], Altitude [m], Fix Mode, Sats in Use, " - "Date, Unix Seconds\n" - ) - with open("gps_log.txt", "a") as gps_file: - gps_file.write( - f"{datetime.now()}, {latitude}, {longitude}, {altitude}, " - f"{fix_mode}, {sat_in_use}, {date_string}, {unix_seconds}\n" - ) - validity_buffer = hk_data[37:39] - pw.dlog(str(header_list)) - pw.dlog(str(content_list)) - printer.print_validity_buffer(validity_buffer=validity_buffer, num_vars=10) + 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"GNSS Date: {date_string}") + pw.dlog(f"Unix seconds {unix_seconds}") + printer.print_validity_buffer(validity_buffer=hk_data[current_idx:], num_vars=14) -- 2.34.1 From b7a6291560a874728ff33d88d5be44a60f82692a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 24 May 2022 01:49:57 +0200 Subject: [PATCH 2/6] update gps hk parsing --- config/object_ids.py | 3 +-- pus_tc/cmd_definitions.py | 2 +- pus_tc/devs/gps.py | 15 ++------------- pus_tc/tc_packer_hook.py | 14 ++++---------- pus_tm/hk_handling.py | 38 +++++++++++++++++++------------------- 5 files changed, 27 insertions(+), 45 deletions(-) diff --git a/config/object_ids.py b/config/object_ids.py index c2c25b1..b0e450f 100644 --- a/config/object_ids.py +++ b/config/object_ids.py @@ -44,8 +44,7 @@ GYRO_0_ADIS_HANDLER_ID = bytes([0x44, 0x12, 0x00, 0x10]) GYRO_1_L3G_HANDLER_ID = bytes([0x44, 0x12, 0x01, 0x11]) GYRO_2_ADIS_HANDLER_ID = bytes([0x44, 0x12, 0x02, 0x12]) GYRO_3_L3G_HANDLER_ID = bytes([0x44, 0x12, 0x03, 0x13]) -GPS_HANDLER_0_ID = bytes([0x44, 0x13, 0x00, 0x45]) -GPS_HANDLER_1_ID = bytes([0x44, 0x13, 0x01, 0x46]) +GPS_CONTROLLER = bytes([0x44, 0x13, 0x00, 0x45]) RW1_ID = bytes([0x44, 0x12, 0x00, 0x47]) RW2_ID = bytes([0x44, 0x12, 0x01, 0x48]) RW3_ID = bytes([0x44, 0x12, 0x02, 0x49]) diff --git a/pus_tc/cmd_definitions.py b/pus_tc/cmd_definitions.py index a9f1764..ee28489 100644 --- a/pus_tc/cmd_definitions.py +++ b/pus_tc/cmd_definitions.py @@ -1,4 +1,4 @@ -from pus_tc.devs.gps import OpCodes +from pus_tc.devs.gps import add_gps_cmds from pus_tc.devs.pcdu import add_pcdu_cmds from pus_tc.devs.rad_sensor import add_rad_sens_cmds from tmtccmd.config import ( diff --git a/pus_tc/devs/gps.py b/pus_tc/devs/gps.py index db3d153..4d5824f 100644 --- a/pus_tc/devs/gps.py +++ b/pus_tc/devs/gps.py @@ -9,8 +9,6 @@ from tmtccmd.tc.definitions import TcQueueT from tmtccmd.tc.pus_8_funccmd import generate_action_command -from config.object_ids import GPS_HANDLER_1_ID, GPS_HANDLER_0_ID - LOGGER = get_console_logger() @@ -46,17 +44,8 @@ def add_gps_cmds(cmd_dict: ServiceOpCodeDictT): def pack_gps_command(object_id: bytes, tc_queue: TcQueueT, op_code: str): if op_code in OpCodes.RESET_GNSS: - if object_id == GPS_HANDLER_0_ID: - # TODO: This needs to be re-implemented - LOGGER.warning("Reset pin handling needs to be re-implemented") - return - # tc_queue.appendleft((QueueCommands.PRINT, "Resetting GPS device 0")) - elif object_id == GPS_HANDLER_1_ID: - LOGGER.warning("Reset pin handling needs to be re-implemented") - return - # tc_queue.appendleft((QueueCommands.PRINT, "Resetting GPS device 1")) - cmd = generate_action_command(object_id=object_id, action_id=int(op_code)) - tc_queue.appendleft(cmd.pack_command_tuple()) + # TODO: This needs to be re-implemented + 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) diff --git a/pus_tc/tc_packer_hook.py b/pus_tc/tc_packer_hook.py index 137877b..2964012 100644 --- a/pus_tc/tc_packer_hook.py +++ b/pus_tc/tc_packer_hook.py @@ -63,8 +63,6 @@ from config.object_ids import ( PLOC_SUPV_ID, STAR_TRACKER_ID, PLOC_MEMORY_DUMPER_ID, - GPS_HANDLER_0_ID, - GPS_HANDLER_1_ID, CCSDS_HANDLER_ID, PDEC_HANDLER_ID, STR_IMG_HELPER_ID, @@ -73,7 +71,7 @@ from config.object_ids import ( RW_ASSEMBLY, get_object_ids, ) - +import config.object_ids as oids LOGGER = get_console_logger() @@ -206,13 +204,9 @@ def pack_service_queue_user( ) if service == CustomServiceList.ACS.value: return pack_acs_command(tc_queue=service_queue, op_code=op_code) - if service == CustomServiceList.GPS_0.value: + if service == CustomServiceList.GPS_CTRL.value: return pack_gps_command( - object_id=GPS_HANDLER_0_ID, tc_queue=service_queue, op_code=op_code - ) - if service == CustomServiceList.GPS_1.value: - return pack_gps_command( - object_id=GPS_HANDLER_1_ID, tc_queue=service_queue, op_code=op_code + object_id=oids.GPS_CONTROLLER, tc_queue=service_queue, op_code=op_code ) if service == CustomServiceList.CCSDS_HANDLER.value: return pack_ccsds_handler_test( @@ -248,7 +242,7 @@ def pack_service_queue_user( ) if service == CustomServiceList.CONTROLLERS.value: return pack_controller_commands(tc_queue=service_queue, op_code=op_code) - LOGGER.warning("Invalid Service !") + LOGGER.warning(f"Invalid Service {service}") def create_total_tc_queue_user() -> TcQueueT: diff --git a/pus_tm/hk_handling.py b/pus_tm/hk_handling.py index 427017c..a468aaf 100644 --- a/pus_tm/hk_handling.py +++ b/pus_tm/hk_handling.py @@ -75,40 +75,40 @@ def handle_regular_hk_print( """This function is called when a Service 3 Housekeeping packet is received.""" if object_id in [obj_ids.RW1_ID, obj_ids.RW2_ID, obj_ids.RW3_ID, obj_ids.RW4_ID]: handle_rw_hk_data(printer, object_id, set_id, hk_data) - if objb == obj_ids.SYRLINKS_HANDLER_ID: + elif objb == obj_ids.SYRLINKS_HANDLER_ID: handle_syrlinks_hk_data(printer=printer, hk_data=hk_data, set_id=set_id) - if objb == obj_ids.IMTQ_HANDLER_ID: + elif objb == obj_ids.IMTQ_HANDLER_ID: if (set_id >= ImtqSetIds.POSITIVE_X_TEST) and ( set_id <= ImtqSetIds.NEGATIVE_Z_TEST ): return handle_self_test_data(printer, hk_data) else: LOGGER.info("Service 3 TM: Syrlinks handler reply with unknown set id") - if objb == obj_ids.GPS_HANDLER_0_ID or object_id == obj_ids.GPS_HANDLER_1_ID: - handle_gps_data(printer=printer, hk_data=hk_data) - if objb == obj_ids.BPX_HANDLER_ID: - handle_bpx_hk_data(hk_data=hk_data, set_id=set_id, printer=printer) - if objb == obj_ids.CORE_CONTROLLER_ID: + elif objb == obj_ids.GPS_CONTROLLER: + return handle_gps_data(printer=printer, hk_data=hk_data) + elif objb == obj_ids.BPX_HANDLER_ID: + return handle_bpx_hk_data(hk_data=hk_data, set_id=set_id, printer=printer) + elif objb == obj_ids.CORE_CONTROLLER_ID: return handle_core_hk_data(printer=printer, hk_data=hk_data, set_id=set_id) - if objb == obj_ids.PDU_1_HANDLER_ID: + elif objb == obj_ids.PDU_1_HANDLER_ID: return handle_pdu_data( printer=printer, pdu_idx=1, set_id=set_id, hk_data=hk_data ) - if objb == obj_ids.PDU_2_HANDLER_ID: + elif objb == obj_ids.PDU_2_HANDLER_ID: return handle_pdu_data( printer=printer, pdu_idx=2, set_id=set_id, hk_data=hk_data ) - if objb == obj_ids.ACU_HANDLER_ID: + elif objb == obj_ids.ACU_HANDLER_ID: return handle_acu_hk_data(printer=printer, hk_data=hk_data, set_id=set_id) - if objb == obj_ids.RAD_SENSOR_ID: + elif objb == obj_ids.RAD_SENSOR_ID: return handle_rad_sensor_data(printer=printer, hk_data=hk_data, set_id=set_id) - if objb in [obj_ids.RW1_ID, obj_ids.RW2_ID, obj_ids.RW3_ID, obj_ids.RW4_ID]: + elif objb in [obj_ids.RW1_ID, obj_ids.RW2_ID, obj_ids.RW3_ID, obj_ids.RW4_ID]: return handle_rw_hk_data( printer=printer, object_id=object_id, set_id=set_id, hk_data=hk_data ) - if objb == obj_ids.P60_DOCK_HANDLER: + elif objb == obj_ids.P60_DOCK_HANDLER: handle_p60_hk_data(printer=printer, set_id=set_id, hk_data=hk_data) - if objb in [ + elif objb in [ obj_ids.GYRO_0_ADIS_HANDLER_ID, obj_ids.GYRO_1_L3G_HANDLER_ID, obj_ids.GYRO_2_ADIS_HANDLER_ID, @@ -117,7 +117,7 @@ def handle_regular_hk_print( handle_gyros_hk_data( object_id=object_id, hk_data=hk_data, printer=printer, set_id=set_id ) - if objb in [ + elif objb in [ obj_ids.MGM_0_LIS3_HANDLER_ID, obj_ids.MGM_1_RM3100_HANDLER_ID, obj_ids.MGM_2_LIS3_HANDLER_ID, @@ -126,12 +126,12 @@ def handle_regular_hk_print( handle_mgm_hk_data( object_id=object_id, hk_data=hk_data, printer=printer, set_id=set_id ) - if objb == obj_ids.PL_PCDU_ID: + elif objb == obj_ids.PL_PCDU_ID: log_to_both(printer, "Received PL PCDU HK data") - if objb == obj_ids.THERMAL_CONTROLLER_ID: + elif objb == obj_ids.THERMAL_CONTROLLER_ID: handle_thermal_controller_hk_data( object_id=object_id, printer=printer, set_id=set_id, hk_data=hk_data ) else: - LOGGER.info("Service 3 TM: Parsing for this SID has not been implemented.") - return HkReplyUnpacked() + LOGGER.info(f"Service 3 TM: Parsing for object {object_id} and set ID {set_id} " + f"has not been implemented.") -- 2.34.1 From 36695bbbb004cffb8867a39ce3f94894886c8262 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 25 May 2022 10:37:38 +0200 Subject: [PATCH 3/6] re-run black --- pus_tc/cmd_definitions.py | 5 ++++- pus_tc/devs/gps.py | 6 ++++-- pus_tc/devs/imtq.py | 6 +++++- pus_tm/devs/gps.py | 8 +++++--- pus_tm/devs/imtq_mgt.py | 20 +++++--------------- pus_tm/hk_handling.py | 14 ++++++++++---- 6 files changed, 33 insertions(+), 26 deletions(-) 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." + ) -- 2.34.1 From 58b021c37f7de61ab90a286815d92929d3a20fc4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 25 May 2022 10:39:17 +0200 Subject: [PATCH 4/6] remove include --- pus_tc/cmd_definitions.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pus_tc/cmd_definitions.py b/pus_tc/cmd_definitions.py index 0eb6b74..3b08349 100644 --- a/pus_tc/cmd_definitions.py +++ b/pus_tc/cmd_definitions.py @@ -8,7 +8,6 @@ from tmtccmd.config import ( from tmtccmd.config.globals import get_default_service_op_code_dict from pus_tc.devs.gps import add_gps_cmds -from pus_tc.devs.gps import GpsOpCodes from pus_tc.devs.pcdu import add_pcdu_cmds from pus_tc.devs.plpcdu import add_pl_pcdu_cmds from pus_tc.devs.rad_sensor import add_rad_sens_cmds -- 2.34.1 From 42aeb874c07172a38b7e37a3788fe3fa4afe75a2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 25 May 2022 15:01:40 +0200 Subject: [PATCH 5/6] bump tmtccmd --- tmtccmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtccmd b/tmtccmd index 0ea7df5..2354f5d 160000 --- a/tmtccmd +++ b/tmtccmd @@ -1 +1 @@ -Subproject commit 0ea7df5f46b069da95fbe795e1541f28071b6371 +Subproject commit 2354f5d2778c7681ddf6602766dd4e68b943e1c0 -- 2.34.1 From acd53c13370870e5cfbf031cb6b00cd5bc7d7454 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 28 May 2022 12:51:07 +0200 Subject: [PATCH 6/6] resolve other merge conflict --- pus_tc/tc_packer_hook.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pus_tc/tc_packer_hook.py b/pus_tc/tc_packer_hook.py index 775a52a..be637d4 100644 --- a/pus_tc/tc_packer_hook.py +++ b/pus_tc/tc_packer_hook.py @@ -242,13 +242,8 @@ def pack_service_queue_user( tc_queue=service_queue, object_id=RW_ASSEMBLY, op_code=op_code ) if service == CustomServiceList.CONTROLLERS.value: -<<<<<<< HEAD return pack_controller_commands(tc_queue=service_queue, op_code=op_code) LOGGER.warning(f"Invalid Service {service}") -======= - return pack_cmd_ctrl_to_prompted_mode(tc_queue=service_queue, op_code=op_code) - LOGGER.warning("Invalid Service !") ->>>>>>> origin/develop def create_total_tc_queue_user() -> TcQueueT: -- 2.34.1