modified static files commited

parent f7c5629a
......@@ -21,7 +21,7 @@
}
throw error;
}).push(function(sim_json) {
var document_list = JSON.parse(sim_json), result_list = [], i;
var document_list = JSON.parse(sim_json).result.result_list, result_list = [], i;
for (i = 0; i < document_list.length; i += 1) {
result_list.push(RSVP.all([ gadget.whoWantsToDisplayThisResult(gadget.props.jio_key, i), document_list[i].score, document_list[i].key ]));
}
......
......@@ -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>
......@@ -11,9 +11,18 @@
_id: gadget.props.jio_key,
_attachment: "simulation.json"
}).push(function(result_json) {
var result = JSON.parse(result_json);
gadget.props.element.querySelector(".json_input").textContent = JSON.stringify(result[gadget.props.result].input, undefined, " ");
gadget.props.element.querySelector(".json_output").textContent = JSON.stringify(result[gadget.props.result].result, undefined, " ");
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(input, undefined, " ");
gadget.props.element.querySelector(".json_output").textContent = JSON.stringify(result[gadget.props.result], undefined, " ");
gadget.props.element.querySelector(".json_configuration").textContent = JSON.stringify(configuration, undefined, " ");
});
});
})(window, rJS, initGadgetMixin);
\ No newline at end of file
......@@ -16,8 +16,8 @@
return a + b;
}) / attainment_list.length * 100).toFixed(2);
}
function calculate_exit_stat(data) {
var output_data = data.result, input_data = data.input, elementList = output_data.elementList, i, j, metric, metric_value, element, interval_value, interval_list, attainment_list, throughputTarget = input_data.general.throughputTarget, result = "";
function calculate_exit_stat(result_index, data) {
var output_data = data.result.result_list[result_index], elementList = output_data.elementList, i, j, metric, metric_value, element, interval_value, interval_list, attainment_list, throughputTarget = data.general.throughputTarget, result = "";
for (i = 0; i < elementList.length; i += 1) {
element = elementList[i];
if (element.family === "Exit") {
......@@ -93,7 +93,7 @@
_id: gadget.props.jio_key,
_attachment: "simulation.json"
}).push(function(simulation_json) {
var result = calculate_exit_stat(JSON.parse(simulation_json)[gadget.props.result]);
var result = calculate_exit_stat(gadget.props.result, JSON.parse(simulation_json));
gadget.props.element.innerHTML = result;
});
});
......
......@@ -27,7 +27,7 @@
_id: gadget.props.jio_key,
_attachment: "simulation.json"
}).push(function(simulation_json) {
gadget.props.series = queue_stat_widget(JSON.parse(simulation_json)[gadget.props.result].result);
gadget.props.series = queue_stat_widget(JSON.parse(simulation_json).result.result_list[gadget.props.result]);
});
}).declareMethod("startService", function() {
// XXX Manually calculate width and height when resizing
......
......@@ -106,7 +106,7 @@
_id: gadget.props.jio_key,
_attachment: "simulation.json"
}).push(function(simulation_json) {
gadget.props.result_list = station_utilisation_graph_widget(JSON.parse(simulation_json)[gadget.props.result].result);
gadget.props.result_list = station_utilisation_graph_widget(JSON.parse(simulation_json).result.result_list[gadget.props.result]);
});
}).declareMethod("startService", function() {
// XXX Manually calculate width and height when resizing
......
......@@ -107,7 +107,7 @@
_attachment: "simulation.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 + " " + document_list[options.result].key;
});
} else {
......
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