예제 #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;
                }
            }
        }
예제 #2
0
        public static void WriteRelasePlan()
        {
            var dcnMst = ReleasePlanMaster.DcnMst;

            var bckList = dcnMst.Buckets;

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

            string versionNo = ModelContext.Current.VersionNo;

            foreach (var bck in bckList)
            {
                if (bck.HasAllocPlan() == false)
                {
                    continue;
                }

                string factoryID  = bck.FactoryID;
                string eqpGroupID = bck.EqpGroupID;
                string eqpID      = bck.EqpID;

                int count = bck.Plans.Count;
                for (int i = 0; i < count; i++)
                {
                    var plan = bck.Plans[i];

                    Outputs.ReleasePlan row = new ReleasePlan();

                    row.VERSION_NO   = versionNo;
                    row.FACTORY_ID   = factoryID;
                    row.EQP_GROUP_ID = eqpGroupID;
                    row.EQP_ID       = eqpID;

                    var target = plan.Target;
                    if (target != null)
                    {
                        row.STEP_ID     = target.StepID;
                        row.TARGET_DATE = target.TargetDate;
                        row.TARGET_QTY  = target.TargetQty;
                    }

                    row.SHOP_ID    = plan.ShopID;
                    row.PRODUCT_ID = plan.ProductID;

                    DateTime planDate = ShopCalendar.SplitDate(plan.EqpStartTime);
                    row.PLAN_DATE = LcdHelper.DbToString(planDate, false);

                    row.START_TIME = plan.EqpStartTime;
                    row.END_TIME   = plan.EqpEndTime;
                    row.UNIT_QTY   = plan.AllocQty;

                    if (target != null)
                    {
                        var inTarget = target.InTarget;
                        if (inTarget != null)
                        {
                            row.DEMAND_ID        = inTarget.DemandID;
                            row.DEMAND_PLAN_DATE = inTarget.DueDate;
                        }
                    }

                    row.ALLOC_EQP_SEQ = i + 1;
                    row.ALLOC_SEQ     = plan.AllocSeq;
                    row.ALLOC_TIME    = LcdHelper.DbToString(plan.AllocTime);

                    var fixPlan = plan.FixPlan;
                    if (fixPlan != null)
                    {
                        row.PLAN_STATE = fixPlan.PLAN_STATE;
                    }
                    else
                    {
                        row.PLAN_STATE = plan.EqpState;
                    }

                    OutputMart.Instance.ReleasePlan.Add(row);
                }

                //clear
                bck.ClearAllocPlan();
            }
        }
예제 #3
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;
            }
        }