re-run black

This commit is contained in:
Robin Müller 2022-05-25 10:37:38 +02:00
parent 6c7c8731ee
commit 36695bbbb0
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
6 changed files with 33 additions and 26 deletions

View File

@ -348,7 +348,10 @@ def add_imtq_cmds(cmd_dict: ServiceOpCodeDictT):
"9": ("IMTQ command dipole", {OpCodeDictKeys.TIMEOUT: 2.0}), "9": ("IMTQ command dipole", {OpCodeDictKeys.TIMEOUT: 2.0}),
"10": ("IMTQ get commanded dipole", {OpCodeDictKeys.TIMEOUT: 2.0}), "10": ("IMTQ get commanded dipole", {OpCodeDictKeys.TIMEOUT: 2.0}),
"11": ("IMTQ get engineering hk set", {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}), "13": ("IMTQ get raw MTM measurement one shot", {OpCodeDictKeys.TIMEOUT: 2.0}),
} }
service_imtq_tuple = ("IMTQ Device", op_code_dict_srv_imtq) service_imtq_tuple = ("IMTQ Device", op_code_dict_srv_imtq)

View File

@ -38,7 +38,7 @@ def add_gps_cmds(cmd_dict: ServiceOpCodeDictT):
srv_op_code_dict=cmd_dict, srv_op_code_dict=cmd_dict,
op_code_entry=op_code_dict, op_code_entry=op_code_dict,
name=CustomServiceList.GPS_CTRL.value, 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") LOGGER.warning("Reset pin handling needs to be re-implemented")
if op_code in OpCodes.REQ_OS_HK: if op_code in OpCodes.REQ_OS_HK:
tc_queue.appendleft((QueueCommands.PRINT, f"GMSS: {Info.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()) tc_queue.appendleft(cmd.pack_command_tuple())

View File

@ -9,7 +9,11 @@ from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT from tmtccmd.tc.packer import TcQueueT
from spacepackets.ecss.tc import PusTelecommand 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 from tmtccmd.tc.pus_200_fsfw_modes import pack_mode_data, Modes

View File

@ -24,14 +24,16 @@ def handle_gps_data(printer: FsfwTmTcPrinter, hk_data: bytes):
hours, hours,
minutes, minutes,
seconds, seconds,
unix_seconds unix_seconds,
) = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len]) ) = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len])
current_idx += inc_len current_idx += inc_len
date_string = f"{day}.{month}.{year} {hours}:{minutes}:{seconds}" date_string = f"{day}.{month}.{year} {hours}:{minutes}:{seconds}"
pw.dlog(f"Lat: {lat} deg") pw.dlog(f"Lat: {lat} deg")
pw.dlog(f"Long: {long} deg") pw.dlog(f"Long: {long} deg")
pw.dlog(f"Altitude: {alt} m | Speed: {speed} m/s") 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"GNSS Date: {date_string}")
pw.dlog(f"Unix seconds {unix_seconds}") pw.dlog(f"Unix seconds {unix_seconds}")
printer.print_validity_buffer(validity_buffer=hk_data[current_idx:], num_vars=14) printer.print_validity_buffer(validity_buffer=hk_data[current_idx:], num_vars=14)

View File

@ -44,7 +44,7 @@ def handle_eng_set(printer: FsfwTmTcPrinter, hk_data: bytes):
coil_x_temperature, coil_x_temperature,
coil_y_temperature, coil_y_temperature,
coil_z_temperature, coil_z_temperature,
mcu_temperature mcu_temperature,
] ]
num_of_vars = len(header_list) num_of_vars = len(header_list)
pw.dlog(str(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 X [nT]",
"Calibrated MTM Y [nT]", "Calibrated MTM Y [nT]",
"Calibrated MTM Z [nT]", "Calibrated MTM Z [nT]",
"Coild actuation status" "Coild actuation status",
] ]
mtm_x = struct.unpack("!I", hk_data[0:4])[0] mtm_x = struct.unpack("!I", hk_data[0:4])[0]
mtm_y = struct.unpack("!I", hk_data[4:8])[0] mtm_y = struct.unpack("!I", hk_data[4:8])[0]
mtm_z = struct.unpack("!I", hk_data[8:12])[0] mtm_z = struct.unpack("!I", hk_data[8:12])[0]
coil_actuation_status = hk_data[12] coil_actuation_status = hk_data[12]
validity_buffer = hk_data[12:] validity_buffer = hk_data[12:]
content_list = [ content_list = [mtm_x, mtm_y, mtm_z, coil_actuation_status]
mtm_x,
mtm_y,
mtm_z,
coil_actuation_status
]
num_of_vars = len(header_list) num_of_vars = len(header_list)
pw.dlog(str(header_list)) pw.dlog(str(header_list))
pw.dlog(str(content_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 X [nT]",
"Raw MTM Y [nT]", "Raw MTM Y [nT]",
"Raw MTM Z [nT]", "Raw MTM Z [nT]",
"Coild actuation status" "Coild actuation status",
] ]
mtm_x = struct.unpack("!f", hk_data[0:4])[0] mtm_x = struct.unpack("!f", hk_data[0:4])[0]
mtm_y = struct.unpack("!f", hk_data[4:8])[0] mtm_y = struct.unpack("!f", hk_data[4:8])[0]
mtm_z = struct.unpack("!f", hk_data[8:12])[0] mtm_z = struct.unpack("!f", hk_data[8:12])[0]
coil_actuation_status = hk_data[12] coil_actuation_status = hk_data[12]
validity_buffer = hk_data[12:] validity_buffer = hk_data[12:]
content_list = [ content_list = [mtm_x, mtm_y, mtm_z, coil_actuation_status]
mtm_x,
mtm_y,
mtm_z,
coil_actuation_status
]
num_of_vars = len(header_list) num_of_vars = len(header_list)
pw.dlog(str(header_list)) pw.dlog(str(header_list))
pw.dlog(str(content_list)) pw.dlog(str(content_list))

View File

@ -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.bpx_bat import handle_bpx_hk_data
from pus_tm.devs.gps import handle_gps_data from pus_tm.devs.gps import handle_gps_data
from pus_tm.devs.gyros import handle_gyros_hk_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, \ from pus_tm.devs.imtq_mgt import (
handle_raw_mtm_measurement 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.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_tm.devs.syrlinks import handle_syrlinks_hk_data
from pus_tc.devs.imtq import ImtqSetIds 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 object_id=object_id, printer=printer, set_id=set_id, hk_data=hk_data
) )
else: else:
LOGGER.info(f"Service 3 TM: Parsing for object {object_id} and set ID {set_id} " LOGGER.info(
f"has not been implemented.") f"Service 3 TM: Parsing for object {object_id} and set ID {set_id} "
f"has not been implemented."
)