예제 #1
0
        private static DateTime GetAvailableSetupTime(FabAoEquipment eqp, DateTime now)
        {
            DateTime availableTime = eqp.AvailableSetupTime;

            //마스크 사용시
            if (eqp.InUseMask != null)
            {
                //실제Setup시 Seize된 툴이 들어옴. 현재 이전의 LoadInfo을 참조해야함.
                if (eqp.InUseMask.LoadInfos.Count > 1)
                {
                    MaskLoadInfo loadInfo = eqp.InUseMask.LoadInfos[eqp.InUseMask.LoadInfos.Count - 2];
                    if (loadInfo.EqpID != eqp.EqpID)
                    {
                        availableTime = LcdHelper.Max(eqp.AvailableSetupTime, (DateTime)loadInfo.AvailableTime);

                        if (availableTime > now)
                        {
                            availableTime = now;
                        }
                    }
                }
            }

            return(availableTime);
        }
예제 #2
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);
        }
예제 #3
0
        public static float CheckAheadSetupTime(this FabAoEquipment eqp, float setupTime, FabLot lot)
        {
            DateTime now = eqp.NowDT;
            float    addIdleSetupTime = 0f;

            string stepID    = lot.CurrentStepID;
            string productID = lot.CurrentProductID;

            if (setupTime > 0 && eqp.AvailableSetupTime < now)
            {
                DateTime availableTime   = GetAvailableSetupTime(eqp, now);
                DateTime aheadSetupStart = LcdHelper.Max(availableTime, (now.AddMinutes(-setupTime)));

                //IDLE에 따른 추가 Setup시간 반영 (AheadSetup에 따라 Idle 시간이 판단됨, 추가 IDLE_SETUP TIME은 Ahead미반영)
                addIdleSetupTime = SetupMaster.GetAdditionalSetupTime(eqp, stepID, productID, aheadSetupStart);
                if (addIdleSetupTime > 0)
                {
                    lot.CurrentFabPlan.IsIdleSetup = true;
                }

                if (aheadSetupStart < now)
                {
                    setupTime = setupTime - (float)(now - aheadSetupStart).TotalMinutes;
                    eqp.AvailableSetupTime = aheadSetupStart;

                    if (setupTime == 0 && addIdleSetupTime == 0)
                    {
                        eqp.OnStateChanged(LoadingStates.SETUP, lot);
                    }
                }
                else
                {
                    eqp.AvailableSetupTime = DateTime.MaxValue;
                }

                return(setupTime + addIdleSetupTime);
            }

            //AheadSetup이 아닐 경우(또는 Setup시간이 0 이지만 추가 Setup이 있을 경우 Setup을 함)
            //기존: Setup이 필요하지만 Setup시간이 0이면 Setup을 하지 않음
            //변경 : Setup이 필요하지만 Setup시간이 0 이어도 추가 Setup 정보가 있을 경우 Setup을 함.
            addIdleSetupTime = SetupMaster.GetAdditionalSetupTime(eqp, stepID, productID, now);
            if (addIdleSetupTime > 0)
            {
                lot.CurrentFabPlan.IsIdleSetup = true;
            }

            setupTime += addIdleSetupTime;

            return(setupTime);
        }
예제 #4
0
        private static void Allocate_State(this DcnBucket bck, EqpStatusInfo info, DateTime startTime, DateTime endTime, DateTime now)
        {
            if (info == null)
            {
                return;
            }

            if (info.Duration <= 0)
            {
                return;
            }

            DateTime st = LcdHelper.Max(info.StartTime, startTime);
            DateTime et = LcdHelper.Min(info.EndTime, endTime);

            if (st < et)
            {
                DcnPlan plan = new DcnPlan()
                {
                    Product      = null,
                    Target       = null,
                    AllocQty     = 0,
                    TactTime     = 0,
                    EqpStartTime = st,
                    EqpEndTime   = et,
                    AllocTime    = now,
                    EqpID        = bck.EqpID,
                    EqpState     = info.MesStatus.ToString()
                };

                bck.LastEqpEndTime = et;
                bck.Plans.Add(plan);
            }

            if (info.EndTime > et)
            {
                info.StartTime = et;
            }
            else
            {
                //clear
                info.StartTime = DateTime.MinValue;
                info.EndTime   = DateTime.MinValue;
            }
        }
예제 #5
0
        private static void DoReserveBatch(this DcnMaster mst, DateTime now)
        {
            AoBatchRelease inputBatch = AoFactory.Current.BatchRelease;

            foreach (DcnPlan plan in mst.Current)
            {
                FabProduct prod = plan.Product;
                if (prod == null)
                {
                    continue;
                }

                FabStep step = prod.Process.FirstStep as FabStep;
                if (step == null)
                {
                    continue;
                }

                string lotID   = EntityHelper.CreateFrontInLotID(prod);
                double unitQty = plan.AllocQty;

                FabWipInfo wip = CreateHelper.CreateWipInfo(lotID, prod, step, unitQty);
                FabLot     lot = CreateHelper.CreateLot(wip, LotState.CREATE);

                DateTime releaseTime = LcdHelper.Max(plan.EqpEndTime, now);

                lot.ReleaseTime = releaseTime;
                lot.LotState    = LotState.CREATE;
                lot.ReleasePlan = plan;

                var inTarget = plan.Target == null ? null : plan.Target.InTarget;
                lot.FrontInTarget = inTarget;

                inputBatch.AddEntity(releaseTime, lot);
            }
        }
예제 #6
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);
        }