Example #1
0
def component_dashboard(page):
    #try:
        component_registry = Registry()
        print("COMPONENTS AVAILABLE")
        print(component_registry)
        print(component_registry.agent_list())
        return render_template('developer_base.html', registry=component_registry)
Example #2
0
def display_mes_run_sequence_diagram():
    system_run_log_dir = request.args.get('system_run_log_dir')
    component_registry = Registry()
    system_run_output = component_registry.get_system_run_output(system_run_log_dir)
    sequence_file = component_registry.read_mes_run_sequence_file(system_run_log_dir)

    return render_template('display_mes_run_sequence_diagram.html', system_run_output=system_run_output,
        sequence_file=sequence_file)
Example #3
0
def view_system_run_output():
    system_run_log_dir = request.args.get('system_run_log_dir')
    run_code = request.args.get("run_code")
    
    component_registry = Registry()

    if system_run_log_dir is not None:
        system_run_output = component_registry.get_system_run_output(system_run_log_dir)
    else:
        system_run_output = component_registry.get_system_run_output_by_run_code(run_code)

    return render_template('view_system_run_output.html', system_run_output=system_run_output)
Example #4
0
def component_view():
    #try:
    mes_directory = request.args.get('mes_directory')
    component_registry = Registry()
    component_type = request.args.get('component_type')
    component_name = request.args.get('component_name')
    component_details = component_registry.get_mes_component_details(component_name)
    component_source = component_registry.get_component_source_file(component_name)
    property_list = component_registry.get_mes_component_properties(component_name)
    return render_template('component_view.html', component_details=component_details,
                           component_name=component_name,
                           component_type=component_type,
                           component_source=component_source,
                           property_list=property_list)
Example #5
0
def show(page):
    if 'admin-user' not in session.keys():
        return render_template('admin_login.html')
    else:
        working_dir = os.getcwd()
        mes_folders = [ f for f in os.scandir(working_dir) if f.is_dir() and f.name[0] != "."]
        component_registry = Registry()
        return render_template('mes_library.html', mes_folders=mes_folders, registry=component_registry)
Example #6
0
def mes_components():
    #try:
        mes_directory = request.args.get('mes_directory')
        title = mes_directory + " - Components"
        working_dir = os.path.join(os.getcwd(), mes_directory)
        component_registry = Registry()
        component_registry.clear_contents()
        component_registry.examine_directory(working_dir)
        return render_template('mes_components.html',  title=title, mes_directory=mes_directory, registry=component_registry)
Example #7
0
        def admin_json(json):
            print("Received a json message to admin...")
            command = json["command"]
            payload = json["payload"]

            if command == "register_admin":
                join_room("admin")
            if command == "start_subject_experiment":
                subject_directory = SubjectDirectory()
                if not subject_directory.experiment_status():   
                    emit('experiment_status_message', {'response': 'status', 'payload': {'status': 'Started'}})
                    subject_directory.start_experiment()
                    configuration = payload["configuration"]
                    component_registry = Registry()
                    working_dir = os.path.join(os.getcwd())
                    simulation_library = MESSimulationLibrary()
                    simulation_library.list_human_subject_files_directory(working_dir)
                    simulation = simulation_library.get_simulation_by_filename(configuration)
                    actor_system = ActorSystemConnector()
                    working_dir = os.path.join(os.getcwd())
                    actor_system.run_human_subject_experiment(working_dir, configuration, simulation["description"].to_hash(), subject_directory.get_subjects())
Example #8
0
def mes_run_simulation():
    mes_directory = request.args.get('mes_directory')
    configuration = request.args.get('configuration')
    component_registry = Registry()


    title = mes_directory + " - " + configuration + " - Configuration"
    working_dir = os.path.join(os.getcwd(), mes_directory)
    simulation_library = MESSimulationLibrary()
    simulation_library.list_simulation_files_directory(working_dir)
    simulation = simulation_library.get_simulation_by_filename(configuration)

    actor_system = ActorSystemConnector()
    working_dir = os.path.join(os.getcwd(), mes_directory)
    #actor_system.send_message()
    #actor_system.run_simulation(working_dir, simulation["description"].to_hash())
    actor_system.run_simulation(working_dir, configuration, simulation["description"].to_hash())


    # sim_controller = SimulationController()
    # sim_controller.process_configuration(simulation["source_file"])

    return redirect("/status")
Example #9
0
def agent_type_list():
    component_registry = Registry()
    agent_types = [agent_type for agent_type in component_registry.agent_list()]
    return jsonify(agent_types=agent_types)
Example #10
0
def test_runner():
    component_registry = Registry()
    return render_template('test_runner.html', registry=component_registry)
Example #11
0
def simulation_builder():
    component_registry = Registry()
    return render_template('simulation_builder.html', registry=component_registry)
Example #12
0
def mes_results():
    mes_directory = request.args.get('mes_directory')

    component_registry = Registry()
    system_runs = component_registry.get_system_runs()
    return render_template('system_runs.html', system_runs=system_runs)
Example #13
0
def display_mes_run_data():
    system_run_log_dir = request.args.get('system_run_log_dir')
    component_registry = Registry()
    mes_data_log = component_registry.get_system_data_log(system_run_log_dir)
    json_data_log = json.dumps(mes_data_log)
    return render_template('display_mes_run_data.html', mes_data_log=json_data_log)
Example #14
0
def display_mes_run_configuration():
    system_run_log_dir = request.args.get('system_run_log_dir')
    component_registry = Registry()
    mes_configuration = component_registry.get_system_run_configuration(system_run_log_dir)
    return render_template('display_mes_run_configuration.html', simulation=mes_configuration)
Example #15
0
def system_runs():
    component_registry = Registry()
    system_runs = component_registry.get_system_runs()
    return render_template('system_runs.html', system_runs=system_runs)