From f4e5bc19568fc9786a3e5ac0a9164dbfe1dcbbe3 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Thu, 24 Jun 2021 16:34:51 +0200 Subject: [PATCH 1/8] updated object IDS --- config/object_ids.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/config/object_ids.py b/config/object_ids.py index 3dd4c29..1332df9 100644 --- a/config/object_ids.py +++ b/config/object_ids.py @@ -6,19 +6,19 @@ from typing import Dict PUS_SERVICE_17_ID = bytes([0x53, 0x00, 0x00, 0x17]) -TEST_DEVICE_ID = bytes([0x44, 0x00, 0xAF, 0xFE]) -P60_DOCK_HANDLER = bytes([0x44, 0x00, 0x00, 0x1]) -PDU_1_HANDLER_ID = bytes([0x44, 0x00, 0x00, 0x2]) -PDU_2_HANDLER_ID = bytes([0x44, 0x00, 0x00, 0x3]) -ACU_HANDLER_ID = bytes([0x44, 0x00, 0x00, 0x4]) -TMP_1075_1_HANDLER_ID = bytes([0x44, 0x00, 0x00, 0x5]) -TMP_1075_2_HANDLER_ID = bytes([0x44, 0x00, 0x00, 0x6]) -HEATER_ID = bytes([0x54, 0x00, 0x00, 0x1]) -PCDU_HANDLER_ID = bytes([0x44, 0x00, 0x10, 0x00]) -SOLAR_ARRAY_DEPLOYMENT_ID = bytes([0x44, 0x00, 0x10, 0x01]) -SYRLINKS_HANDLER = bytes([0x44, 0x00, 0x10, 0x02]) -IMTQ_HANDLER_ID = bytearray([0x44, 0x00, 0x00, 0x14]) -PLOC_ID = bytearray([0x44, 0x00, 0x00, 0x15]) +TEST_DEVICE_ID = bytes([0x54, 0x00, 0xAF, 0xFE]) +P60_DOCK_HANDLER = bytes([0x44, 0x20, 0x00, 0x01]) +PDU_1_HANDLER_ID = bytes([0x44, 0x20, 0x00, 0x02]) +PDU_2_HANDLER_ID = bytes([0x44, 0x20, 0x00, 0x03]) +ACU_HANDLER_ID = bytes([0x44, 0x20, 0x00, 0x04]) +TMP_1075_1_HANDLER_ID = bytes([0x44, 0x00, 0x00, 0x05]) +TMP_1075_2_HANDLER_ID = bytes([0x44, 0x00, 0x00, 0x06]) +HEATER_ID = bytes([0x44, 0x41, 0x00, 0x35]) +PCDU_HANDLER_ID = bytes([0x44, 0x20, 0x00, 0x32]) +SOLAR_ARRAY_DEPLOYMENT_ID = bytes([0x44, 0x41, 0x10, 0x33]) +SYRLINKS_HANDLER = bytes([0x44, 0x53, 0x00, 0x34]) +IMTQ_HANDLER_ID = bytearray([0x44, 0x10, 0x00, 0x14]) +PLOC_ID = bytearray([0x44, 0x30, 0x00, 0x15]) def get_object_ids() -> Dict[bytes, list]: From 8a66b2a721882acf342d1e25c9967db3651a919f Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Thu, 24 Jun 2021 16:42:58 +0200 Subject: [PATCH 2/8] updated TMTC IDs --- config/object_ids.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/config/object_ids.py b/config/object_ids.py index 1332df9..b26536f 100644 --- a/config/object_ids.py +++ b/config/object_ids.py @@ -7,18 +7,18 @@ from typing import Dict PUS_SERVICE_17_ID = bytes([0x53, 0x00, 0x00, 0x17]) TEST_DEVICE_ID = bytes([0x54, 0x00, 0xAF, 0xFE]) -P60_DOCK_HANDLER = bytes([0x44, 0x20, 0x00, 0x01]) -PDU_1_HANDLER_ID = bytes([0x44, 0x20, 0x00, 0x02]) -PDU_2_HANDLER_ID = bytes([0x44, 0x20, 0x00, 0x03]) -ACU_HANDLER_ID = bytes([0x44, 0x20, 0x00, 0x04]) -TMP_1075_1_HANDLER_ID = bytes([0x44, 0x00, 0x00, 0x05]) -TMP_1075_2_HANDLER_ID = bytes([0x44, 0x00, 0x00, 0x06]) -HEATER_ID = bytes([0x44, 0x41, 0x00, 0x35]) -PCDU_HANDLER_ID = bytes([0x44, 0x20, 0x00, 0x32]) -SOLAR_ARRAY_DEPLOYMENT_ID = bytes([0x44, 0x41, 0x10, 0x33]) -SYRLINKS_HANDLER = bytes([0x44, 0x53, 0x00, 0x34]) -IMTQ_HANDLER_ID = bytearray([0x44, 0x10, 0x00, 0x14]) -PLOC_ID = bytearray([0x44, 0x30, 0x00, 0x15]) +P60_DOCK_HANDLER = bytes([0x44, 0x25, 0x00, 0x00]) +PDU_1_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x01]) +PDU_2_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x02]) +ACU_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x03]) +TMP_1075_1_HANDLER_ID = bytes([0x44, 0x42, 0x00, 0x04]) +TMP_1075_2_HANDLER_ID = bytes([0x44, 0x42, 0x00, 0x05]) +HEATER_ID = bytes([0x44, 0x41, 0x00, 0x53]) +PCDU_HANDLER_ID = bytes([0x44, 0x20, 0x00, 0x50]) +SOLAR_ARRAY_DEPLOYMENT_ID = bytes([0x44, 0x41, 0x10, 0x51]) +SYRLINKS_HANDLER = bytes([0x44, 0x53, 0x00, 0x52]) +IMTQ_HANDLER_ID = bytearray([0x44, 0x14, 0x00, 0x14]) +PLOC_ID = bytearray([0x44, 0x33, 0x00, 0x15]) def get_object_ids() -> Dict[bytes, list]: From 2a9862489d57e2ccbf8b9ca5017f5e89395acddf Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Thu, 24 Jun 2021 16:49:19 +0200 Subject: [PATCH 3/8] updated object ids again --- config/object_ids.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/object_ids.py b/config/object_ids.py index b26536f..733107b 100644 --- a/config/object_ids.py +++ b/config/object_ids.py @@ -13,10 +13,10 @@ PDU_2_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x02]) ACU_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x03]) TMP_1075_1_HANDLER_ID = bytes([0x44, 0x42, 0x00, 0x04]) TMP_1075_2_HANDLER_ID = bytes([0x44, 0x42, 0x00, 0x05]) -HEATER_ID = bytes([0x44, 0x41, 0x00, 0x53]) -PCDU_HANDLER_ID = bytes([0x44, 0x20, 0x00, 0x50]) -SOLAR_ARRAY_DEPLOYMENT_ID = bytes([0x44, 0x41, 0x10, 0x51]) -SYRLINKS_HANDLER = bytes([0x44, 0x53, 0x00, 0x52]) +HEATER_ID = bytes([0x44, 0x41, 0x00, 0xA4]) +PCDU_HANDLER_ID = bytes([0x44, 0x20, 0x00, 0xA1]) +SOLAR_ARRAY_DEPLOYMENT_ID = bytes([0x44, 0x41, 0x10, 0xA2]) +SYRLINKS_HANDLER = bytes([0x44, 0x53, 0x00, 0xA3]) IMTQ_HANDLER_ID = bytearray([0x44, 0x14, 0x00, 0x14]) PLOC_ID = bytearray([0x44, 0x33, 0x00, 0x15]) From 98deb8444f84e94dc0252ad3c51eb61574174b90 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Mon, 28 Jun 2021 17:49:13 +0200 Subject: [PATCH 4/8] updated gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 50cba5f..ec6e113 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ log /lib /lib64 /share + +/venv From 8048c50c227065dfdc1cb715b108fe6e79d5a88e Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Mon, 28 Jun 2021 18:55:14 +0200 Subject: [PATCH 5/8] tmtccmd update --- tmtccmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtccmd b/tmtccmd index b0cf33b..e839281 160000 --- a/tmtccmd +++ b/tmtccmd @@ -1 +1 @@ -Subproject commit b0cf33b8a6223247c5df38e5918ac8885c494c11 +Subproject commit e83928127df3451171d8d5c22d8c2ca1d571d629 From 9d98eb6b606b40fa26aad12786894d1a99cb726c Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Mon, 28 Jun 2021 19:06:09 +0200 Subject: [PATCH 6/8] renaming logging functions --- config/custom_mode_op.py | 4 ++-- config/globals_config.py | 4 ++-- pus_tc/tc_packer_hook.py | 4 ++-- pus_tm/factory_hook.py | 4 ++-- pus_tm/hk_handling.py | 4 ++-- tmtccmd | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/config/custom_mode_op.py b/config/custom_mode_op.py index a82797b..159e350 100644 --- a/config/custom_mode_op.py +++ b/config/custom_mode_op.py @@ -6,9 +6,9 @@ import enum from tmtccmd.core.backend import TmTcHandler -from tmtccmd.utility.logger import get_logger +from tmtccmd.utility.logger import get_console_logger -LOGGER = get_logger() +LOGGER = get_console_logger() class CustomModeList(enum.IntEnum): diff --git a/config/globals_config.py b/config/globals_config.py index b8274bb..3fc9b35 100644 --- a/config/globals_config.py +++ b/config/globals_config.py @@ -14,9 +14,9 @@ from config.custom_mode_op import CustomModeList from tmtccmd.config.definitions import CoreComInterfaces from tmtccmd.config.globals import set_default_globals_pre_args_parsing, \ set_default_globals_post_args_parsing -from tmtccmd.utility.logger import get_logger +from tmtccmd.utility.logger import get_console_logger -LOGGER = get_logger() +LOGGER = get_console_logger() class CustomGlobalIds(enum.Enum): diff --git a/pus_tc/tc_packer_hook.py b/pus_tc/tc_packer_hook.py index 41b572b..b1ee736 100644 --- a/pus_tc/tc_packer_hook.py +++ b/pus_tc/tc_packer_hook.py @@ -9,7 +9,7 @@ from collections import deque from typing import Union from tmtccmd.config.definitions import CoreServiceList -from tmtccmd.utility.logger import get_logger +from tmtccmd.utility.logger import get_console_logger from tmtccmd.pus_tc.definitions import TcQueueT from tmtccmd.pus_tc.service_5_event import pack_generic_service5_test_into from tmtccmd.pus_tc.service_17_test import pack_service17_ping_command @@ -27,7 +27,7 @@ from config.object_ids import P60_DOCK_HANDLER, PDU_1_HANDLER_ID, PDU_2_HANDLER_ TMP_1075_1_HANDLER_ID, TMP_1075_2_HANDLER_ID, HEATER_ID, IMTQ_HANDLER_ID, PLOC_ID -LOGGER = get_logger() +LOGGER = get_console_logger() def pack_service_queue_user(service: Union[str, int], op_code: str, service_queue: TcQueueT): diff --git a/pus_tm/factory_hook.py b/pus_tm/factory_hook.py index ab2b264..d1a2bac 100644 --- a/pus_tm/factory_hook.py +++ b/pus_tm/factory_hook.py @@ -5,7 +5,7 @@ """ from tmtccmd.pus_tm.service_8_functional_cmd import Service8TM from tmtccmd.ecss.tm import PusTelemetry -from tmtccmd.utility.logger import get_logger +from tmtccmd.utility.logger import get_console_logger from tmtccmd.pus_tm.service_1_verification import Service1TM from tmtccmd.pus_tm.service_3_housekeeping import Service3TM @@ -15,7 +15,7 @@ from tmtccmd.utility.tmtc_printer import TmTcPrinter from config.definitions import PUS_APID -LOGGER = get_logger() +LOGGER = get_console_logger() def ccsds_tm_handler(apid: int, raw_tm_packet: bytearray, tmtc_printer: TmTcPrinter) -> None: diff --git a/pus_tm/hk_handling.py b/pus_tm/hk_handling.py index f093ae7..681c8aa 100644 --- a/pus_tm/hk_handling.py +++ b/pus_tm/hk_handling.py @@ -8,11 +8,11 @@ import struct from typing import Tuple from tmtccmd.pus_tm.service_3_housekeeping import Service3Base -from tmtccmd.utility.logger import get_logger +from tmtccmd.utility.logger import get_console_logger from pus_tc.syrlinks_hk_handler import SetIds from pus_tc.imtq import ImtqSetIds from config.object_ids import SYRLINKS_HANDLER, IMTQ_HANDLER_ID -LOGGER = get_logger() +LOGGER = get_console_logger() def handle_user_hk_packet(object_id: bytes, set_id: int, hk_data: bytearray, diff --git a/tmtccmd b/tmtccmd index e839281..742e73d 160000 --- a/tmtccmd +++ b/tmtccmd @@ -1 +1 @@ -Subproject commit e83928127df3451171d8d5c22d8c2ca1d571d629 +Subproject commit 742e73dba0fbcad35768a268320c419854eab2ae From 011fea37a0cfe4ecc54bb52dd7c182de6e29dbac Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 30 Jun 2021 11:17:57 +0200 Subject: [PATCH 7/8] tmtccmd update --- tmtccmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtccmd b/tmtccmd index 742e73d..657b7b3 160000 --- a/tmtccmd +++ b/tmtccmd @@ -1 +1 @@ -Subproject commit 742e73dba0fbcad35768a268320c419854eab2ae +Subproject commit 657b7b3f36f931eabf6ee4ff8267a119702099c8 From 96e9f26fd045c7dd22e72a9b66b78c3332c7ba97 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 30 Jun 2021 11:18:57 +0200 Subject: [PATCH 8/8] added linter --- lint.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 lint.py diff --git a/lint.py b/lint.py new file mode 100755 index 0000000..f0f66f0 --- /dev/null +++ b/lint.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 +import os +import sys + + +def main(): + status = os.system("flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics") + if os.WEXITSTATUS(status) != 0: + print("Flake8 linter errors") + sys.exit(0) + os.system("flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics") + + +if __name__ == "__main__": + main()