Esempio n. 1
0
        /// <summary>
        /// </summary>
        /// <param name="hb"/>
        /// <param name="bucketer"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public Time GET_BUCKET_TIME0(IHandlingBatch hb, AoBucketer bucketer, ref bool handled, Time prevReturnValue)
        {
            FabStep step = hb.CurrentStep as FabStep;
            FabLot  lot  = hb.Sample as FabLot;

            string productID = lot.CurrentProductID;
            var    tatInfo   = step.GetTat(productID, true);

            if (tatInfo == null)
            {
                return(Time.Zero);
            }

            Time remainTime = Time.FromMinutes(tatInfo.TAT);

            //Wip 초기화시 TrackIn 반영
            if (lot.IsWipHandle)
            {
                Time now      = bucketer.Now;
                bool isRunWip = lot.Wip.CurrentState == EntityState.RUN;
                Time stateTat = isRunWip ? tatInfo.RunTat : tatInfo.WaitTat;

                //current state
                DateTime stateInTime = lot.Wip.WipStateTime;

                if (lot.Wip.IsInputLot)
                {
                    stateInTime = lot.ReleaseTime;
                }
                else if (lot.Wip.CurrentState == EntityState.HOLD)
                {
                    stateInTime = lot.HoldStartTime;
                }

                Time stayTime = now - stateInTime;
                remainTime = Time.Max(stateTat - stayTime, Time.Zero);

                //+ runTat (run wip 제외)
                if (isRunWip == false)
                {
                    remainTime += tatInfo.RunTat;
                }

                //Max(defaultMinBucketTime, minBucketTime) (2020.03.11 - by.liujian(유건))
                Time defaultMinBucketTime = SiteConfigHelper.GetDefaultMinBucketTime();
                remainTime = Time.Max(remainTime, defaultMinBucketTime);
            }

            lot.CurrentFabPlan.AoBucketTime = Time.Max(remainTime, Time.Zero);

            return(remainTime);
        }
Esempio n. 2
0
        private static Time GetRunTat(FabStep step, string productID)
        {
            if (step == null)
            {
                return(Time.Zero);
            }

            var tat = step.GetTat(productID, true);

            if (tat == null)
            {
                return(Time.Zero);
            }

            return(tat.RunTat);
        }
Esempio n. 3
0
        public static decimal GetAvgProcTime(FabStep step, FabProduct prod, string productVersion)
        {
            if (step.AvgFlowTime < 0)
            {
                List <string> list = EqpArrangeMaster.GetLoadableEqpList(step.StdStep, prod.ProductID, productVersion);
                if (list == null)
                {
                    StepTat tat = step.GetTat(prod.ProductID, true);
                    if (tat != null)
                    {
                        step.AvgFlowTime = Convert.ToDecimal(tat.TAT * 60);
                    }

                    return(step.AvgFlowTime);
                }

                decimal n = list.Count;
                decimal s = 0;

                foreach (string eqpID in list)
                {
                    StepTime st = step.GetStepTime(eqpID, prod.ProductID);

                    if (st == null || st.ProcTime <= 0)
                    {
                        continue;
                    }

                    s = s + Convert.ToDecimal(1d / st.ProcTime);
                }

                if (s > 0m)
                {
                    step.AvgFlowTime = Math.Round(n / (decimal)s, 2);
                }
                else
                {
                    step.AvgFlowTime = (decimal)SiteConfigHelper.GetDefaultFlowTime().TotalSeconds;
                }
            }
            return(step.AvgFlowTime);
        }
Esempio n. 4
0
        /// <summary>
        /// </summary>
        /// <param name="pegTarget"/>
        /// <param name="stage"/>
        /// <param name="isRun"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public TimeSpan GET_TARGET_TAT0(Mozart.SeePlan.Pegging.PegTarget pegTarget, Mozart.SeePlan.Pegging.PegStage stage, bool isRun, ref bool handled, TimeSpan prevReturnValue)
        {
            FabPegTarget target = pegTarget as FabPegTarget;
            FabStep      step   = pegTarget.PegPart.CurrentStep as FabStep;

            float waitTat = (float)SiteConfigHelper.GetDefaultWaitTAT().TotalMinutes;
            float runTat  = (float)SiteConfigHelper.GetDefaultRunTAT().TotalMinutes;

            StepTat tat = step.GetTat(target.ProductID, target.IsMainLint);

            if (tat != null)
            {
                waitTat = tat.WaitTat;
                runTat  = tat.RunTat;
            }

            float time = isRun ? runTat : waitTat;

            return(TimeSpan.FromMinutes(time));
        }
Esempio n. 5
0
        /// <summary>
        /// </summary>
        /// <param name="entity"/>
        /// <param name="now"/>
        /// <param name="target"/>
        /// <param name="factor"/>
        /// <param name="ctx"/>
        /// <returns/>
        public WeightValue SMALL_BATCH_MERGE_PRIORITY(Mozart.Simulation.Engine.ISimEntity entity, DateTime now, Mozart.Simulation.Engine.ActiveObject target, Mozart.SeePlan.DataModel.WeightFactor factor, Mozart.SeePlan.Simulation.IDispatchContext ctx)
        {
            if (factor.Factor == 0)
            {
                return(new WeightValue(0));
            }

            int baseQty        = (int)factor.Criteria[0];
            int checkStepCount = (int)factor.Criteria[1];

            FabAoEquipment eqp = target as FabAoEquipment;
            FabLot         lot = entity as FabLot;

            //if (eqp.IsLastPlan(lot.CurrentShopID, lot.CurrentStepID, lot.CurrentProductID, Constants.NULL_ID, lot.OwnerType, lot.OwnerID))
            //	return new WeightValue(1 * factor.Factor, string.Format("[IsLast:Y]"));

            FabStep currentStep = lot.CurrentFabStep;
            var     currentProd = lot.FabProduct;

            FabStep prevStep = currentStep.GetPrevMainStep(lot.FabProduct, true);

            StepTat tat = null;

            if (prevStep != null)
            {
                tat = prevStep.GetTat(lot.CurrentProductID, true);
            }

            if (tat == null)
            {
                tat = currentStep.GetDefaultTAT();
            }


            var job = InFlowMaster.GetJobState(lot);

            if (job == null)
            {
                return(new WeightValue(0));
            }


            int waitQty = job.GetCurrenStepWaitWipQty(eqp, currentStep, Constants.NULL_ID, (decimal)TimeSpan.FromMinutes(tat.RunTat).TotalHours);

            if (waitQty > baseQty)
            {
                return(new WeightValue(0, string.Format("[Wait:{0}>{1}:Base]", waitQty, baseQty)));
            }

            int prevWipQty = job.GetPrevStepRunWipQty(eqp, currentStep, Constants.NULL_ID, now.AddMinutes(tat.TAT));

            if (prevWipQty > 0)
            {
                return(new WeightValue(0, string.Format("[PrevRunWip:{0}>0", prevWipQty)));
            }

            int nextWipQty = 0;

            var nextStepList = currentStep.GetNextStepList(currentProd, checkStepCount);

            foreach (FabStep next in nextStepList)
            {
                nextWipQty += job.GetStepWips(next, WipType.Total);
            }

            int runQty = job.GetStepWips(currentStep, WipType.Run);

            if (runQty + nextWipQty == 0)
            {
                return(new WeightValue(0, string.Format("[Run:{0} + NextQty:{1} = 0]", runQty, nextWipQty)));
            }

            return(new WeightValue(1 * factor.Factor, string.Format("[Run:{0} + NextQty:{1}>0]", runQty, nextWipQty)));
        }