From 51bbeaa693a11bfc4d2cb342354041972dd93c1e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 23 May 2022 22:24:10 +0200 Subject: [PATCH] transform into static method --- pus_tm/devs/pcdu.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pus_tm/devs/pcdu.py b/pus_tm/devs/pcdu.py index ae24d7e..ca39a75 100644 --- a/pus_tm/devs/pcdu.py +++ b/pus_tm/devs/pcdu.py @@ -104,7 +104,15 @@ class DevicesInfoParser: current_idx += 1 return current_idx - def map_idx_to_type(self, devtype: int) -> str: + def print(self, pw: PrintWrapper): + pw.dlog(f"Device Type | Device State (0:None | 1:OK | 3:ERROR | 4:NOT FOUND)") + for i in range(len(self.dev_types)): + pw.dlog( + f"{self.map_idx_to_type(self.dev_types[i])} | {self.dev_statuses[i]}" + ) + + @staticmethod + def map_idx_to_type(devtype: int) -> str: if devtype == 0: return "Reserved" if devtype == 1: @@ -123,13 +131,6 @@ class DevicesInfoParser: return "FRAM" return "Unknown Type" - def print(self, pw: PrintWrapper): - pw.dlog(f"Device Type | Device State (0:None | 1:OK | 3:ERROR | 4:NOT FOUND)") - for i in range(len(self.dev_types)): - pw.dlog( - f"{self.map_idx_to_type(self.dev_types[i])} | {self.dev_statuses[i]}" - ) - def handle_pdu_data( printer: FsfwTmTcPrinter, pdu_idx: int, set_id: int, hk_data: bytes