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 fdca8f31
......@@ -42,7 +42,7 @@
throw error;
})
.push(function (sim_json) {
var document_list = JSON.parse(sim_json),
var document_list = JSON.parse(sim_json).result.result_list,
result_list = [],
i;
for (i = 0; i < document_list.length; i += 1) {
......
......@@ -14,5 +14,7 @@
<textarea spellcheck="false" rows="20" name="json_input" class="json_input"></textarea>
<label for="json_output">Output</label>
<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>
</html>
......@@ -23,11 +23,25 @@
"_attachment": "simulation.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 =
JSON.stringify(result[gadget.props.result].input, undefined, " ");
JSON.stringify(input, undefined, " ");
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 @@
) / attainment_list.length) * 100).toFixed(2);
}
function calculate_exit_stat(data) {
var output_data = data.result,
input_data = data.input,
function calculate_exit_stat(result_index, data) {
var output_data = data.result.result_list[result_index],
elementList = output_data.elementList,
i,
j,
......@@ -50,7 +49,7 @@
interval_value,
interval_list,
attainment_list,
throughputTarget = input_data.general.throughputTarget,
throughputTarget = data.general.throughputTarget,
result = "";
for (i = 0; i < elementList.length; i += 1) {
......@@ -149,7 +148,7 @@
})
.push(function (simulation_json) {
var result = calculate_exit_stat(
JSON.parse(simulation_json)[gadget.props.result]
gadget.props.result, JSON.parse(simulation_json)
);
gadget.props.element.innerHTML = result;
});
......
......@@ -40,7 +40,8 @@
})
.push(function (simulation_json) {
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 @@
})
.push(function (simulation_json) {
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 @@
});
})
.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 + " " +
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