Exemple #1
0
        public static decimal GetAvgTactTimeForEqps(FabStep step, FabProduct product, List <FabAoEquipment> workingEqps)
        {
            Decimal defaultTactTime = (decimal)SiteConfigHelper.GetDefaultTactTime().TotalSeconds;

            if (workingEqps == null)
            {
                return(defaultTactTime);
            }

            int n = workingEqps.Count;

            decimal s = 0;

            foreach (var eqp in workingEqps)
            {
                string   eqpID    = eqp.EqpID;
                StepTime tactTime = step.GetStepTime(eqpID, product.ProductID);

                if (tactTime == null || tactTime.TactTime <= 0)
                {
                    continue;
                }

                s += Convert.ToDecimal(1d / tactTime.TactTime);
            }

            if (s > 0m)
            {
                return(n / s);
            }
            else
            {
                return(defaultTactTime);
            }
        }
Exemple #2
0
        public static decimal GetHarmonicTactTime(FabStep step, List <FabAoEquipment> assignedEqps, string productID)
        {
            if (assignedEqps == null)
            {
                return(0);
            }


            float tactSum = 0;

            foreach (var eqp in assignedEqps)
            {
                StepTime st = step.GetStepTime(eqp.EqpID, productID);

                if (st == null)
                {
                    continue;
                }

                float tact = (1f / st.TactTime);
                tactSum += tact;
            }

            if (tactSum == 0)
            {
                return(0);
            }

            return(Convert.ToDecimal(1f / tactSum));
        }
Exemple #3
0
        /// <summary>
        /// </summary>
        /// <param name="entity"/>
        /// <returns/>
        public bool OnAfterLoad_StepTime(StepTime entity)
        {
            entity.TACT_TIME = (decimal)UtilityHelper.GetTimeBySeconds((double)entity.TACT_TIME, entity.TIME_UOM);
            entity.FLOW_TIME = (decimal)UtilityHelper.GetTimeBySeconds((double)entity.FLOW_TIME, entity.TIME_UOM);

            return(true);
        }
Exemple #4
0
 public void DecreaseSpeed()
 {
     if ((int)currentStepTime > 0)
     {
         currentStepTime = (StepTime)((int)currentStepTime - 1);
         currentWait     = waits[(int)currentStepTime];
         Debug.Log("New Wait Seconds: " + GetWaitSeconds());
     }
 }
Exemple #5
0
 public void IncreaseSpeed()
 {
     if ((int)currentStepTime < waits.Count - 1)
     {
         currentStepTime = (StepTime)((int)currentStepTime + 1);
         currentWait     = waits[(int)currentStepTime];
         Debug.Log("New Wait Seconds: " + GetWaitSeconds());
     }
 }
Exemple #6
0
        public static StepTime CreateAverageStepTime(FabStep step, FabEqp eqp, string productID, float tact, float proc, string reason)
        {
            StepTime st = CreateHelper.CreateStepTime(eqp, step, productID, tact, proc);

            List <StepTime> list;

            if (step.StepTimes.TryGetValue(productID, out list) == false)
            {
                list = new List <StepTime>();
            }

            list.Add(st);

            //TODO : Output:
            //OutputMart.Instance.AppxStepTime.Add(item);

            return(st);
        }
Exemple #7
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);
        }
Exemple #8
0
        public static decimal GetAvgTactTime(FabStep step, FabProduct prod, string productVersion)
        {
            if (step.AvgTactTime < 0)
            {
                List <string> eqps = EqpArrangeMaster.GetLoadableEqpList(step.StdStep, prod.ProductID, productVersion);

                if (eqps == null)
                {
                    step.AvgTactTime = 0;
                    return(step.AvgTactTime);
                }

                int n = eqps == null ? 0 : eqps.Count;

                decimal s = 0;
                foreach (string eqpID in eqps)
                {
                    StepTime tactTime = step.GetStepTime(eqpID, prod.ProductID);

                    if (tactTime == null || tactTime.TactTime <= 0)
                    {
                        continue;
                    }

                    s += Convert.ToDecimal(1d / tactTime.TactTime);
                }

                if (s > 0m)
                {
                    step.AvgTactTime = n / s;
                }
                else
                {
                    step.AvgTactTime = (decimal)SiteConfigHelper.GetDefaultTactTime().TotalSeconds;
                }
            }

            return(step.AvgTactTime);
        }
