Esempio n. 1
0
        public GanttChart(IDirectedGraph <INode> orderOperationGraph)
        {
            Dictionary <Id, List <Interval> > groups = new Dictionary <Id, List <Interval> >();

            foreach (var graphNode in orderOperationGraph.GetNodes())
            {
                IScheduleNode node = graphNode.GetNode().GetEntity();
                if (node.GetType() != typeof(ProductionOrderOperation) && node.GetType() != typeof(PurchaseOrderPart))
                {
                    continue;
                }
                GanttChartBar ganttChartBar = new GanttChartBar();

                ganttChartBar.operation   = node.GetId().ToString();
                ganttChartBar.operationId = node.GetId().ToString();
                ganttChartBar.resource    = DetermineFreeGroup(groups,
                                                               new Interval(node.GetId(), node.GetStartTimeBackward(), node.GetEndTimeBackward())).ToString();

                ;
                ganttChartBar.start = node.GetStartTimeBackward().GetValue().ToString();
                ganttChartBar.end   = node.GetEndTimeBackward().GetValue().ToString();

                ganttChartBar.groupId = ganttChartBar.resource;

                AddGanttChartBar(ganttChartBar);
            }
        }