Skip to content

Commit

Permalink
removed unneeded function
Browse files Browse the repository at this point in the history
  • Loading branch information
robamu committed Mar 19, 2021
1 parent a9fbd5a commit bef9dc2
Showing 1 changed file with 22 additions and 33 deletions.
55 changes: 22 additions & 33 deletions src/tmtccmd/defaults/globals_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,30 @@
LOGGER = get_logger()


def default_add_globals_pre_args_parsing(gui: bool = False):
from tmtccmd.core.globals_manager import update_global
set_default_globals_pre_args_parsing(apid=0xef)
if gui:
default_tcpip_udp_cfg_setup()

service_dict = get_core_service_dict()
update_global(CoreGlobalIds.CURRENT_SERVICE, CoreServiceList.SERVICE_17)
update_global(CoreGlobalIds.SERVICE_DICT, service_dict)
def set_default_globals_pre_args_parsing(
apid: int, com_if_id: int = CoreComInterfaces.TCPIP_UDP, display_mode="long",
tm_timeout: float = 4.0, print_to_file: bool = True, tc_send_timeout_factor: float = 2.0
):
update_global(CoreGlobalIds.APID, apid)
update_global(CoreGlobalIds.COM_IF, com_if_id)
update_global(CoreGlobalIds.TC_SEND_TIMEOUT_FACTOR, tc_send_timeout_factor)
update_global(CoreGlobalIds.TM_TIMEOUT, tm_timeout)
update_global(CoreGlobalIds.DISPLAY_MODE, display_mode)
update_global(CoreGlobalIds.PRINT_TO_FILE, print_to_file)
update_global(CoreGlobalIds.SERIAL_CONFIG, dict())
update_global(CoreGlobalIds.ETHERNET_CONFIG, dict())
pp = pprint.PrettyPrinter()
update_global(CoreGlobalIds.PRETTY_PRINTER, pp)
update_global(CoreGlobalIds.TM_LISTENER_HANDLE, None)
update_global(CoreGlobalIds.COM_INTERFACE_HANDLE, None)
update_global(CoreGlobalIds.TMTC_PRINTER_HANDLE, None)
update_global(CoreGlobalIds.PRINT_RAW_TM, False)
update_global(CoreGlobalIds.RESEND_TC, False)
update_global(CoreGlobalIds.OP_CODE, "0")
update_global(CoreGlobalIds.MODE, CoreModeList.LISTENER_MODE)


def default_add_globals_post_args_parsing(
def set_default_globals_post_args_parsing(
args: argparse.Namespace, custom_mode_list: Union[None, collections.Iterable] = None,
custom_service_list: Union[None, collections.Iterable] = None,
custom_com_if_list: Union[None, collections.Iterable] = None):
Expand Down Expand Up @@ -117,29 +129,6 @@ def get_core_service_dict() -> dict:
return core_service_dict


def set_default_globals_pre_args_parsing(
apid: int, com_if_id: int = CoreComInterfaces.TCPIP_UDP, display_mode="long",
tm_timeout: float = 4.0, print_to_file: bool = True, tc_send_timeout_factor: float = 2.0
):
update_global(CoreGlobalIds.APID, apid)
update_global(CoreGlobalIds.COM_IF, com_if_id)
update_global(CoreGlobalIds.TC_SEND_TIMEOUT_FACTOR, tc_send_timeout_factor)
update_global(CoreGlobalIds.TM_TIMEOUT, tm_timeout)
update_global(CoreGlobalIds.DISPLAY_MODE, display_mode)
update_global(CoreGlobalIds.PRINT_TO_FILE, print_to_file)
update_global(CoreGlobalIds.SERIAL_CONFIG, dict())
update_global(CoreGlobalIds.ETHERNET_CONFIG, dict())
pp = pprint.PrettyPrinter()
update_global(CoreGlobalIds.PRETTY_PRINTER, pp)
update_global(CoreGlobalIds.TM_LISTENER_HANDLE, None)
update_global(CoreGlobalIds.COM_INTERFACE_HANDLE, None)
update_global(CoreGlobalIds.TMTC_PRINTER_HANDLE, None)
update_global(CoreGlobalIds.PRINT_RAW_TM, False)
update_global(CoreGlobalIds.RESEND_TC, False)
update_global(CoreGlobalIds.OP_CODE, "0")
update_global(CoreGlobalIds.MODE, CoreModeList.LISTENER_MODE)


def check_args_in_enum(param: any, enumeration: collections.Iterable,
warning_hint: str) -> Tuple[bool, int]:
"""
Expand Down

0 comments on commit bef9dc2

Please sign in to comment.