tmtccmd udpate

This commit is contained in:
Jakob Meier 2021-06-30 15:10:57 +02:00
commit 953f02e895
9 changed files with 41 additions and 24 deletions

2
.gitignore vendored
View File

@ -13,3 +13,5 @@ log
/lib /lib
/lib64 /lib64
/share /share
/venv

View File

@ -6,9 +6,9 @@
import enum import enum
from tmtccmd.core.backend import TmTcHandler 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): class CustomModeList(enum.IntEnum):

View File

@ -14,9 +14,9 @@ from config.custom_mode_op import CustomModeList
from tmtccmd.config.definitions import CoreComInterfaces from tmtccmd.config.definitions import CoreComInterfaces
from tmtccmd.config.globals import set_default_globals_pre_args_parsing, \ from tmtccmd.config.globals import set_default_globals_pre_args_parsing, \
set_default_globals_post_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): class CustomGlobalIds(enum.Enum):

View File

@ -6,19 +6,19 @@
from typing import Dict from typing import Dict
PUS_SERVICE_17_ID = bytes([0x53, 0x00, 0x00, 0x17]) PUS_SERVICE_17_ID = bytes([0x53, 0x00, 0x00, 0x17])
TEST_DEVICE_ID = bytes([0x44, 0x00, 0xAF, 0xFE]) TEST_DEVICE_ID = bytes([0x54, 0x00, 0xAF, 0xFE])
P60_DOCK_HANDLER = bytes([0x44, 0x00, 0x00, 0x1]) P60_DOCK_HANDLER = bytes([0x44, 0x25, 0x00, 0x00])
PDU_1_HANDLER_ID = bytes([0x44, 0x00, 0x00, 0x2]) PDU_1_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x01])
PDU_2_HANDLER_ID = bytes([0x44, 0x00, 0x00, 0x3]) PDU_2_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x02])
ACU_HANDLER_ID = bytes([0x44, 0x00, 0x00, 0x4]) ACU_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x03])
TMP_1075_1_HANDLER_ID = bytes([0x44, 0x00, 0x00, 0x5]) TMP_1075_1_HANDLER_ID = bytes([0x44, 0x42, 0x00, 0x04])
TMP_1075_2_HANDLER_ID = bytes([0x44, 0x00, 0x00, 0x6]) TMP_1075_2_HANDLER_ID = bytes([0x44, 0x42, 0x00, 0x05])
HEATER_ID = bytes([0x54, 0x00, 0x00, 0x1]) HEATER_ID = bytes([0x44, 0x41, 0x00, 0xA4])
PCDU_HANDLER_ID = bytes([0x44, 0x00, 0x10, 0x00]) PCDU_HANDLER_ID = bytes([0x44, 0x20, 0x00, 0xA1])
SOLAR_ARRAY_DEPLOYMENT_ID = bytes([0x44, 0x00, 0x10, 0x01]) SOLAR_ARRAY_DEPLOYMENT_ID = bytes([0x44, 0x41, 0x10, 0xA2])
SYRLINKS_HANDLER = bytes([0x44, 0x00, 0x10, 0x02]) SYRLINKS_HANDLER = bytes([0x44, 0x53, 0x00, 0xA3])
IMTQ_HANDLER_ID = bytearray([0x44, 0x00, 0x00, 0x14]) IMTQ_HANDLER_ID = bytearray([0x44, 0x14, 0x00, 0x14])
PLOC_ID = bytearray([0x44, 0x00, 0x00, 0x15]) PLOC_ID = bytearray([0x44, 0x33, 0x00, 0x15])
def get_object_ids() -> Dict[bytes, list]: def get_object_ids() -> Dict[bytes, list]:

15
lint.py Executable file
View File

@ -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()

View File

@ -9,7 +9,7 @@ from collections import deque
from typing import Union from typing import Union
from tmtccmd.config.definitions import CoreServiceList 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.definitions import TcQueueT
from tmtccmd.pus_tc.service_5_event import pack_generic_service5_test_into 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 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 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): def pack_service_queue_user(service: Union[str, int], op_code: str, service_queue: TcQueueT):

View File

@ -5,7 +5,7 @@
""" """
from tmtccmd.pus_tm.service_8_functional_cmd import Service8TM from tmtccmd.pus_tm.service_8_functional_cmd import Service8TM
from tmtccmd.ecss.tm import PusTelemetry 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_1_verification import Service1TM
from tmtccmd.pus_tm.service_3_housekeeping import Service3TM 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 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: def ccsds_tm_handler(apid: int, raw_tm_packet: bytearray, tmtc_printer: TmTcPrinter) -> None:

View File

@ -8,11 +8,11 @@ import struct
from typing import Tuple from typing import Tuple
from tmtccmd.pus_tm.service_3_housekeeping import Service3Base 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.syrlinks_hk_handler import SetIds
from pus_tc.imtq import ImtqSetIds from pus_tc.imtq import ImtqSetIds
from config.object_ids import SYRLINKS_HANDLER, IMTQ_HANDLER_ID 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, def handle_user_hk_packet(object_id: bytes, set_id: int, hk_data: bytearray,

@ -1 +1 @@
Subproject commit b4358a15fd945a9e0103a707b2a2dc56c458b24a Subproject commit 657b7b3f36f931eabf6ee4ff8267a119702099c8