def setup_mvc_configuration(core_config_path, gui_config_path, runtime_config_path, design_config): """ Loads all configurations from disk :param core_config_path: the path to the core configuration file :param gui_config_path: the path to the gui configuration file :param runtime_config_path: the path to the runtime configuration file :param design_config: the path to the design configuration file :return: """ setup_configuration(core_config_path) # the design config has to be loaded before loading the gui config as it is used by the gui config if design_config: design_config_path, design_config_file = filesystem.separate_folder_path_and_file_name(design_config) global_design_config.load(design_config_file, design_config_path) # the constant has to be overwritten here, # as the singleton was already loaded that hus the wrong INTERFACE_FONT was chosen from rafcon.gui.utils import constants constants.INTERFACE_FONT = global_design_config.get_config_value("PRIMARY_FONT") else: # no design config file specified => check environment variable if os.environ.get('RAFCON_CUSTOM_DESIGN'): design_config = os.environ.get('RAFCON_CUSTOM_DESIGN') design_config_path, design_config_file = filesystem.separate_folder_path_and_file_name(design_config) global_design_config.load(design_config_file, design_config_path) gui_config_path, gui_config_file = filesystem.separate_folder_path_and_file_name(gui_config_path) global_gui_config.load(gui_config_file, gui_config_path) runtime_config_path, runtime_config_file = filesystem.separate_folder_path_and_file_name(runtime_config_path) global_runtime_config.load(runtime_config_file, runtime_config_path)
def setup_mvc_configuration(core_config_path, gui_config_path, runtime_config_path): setup_configuration(core_config_path) gui_config_path, gui_config_file = filesystem.separate_folder_path_and_file_name( gui_config_path) global_gui_config.load(gui_config_file, gui_config_path) runtime_config_path, runtime_config_file = filesystem.separate_folder_path_and_file_name( runtime_config_path) global_runtime_config.load(runtime_config_file, runtime_config_path)
#!/usr/bin/env python import unittest from rafcon.core.start import open_state_machine, setup_configuration import rospkg # A work around for missing libraries prompting user interaction # https://github.com/DLR-RM/RAFCON/issues/838 import rafcon.core.interface from rafcon.core.states.library_state import LibraryState rafcon.core.interface.show_notice_func = lambda *args, **kwargs: None rafcon.core.interface.open_folder_func = lambda *args, **kwargs: None setup_configuration(None) rospack = rospkg.RosPack() def get_missing_states(sm): """ Finds the IDs of any states that failed to load :param sm: the state machine to recursively search for missing states :return: a list of IDs of missing states """ missing_list = [] for id, state in sm.states.items(): if state.name == "LIBRARY NOT FOUND DUMMY STATE": missing_list.append(id) elif isinstance(state, LibraryState): # This is a successfully loaded leaf state continue else: