Commit b4b229e4 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

render job simulation result in spreadsheet.

parent 2454542a
......@@ -40,6 +40,7 @@
<div class="twelve columns">
<div id="main"></div>
<div id="spreadsheet_input"></div>
</div>
</div>
......@@ -62,6 +63,7 @@
<div>Stations Utilization</div>
<div id="graph"></div>
</div>
<div id="spreadsheet_output"></div>
<div id="debug">
<div class="six columns alpha">
......@@ -76,12 +78,6 @@
</div>
</div>
<div id="spreadsheet" class="sixteen columns">
<h4>Spreadsheet</h4>
<div id="spreadsheet_input"></div>
<div id="spreadsheet_output"></div>
</div>
<!-- DEP -->
<script type="text/javascript" src="lib/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="lib/jquery-ui-1.10.3.custom.min.js"></script>
......
......@@ -313,7 +313,18 @@
failure_data = [],
working_data = [],
ticks = [],
counter = 1;
counter = 1,
spreadsheet_data = [[
"Jobs",
"ID",
"Order Date",
"Due Date",
"Priority",
"Material",
"Entrance Time",
"Station ID",
"Step No."
]];
$.each(data['success'].elementList, function (idx, obj) {
if (obj.results.working_ratio !== undefined) {
/* when there is only one replication, the ratio is given as a float,
......@@ -342,6 +353,23 @@
obj.id].name || obj.id]);
counter++;
}
if (obj._class === 'Dream.Job') {
var property_dict = obj.extraPropertyDict;
$.each(obj['results']['schedule'], function (i, schedule) {
spreadsheet_data.push([
property_dict['name'],
obj['id'],
property_dict['order_date'],
property_dict['due_date'],
property_dict['priority'],
property_dict['material'],
schedule['entranceTime'],
schedule['stationId'],
schedule['stepNumber']
]);
});
}
});
var series = [{
......@@ -377,6 +405,11 @@
};
$.plot("#graph", series, options);
if (spreadsheet_data.length > 1) {
$('#spreadsheet_output').handsontable({
data: spreadsheet_data
});
}
} else {
$("#json_result").effect('shake', 50).val(data['error']);
}
......
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