Example #1
0
        private FabEqp CheckEqp(string factoryID, string shopID, string eqpID, string where, ref bool hasError)
        {
            FabEqp eqp = ResHelper.FindEqp(eqpID);

            if (eqp == null)
            {
                hasError = true;

                ErrHist.WriteIf(where + eqpID,
                                ErrCategory.PERSIST,
                                ErrLevel.WARNING,
                                factoryID,
                                shopID,
                                Constants.NULL_ID,
                                Constants.NULL_ID,
                                Constants.NULL_ID,
                                Constants.NULL_ID,
                                eqpID,
                                Constants.NULL_ID,
                                "NOT FOUND EQP",
                                string.Format("Table:{0}", where)
                                );
            }

            return(eqp);
        }
Example #2
0
        /// <summary>
        /// </summary>
        /// <param name="da"/>
        /// <param name="hb"/>
        /// <param name="destCount"/>
        /// <param name="handled"/>
        public void ON_NOT_FOUND_DESTINATION0(Mozart.SeePlan.Simulation.DispatchingAgent da, Mozart.SeePlan.Simulation.IHandlingBatch hb, int destCount, ref bool handled)
        {
            FabLot lot = hb.ToFabLot();


            //TODO:
            if (lot.CurrentFabStep.StdStep.IsMandatory)
            {
                ErrHist.WriteIf(string.Format("{0}/{1}/{2}", "NotFoundArrange", lot.CurrentFabStep.StepID, lot.CurrentProductID),
                                ErrCategory.SIMULATION,
                                ErrLevel.INFO,
                                lot.CurrentFactoryID,
                                lot.CurrentShopID,
                                lot.LotID,
                                lot.CurrentProductID,
                                lot.CurrentProductVersion ?? lot.Wip.ProductVersion,
                                lot.CurrentProcessID,
                                Constants.NULL_ID,
                                lot.CurrentStepID,
                                "ON NOT FOUND DESTINATION0",
                                string.Format("Check Arrange → LOT_ID:{0}", lot.ToString())
                                );

                return;
            }

            da.Factory.AddToBucketer(hb);
        }
Example #3
0
        private FabProcess CheckProcess(string factoryID, string shopID, string processID, string where, ref bool hasError)
        {
            FabProcess process = BopHelper.FindProcess(shopID, processID);

            if (process == null)
            {
                hasError = true;

                ErrHist.WriteIf(where + processID,
                                ErrCategory.PERSIST,
                                ErrLevel.WARNING,
                                factoryID,
                                shopID,
                                Constants.NULL_ID,
                                Constants.NULL_ID,
                                Constants.NULL_ID,
                                processID,
                                Constants.NULL_ID,
                                Constants.NULL_ID,
                                "NOT FOUND PROCESS",
                                string.Format("Table:{0}", where)
                                );
            }

            return(process);
        }
Example #4
0
        private FabStdStep CheckStdStep(string factoryID, string shopID, string stepID, string where, ref bool hasError)
        {
            FabStdStep step = BopHelper.FindStdStep(shopID, stepID);

            if (step == null)
            {
                hasError = true;

                ErrHist.WriteIf(where + stepID,
                                ErrCategory.PERSIST,
                                ErrLevel.WARNING,
                                factoryID,
                                shopID,
                                Constants.NULL_ID,
                                Constants.NULL_ID,
                                Constants.NULL_ID,
                                Constants.NULL_ID,
                                Constants.NULL_ID,
                                stepID,
                                "NOT FOUND STD_STEP",
                                string.Format("Table:{0}", where)
                                );
            }

            return(step);
        }
