예제 #1
0
        internal static List <FabSubEqp> GetLoadableSubEqpsByTriggerSubEqp(this FabSubEqp triggerSubEqp, FabLot lot)
        {
            List <FabSubEqp> loadableList = new List <FabSubEqp>();

            //group별 운영
            var group = triggerSubEqp.SubEqpGroup;

            if (group != null && group.SubEqps != null)
            {
                var list = group.SubEqps.Values.ToList();
                foreach (var subEqp in list)
                {
                    if (loadableList.Contains(subEqp))
                    {
                        continue;
                    }

                    //check eqpArrange (subEqp)
                    if (EqpArrangeMaster.IsLoadable_ParallelChamber(subEqp, lot) == false)
                    {
                        continue;
                    }

                    loadableList.Add(subEqp);
                }
            }

            return(loadableList);
        }
예제 #2
0
        public static void OnEqpLoadingStateChanged(object sender, object args)
        {
            object[] arr = args as object[];
            if (arr == null || arr.Length != 3)
            {
                return;
            }

            FabSubEqp subEqp = arr[0] as FabSubEqp;

            if (subEqp == null)
            {
                return;
            }

            string stateName = arr[1] as string;

            LoadingStates state;

            if (Enum.TryParse(stateName, out state) == false)
            {
                return;
            }

            FabLot lot = arr[2] as FabLot;

            if (subEqp.SubEqpID.StartsWith("THCVD9") && lot.LotID == "TH9A0759N01")
            {
                Console.WriteLine();
            }

            var eqp = AoFactory.Current.GetEquipment(subEqp.Parent.EqpID) as FabAoEquipment;

            subEqp.OnStateChanged(eqp, state, lot);
        }
예제 #3
0
        public static void OnChamberStateChanged(this FabSubEqp subEqp, FabAoEquipment eqp, LoadingStates state,
                                                 FabLot lot = null, bool isDone = false)
        {
            if (subEqp == null)
            {
                return;
            }

            subEqp.OnStateChanged(eqp, state, lot, isDone);
        }
예제 #4
0
        public static float GetSetupTime(FabSubEqp subEqp, string shopID, string stepID,
                                         string productID, string prodVer, string ownerType, string ownerID, bool markingAcid = false)
        {
            SetupInfo info = CreateHelper.CreateSetupInfo(subEqp, shopID, stepID, productID, prodVer, ownerType, ownerID);

            string eqpGroup  = (subEqp.Parent as FabEqp).EqpGroup;
            float  setupTime = GetSetupTime(eqpGroup, info);

            return(setupTime);
        }
예제 #5
0
        internal static bool IsLastPlan(this FabSubEqp subEqp, string shopID, string stepID,
                                        string productID, string productVersion, string ownerType, string ownerID,
                                        bool checkProductVersion = true)
        {
            var last = subEqp.LastPlan as FabPlanInfo;

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

            return(last.IsMatched(shopID, stepID, productID, productVersion, ownerType, ownerID, checkProductVersion));
        }
예제 #6
0
        internal static float GetSetupTime(this FabSubEqp subEqp, string shopID, string stepID,
                                           string productID, string prodVer, string ownerType, string ownerID)
        {
            var setupTime = SetupMaster.GetSetupTime(subEqp,
                                                     shopID,
                                                     stepID,
                                                     productID,
                                                     prodVer,
                                                     ownerType,
                                                     ownerID);

            return(setupTime);
        }
예제 #7
0
        private static void CheckOtherSubEqpGroup(this FabEqp targetEqp, FabSubEqp subEqp, FabStdStep targetStdStep, out bool isIdle, out bool isAvailableMixRun)
        {
            isIdle            = true;
            isAvailableMixRun = true;

            var groupList = targetEqp.SubEqpGroups;

            foreach (var group in groupList)
            {
                //동일 Group 체크 X
                if (group == subEqp.SubEqpGroup)
                {
                    continue;
                }

                var sampleSubEqp = group.SubEqps.Values.FirstOrDefault();
                if (sampleSubEqp == null)
                {
                    continue;
                }

                if (sampleSubEqp.Current != null)
                {
                    isIdle = false;
                }

                if (sampleSubEqp.IsMixRunStep == false)
                {
                    isAvailableMixRun = false;
                }
                else
                {
                    if (sampleSubEqp.CurrentStepID == targetStdStep.StepID)
                    {
                        continue;
                    }

                    FabStdStep stdStep = sampleSubEqp.CurrentStep.StdStep;
                    if (stdStep.MixRunPairSteps.Contains(targetStdStep) == false)
                    {
                        isAvailableMixRun = false;
                    }
                }
            }

            //모두 IDLE인 경우는 isAvailableMixRun = false 상태이므로
            if (isIdle && isAvailableMixRun)
            {
                isAvailableMixRun = false;
            }
        }
