Exemple #1
0
        public static void UpdateDispatchLogByAheadSetup(FabAoEquipment eqp, EqpDispatchInfo info)
        {
            if (eqp == null || info == null)
            {
                return;
            }

            //TODO : [bong] ParallelChamber는 제외
            if (eqp.IsParallelChamber)
            {
                return;
            }

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

            string setupStartTime = LcdHelper.DbToString(eqp.AvailableSetupTime);
            string dispatchTime   = LcdHelper.DbToString(info.DispatchTime);

            //Dispach시간과 AheadSetup 으로 인해 시간이 다름
            if (setupStartTime != dispatchTime)
            {
                var table = OutputMart.Instance.EqpDispatchLog;

                EqpDispatchLog origRow = table.Find(eqpID, subEqpID, dispatchTime);
                EqpDispatchLog dubRow  = table.Find(eqpID, subEqpID, setupStartTime);

                string otherInfo = string.Format("ORIGIN_TIME:{0}", dispatchTime);

                if (dubRow != null)
                {
                    dubRow.DISPATCHING_TIME = setupStartTime;

                    dubRow.INIT_WIP_CNT     = origRow.INIT_WIP_CNT;
                    dubRow.FILTERED_WIP_CNT = origRow.FILTERED_WIP_CNT;
                    dubRow.SELECTED_WIP_CNT = origRow.SELECTED_WIP_CNT;
                    dubRow.SELECTED_WIP     = origRow.SELECTED_WIP;
                    dubRow.FILTERED_WIP_LOG = origRow.FILTERED_WIP_LOG;
                    dubRow.DISPATCH_WIP_LOG = origRow.DISPATCH_WIP_LOG;
                    dubRow.PRESET_ID        = origRow.PRESET_ID;
                    dubRow.OTHER_INFO       = otherInfo;
                }
                else if (origRow != null)
                {
                    origRow.DISPATCHING_TIME = setupStartTime;
                    origRow.OTHER_INFO       = otherInfo;
                }
            }
        }
Exemple #2
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;
            }
        }