Example #5
0
        private string CheckMainProcessID(string factoryID, string shopID, string productID, string stepID, Wip wip, string where, ref bool hasError)
        {
            var proc = BopHelper.FindProcess2(productID, stepID);

            if (proc == null)
            {
                hasError = true;

                ErrHist.WriteIf(where + proc,
                                ErrCategory.PERSIST,
                                ErrLevel.WARNING,
                                factoryID,
                                shopID,
                                Constants.NULL_ID,
                                productID,
                                Constants.NULL_ID,
                                Constants.NULL_ID,
                                Constants.NULL_ID,
                                stepID,
                                "NOT FOUND MAIN_PROCESS",
                                string.Format("Table:{0}", where)
                                );

                return(null);
            }

            return(proc.ProcessID);
        }
Example #6
0
        private void CheckWipStateByHoldInfo(FabWipInfo wip, string holdType)
        {
            //AvailabaleTime이 MinValue일 경우 바로 가용( DateTime MinValue : HoldEndTime < PlanStartTime 경우임.)
            if (wip.AvailableTime == DateTime.MinValue)
            {
                ErrHist.WriteIf(string.Format("{0}/{1}", wip.LotID, "WipHold"),
                                ErrCategory.PERSIST,
                                ErrLevel.INFO,
                                wip.FactoryID,
                                wip.ShopID,
                                wip.LotID,
                                wip.WipProductID,
                                wip.ProductVersion,
                                wip.WipProcessID,
                                wip.WipEqpID,
                                wip.WipStepID,
                                string.Format("{0} : HoldEndTime < PlanStartTime", holdType),
                                string.Format("Change WIP_STATE : {0} → {1}", wip.CurrentState.ToString(), "WAIT")
                                );

                wip.CurrentState = Mozart.SeePlan.Simulation.EntityState.WAIT;
            }
            else if (wip.IsSubStepWip)
            {
                wip.CurrentState = Mozart.SeePlan.Simulation.EntityState.MOVE;
            }
            else
            {
                wip.CurrentState = Mozart.SeePlan.Simulation.EntityState.HOLD;
            }
        }
Example #7
0
        private bool InitInPortWip(AoFactory factory, IHandlingBatch hb)
        {
            FabLot lot = hb.ToFabLot();

            //if (lot.LotID == "TH961377N00")
            //	Console.WriteLine();

            if (lot.IsInPortWip == false)
            {
                return(false);
            }

            var    wipInitiator = ServiceLocator.Resolve <WipInitiator>();
            string eqpID        = wipInitiator.GetLoadingEquipment(hb);

            AoEquipment eqp;

            if (string.IsNullOrEmpty(eqpID) || factory.Equipments.TryGetValue(eqpID, out eqp) == false)
            {
                Logger.Warn("Can't Locate InportWip to Eqp {0}, check input data!", eqpID ?? "-");

                #region Write ErrorHistory
                ErrHist.WriteIf(string.Format("LocateInportWip{0}", lot.LotID),
                                ErrCategory.SIMULATION,
                                ErrLevel.INFO,
                                lot.CurrentFactoryID,
                                lot.CurrentShopID,
                                lot.LotID,
                                lot.CurrentProductID,
                                lot.CurrentProductVersion ?? lot.Wip.ProductVersion,
                                lot.CurrentProcessID,
                                eqpID,
                                lot.CurrentStepID,
                                "NOT FOUND EQP",
                                "Can't Locate InportWip");
                #endregion

                return(false);
            }
            else
            {
                FabAoEquipment feqp = eqp.ToFabAoEquipment();

                //Inport Wip (M잔여 수량 체크 X)
                if (EqpArrangeMaster.IsLoadable(feqp, lot, false) == false)
                {
                    #region Write ErrorHistory
                    ErrHist.WriteIf(string.Format("LocateInportWip{0}", lot.LotID),
                                    ErrCategory.SIMULATION,
                                    ErrLevel.INFO,
                                    lot.CurrentFactoryID,
                                    lot.CurrentShopID,
                                    lot.LotID,
                                    lot.CurrentProductID,
                                    lot.CurrentProductVersion ?? lot.Wip.ProductVersion,
                                    lot.CurrentProcessID,
                                    eqpID,
                                    lot.CurrentStepID,
                                    "NOT FOUND EQP_ARRANGE",
                                    "Can't Locate InportWip");
                    #endregion

                    return(false);
                }

                if (feqp.InitInPortWips == null)
                {
                    feqp.InitInPortWips = new List <IHandlingBatch>();
                }

                feqp.InitInPortWips.Add(hb);

                InFlowMaster.ChangeWipLocation(hb, EventType.StartTOWait);

                return(true);
            }
        }
