Example #1
0
def launch(launch_name):
    """
    render the specified launch setting page
    :param launch_name: the launch type
    :return: the render template of specified launch setting page
    """
    print('launch: ', launch_name)
    board_info, board_type, scenario_config, launch_config = \
        get_xml_configs(launch_name.startswith('user_defined_'))
    print(board_info, scenario_config, launch_config)

    if launch_name.startswith('user_defined_'):
        launch_config.set_curr(launch_name[13:])
    else:
        launch_config.set_curr(launch_name)

    launch_item_values = {}
    if board_info is not None:
        launch_item_values = get_launch_item_values(
            os.path.join(os.path.dirname(os.path.abspath(__file__)), 'res', board_info + '.xml'))

    print('launch_item_values: ', launch_item_values)

    return render_template('launch.html', board_info_list=get_board_list(),
                           board_info=board_info, board_type=board_type,
                           scenarios=scenario_config.list_all(xml_type='scenario'),
                           launches=launch_config.list_all(xml_type='uos_launcher'),
                           launch=launch_name, root=launch_config.get_curr_root(),
                           scenario=current_app.config.get('SCENARIO'),
                           launch_item_values=launch_item_values)
Example #2
0
def launch(launch_name):
    """
    render the specified launch setting page
    :param launch_name: the launch type
    :return: the render template of specified launch setting page
    """
    board_info, board_type, scenario_config, launch_config = get_xml_configs()
    (bios_info, base_board_info) = get_board_info(board_info)

    launch_config.set_curr(launch_name)

    launch_item_values = {}
    if board_info is not None:
        launch_item_values = get_launch_item_values(
            os.path.join(os.path.dirname(os.path.abspath(__file__)), 'res', board_info + '.xml'))

    scenario_name = None
    launch_config_root = launch_config.get_curr_root()
    if launch_config_root is not None and 'scenario' in launch_config_root.attrib:
        scenario_name = launch_config_root.attrib['scenario']
    post_launch_vm_list = get_post_launch_vm_list(scenario_name)

    return render_template('launch.html', board_info_list=get_board_list(),
                           board_info=board_info, board_type=board_type,
                           bios_info=bios_info, base_board_info=base_board_info,
                           scenarios=scenario_config.list_all(xml_type='scenario'),
                           launches=launch_config.list_all(xml_type='uos_launcher'),
                           launch=launch_name, root=launch_config.get_curr_root(),
                           scenario=current_app.config.get('SCENARIO'),
                           post_launch_vm_list=post_launch_vm_list,
                           launch_item_values=launch_item_values)