Beispiel #1
0
        private static List <FabLot> CreateCellInputLot(this CellInProfile profile)
        {
            List <FabLot> list = new List <FabLot>();

            var infos = profile.CellInfos;

            if (infos == null || infos.Count == 0)
            {
                return(list);
            }

            var     prod = profile.Product;
            FabStep step = prod.Process.FirstStep as FabStep;

            foreach (InInfo info in infos)
            {
                DateTime avalableTime = info.ReleaseTime;
                int      unitQty      = info.Qty;

                string     lotID = EntityHelper.CreateCellInLotID(prod);
                FabWipInfo wip   = CreateHelper.CreateWipInfo(lotID, prod, step, unitQty);

                FabLot lot = CreateHelper.CreateLot(wip, Mozart.SeePlan.Simulation.LotState.CREATE);

                lot.ReleaseTime   = LcdHelper.Max((DateTime)avalableTime, ModelContext.Current.StartTime);
                lot.LotState      = Mozart.SeePlan.Simulation.LotState.CREATE;
                lot.FrontInTarget = info.InTarget;

                list.Add(lot);
            }

            return(list);
        }
Beispiel #2
0
        private static ShopInTarget FirstTarget(this CellInProfile profile)
        {
            var list = profile.InTargets;

            if (list == null || list.Count == 0)
            {
                return(null);
            }

            return(list.FirstOrDefault());
        }
Beispiel #3
0
        private static void AddOutInfos(this CellInProfile profile, string shopID, List <ProfileItem> outInfos)
        {
            if (outInfos == null || outInfos.Count == 0)
            {
                return;
            }

            var list = BopHelper.IsArrayShop(shopID) ? profile.ArrayInfos : profile.CFInfos;

            foreach (var info in outInfos)
            {
                AddInfo(list, info);
            }
        }
Beispiel #4
0
        private static bool HasRemainMatQty(this CellInProfile profile)
        {
            bool hasArray = HasRemainQty(profile.ArrayInfos);

            if (hasArray == false)
            {
                return(false);
            }

            bool hasCf = HasRemainQty(profile.CFInfos);

            if (hasCf == false)
            {
                return(false);
            }

            return(true);
        }
Beispiel #5
0
        private static void Allocate(this CellInProfile profile)
        {
            int lotSize = SeeplanConfiguration.Instance.LotUnitSize;
            int maxQty  = int.MaxValue;

            var inTarget = profile.FirstTarget();

            if (inTarget != null)
            {
                maxQty = (int)inTarget.TargetQty;

                //remove in target
                profile.InTargets.Remove(inTarget);
            }

            int allocQty = 0;

            while (true)
            {
                if (allocQty >= maxQty)
                {
                    break;
                }

                var minfo = profile.GetMatQtyInfo(lotSize);

                DateTime matTime = minfo.Item1;
                int      matQty  = minfo.Item2;

                if (matQty <= 0)
                {
                    break;
                }

                profile.AddCellInQty(matTime, matQty, inTarget);

                //remove out profile
                profile.RemoveOutProfile(matQty);
            }
        }
Beispiel #6
0
        private static int CellInProfileComparer(CellInProfile x, CellInProfile y)
        {
            if (object.ReferenceEquals(x, y))
            {
                return(0);
            }

            var xt = x.FirstTarget();
            var yt = y.FirstTarget();

            bool null_x = xt == null;
            bool null_y = yt == null;

            int cmp = null_x.CompareTo(null_y);

            if (null_x || null_y)
            {
                return(cmp);
            }

            if (cmp == 0)
            {
                cmp = xt.TargetDate.CompareTo(yt.TargetDate);
            }

            if (cmp == 0)
            {
                cmp = xt.TargetQty.CompareTo(yt.TargetQty) * -1;
            }

            //low level
            if (cmp == 0)
            {
                cmp = string.Compare(x.ProductID, y.ProductID);
            }

            return(cmp);
        }
Beispiel #7
0
        private static Tuple <DateTime, int> GetMatQtyInfo(this CellInProfile profile, int targetQty)
        {
            Time xtat = Time.FromMinutes(BANK_TAT_ARRAY);
            Time ytat = Time.FromMinutes(BANK_TAT_CF);

            //필요수량(targetQty) 기준으로 체크
            var x = GetQtyInfo(profile.ArrayInfos, targetQty);

            DateTime xtime = x.Item1.AddMinutes(xtat.TotalMinutes);
            int      xqty  = x.Item2;

            //사용수량(array) 기준으로 체크
            var y = GetQtyInfo(profile.ArrayInfos, xqty);

            DateTime ytime = y.Item1.AddMinutes(ytat.TotalMinutes);
            int      yqty  = y.Item2;

            DateTime matTime = LcdHelper.Max(xtime, ytime);
            int      matQty  = yqty;

            Tuple <DateTime, int> info = new Tuple <DateTime, int>(matTime, matQty);

            return(info);
        }
Beispiel #8
0
 private static void RemoveOutProfile(this CellInProfile profile, int qty)
 {
     RemoveQty(profile.ArrayInfos, qty);
     RemoveQty(profile.CFInfos, qty);
 }
Beispiel #9
0
        private static void AddCellInQty(this CellInProfile profile, DateTime matTime, int matQty, ShopInTarget inTarget)
        {
            InInfo info = CreateHelper.CreateInInfo(profile, matTime, matQty, inTarget);

            AddInfo(profile.CellInfos, info);
        }