Exemple #9
0
        /// <summary>
        /// </summary>
        /// <param name="aeqp"/>
        /// <param name="hb"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public ProcTimeInfo GET_PROCESS_TIME0(AoEquipment aeqp, IHandlingBatch hb, ref bool handled, ProcTimeInfo prevReturnValue)
        {
            FabStep step = hb.CurrentStep as FabStep;
            FabEqp  eqp  = aeqp.Target as FabEqp;

            FabLot   lot = hb.Sample as FabLot;
            StepTime st  = step.GetStepTime(eqp.EqpID, lot.CurrentProductID);

            float mixRunRatio = 1;

            if (aeqp.IsParallelChamber)
            {
                if (eqp.IsMixRunning())
                {
                    mixRunRatio = lot.CurrentFabStep.StdStep.MixCriteria;
                }

                if (mixRunRatio == 0)
                {
                    mixRunRatio = 1;
                }
            }

            ProcTimeInfo time = new ProcTimeInfo();

            if (st != null)
            {
                time.FlowTime = TimeSpan.FromSeconds(st.ProcTime * mixRunRatio);
                time.TactTime = TimeSpan.FromSeconds(st.TactTime * mixRunRatio);
            }
            else
            {
                time.FlowTime = TimeSpan.FromMinutes(10);
                time.TactTime = TimeSpan.FromMinutes(10);
            }

            return(time);
        }
Exemple #10
0
        private void PersistStepLayerInfo(StepTime st, FabStep step)
        {
            string key = step.GetLayerStepKey();

            StepLayerInfo layerStep;

            if (InputMart.Instance.StepLayerGroups.TryGetValue(key, out layerStep) == false)
            {
                layerStep = new StepLayerInfo();

                layerStep.ShopID   = step.ShopID;
                layerStep.LayerID  = step.LayerID;
                layerStep.EqpGroup = step.EqpGroup;
                //layerStep.StepPattern = step.GetStepPatternKey();
                layerStep.Key   = key;
                layerStep.Count = 0;

                InputMart.Instance.StepLayerGroups.Add(key, layerStep);
            }

            layerStep.CumHarmonicTime += (1f / st.TactTime);
            layerStep.Count++;
        }
Exemple #11
0
            void findOpenTime(List <String> timeList)
            {
                if (timeList.Count <= 1)
                {
                    return;
                }

                StepTime time = new StepTime();

                for (int i = 0; i < timeList.Count; i++)
                {
                    if (timeList[i].Contains(OPEN_START))
                    {
                        //Console.WriteLine("open:" + timeList[i]);
                        time.startTime = getTime(timeList[i]);
                        //删除当前项避免重复匹配
                        timeList.RemoveAt(i);
                        i--;
                        continue;
                    }
                    else if (timeList[i].Contains(OPEN_END))
                    {
                        // Console.WriteLine("open:" + timeList[i]);
                        time.endTime = getTime(timeList[i]);
                        //删除当前项避免重复匹配
                        timeList.RemoveAt(i);
                        i--;
                        //退出当前循环
                        if (time.startTime != null && time.endTime != null)
                        {
                            time.calcTime();
                            open = time;
                        }
                        return;
                    }
                }
            }
Exemple #12
0
        private static bool IsFilterInflowMoreThenRemainArrMtype(this JobFilterInfo info, FabAoEquipment eqp)
        {
            if (InputMart.Instance.GlobalParameters.ApplyArrangeMType == false)
            {
                return(false);
            }

            WeightFactor wf;

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

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

            FabLot lot = info.Sample;

            if (info.IsRunning)
            {
                return(false);
            }

            if (lot == null)
            {
                return(false);
            }

            var list = lot.CurrentEqpArrange.EqpArrrangeSet.Items.FindAll(x => x.ActivateType == ActivateType.M);

            if (list == null || list.Count == 0)
            {
                return(false);
            }

            float minMoveQty = (int)wf.Criteria[0] / 2;

            float tactTime = (float)SiteConfigHelper.GetDefaultTactTime().TotalSeconds;

            StepTime st = info.Step.GetStepTime(eqp.EqpID, info.ProductID);

            if (st != null)
            {
                tactTime = st.TactTime;
            }

            Time inflowTime = Time.FromSeconds(minMoveQty * tactTime);

            decimal inflowQty = InFlowAgent.GetInflowQty(lot, eqp, (decimal)inflowTime.TotalHours, 0);

            Time endTime           = eqp.Now + inflowTime;
            bool isContinueNextDay = ShopCalendar.StartTimeOfNextDay(eqp.NowDT) <= endTime;

            foreach (var item in list)
            {
                int remainQty = item.RemainQty;
                if (isContinueNextDay && item.IsDailyMode)
                {
                    remainQty += item.LimitQty;
                }

                //limit(M) 잔여 수량이 MIN_MOVEQTY의 1 / 2 이상인 경우 체크 제외.
                if (remainQty >= minMoveQty)
                {
                    continue;
                }

                if (remainQty < inflowQty)
                {
                    info.FilterReason = string.Format("Remain:{0} < Inflow:{1}", remainQty, inflowQty);
                    return(true);
                }
            }

            return(false);
        }
