예제 #1
0
파일: Weights.cs 프로젝트: yichunbong/CSOT
        public WeightValue ALLOW_RUN_DOWN_TIME(ISimEntity entity, DateTime now, ActiveObject target, WeightFactor factor, IDispatchContext ctx)
        {
            FabAoEquipment eqp = target as FabAoEquipment;
            FabLot         lot = entity as FabLot;

            var wf = WeightHelper.GetWeightFactor(eqp.Target.Preset, Constants.WF_ALLOW_RUN_DOWN_TIME);

            if (wf == null || wf.Factor == 0)
            {
                return(new WeightValue(0));
            }

            decimal inflowHour = (decimal)wf.Criteria[0];

            var     idleTime   = eqp.GetIdleRunTime();
            decimal adjustHour = inflowHour - Convert.ToDecimal(idleTime.TotalHours);

            if (adjustHour < 0)
            {
                return(new WeightValue(0));
            }

            var inflowQty = InFlowMaster.GetAllowRunDownWip(eqp, lot.CurrentProductID, lot.OrigProductVersion, lot.OwnerType, lot.CurrentStep as FabStep, adjustHour);

            float score = 0f;

            if (inflowQty > 0)
            {
                score = 1f;
            }

            string desc = string.Format("[inflow:{0}]", inflowQty);

            return(new WeightValue(score * factor.Factor, desc));
        }
예제 #2
0
        /// <summary>
        /// </summary>
        /// <param name="aoFactory"/>
        /// <param name="handled"/>
        public void ON_END_INITIALIZE0(Mozart.SeePlan.Simulation.AoFactory aoFactory, ref bool handled)
        {
            InFlowAgent.InitConstruct(aoFactory);

            OutCollector.WriteStepWip();
            WeightHelper.WriteWeightPresetLog();
        }
예제 #3
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));
        }
예제 #4
0
        /// <summary>
        /// </summary>
        /// <param name="db"/>
        /// <param name="aeqp"/>
        /// <param name="wips"/>
        /// <param name="ctx"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public IHandlingBatch[] DO_SELECT0(Mozart.SeePlan.Simulation.DispatcherBase db, Mozart.SeePlan.Simulation.AoEquipment aeqp, IList <Mozart.SeePlan.Simulation.IHandlingBatch> wips, Mozart.SeePlan.Simulation.IDispatchContext ctx, ref bool handled, Mozart.SeePlan.Simulation.IHandlingBatch[] prevReturnValue)
        {
            WeightPreset   preset = aeqp.Target.Preset;
            FabAoEquipment eqp    = aeqp as FabAoEquipment;

            //InPort Wip 처리
            if (eqp.HasInPortWip)
            {
                //여러 Lot을 넘길 경우 첫번째 투입, 나머지는 설비의 Buffer에 넣음.
                IHandlingBatch[] list = eqp.InitInPortWips.ToArray();

                eqp.InitInPortWips.Clear();

                return(list);
            }

            IHandlingBatch[] selected = null;

            if (wips.Count > 0)
            {
                List <IHandlingBatch> newlist = new List <IHandlingBatch>(wips);
                var control = DispatchControl.Instance;

                //if (eqp.EqpID == "FHRPH100" && eqp.NowDT >= LcdHelper.StringToDateTime("20200113 073000"))
                //	Console.WriteLine("B");

                var dummy = WeightHelper.NeedAllowRunDown_Dummy(eqp, wips);
                if (dummy != null)
                {
                    newlist.Add(dummy);
                    dummy.DispatchFilterInfo = eqp.LastPlanFilterInfo;
                }

                var dummyList = FilterMaster.WaitForPrevStepWip_Dummy(ctx, eqp);
                if (dummyList != null && dummyList.Count > 0)
                {
                    newlist.AddRange(dummyList);
                }

                var lotList = control.Evaluate(db, newlist, ctx);
                selected = control.Select(db, eqp, lotList);

                if (control.IsWriteDispatchLog(eqp))
                {
                    DispatchLogHelper.AddDispatchInfo(eqp, lotList, selected, preset);
                    //eqp.EqpDispatchInfo.AddDispatchInfo(lotList, selected, preset);
                }
            }

            if (selected == null)
            {
                eqp.CheckAvailableSubEqps();
            }

            return(selected);
        }
