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);
            }
        }
Esempio n. 2
0
        public GanttChart(IEnumerable <ProductionOrderOperation> productionOrderOperations)
        {
            foreach (var productionOrderOperation in productionOrderOperations)
            {
                GanttChartBar ganttChartBar = new GanttChartBar();
                T_ProductionOrderOperation tProductionOrderOperation = productionOrderOperation.GetValue();

                ganttChartBar.operation   = productionOrderOperation.GetId().ToString();
                ganttChartBar.operationId = tProductionOrderOperation.Id.ToString();
                if (tProductionOrderOperation.Resource == null)
                {
                    tProductionOrderOperation.Resource = _dbMasterDataCache
                                                         .M_ResourceGetById(new Id(tProductionOrderOperation.ResourceId
                                                                                   .GetValueOrDefault())).GetValue();
                }

                ganttChartBar.resource = tProductionOrderOperation.Resource.ToString();
                ganttChartBar.start    = tProductionOrderOperation.Start.ToString();
                ganttChartBar.end      = tProductionOrderOperation.End.ToString();

                ganttChartBar.groupId = productionOrderOperation.GetProductionOrderId().ToString();

                AddGanttChartBar(ganttChartBar);
            }
        }
Esempio n. 3
0
 public void AddGanttChartBar(GanttChartBar ganttChartBar)
 {
     _ganttChartBars.Add(ganttChartBar);
 }