Commit 78f18ed6 authored by Jérome Perrin's avatar Jérome Perrin

update gantt widget to support capacity project

reapply 3e1b8dcd
parent 727ab731
......@@ -54,7 +54,10 @@
// station is visible
return (input_data.nodes[station]._class !== "Dream.QueueManagedJob") &&
(input_data.nodes[station]._class !== "Dream.OperatorManagedJob") &&
(input_data.nodes[station]._class !== "Dream.ExitJobShop");
(input_data.nodes[station]._class !== "Dream.ExitJobShop") &&
(input_data.nodes[station]._class !== "Dream.CapacityStationBuffer") &&
(input_data.nodes[station]._class !== "Dream.CapacityStationExit") &&
(input_data.nodes[station]._class !== "Dream.Queue");
}
$.each(
......@@ -73,7 +76,8 @@
duration,
seen_parts = {};
if (obj._class === 'Dream.Job') {
if (obj._class === 'Dream.Job' ||
obj._class === 'Dream.CapacityProject') {
// find the corresponding input
// find the input order and order component for this job
for (node_key in input_data.nodes) {
......@@ -85,7 +89,7 @@
if (order.id === obj.id) {
input_job = input_order = order;
}
if (input_job === null) {
if (input_job === null && order.componentsList) {
for (j = 0; j < order.componentsList.length; j += 1) {
component = order.componentsList[j];
if (component.id === obj.id) {
......@@ -122,11 +126,16 @@
entrance_date = new Date(start_date.getTime());
entrance_date.setTime(entrance_date.getTime() +
schedule.entranceTime * 1000 * 3600);
if (obj.results.schedule[i + 1]) {
duration = obj.results.schedule[i + 1].entranceTime -
schedule.entranceTime;
if (schedule.exitTime) {
duration = (schedule.exitTime - schedule.entranceTime);
} else {
duration = obj.results.completionTime - schedule.entranceTime;
if (obj.results.schedule[i + 1]) {
duration = obj.results.schedule[i + 1].entranceTime -
schedule.entranceTime;
} else {
duration = obj.results.completionTime -
schedule.entranceTime;
}
}
if (duration > 0.0) {
task_start_date = new Date(start_date.getTime());
......
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