cleaned up a bit and changed to PUS C

This commit is contained in:
Robin Müller 2021-06-17 12:14:31 +02:00
parent 09947d4795
commit 11f4b23b1d
No known key found for this signature in database
GPG Key ID: 9C287E88FED11DF3
2 changed files with 15 additions and 10 deletions

View File

@ -18,6 +18,7 @@
#endif
#define FSFW_USE_PUS_C_TELEMETRY 1
#define FSFW_USE_PUS_C_TELECOMMANDS 1
//! Can be used to disable the ANSI color sequences for C stdio.
#define FSFW_COLORED_OUTPUT 1

View File

@ -1,17 +1,18 @@
import argparse
from typing import Dict, Union, Tuple
from typing import Dict, Tuple, Optional
from tmtccmd.com_if.com_interface_base import CommunicationInterface
from tmtccmd.config.definitions import ServiceOpCodeDictT
from tmtccmd.config.hook import TmTcHookBase
from tmtccmd.core.backend import TmTcHandler
from tmtccmd.ecss.tm import PusTelemetry
from tmtccmd.pus_tc.definitions import TcQueueT
from tmtccmd.pus_tm.service_3_base import Service3Base
from tmtccmd.ecss.conf import PusVersion
from tmtccmd.utility.tmtc_printer import TmTcPrinter
class FsfwHookBase(TmTcHookBase):
from tmtccmd.com_if.com_interface_base import CommunicationInterface
from tmtccmd.core.backend import TmTcHandler
from tmtccmd.pus_tc.definitions import TcQueueT
from tmtccmd.ecss.tm import PusTelemetry
from tmtccmd.utility.tmtc_printer import TmTcPrinter
def get_version(self) -> str:
from config.version import SW_NAME, SW_VERSION, SW_SUBVERSION, SW_SUBSUBVERSION
@ -26,14 +27,17 @@ class FsfwHookBase(TmTcHookBase):
def add_globals_pre_args_parsing(self, gui: bool = False):
from tmtccmd.config.globals import set_default_globals_pre_args_parsing
set_default_globals_pre_args_parsing(gui=gui, apid=0xef)
set_default_globals_pre_args_parsing(
gui=gui, pus_tm_version=PusVersion.PUS_C, pus_tc_version=PusVersion.PUS_C, apid=0xef
)
def add_globals_post_args_parsing(self, args: argparse.Namespace):
from tmtccmd.config.globals import set_default_globals_post_args_parsing
set_default_globals_post_args_parsing(args=args, json_cfg_path=self.get_json_config_file_path())
def assign_communication_interface(self, com_if_key: str, tmtc_printer: TmTcPrinter) -> \
Union[CommunicationInterface, None]:
def assign_communication_interface(
self, com_if_key: str, tmtc_printer: TmTcPrinter
) -> Optional[CommunicationInterface]:
from tmtccmd.config.com_if import create_communication_interface_default
return create_communication_interface_default(
com_if_key=com_if_key, tmtc_printer=tmtc_printer, json_cfg_path=self.get_json_config_file_path()
@ -46,7 +50,7 @@ class FsfwHookBase(TmTcHookBase):
from pus_tc.tc_packing import pack_service_queue_user
pack_service_queue_user(service=service, op_code=op_code, service_queue=service_queue)
def tm_user_factory_hook(self, raw_tm_packet: bytearray) -> Union[None, PusTelemetry]:
def tm_user_factory_hook(self, raw_tm_packet: bytearray) -> Optional[PusTelemetry]:
from pus_tm.factory_hook import tm_user_factory_hook
return tm_user_factory_hook(raw_tm_packet=raw_tm_packet)