eive-tmtc/config/globals_config.py

64 lines
2.3 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.
from config.definitions import CustomServiceList
from config.custom_mode_op import CustomModeList
from tmtccmd.core.definitions import CoreComInterfaces
from tmtccmd.defaults.globals_setup import set_default_globals_pre_args_parsing, \
set_default_globals_post_args_parsing
from tmtccmd.core.globals_manager import update_global
from tmtccmd.core.definitions import CoreGlobalIds
from tmtccmd.utility.tmtcc_logger import get_logger
LOGGER = get_logger()
class CustomGlobalIds(enum.Enum):
from enum import auto
pass
2021-03-19 17:50:09 +01:00
def set_globals_pre_args_parsing(gui: bool = False):
2021-03-19 17:39:52 +01:00
set_default_globals_pre_args_parsing(apid=0x65, com_if_id=CoreComInterfaces.EthernetUDP)
servicelist = dict()
servicelist[CustomServiceList.SERVICE_2] = ["Service 2 Raw Commanding"]
servicelist[CustomServiceList.SERVICE_3] = ["Service 3 Housekeeping"]
servicelist[CustomServiceList.SERVICE_5] = ["Service 5 Event"]
servicelist[CustomServiceList.SERVICE_8] = ["Service 8 Functional Commanding"]
servicelist[CustomServiceList.SERVICE_9] = ["Service 9 Time"]
servicelist[CustomServiceList.SERVICE_17] = ["Service 17 Test"]
servicelist[CustomServiceList.SERVICE_20] = ["Service 20 Parameters"]
servicelist[CustomServiceList.SERVICE_23] = ["Service 23 File Management"]
servicelist[CustomServiceList.SERVICE_200] = ["Service 200 Mode Management"]
update_global(CoreGlobalIds.SERVICE, CustomServiceList.SERVICE_17)
update_global(CoreGlobalIds.SERVICELIST, servicelist)
def add_globals_post_args_parsing(args: argparse.Namespace):
set_default_globals_post_args_parsing(
args=args, custom_service_list=CustomServiceList, custom_mode_list=CustomModeList,
custom_com_if_list=None
)
def set_up_serial_cfg(com_if: CoreComInterfaces):
from tmtccmd.defaults.com_setup import default_serial_cfg_setup
default_serial_cfg_setup(com_if=com_if)
def set_up_ethernet_cfg():
from tmtccmd.defaults.com_setup import default_tcpip_udp_cfg_setup
default_tcpip_udp_cfg_setup()