예제 #1
0
파일: Weights.cs 프로젝트: yichunbong/CSOT
        /// <summary>
        /// </summary>
        /// <param name="entity"/>
        /// <param name="now"/>
        /// <param name="target"/>
        /// <param name="factor"/>
        /// <param name="ctx"/>
        /// <returns/>
        public WeightValue LAYER_BALANCE_FOR_PHOTO(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));
            }

            FabLot lot = entity as FabLot;

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

            if (checkStepCount == 0)
            {
                checkStepCount = 10;
            }

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

            FabStep nextPhoto = currentStep.GetNextPhotoNearByMe(currentProd, checkStepCount, out _);

            LayerStats sts = WeightHelper.GetLayerBalacne(nextPhoto.StdStep.DspEqpGroup);

            if (sts == null)
            {
                AoEquipment aeqp = null;
                foreach (var eqp in nextPhoto.StdStep.AllEqps)
                {
                    aeqp = AoFactory.Current.GetEquipment(eqp.EqpID);
                    if (aeqp != null)
                    {
                        break;
                    }
                }

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

                sts = WeightHelper.CalcLayerBalance(aeqp);
            }


            LayerStats.StepWipStat wipStat = sts.GetWipStat(nextPhoto.StdStepID);

            string desc  = string.Empty;
            float  score = 0f;

            if (wipStat != null)
            {
                score = sts.GetLayerBalanceScore(wipStat, out desc);
            }


            return(new WeightValue(score * factor.Factor, desc));
        }
예제 #2
0
        /// <summary>
        /// </summary>
        /// <param name="dc"/>
        /// <param name="aeqp"/>
        /// <param name="wips"/>
        /// <param name="handled"/>
        public void UPDATE_CONTEXT0(IDispatchContext dc, AoEquipment aeqp, IList <IHandlingBatch> wips, ref bool handled)
        {
            //////20161122075408
            //if (aeqp.EqpID == "8APPH02" && aeqp.NowDT == new DateTime(2016, 12, 12, 8, 42, 14))
            //    Console.WriteLine("T");

            List <JobFilterInfo> joblist = dc.Get <List <JobFilterInfo> >(Constants.JobGroup, null);

            if (aeqp.Preset == null)
            {
                return;
            }

            double maxRequireEqp;

            if (WeightHelper.TryGetMaxRequiredEqp(aeqp, joblist, out maxRequireEqp))
            {
                dc.Set(Constants.WF_MAX_REQUIRED_EQP_COUNT, maxRequireEqp);
            }

            LayerStats sts = WeightHelper.CalcLayerBalance(aeqp);

            dc.Set(Constants.WF_LAYER_BALANCE_PRIORITY, sts);

            //투입을 위한 waiting wip infomation(unpack 설비 )
            Dictionary <string, WaitingWipInfo> waitingInfos = WeightHelper.SetWatingWipInfo(aeqp, joblist);

            dc.Set(Constants.WF_WAITING_WIP_INFO, waitingInfos);

            dc.Set(Constants.WF_MINMAX_VALUE_INFOS, WeightHelper.SetMinMaxVaule_WF(aeqp, joblist));

            if (wips.Count > 0)
            {
                dc.Set(Constants.WF_LOT_PRIORITY, wips.Max(x => x.ToFabLot().Priority));
            }

            DispatchLogHelper.InitLotLogDetail(wips);
        }