예제 #8
0
        //internal static bool IsNeedSetup(this FabSubEqp subEqp, string stepID, string productID, string prodVer, string ownerType)
        //{
        //	if (ResHelper.IsIgnoreSetup(subEqp.LoadInfos))
        //		return false;

        //	FabPlanInfo last = subEqp.LastPlan;

        //	if (subEqp.Current != null)
        //	{
        //		FabLot current = subEqp.Current as FabLot;
        //		last = current.CurrentFabPlan;
        //	}

        //	if (last == null)
        //		return true;

        //	if (last.Step == null || last.Product == null)
        //		return true;

        //	var eqp = ResHelper.GetFabAoEquipment(subEqp.Parent.EqpID);
        //	if (eqp == null)
        //		return false;

        //	if (last.StepID != stepID)
        //		return true;

        //	if (last.ProductID != productID)
        //		return true;

        //	if (last.ProductVersion != prodVer)
        //		return true;

        //	if (last.OwnerType != ownerType)
        //		return true;

        //	return false;
        //}

        internal static bool IsLastPlan(this FabSubEqp subEqp, FabLot lot)
        {
            if (lot == null)
            {
                return(false);
            }

            return(subEqp.IsLastPlan(lot.CurrentShopID,
                                     lot.CurrentStepID,
                                     lot.CurrentProductID,
                                     lot.CurrentProductVersion,
                                     lot.OwnerType,
                                     lot.OwnerID));
        }
예제 #9
0
        private static List <FabSubEqp> GetLoadableSubEqps_RunWip(this FabAoEquipment eqp, FabLot lot)
        {
            List <FabSubEqp> loadableList = new List <FabSubEqp>();

            var       availablelist = eqp.GetAvailableSubEqp();
            FabSubEqp triggerSubEqp = SelectBestTriggerSubEqp(availablelist, lot);

            if (triggerSubEqp != null)
            {
                return(triggerSubEqp.GetLoadableSubEqpsByTriggerSubEqp(lot));
            }

            return(loadableList);
        }
예제 #10
0
        private static void SetLastFabLoadInfo(this FabSubEqp subEqp, LoadingStates state,
                                               DateTime now, FabLot lot = null, bool isDone = false)
        {
            var infos = subEqp.LoadInfos;

            var newInfo = SetLastFabLoadInfo(infos, state, now, lot, isDone);

            newInfo.SubEqpID = subEqp.SubEqpID;

            if (state == LoadingStates.BUSY)
            {
                newInfo.UnitQty = subEqp.ChamberInfo.CurrentUnits;
                newInfo.RunMode = subEqp.SubEqpGroup.CurrentRunMode;
            }
        }
예제 #11
0
        private static bool RemoveAvailableList(this TriggerSubEqpInfo info, FabSubEqp subEqp)
        {
            if (subEqp == null)
            {
                return(false);
            }

            var list = info.AvailableList;

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

            return(list.Remove(subEqp));
        }
예제 #12
0
        public static List <FabSubEqp> GetSubEqpList(this FabEqp eqp, List <string> subEqps)
        {
            List <FabSubEqp> list = new List <FabSubEqp>();

            foreach (var item in subEqps)
            {
                FabSubEqp sub = GetSubEqp(eqp, item);

                if (sub != null)
                {
                    list.Add(sub);
                }
            }

            return(list);
        }
예제 #13
0
        internal static bool IsNeedSetup(this FabSubEqp subEqp, string shopID, string stepID,
                                         string productID, string prodVer, string ownerType, string ownerID)
        {
            var setupTime = subEqp.GetSetupTime(shopID,
                                                stepID,
                                                productID,
                                                prodVer,
                                                ownerType,
                                                ownerID);

            if (setupTime > 0)
            {
                return(true);
            }

            return(false);
        }
예제 #14
0
        internal static float GetSetupTime(this FabSubEqp subEqp, FabLot lot)
        {
            string shopID    = lot.CurrentShopID;
            string stepID    = lot.CurrentStepID;
            string productID = lot.CurrentProductID;
            string prodVer   = lot.CurrentProductVersion;
            string ownerType = lot.OwnerType;
            string ownerID   = lot.OwnerID;

            var setupTime = subEqp.GetSetupTime(shopID,
                                                stepID,
                                                productID,
                                                prodVer,
                                                ownerType,
                                                ownerID);

            return(setupTime);
        }