예제 #5
0
 public void Update(string name, decimal weight, WeightPrefix weightPrefix, string description)
 {
     Entity.Name         = name;
     Entity.WeightPrefix = weightPrefix;
     if (weightPrefix != WeightPrefix.Gram)
     {
         weight = WeightHelper.ConvertToGram(weight, weightPrefix);
     }
     Entity.Weight      = weight;
     Entity.Description = description;
 }
예제 #6
0
파일: Weights.cs 프로젝트: yichunbong/CSOT
        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));
        }
예제 #7
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 SETUP_TIME_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));
            }

            float score     = 1;
            int   criteria0 = 1;

            if (factor.Criteria != null && factor.Criteria.Length > 0)
            {
                criteria0 = Math.Max((int)factor.Criteria[0], 1);
            }

            int cutMinutes = (int)Time.FromMinutes(criteria0).TotalMinutes;

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

            //if (aeqp.EqpID == "THCVD300" && aeqp.NowDT >= LcdHelper.StringToDateTime("20200108 123433"))
            //	Console.WriteLine("B");

            float setupTime    = SetupMaster.GetSetupTime(aeqp, lot);
            float maxSetupTime = WeightHelper.GetMaxVaule_WF(ctx, Constants.WF_SETUP_TIME_PRIORITY, 0f);

            if (setupTime > 0 && maxSetupTime > 0)
            {
                float s = (int)(setupTime / cutMinutes);
                float m = (int)(maxSetupTime / cutMinutes);
                float r = m == 0 ? 0 : (float)Math.Round(s / m, 3);

                score = 1 - r;
            }

            string desc = string.Format("[{0} = SETUP:{1}m/MAX:{2}m]", score, setupTime, maxSetupTime);

            return(new WeightValue(score * factor.Factor, desc));
        }
예제 #8
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);
        }
예제 #9
0
 public string WeightAndToken(bool shortToken = false)
 {
     return(WeightHelper.GetRoundedWeight(GetTotalWeight(), true, WeightPrefix, shortToken));
 }
예제 #10
0
 private string GetConvertedWeight()
 {
     return((WeightHelper.ConvertFromGram(Convert.ToDecimal(Weight), WeightPrefix)).ToString());
 }
예제 #11
0
 public string GetWeightAndToken(bool shortToken = false)
 {
     return(WeightHelper.GetRoundedWeight(Convert.ToDecimal(Weight), true, WeightPrefix, shortToken));
 }
 public string GetWeightAndToken()
 {
     return(WeightHelper.GetRoundedWeight(Convert.ToDecimal(Weight), true, WeightPrefix));
 }