Exemple #13
0
        private static bool IsWaitSmallSizeLot(AoEquipment aeqp, JobFilterInfo info, FabLot lot, double waitQty, double setupTime, double ratio, StepTime st)
        {
            var step = lot.CurrentFabStep;

            if (step == null)
            {
                return(false);
            }

            var stdStep = step.StdStep;

            if (stdStep == null || stdStep.IsInputStep)
            {
                return(false);
            }

            FabAoEquipment eqp = aeqp.ToFabAoEquipment();

            TimeSpan firstInflowTime = TimeSpan.FromMinutes(setupTime);
            decimal  allowTime       = 3m;

            WeightFactor wf;

            WeightHelper.TryGetEqpWeightFactor(eqp, Constants.WF_ALLOW_RUN_DOWN_TIME, out wf);
            if (wf != null)
            {
                allowTime = (decimal)wf.Criteria[0];
            }

            double inflowQty1 = Convert.ToDouble(InFlowAgent.GetInflowQty(info, aeqp, (decimal)firstInflowTime.TotalHours, 0));
            double inflowQty2 = Convert.ToDouble(InFlowAgent.GetInflowQty(info, aeqp, allowTime, 0));

            double waitQty1 = waitQty + inflowQty1;
            double waitQty2 = waitQty + inflowQty2;

            //Setup 시간 이내에 유입이 있나?
            if (LcdHelper.IsIncludeInRange(waitQty, waitQty1 * 0.95d, waitQty1 * 1.05d))
            {
                //지정된 시간내에 유입재공이 있나?
                if (LcdHelper.IsIncludeInRange(waitQty, waitQty2 * 0.95d, waitQty2 * 1.05d))
                {
                    double requiredSec = st.TactTime * waitQty2;

                    bool isSmall = requiredSec < setupTime * 60 * ratio;

                    return(isSmall);
                }
            }

            return(false);
        }
            void findOpenTime(List<String> timeList)
            {
                if (timeList.Count <= 1)
                    return;

                StepTime time = new StepTime();
                for (int i = 0; i < timeList.Count; i++)
                {
                    if (timeList[i].Contains(OPEN_START))
                    {
                        //Console.WriteLine("open:" + timeList[i]);
                        time.startTime = getTime(timeList[i]);
                        //删除当前项避免重复匹配
                        timeList.RemoveAt(i);
                        i--;
                        continue;
                    }
                    else if (timeList[i].Contains(OPEN_END))
                    {
                       // Console.WriteLine("open:" + timeList[i]);
                        time.endTime = getTime(timeList[i]);
                        //删除当前项避免重复匹配
                        timeList.RemoveAt(i);
                        i--;
                        //退出当前循环
                        if (time.startTime != null && time.endTime != null)
                        {
                            time.calcTime();
                            open = time;
                        }
                        return;
                    }
                }
            }
            void findOpen2Connected(List<String> timeList)
            {
                if (timeList.Count <= 1)
                    return;

                StepTime time = new StepTime();
                for (int i = 0; i < timeList.Count; i++)
                {
                    if (timeList[i].Contains(OPEN_START))
                    {
                        //Console.WriteLine("open:" + timeList[i]);
                        time.startTime = getTime(timeList[i]);
                        continue;
                    }
                    else if (timeList[i].Contains(DHCP_END))
                    {
                        //Console.WriteLine("open:" + timeList[i]);
                        time.endTime = getTime(timeList[i]);
                        //退出当前循环
                        if (time.startTime != null && time.endTime != null)
                        {
                            time.calcTime();
                            open2Connected = time;
                        }
                        return;
                    }
                }
            }
            void findCloseTime(List<String> timeList)
            {
                if (timeList.Count <= 1)
                    return;

                StepTime time = new StepTime();
                for (int i = 0; i < timeList.Count; i++)
                {
                    if (timeList[i].Contains(CLOSE_START))
                    {
                        time.startTime = getTime(timeList[i]);
                        //删除当前项避免重复匹配
                        timeList.RemoveAt(i);
                        i--;
                        continue;
                    }
                    else if (timeList[i].Contains(CLOSE_END))
                    {
                        time.endTime = getTime(timeList[i]);
                        //删除当前项避免重复匹配
                        timeList.RemoveAt(i);
                        i--;
                        //退出当前循环
                        if (time.startTime != null && time.endTime != null)
                        {
                            time.calcTime();
                            close = time;
                        }
                        return;
                    }
                }
            }