Commit 357226fe authored by Jérome Perrin's avatar Jérome Perrin

Output_viewJobGantt: update to new format

parent 98450047
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
return obj.parent ? "sub_task" : ""; return obj.parent ? "sub_task" : "";
}; };
function job_gantt_widget(all_data) { function job_gantt_widget(data, result_id) {
// XXX: use dhx_gantt zoom level feature ( // XXX: use dhx_gantt zoom level feature (
// http://dhtmlx.com/docs/products/dhtmlxGantt/02_features.html ) // http://dhtmlx.com/docs/products/dhtmlxGantt/02_features.html )
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
], ],
link: [] link: []
}, },
input_data = all_data.input, input_data = data,
output_data = all_data.result; output_data = data.result.result_list[result_id];
// temporary hack // temporary hack
now.setHours(0); now.setHours(0);
...@@ -54,8 +54,8 @@ ...@@ -54,8 +54,8 @@
function isVisibleStation(station) { function isVisibleStation(station) {
// we should be able to define in the backend which // we should be able to define in the backend which
// station is visible // station is visible
return (input_data.nodes[station].family !== 'Buffer' && return (input_data.graph.node[station].family !== 'Buffer' &&
input_data.nodes[station].family !== 'Exit'); input_data.graph.node[station].family !== 'Exit');
} }
$.each( $.each(
...@@ -77,9 +77,9 @@ ...@@ -77,9 +77,9 @@
if (obj.family === 'Job') { if (obj.family === 'Job') {
// find the corresponding input // find the corresponding input
// find the input order and order component for this job // find the input order and order component for this job
for (node_key in input_data.nodes) { for (node_key in input_data.graph.node) {
if (input_data.nodes.hasOwnProperty(node_key)) { if (input_data.graph.node.hasOwnProperty(node_key)) {
node = input_data.nodes[node_key]; node = input_data.graph.node[node_key];
if (node.wip) { if (node.wip) {
for (i = 0; i < node.wip.length; i += 1) { for (i = 0; i < node.wip.length; i += 1) {
order = node.wip[i]; order = node.wip[i];
...@@ -226,7 +226,7 @@ ...@@ -226,7 +226,7 @@
}) })
.push(function (simulation_json) { .push(function (simulation_json) {
gadget.props.result = job_gantt_widget( gadget.props.result = job_gantt_widget(
JSON.parse(simulation_json)[gadget.props.result] JSON.parse(simulation_json), gadget.props.result
); );
}); });
}) })
......
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