예제 #15
0
        public static bool IsAvailable(this FabSubEqp subEqp, DateTime now)
        {
            if (subEqp.ChamberInfo.Active == false)
            {
                return(false);
            }

            if (subEqp.ChamberInfo.Current != null)
            {
                return(false);
            }

            if (subEqp.ChamberInfo.GetAvailableTime() <= now)
            {
                return(true);
            }

            return(false);
        }
예제 #16
0
        public static bool IsLoadable(this FabSubEqp subEqp, FabStep step, DateTime now)
        {
            if (subEqp.IsAvailable(now) == false)
            {
                return(false);
            }

            var targetEqp = subEqp.Parent as FabEqp;

            int  groupCount = targetEqp.SubEqpGroups.Count;
            bool isMulti    = groupCount > 1;

            if (isMulti == false)
            {
                return(true);
            }

            //진행 중인 Step과 동일한 Step 가용
            if (subEqp.ChamberInfo.Current != null && subEqp.CurrentStepID == step.StepID)
            {
                return(true);
            }

            bool isIdle, isAvailableMixRun;

            targetEqp.CheckOtherSubEqpGroup(subEqp, step.StdStep, out isIdle, out isAvailableMixRun);

            //타 Group의 Chamber가 모두 IDLE 상태
            if (isIdle)
            {
                return(true);
            }

            //타 Group의 Chamber가 MixRun가능 Step을 진행 중인 경우 MixRun 가능 Step은 동시 가용
            if (isAvailableMixRun && step.StdStep.IsMixRunStep)
            {
                return(true);
            }

            return(false);
        }
예제 #17
0
        public static bool IsLoadable_ParallelChamber(FabSubEqp subEqp, FabLot lot, bool checkQty = true)
        {
            if (InputMart.Instance.GlobalParameters.ApplyChamberArrange == false)
            {
                return(true);
            }

            var step    = lot.CurrentFabStep;
            var stdStep = step.StdStep;

            string eqpID      = subEqp.SubEqpID;
            string productID  = lot.CurrentProductID;
            string productVer = lot.CurrentProductVersion;

            var targetEqp = subEqp.Parent as FabEqp;

            var setInfo = GetEqpArrangeSet(eqpID, targetEqp, stdStep, productID, productVer, true);

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

            bool isLastPlan = subEqp.IsLastPlan(lot);

            List <EqpArrangeInfo> loadableList;
            bool isLoadable = setInfo.IsLoadable(lot, checkQty, isLastPlan, out loadableList);

            if (isLoadable)
            {
                lot.CurrentEqpArrange = new CurrentArrange()
                {
                    EqpArrrangeSet = setInfo,
                    LoadableList   = loadableList,
                    UsedEqpArrange = null
                };
            }

            return(isLoadable);
        }
예제 #18
0
        internal static void ChangeCurrentRunMode(this FabSubEqp subEqp, FabLot lot)
        {
            if (subEqp == null)
            {
                return;
            }

            if (lot == null)
            {
                return;
            }

            var step = lot.CurrentFabStep;

            if (step == null || step.StdStep == null)
            {
                return;
            }

            var    targetEqp = subEqp.Parent as FabEqp;
            string eqpGroup  = targetEqp.EqpGroup;
            string runMode   = subEqp.SubEqpGroup.CurrentRunMode;
            string productID = lot.CurrentProductID;
            string ownerType = lot.OwnerType;

            var branchStep = BranchStepMaster.GetBranchStep(eqpGroup, runMode);

            if (branchStep != null)
            {
                //현재 runMode에서 Loadable 한 경우 RunMode 유지
                if (branchStep.IsLoadable(productID, ownerType))
                {
                    return;
                }
            }

            //change runMode (DefaultRunMode)
            subEqp.SubEqpGroup.CurrentRunMode = step.StdStep.DefaultRunMode;
        }