예제 #13
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 NEXT_STEP_CONTINUOUS_PRODUCTION_PRIORITY(Mozart.Simulation.Engine.ISimEntity entity, DateTime now, Mozart.Simulation.Engine.ActiveObject target, Mozart.SeePlan.DataModel.WeightFactor factor, Mozart.SeePlan.Simulation.IDispatchContext ctx)
        {
            FabAoEquipment eqp = target as FabAoEquipment;

            WeightFactor wf;

            WeightHelper.TryGetEqpWeightFactor(eqp, Constants.WF_NEXT_STEP_CONTINUOUS_PRODUCTION_PRIORITY, out wf);

            FabLot lot = entity as FabLot;

            string desc           = string.Empty;
            float  score          = 0;
            int    checkStepCount = (int)wf.Criteria[0];
            int    minLimitQty    = (int)wf.Criteria[1];
            int    maxLimitQty    = (int)wf.Criteria[2];

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

            FabStep nextPhotoStep = currentStep.GetNextPhotoNearByMe(currentProd, checkStepCount, out int idx);

            if (nextPhotoStep == null)
            {
                score = 0f;
            }
            else
            {
                var job = InFlowMaster.GetJobState(lot);

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

                int nextPhlWipQty = job.GetStepWips(nextPhotoStep, WipType.Total);

                if (nextPhlWipQty <= maxLimitQty && nextPhlWipQty > minLimitQty)
                {
                    bool checkProductVersion = false;

                    var     workingEqps     = currentStep.StdStep.GetWorkingEqpList(lot, checkProductVersion);
                    int     workingCnt      = workingEqps == null ? 0 : workingEqps.Count;
                    Decimal curStepTactTime = TimeHelper.GetAvgTactTimeForEqps(currentStep, currentProd, workingEqps);

                    var     targetWorkingEqps     = nextPhotoStep.StdStep.GetWorkingEqpList(lot, checkProductVersion);
                    int     targetWorkingCnt      = targetWorkingEqps == null ? 0 : targetWorkingEqps.Count;
                    Decimal nextPhotoStepTactTime = TimeHelper.GetAvgTactTimeForEqps(nextPhotoStep, currentProd, targetWorkingEqps);

                    if ((workingCnt / curStepTactTime) < (targetWorkingCnt / nextPhotoStepTactTime))
                    {
                        score = 1f;
                    }

                    desc = string.Format("[Working:{0}, Next_Photo:{1}]", workingCnt, targetWorkingCnt);
                }
                else if (nextPhlWipQty <= minLimitQty)
                {
                    float s = idx;
                    float m = checkStepCount;
                    float r = m == 0 ? 0 : (float)Math.Round(s / m, 3);

                    score = 1 - r;
                    int adv = 2;
                    score *= adv;

                    desc = string.Format("[NextPhotoStepWipQty:{0}, Adv:{1}]", nextPhlWipQty, adv);
                }
            }

            return(new WeightValue(score * wf.Factor, desc));
        }
예제 #14
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 MAX_QTIME_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));
            }

            FabLot lot      = entity as FabLot;
            var    currStep = lot.CurrentFabStep;

            //FabAoEquipment eqp = target as FabAoEquipment;
            //if (lot.LotID == "TH9C1396N0X" && eqp.EqpID == "THOVN200") //&& eqp.NowDT >= LcdHelper.StringToDateTime("20191128 133538"))
            //	Console.WriteLine("B");

            //if (lot.LotID == "TH9C1472N0L" && eqp.EqpID == "THOVN200") //&& eqp.NowDT >= LcdHelper.StringToDateTime("20191128 133538"))
            //	Console.WriteLine("B");

            var info = lot.QtimeInfo;

            if (info == null || info.HasMaxQTime() == false)
            {
                return(new WeightValue(0));
            }

            var find = info.FindMinimumRemainTime(now);

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

            int criteria0 = Math.Max(WeightHelper.GetCriteria(factor, 0, 1), 1);
            int criteria1 = Math.Max(WeightHelper.GetCriteria(factor, 1, 0), 0);
            int criteria2 = Math.Max(WeightHelper.GetCriteria(factor, 2, 0), 0);

            int cutMinutes = (int)Time.FromMinutes(criteria0).TotalMinutes;

            Time baseSafe = Time.FromMinutes(criteria1);
            Time stepSafe = Time.FromMinutes(criteria2);

            int  remainStepCount = find.RemainStepCount(currStep);
            Time safeTime        = baseSafe + (stepSafe * remainStepCount);

            Time remainTime    = find.RemainTime(lot, currStep, now);
            Time maxRemainTime = WeightHelper.GetMaxVaule_WF(ctx, Constants.WF_MAX_QTIME_PRIORITY, Time.Zero);

            float score = 0;

            if (remainTime < safeTime)
            {
                if (remainTime > 0 && maxRemainTime > 0)
                {
                    float s = (int)(remainTime.TotalMinutes / cutMinutes);
                    float m = (int)(maxRemainTime.TotalMinutes / cutMinutes);
                    float r = m == 0 ? 0 : (float)Math.Round(s / m, 3);

                    score = 1 - r;
                }
            }

            string desc = string.Format("[{0} = SAFE:{1}min, REMAIN:{2}min, MAX:{3}min])",
                                        Math.Round(score, 2),
                                        Math.Round(safeTime.TotalMinutes, 2),
                                        Math.Round(remainTime.TotalMinutes, 2),
                                        Math.Round(maxRemainTime.TotalMinutes, 2));

            return(new WeightValue(score * factor.Factor, desc));
        }