Example #8
0
        private void BuildFabMask(Tool item, Dictionary <string, FabEqp> dic)
        {
            FabMask mask = CreateHelper.CreateFabMask(item);

            #region 중복체크
            if (InputMart.Instance.FabMask.ContainsKey(mask.ToolID))
            {
                ErrHist.WriteIf(string.Format("LoadTool{0}", mask.ToolID),
                                ErrCategory.PERSIST,
                                ErrLevel.INFO,
                                item.FACTORY_ID,
                                item.SHOP_ID,
                                Constants.NULL_ID,
                                Constants.NULL_ID,
                                Constants.NULL_ID,
                                Constants.NULL_ID,
                                item.EQP_ID,
                                Constants.NULL_ID,
                                "DUPLICATE TOOL_ID",
                                string.Format("Table:Tool → TOOL_ID:{0}", item.TOOL_ID)
                                );

                return;
            }
            #endregion

            if (mask.StateCode == ToolStatus.INUSE)
            {
                bool   hasError = false;
                FabEqp eqp      = CheckEqp(item.FACTORY_ID, item.SHOP_ID, item.EQP_ID, "Tool", ref hasError);

                if (hasError)
                {
                    #region Write ErrorHist
                    ErrHist.WriteIf(string.Format("LoadTool{0}", mask.ToolID),
                                    ErrCategory.PERSIST,
                                    ErrLevel.INFO,
                                    item.FACTORY_ID,
                                    item.SHOP_ID,
                                    Constants.NULL_ID,
                                    Constants.NULL_ID,
                                    Constants.NULL_ID,
                                    Constants.NULL_ID,
                                    item.EQP_ID,
                                    Constants.NULL_ID,
                                    "NOT FOUND EQP",
                                    string.Format("Table:Tool → TOOL_ID:{0} Change STATE_CODE {1} → {2} ", item.TOOL_ID, item.STATE_CODE, ToolStatus.WAIT.ToString())
                                    );
                    #endregion

                    mask.StateCode = ToolStatus.WAIT;
                }
                else
                {
                    //설비중복체크
                    FabEqp target;
                    if (dic.TryGetValue(mask.ToolID, out target))
                    {
                        #region Write ErrorHist
                        ErrHist.WriteIf(string.Format("LoadTool_EqpCheck{0}", mask.ToolID),
                                        ErrCategory.PERSIST,
                                        ErrLevel.INFO,
                                        item.FACTORY_ID,
                                        item.SHOP_ID,
                                        Constants.NULL_ID,
                                        Constants.NULL_ID,
                                        Constants.NULL_ID,
                                        Constants.NULL_ID,
                                        item.EQP_ID,
                                        Constants.NULL_ID,
                                        "ALREADY USED TOOL",
                                        string.Format("Table:Tool → TOOL_ID:{0} was uesd to EQP_ID:{1}", item.TOOL_ID, target.EqpID)
                                        );
                        #endregion

                        mask.EqpID     = Constants.NULL_ID;
                        mask.StateCode = ToolStatus.WAIT;
                    }
                    else
                    {
                        dic.Add(mask.ToolID, target);

                        if (eqp.InitMask == null)
                        {
                            eqp.InitMask = mask;
                        }
                        else
                        {
                            if (eqp.InitMask.StateChangeTime < mask.StateChangeTime)
                            {
                                eqp.InitMask.StateCode = ToolStatus.MOUNT;
                                eqp.InitMask           = mask;
                            }
                        }
                    }
                }
            }

            MaskMaster.AddTool(mask);
        }