Merge remote-tracking branch 'origin/main' into mueller_new_switcher_hk

This commit is contained in:
2023-02-14 16:10:55 +01:00
94 changed files with 3828 additions and 2542 deletions

View File

@ -3,7 +3,7 @@ from typing import List, Tuple
from eive_tmtc.tmtc.power.acu import acu_config_table_handler
from eive_tmtc.tmtc.power.common_power import (
SetIds,
SetId,
unpack_array_in_data,
OBC_ENDIANNESS,
)
@ -11,7 +11,7 @@ from eive_tmtc.tmtc.power.power import PcduSetIds
from tmtccmd.util import ObjectIdBase
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
from eive_tmtc.pus_tm.defs import PrintWrapper
from eive_tmtc.gomspace.gomspace_common import GomspaceDeviceActionIds
from eive_tmtc.gomspace.gomspace_common import GomspaceDeviceActionId
from eive_tmtc.config.object_ids import (
PDU_1_HANDLER_ID,
PDU_2_HANDLER_ID,
@ -152,7 +152,7 @@ def handle_pdu_data(
pw = PrintWrapper(printer=printer)
current_idx = 0
priv_idx = pdu_idx - 1
if set_id == SetIds.AUX or set_id == SetIds.AUX:
if set_id == SetId.AUX or set_id == SetId.AUX:
fmt_str = "!hhBBBIIH"
inc_len = struct.calcsize(fmt_str)
(
@ -189,7 +189,7 @@ def handle_pdu_data(
wdt.print()
pw.dlog(f"PDU Device Types: 0:FRAM|1:ADC|2:ADC|3:TempSens|4,5,6,7:Reserved")
dev_parser.print(pw=pw)
if set_id == SetIds.CORE or set_id == SetIds.CORE:
if set_id == SetId.CORE or set_id == SetId.CORE:
pw.dlog(f"Received PDU HK from PDU {pdu_idx}")
current_list = []
for idx in range(len(PDU1_CHANNELS_NAMES)):
@ -230,7 +230,7 @@ def handle_pdu_data(
def handle_p60_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
pw = PrintWrapper(printer=printer)
if set_id == SetIds.CORE:
if set_id == SetId.CORE:
pw.dlog("Received P60 Core HK. Voltages in mV, currents in mA")
current_idx = 0
current_list = []
@ -277,7 +277,7 @@ def handle_p60_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
pw.dlog(temps)
pw.dlog(batt_info)
printer.print_validity_buffer(validity_buffer=hk_data[current_idx:], num_vars=9)
if set_id == SetIds.AUX:
if set_id == SetId.AUX:
pw.dlog("Received P60 AUX HK. Voltages in mV, currents in mA")
current_idx = 0
latchup_list = []
@ -356,7 +356,7 @@ def gen_six_entry_u16_list(hk_data: bytes, current_idx: int) -> Tuple[int, List[
def handle_acu_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
pw = PrintWrapper(printer=printer)
if set_id == SetIds.CORE:
if set_id == SetId.CORE:
mppt_mode = hk_data[0]
current_idx = 1
current_idx, currents = gen_six_entry_u16_list(
@ -400,7 +400,7 @@ def handle_acu_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
printer.print_validity_buffer(
validity_buffer=hk_data[current_idx:], num_vars=12
)
if set_id == SetIds.AUX:
if set_id == SetId.AUX:
current_idx = 0
fmt_str = "!BBB"
inc_len = struct.calcsize(fmt_str)
@ -440,7 +440,7 @@ def handle_acu_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
def handle_get_param_data_reply(
obj_id: ObjectIdBase, action_id: int, pw: PrintWrapper, custom_data: bytearray
):
if action_id == GomspaceDeviceActionIds.PARAM_GET:
if action_id == GomspaceDeviceActionId.PARAM_GET:
pw.dlog(f"Parameter Get Request received for object {obj_id}")
header_list = [
"Gomspace Request Code",
@ -462,7 +462,7 @@ def handle_get_param_data_reply(
]
pw.dlog(f"{header_list}")
pw.dlog(f"{content_list}")
elif action_id == GomspaceDeviceActionIds.REQUEST_CONFIG_TABLE:
elif action_id == GomspaceDeviceActionId.REQUEST_CONFIG_TABLE:
print(f"Received config table with size {len(custom_data)} for object {obj_id}")
if obj_id.as_bytes == PDU_1_HANDLER_ID or obj_id.as_bytes == PDU_2_HANDLER_ID:
pdu_config_table_handler(pw, custom_data, obj_id)