예제 #15
0
        private void BuildWeightFactor(WeightFactor f, WeightPresets item)
        {
            if (f.Name == Constants.WF_ALLOW_RUN_DOWN_TIME)
            {
                var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1);

                decimal inflowHour;
                if (decimal.TryParse(criteria[0], out inflowHour) == false)
                {
                    inflowHour = 0;
                }

                f.Criteria = new object[] { inflowHour };
            }
            else if (f.Name == Constants.WF_MAX_MOVE_LIMIT_PRIORITY)
            {
                var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1);

                decimal limitQty;
                if (decimal.TryParse(criteria[0], out limitQty) == false)
                {
                    limitQty = decimal.MaxValue;
                }

                f.Criteria = new object[] { limitQty };
            }
            else if (f.Name == Constants.WF_MIN_MOVEQTY_PRIORITY)
            {
                var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 2);

                int minMoveQty;
                if (int.TryParse(criteria[0], out minMoveQty) == false)
                {
                    minMoveQty = 0;
                }


                f.Criteria = new object[] { minMoveQty };
            }
            else if (f.Name == Constants.WF_STEP_TARGET_PRIORITY)
            {
                var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 2);

                int precedeDay;
                int delayDay;

                if (int.TryParse(criteria[0], out precedeDay) == false)
                {
                    precedeDay = 0;
                }

                if (int.TryParse(criteria[1], out delayDay) == false)
                {
                    delayDay = 0;
                }

                f.Criteria = new object[] { precedeDay, delayDay };
            }
            else if (f.Name == Constants.WF_NEW_EQP_ASSIGN_FILTERING)
            {
                var    criteria = WeightHelper.ParseCriteria(item.CRITERIA, 2);
                double param1;
                if (double.TryParse(criteria[0], out param1) == false)
                {
                    param1 = 0;
                }

                double param2;
                if (double.TryParse(criteria[1], out param2) == false)
                {
                    param2 = 0;
                }

                f.Criteria = new object[] { param1, param2 };
            }
            else if (f.Name == Constants.WF_SETUP_FILTERING)
            {
                var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1);

                decimal arg;
                if (decimal.TryParse(criteria[0], out arg) == false)
                {
                    arg = 0;
                }

                f.Criteria = new object[] { arg };
            }
            else if (f.Name == Constants.WF_REQUIRED_EQP_PRIORITY)
            {
                var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 2);

                double inflowHour;
                if (double.TryParse(criteria[0], out inflowHour) == false)
                {
                    inflowHour = 8;
                }

                double advantage;
                if (double.TryParse(criteria[1], out advantage) == false)
                {
                    advantage = 0;
                }

                f.Criteria = new object[] { inflowHour, advantage };
            }
            else if (f.Name == Constants.WF_SMALL_BATCH_MERGE_PRIORITY)
            {
                var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 2);

                int arg1;
                if (int.TryParse(criteria[0], out arg1) == false)
                {
                    arg1 = 80;
                }

                int arg2;
                if (int.TryParse(criteria[1], out arg2) == false)
                {
                    arg2 = 2;
                }

                f.Criteria = new object[] { arg1, arg2 };
            }
            else if (f.Name == Constants.WF_LOT_PRIORITY)
            {
                var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 2);

                int arg1;
                if (!int.TryParse(criteria[0], out arg1))
                {
                    arg1 = 1;
                }

                int arg2;
                if (!int.TryParse(criteria[1], out arg2))
                {
                    arg2 = 0;
                }

                f.Criteria = new object[] { arg1, arg2 };
            }
            else if (f.Name == Constants.WF_LAST_RUN)
            {
                var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1);

                float value;
                if (float.TryParse(criteria[0], out value) == false)
                {
                    value = 1;
                }

                f.Criteria = new object[] { value };
            }
            else if (f.Name == Constants.WF_SETUP_TIME_PRIORITY)
            {
                var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1);

                int value;
                if (int.TryParse(criteria[0], out value) == false)
                {
                    value = 1;
                }

                f.Criteria = new object[] { value };
            }
            else if (f.Name == Constants.WF_MAX_QTIME_PRIORITY)
            {
                var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 3);

                int value0;
                if (int.TryParse(criteria[0], out value0) == false)
                {
                    value0 = 1;
                }

                int value1;
                if (int.TryParse(criteria[1], out value1) == false)
                {
                    value1 = 1;
                }

                int value2;
                if (int.TryParse(criteria[2], out value2) == false)
                {
                    value2 = 1;
                }

                f.Criteria = new object[] { value0, value1, value2 };
            }
            else if (f.Name == Constants.WF_LAYER_BALANCE_PRIORITY)
            {
                var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1);

                decimal value;
                if (decimal.TryParse(criteria[0], out value) == false)
                {
                    value = 1;
                }

                f.Criteria = new object[] { value };
            }
            else if (f.Name == Constants.WF_NEXT_STEP_CONTINUOUS_PRODUCTION_PRIORITY)
            {
                var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 3);

                int value0;
                if (int.TryParse(criteria[0], out value0) == false)
                {
                    value0 = 3;
                }

                int value1;
                if (int.TryParse(criteria[1], out value1) == false)
                {
                    value1 = 120;
                }

                int value2;
                if (int.TryParse(criteria[2], out value2) == false)
                {
                    value2 = 400;
                }

                f.Criteria = new object[] { value0, value1, value2 };
            }
            else if (f.Name == Constants.WF_LAYER_BALANCE_FOR_PHOTO)
            {
                var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1);

                int value;
                if (int.TryParse(criteria[0], out value) == false)
                {
                    value = 1;
                }

                f.Criteria = new object[] { value };
            }
            else if (f.Name == Constants.WF_ASSIGN_STEP_PRIORITY)
            {
                var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1);

                int value;
                if (int.TryParse(criteria[0], out value) == false)
                {
                    value = 1;
                }

                f.Criteria = new object[] { value };
            }
            else if (f.Name == Constants.WF_OWNER_TYPE_PRIORITY)
            {
                var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 3);

                f.Criteria = new object[] { criteria };
            }
            else if (f.Name == Constants.WF_CU_DENSITY_3400)
            {
                var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1);

                int acidLimit1;
                if (int.TryParse(criteria[0], out acidLimit1) == false)
                {
                    acidLimit1 = 0;
                }

                f.Criteria = new object[] { acidLimit1 };
            }
            else if (f.Name == Constants.WF_CU_DENSITY_3402)
            {
                var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1);

                int acidLimit2;
                if (int.TryParse(criteria[0], out acidLimit2) == false)
                {
                    acidLimit2 = 0;
                }

                f.Criteria = new object[] { acidLimit2 };
            }
            else if (f.Name == Constants.WF_SMALL_LOT)
            {
                var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 2);

                int unitQyt;
                if (!int.TryParse(criteria[0], out unitQyt))
                {
                    unitQyt = 0;
                }

                int stepCount;
                if (!int.TryParse(criteria[1], out stepCount))
                {
                    stepCount = 0;
                }

                f.Criteria = new object[] { unitQyt, stepCount };
            }
            else if (f.Name == Constants.WF_ALLOW_SMALL_LOT_FILTER)
            {
                var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1);

                decimal inflowHour;
                if (decimal.TryParse(criteria[0], out inflowHour) == false)
                {
                    inflowHour = 0;
                }

                f.Criteria = new object[] { inflowHour };
            }
        }