Commit 3d5e1b18 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Jérome Perrin

modules modified to addapt to the newly introduced method to store results...

modules modified to addapt to the newly introduced method to store results within the one all-inclusive-file
parent 318f3cc5
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
throw error; throw error;
}) })
.push(function (sim_json) { .push(function (sim_json) {
var document_list = JSON.parse(sim_json), var document_list = JSON.parse(sim_json).result.result_list,
result_list = [], result_list = [],
i; i;
for (i = 0; i < document_list.length; i += 1) { for (i = 0; i < document_list.length; i += 1) {
......
...@@ -14,5 +14,7 @@ ...@@ -14,5 +14,7 @@
<textarea spellcheck="false" rows="20" name="json_input" class="json_input"></textarea> <textarea spellcheck="false" rows="20" name="json_input" class="json_input"></textarea>
<label for="json_output">Output</label> <label for="json_output">Output</label>
<textarea spellcheck="false" rows="20" name="json_output" class="json_output"></textarea> <textarea spellcheck="false" rows="20" name="json_output" class="json_output"></textarea>
<label for="json_output">Configuration</label>
<textarea spellcheck="false" rows="20" name="json_configuration" class="json_configuration"></textarea>
</body> </body>
</html> </html>
...@@ -23,11 +23,25 @@ ...@@ -23,11 +23,25 @@
"_attachment": "simulation.json" "_attachment": "simulation.json"
}) })
.push(function (result_json) { .push(function (result_json) {
var result = JSON.parse(result_json); var document = JSON.parse(result_json),
result = document.result.result_list,
input = {"input" : document.input,
"graph" : document.graph,
"general" : document.general},
configuration = {"application_configuration" :
document.application_configuration,
"class_definition" : document.class_definition,
"constrains" : document.constrains};
gadget.props.element.querySelector(".json_input").textContent = gadget.props.element.querySelector(".json_input").textContent =
JSON.stringify(result[gadget.props.result].input, undefined, " "); JSON.stringify(input, undefined, " ");
gadget.props.element.querySelector(".json_output").textContent = gadget.props.element.querySelector(".json_output").textContent =
JSON.stringify(result[gadget.props.result].result, undefined, " "); JSON.stringify(result[gadget.props.result], undefined, " ");
gadget.props.element
.querySelector(".json_configuration").textContent =
JSON.stringify(configuration, undefined, " ");
}); });
}); });
......
...@@ -38,9 +38,8 @@ ...@@ -38,9 +38,8 @@
) / attainment_list.length) * 100).toFixed(2); ) / attainment_list.length) * 100).toFixed(2);
} }
function calculate_exit_stat(data) { function calculate_exit_stat(result_index, data) {
var output_data = data.result, var output_data = data.result.result_list[result_index],
input_data = data.input,
elementList = output_data.elementList, elementList = output_data.elementList,
i, i,
j, j,
...@@ -50,7 +49,7 @@ ...@@ -50,7 +49,7 @@
interval_value, interval_value,
interval_list, interval_list,
attainment_list, attainment_list,
throughputTarget = input_data.general.throughputTarget, throughputTarget = data.general.throughputTarget,
result = ""; result = "";
for (i = 0; i < elementList.length; i += 1) { for (i = 0; i < elementList.length; i += 1) {
...@@ -149,7 +148,7 @@ ...@@ -149,7 +148,7 @@
}) })
.push(function (simulation_json) { .push(function (simulation_json) {
var result = calculate_exit_stat( var result = calculate_exit_stat(
JSON.parse(simulation_json)[gadget.props.result] gadget.props.result, JSON.parse(simulation_json)
); );
gadget.props.element.innerHTML = result; gadget.props.element.innerHTML = result;
}); });
......
...@@ -40,7 +40,8 @@ ...@@ -40,7 +40,8 @@
}) })
.push(function (simulation_json) { .push(function (simulation_json) {
gadget.props.series = queue_stat_widget( gadget.props.series = queue_stat_widget(
JSON.parse(simulation_json)[gadget.props.result].result JSON.parse(simulation_json)
.result.result_list[gadget.props.result]
); );
}); });
}) })
......
...@@ -146,7 +146,8 @@ ...@@ -146,7 +146,8 @@
}) })
.push(function (simulation_json) { .push(function (simulation_json) {
gadget.props.result_list = station_utilisation_graph_widget( gadget.props.result_list = station_utilisation_graph_widget(
JSON.parse(simulation_json)[gadget.props.result].result JSON.parse(simulation_json)
.result.result_list[gadget.props.result]
); );
}); });
}) })
......
...@@ -295,7 +295,7 @@ ...@@ -295,7 +295,7 @@
}); });
}) })
.push(function (sim_json) { .push(function (sim_json) {
var document_list = JSON.parse(sim_json); var document_list = JSON.parse(sim_json).result.result_list;
return document_list[options.result].score + " " + return document_list[options.result].score + " " +
document_list[options.result].key; document_list[options.result].key;
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment