eive-tmtc/config/globals_config.py

46 lines
1.2 KiB
Python
Raw Normal View History

2021-03-19 17:39:52 +01:00
"""
@brief This file transfers definitions of global variables to the user.
@details Template configuration file. Copy this folder to the TMTC commander root and adapt
it to your needs.
"""
import enum
import argparse
# All globals can be added here and will be part of a globals dictionary.
2021-06-21 17:30:37 +02:00
from config.definitions import CustomServiceList, PUS_APID
2021-03-19 17:39:52 +01:00
from config.custom_mode_op import CustomModeList
2021-05-17 18:01:55 +02:00
from tmtccmd.config.definitions import CoreComInterfaces
2022-01-18 14:03:56 +01:00
from tmtccmd.config.globals import (
set_default_globals_pre_args_parsing,
set_default_globals_post_args_parsing,
)
2022-04-05 00:51:52 +02:00
from tmtccmd.logging import get_console_logger
2021-03-19 17:39:52 +01:00
2021-06-28 19:06:09 +02:00
LOGGER = get_console_logger()
2021-03-19 17:39:52 +01:00
class CustomGlobalIds(enum.Enum):
from enum import auto
2022-01-18 14:03:56 +01:00
2021-03-19 17:39:52 +01:00
pass
2021-03-19 17:50:09 +01:00
def set_globals_pre_args_parsing(gui: bool = False):
2021-06-21 17:30:37 +02:00
set_default_globals_pre_args_parsing(
2022-01-18 14:03:56 +01:00
gui=gui,
tc_apid=PUS_APID,
tm_apid=PUS_APID,
com_if_id=CoreComInterfaces.TCPIP_UDP.value,
)
2021-03-19 18:01:17 +01:00
2021-03-19 17:39:52 +01:00
2021-05-17 17:42:04 +02:00
def add_globals_post_args_parsing(args: argparse.Namespace, json_cfg_path: str):
2021-03-19 17:39:52 +01:00
set_default_globals_post_args_parsing(
2022-01-18 14:03:56 +01:00
args=args,
custom_services_list=[CustomServiceList],
custom_modes_list=[CustomModeList],
json_cfg_path=json_cfg_path,
2021-03-19 17:39:52 +01:00
)