Esempio n. 1
0
        private void BuildFabJig(Tool item)
        {
            int qty = item.QTY;

            for (int i = 1; i <= qty; i++)
            {
                string jigID = string.Format("{0}_{1}", item.TOOL_ID, i);

                FabMask mask = CreateHelper.CreateFabMask(item, jigID);

                JigMaster.AddTool(mask);
            }
        }
Esempio n. 2
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);
        }