예제 #19
0
        public static void OnStateChanged(this FabSubEqp subEqp, FabAoEquipment parent,
                                          LoadingStates state, FabLot lot = null, bool isDone = false)
        {
            var      eqp = parent;
            DateTime now = eqp.NowDT;

            //PM 발생시 IDLE 무시
            bool isIngore = subEqp.UpdateLastLoadInfo(now, state, eqp, isDone);

            if (isIngore && isDone == false)
            {
                return;
            }

            subEqp.SetLastFabLoadInfo(state, now, lot, isDone);

            UpdateAheadSetupInfo(eqp, state, now);

            if (state == LoadingStates.BUSY)
            {
                subEqp.LastPlan = lot.CurrentFabPlan;

                subEqp.LastIdleRunStartTime = DateTime.MinValue;
                subEqp.LastIdleStartTime    = DateTime.MinValue;
            }

            if (state == LoadingStates.IDLE)
            {
                subEqp.LastIdleStartTime = now;
            }

            if (state == LoadingStates.IDLERUN)
            {
                subEqp.LastIdleRunStartTime = now;
            }


            subEqp.ChangeCurrentRunMode(lot);
        }
예제 #20
0
        private static bool UpdateLastLoadInfo(this FabSubEqp subEqp, DateTime now, LoadingStates state, FabAoEquipment eqp, bool isDone)
        {
            var lastInfo = subEqp.LastLoadInfo;

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

            if (SimHelper.IgnoreStateChange(eqp, state, isDone))
            {
                return(true);
            }

            lastInfo.EndTime = now;

            var lastPlan = lastInfo.Target as FabPlanInfo;

            if (lastPlan != null)
            {
                lastPlan.EqpInEndTime = now;
            }

            var infos = subEqp.LoadInfos;

            if (lastInfo.IsDummyState())
            {
                infos.Remove(lastInfo);
            }

            //TODO : 임시처리 BUSY 중복 제외
            if (lastInfo.IsDummyState_Busy())
            {
                infos.Remove(lastInfo);
            }

            return(false);
        }
예제 #21
0
        public static void WriteDispatchLog(FabAoEquipment eqp, EqpDispatchInfo info, FabSubEqp subEqp)
        {
            if (eqp == null || info == null)
            {
                return;
            }

            DateTime dispatchTime = info.DispatchTime;

            if (dispatchTime == DateTime.MinValue || dispatchTime == DateTime.MaxValue)
            {
                return;
            }

            string dispatchTimeStr = LcdHelper.DbToString(dispatchTime);
            var    last            = eqp.LastPlan as FabPlanInfo;

            string eqpID    = eqp.EqpID;
            string subEqpID = string.Empty;

            if (subEqp != null)
            {
                subEqpID = subEqp.SubEqpID;
                last     = subEqp.LastPlan as FabPlanInfo;
            }

            var table = OutputMart.Instance.EqpDispatchLog;
            var row   = table.Find(eqpID, subEqpID, dispatchTimeStr);

            //parent EqpID 존재시
            if (row == null)
            {
                if (eqp.IsParallelChamber && subEqp != null)
                {
                    row = table.Find(eqpID, string.Empty, dispatchTimeStr);
                }
            }

            if (row == null)
            {
                row = new EqpDispatchLog();

                row.EQP_ID           = eqpID;
                row.SUB_EQP_ID       = subEqpID;
                row.DISPATCHING_TIME = dispatchTimeStr;

                table.Add(row);
            }

            FabEqp targetEqp = eqp.TargetEqp;

            row.VERSION_NO = ModelContext.Current.VersionNo;

            row.FACTORY_ID = targetEqp.FactoryID;
            row.SHOP_ID    = targetEqp.ShopID;
            row.EQP_GROUP  = targetEqp.EqpGroup;

            row.SUB_EQP_ID = subEqpID;

            if (last != null)
            {
                StringBuilder sb = GetDefaultLotInfo(last.LotID,
                                                     last.ProductID,
                                                     last.ProductVersion,
                                                     last.StepID,
                                                     last.UnitQty.ToString(),
                                                     last.OwnerType,
                                                     last.OwnerID,
                                                     Constants.NULL_ID);
                row.LAST_WIP = sb.ToString();
            }

            row.SELECTED_WIP     = info.SelectedWipLog;
            row.DISPATCH_WIP_LOG = ParseDispatchWipLog(info);

            int filteredWipCnt = 0;

            row.FILTERED_WIP_LOG = ParseFilteredInfo(info, ref filteredWipCnt);

            row.FILTERED_WIP_CNT = filteredWipCnt;
            row.SELECTED_WIP_CNT = string.IsNullOrWhiteSpace(info.SelectedWipLog) ? 0 : info.SelectedWipLog.Split(';').Length;
            row.INIT_WIP_CNT     = row.FILTERED_WIP_CNT + info.Batches.Count;

            if (targetEqp.Preset != null)
            {
                row.PRESET_ID = targetEqp.Preset.Name;
            }
        }