Beispiel #1
0
        public WeightValue NEXT_STEP_RUN_PRIORITY(ISimEntity entity, DateTime now, ActiveObject target, WeightFactor factor, IDispatchContext ctx)
        {
            if (factor.Factor == 0)
            {
                return(new WeightValue(0));
            }

            float criteria0 = WeightHelper.GetCriteria(factor, 0, 0.5f);

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

            FabStep nextStep = BopHelper.GetNextMandatoryStep(lot);

            float score      = 0f;
            int   workingCnt = 0;
            int   adv        = 0;

            if (nextStep != null && nextStep.IsMandatoryStep)
            {
                bool checkProductVersion = true;
                var  workingEqps         = nextStep.StdStep.GetWorkingEqpList(lot, checkProductVersion);

                //checkProductVersion = false
                if (workingEqps == null || workingEqps.Count == 0)
                {
                    checkProductVersion = false;
                    workingEqps         = nextStep.StdStep.GetWorkingEqpList(lot, checkProductVersion);
                }

                workingCnt = workingEqps == null ? 0 : workingEqps.Count;

                if (workingCnt > 0)
                {
                    score = checkProductVersion ? 1f : criteria0;
                }

                var hasDummy = workingEqps.Find(t => t.IsDummyWait) != null;
                if (hasDummy)
                {
                    adv    = 2;
                    score *= adv;
                }
            }

            string nextStepID = nextStep != null ? nextStep.StepID : Constants.NULL_ID;
            string desc       = string.Format("[Next:{0}, Working:{1}, Adv:{2}]", nextStepID, workingCnt, adv);

            return(new WeightValue(score * factor.Factor, desc));
        }