Exemplo n.º 1
0
        public Batch(Line line, string name, string type, int capacity, int batchId, int typeId, int length, int takt)
        {
            this.id       = batchId;
            this.typeId   = typeId;
            this.name     = name;
            this.type     = type;
            this.capacity = capacity;
            this.line     = line;
            this.takt     = takt;
            this.length   = length;

            this.map = null; //x new BatchMap(this, this.line);
            this.incompleteProducts = new Queue <Product>();
        }
Exemplo n.º 2
0
        public ProductMap(Product owner, BatchMap batchMap, LogProvider logProvider)
        {
            this.owner = owner;
            this.myLog = logProvider;

            //
            // copy from Batch Mapt
            marker = null;
            int i = 0;
            LinkedListNode <BatchMapItem> enBatchMapItem = batchMap.First;

            while (enBatchMapItem != null)
            {
                // create main item in product map
                MapItem newProductMapItem = new MapItem("NA", enBatchMapItem.Value.LineStation, enBatchMapItem.Value.LineStation.Name, ++i);
                this.AddLast(newProductMapItem);

                //this.myLog.LogAlert(AppLog.AlertType.System, this.GetType().ToString(), "Product " + owner.Name + ", add map item: " + enBatchMapItem.Value.LineStation.Name);

                // check and create assistant items for current main item in product map
                List <BatchMapItem> assistLineStations = enBatchMapItem.Value.AssistLineStations;
                int assist_count = assistLineStations.Count;
                if (assist_count > 0)
                {
                    // read all elements in assistant list
                    for (int j = 0; j < assist_count; j++)
                    {
                        // get first element and move it to the end
                        BatchMapItem enBatchMapAssistItem = assistLineStations.First();
                        assistLineStations.RemoveAt(0);
                        assistLineStations.Add(enBatchMapAssistItem);

                        // create new assist map item for product
                        MapItem newAssisttMapItem = new MapItem("NA", enBatchMapAssistItem.LineStation, enBatchMapAssistItem.LineStation.Name, j);
                        newProductMapItem.AssistLineStations.Add(newAssisttMapItem);

                        //this.myLog.LogAlert(AppLog.AlertType.System, this.GetType().ToString(), "Product " + owner.Name + ", add assist map item: " + enBatchMapAssistItem.LineStation.Name);
                    }
                }

                enBatchMapItem = enBatchMapItem.Next;
            }
        }