Esempio n. 1
0
 public ToolBar(
     string shopID,
     string eqpId,
     string productId,
     string processId,
     string layer,
     string toolID,
     string stepId,
     string lotId,
     DateTime startTime,
     DateTime endTime,
     int qty,
     EqpState state,
     EqpMaster.Eqp info,
     DataRow dispatchingInfo = null,
     bool isGhostBar         = false)
     : base(startTime, endTime, qty, qty, state)
 {
     this.ShopID          = shopID;
     this.EqpId           = eqpId;
     this.ProductId       = productId;
     this.ProcessId       = processId;
     this.Layer           = layer;
     this.ToolID          = toolID;
     this.StepId          = stepId;
     this.LotId           = lotId;
     this.EqpInfo         = info;
     this.DispatchingInfo = dispatchingInfo;
     this.IsGhostBar      = isGhostBar;
 }
Esempio n. 2
0
 public ToolSchedInfo(
     string shopID,
     string eqpId,
     string productId,
     string processId,
     string layer,
     string toolID,
     string eqpGroup,
     string stepId,
     string lotId,
     DateTime startTime,
     DateTime endTime,
     DateTime tkInTime,
     DateTime tkOutTime,
     int qty,
     EqpState state,
     EqpMaster.Eqp eqpInfo)
 {
     this.ShopID    = shopID;
     this.EqpId     = eqpId;
     this.ProductId = productId;
     this.ProcessId = processId;
     this.Layer     = layer;
     this.ToolId    = toolID;
     this.EqpGroup  = eqpGroup;
     this.StepId    = stepId;
     this.LotId     = lotId;
     this.StartTime = startTime;
     this.EndTime   = endTime;
     this.TkInTime  = tkInTime;
     this.TkOutTime = tkOutTime;
     this.Qty       = qty;
     this.State     = state;
     this.EqpInfo   = eqpInfo;
 }
Esempio n. 3
0
 public DownItemInfo(string eqpID, string eqpGroup, DateTime loadTime, DateTime endTime, DateTime stateEndTime, EqpState state, DateTime toTime, EqpMaster.Eqp eqp)
 {
     this.EqpID        = eqpID;
     this.EqpGroup     = eqpGroup;
     this.LoadTime     = loadTime;
     this.EndTime      = endTime;
     this.StateEndTime = stateEndTime;
     this.State        = state;
     this.ToTime       = toTime;
     this.Eqp          = eqp;
 }
Esempio n. 4
0
        public GanttBar(
            string eqpGroup,
            string eqpID,
            string subEqpID,
            string layer,
            string lotID,
            string origLotID,
            string wipInitRun,
            string productID,
            string productVersion,
            string ownerID,
            string processID,
            string stepID,
            string toolID,
            DateTime startTime,
            DateTime endTime,
            int inQty,
            EqpState state,
            EqpMaster.Eqp info,
            DataRow dispatchingInfo,
            int lotPriority,
            string eqpRecipe,
            string stateInfo,
            bool isGhostBar = false)
            : base(startTime, endTime, inQty, 0, state)
        {
            this.EqpGroup = eqpGroup;
            this.EqpID    = eqpID;
            this.SubEqpID = subEqpID;
            this.Layer    = layer;

            this.LotID      = lotID;
            this.OrigLotID  = origLotID;
            this.WipInitRun = wipInitRun;

            this.ProductID      = productID;
            this.ProductVersion = productVersion;
            this.OwnerType      = ownerID;

            this.ProcessID = processID;
            this.StepID    = stepID;

            this.ToolID  = toolID;
            this.EqpInfo = info;

            this.DispatchingInfo = dispatchingInfo;

            this.LotPriority = lotPriority;
            this.EqpRecipe   = eqpRecipe;
            this.StateInfo   = stateInfo;

            this.IsGhostBar = isGhostBar;
        }
Esempio n. 5
0
 public virtual void AddItem
 (
     string lotID,
     string processID,
     string stepSeq,
     string productID,
     DateTime tkin, DateTime tkout,
     int qty,
     EqpState state,
     DateTime toTime
 )
 {
 }
Esempio n. 6
0
        private Dictionary <string, List <string> > GetPlanStepList(List <EqpPlan> planList)
        {
            Dictionary <string, List <string> > infos = new Dictionary <string, List <string> >();

            bool isFilterIDLE = true;

            foreach (var item in planList)
            {
                EqpState state = Enums.ParseEqpState(item.EQP_STATUS);

                if (state == EqpState.DOWN || state == EqpState.PM)
                {
                    continue;
                }

                if (IsMatched_Plan(item, state, isFilterIDLE) == false)
                {
                    continue;
                }

                string eqpID = item.EQP_ID;

                EqpMaster.Eqp eqp;
                if (TryGetValidEqp(eqpID, out eqp) == false)
                {
                    continue;
                }

                string shopID      = item.SHOP_ID;
                string subEqpID    = item.SUB_EQP_ID;
                string detailEqpID = GetDetailEqpID(eqpID, subEqpID);

                string stepID = StringHelper.ToSafeString(item.STEP_ID);

                List <string> list;
                if (infos.TryGetValue(detailEqpID, out list) == false)
                {
                    list = new List <string>();
                    infos.Add(detailEqpID, list);
                }

                if (list.Contains(stepID))
                {
                    continue;
                }

                list.Add(stepID);
            }

            return(infos);
        }
Esempio n. 7
0
        private bool IsMatched_Plan(EqpPlan item, EqpState state, bool isFilterIDLE)
        {
            var fromTime = this.FromTime;
            var toTime   = this.ToTime;

            //상태시작시간
            DateTime startTime = item.START_TIME.GetValueOrDefault(toTime);

            if (startTime >= toTime)
            {
                return(false);
            }

            //상태종료시간
            DateTime endTime = item.END_TIME.GetValueOrDefault(toTime);

            if (endTime <= fromTime)
            {
                return(false);
            }

            //PlanStartTime보다 EqpPlanStart가 작을 경우 (초기Run재공)
            if (startTime < fromTime)
            {
                startTime = fromTime;
            }

            //PlanEndTime보다 Lot의 EndTime이 작을 경우
            if (endTime > toTime)
            {
                endTime = toTime;
            }

            //ProcessedTime is zero
            if (startTime >= endTime)
            {
                return(false);
            }

            if (isFilterIDLE)
            {
                //IDLE, IDLERUN
                if ((state == EqpState.IDLE || state == EqpState.IDLERUN))
                {
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 8
0
        private bool IsIDLE(string eqpStatus)
        {
            if (string.IsNullOrEmpty(eqpStatus))
            {
                return(false);
            }

            EqpState state = Enums.ParseEqpState(eqpStatus);

            if (state == EqpState.IDLE || state == EqpState.IDLERUN)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 9
0
        private void DoAddItem(
            GanttInfo info,
            string productId,
            string processId,
            string layer,
            string stepId,
            string lotId,
            DateTime startTime,
            DateTime endTime,
            int qty,
            EqpState state,
            EqpMaster.Eqp eqpInfo,
            DataRow dispatchingInfo)
        {
            string shopID = info.ShopID;
            string eqpId  = info.EqpID;
            string toolID = info.ToolID;

            ToolBar currentBar = new ToolBar(
                shopID,
                eqpId,
                productId,
                processId,
                layer,
                toolID,
                stepId,
                lotId,
                startTime,
                endTime,
                qty,
                state,
                eqpInfo,
                dispatchingInfo,
                false
                );

            var barKey = state != EqpState.DOWN ? currentBar.BarKey : "DOWN";

            if (barKey != string.Empty)
            {
                info.AddItem(barKey, currentBar, this.IsOnlyToolMode);
            }
        }
Esempio n. 10
0
 public GanttBar(
     EqpPlanItem item,
     DateTime tkIn,
     DateTime tkOut,
     double tiQty,
     double toQty,
     EqpState state)
     : base(tkIn, tkOut, tiQty, toQty, state)
 {
     this.LineID    = item.LineID;
     this.ProductID = item.ProductID;
     this.ProcessID = item.ProcessID;
     this.StepID    = item.StepID;
     this.EqpID     = item.EqpID;
     this.LotID     = item.LotID;
     this.StartTime = item.StartTime;
     this.EndTime   = item.EndTime;
     this.Qty       = item.Qty;
     this.Status    = item.Status;
 }
Esempio n. 11
0
 public virtual void AddItem(
     EqpMaster.Eqp eqpInfo,
     string shopID,
     string toolID,
     string productId,
     string processId,
     string layer,
     string stepId,
     string lotId,
     DateTime startTime,
     DateTime endTime,
     DateTime tkInTime,
     DateTime tkOutTime,
     DateTime nextStateStartTime,
     int qty,
     EqpState state,
     DataRow dispatchingInfo = null
     )
 {
 }
Esempio n. 12
0
        private GanttBar AddItem(
            EqpPlanItem item,
            DateTime tkin,
            DateTime tkout,
            EqpState state,
            string seltype
            )
        {
            var info = this.TryGetGanttInfo(item.LineID, item.STEP_GROUP, item.EqpID);

            var currentBar = new GanttBar(item, tkin, tkout, item.Qty, item.Qty, state);

            if (string.IsNullOrEmpty(currentBar.BarKey))
            {
                return(null);
            }

            info.AddItem(currentBar.BarKey, currentBar, seltype);

            return(currentBar);
        }
Esempio n. 13
0
        public override void  AddItem(
            EqpMaster.Eqp eqpInfo,
            string shopID,
            string toolID,
            string productId,
            string processId,
            string layer,
            string stepId,
            string lotId,
            DateTime startTime,
            DateTime endTime,
            DateTime tkInTime,
            DateTime tkOutTime,
            DateTime nextStateStartTime,
            int qty,
            EqpState state,
            DataRow dispatchingInfo = null)
        {
            GanttInfo info = (GanttInfo)TryGetItem(eqpInfo, shopID, toolID, stepId);

            //BUSY
            DoAddItem(info, productId, processId, layer, stepId, lotId,
                      startTime, endTime, qty, state, eqpInfo, dispatchingInfo);

            //IDLE RUN
            DateTime barStartTime = endTime;
            DateTime barEndTime   = tkOutTime;

            if (barEndTime > nextStateStartTime)
            {
                barEndTime = nextStateStartTime;
            }

            if (barStartTime < barEndTime)
            {
                DoAddItem(info, productId, processId, layer, stepId, lotId,
                          barStartTime, barEndTime, 0, EqpState.IDLERUN, eqpInfo, dispatchingInfo);
            }
        }
Esempio n. 14
0
        private DataRow FindDispInfo(string eqpID, string subEqpID, EqpState state, DateTime startTime, DateTime endTime)
        {
            string eqpKey = CommonHelper.CreateKey(eqpID, subEqpID);

            DataRow find;

            if (this.DispInfos.TryGetValue(eqpKey, startTime, out find))
            {
                return(find);
            }

            //AheadSetup인 경우 EndTime 기준으로 추가 체크
            if (state == EqpState.SETUP)
            {
                if (this.DispInfos.TryGetValue(eqpKey, endTime, out find))
                {
                    return(find);
                }
            }

            return(null);
        }
Esempio n. 15
0
        private void AddItem(
            string key,
            EqpMaster.Eqp eqpInfo,
            string subEqpID,
            int?subEqpCount,
            string layer,
            string lotID,
            string origLotID,
            string wipInitRun,
            string productID,
            string productVersion,
            string ownerID,
            string processID,
            string stepID,
            string toolID,
            DateTime startTime,
            DateTime endTime,
            int inQty,
            EqpState state,
            DataRow dispInfo,
            int lotPriority,
            string eqpRecipe,
            string stateInfo,
            bool isGhostBar = false)
        {
            string shopID   = eqpInfo.ShopID;
            string eqpGroup = eqpInfo.EqpGroup;
            string eqpID    = eqpInfo.EqpID;

            GanttInfo info;

            if (this.GanttInfos.TryGetValue(key, out info) == false)
            {
                this.GanttInfos.Add(key, info = new GanttInfo(eqpGroup, eqpID, subEqpID, subEqpCount, layer));
            }

            int sortSeq = GetSortSeq(shopID, stepID);

            //SortSeq MIN 기준으로 변경
            info.SortSeq = Math.Min(info.SortSeq, sortSeq);

            GanttBar bar = new GanttBar(eqpGroup,
                                        eqpID,
                                        subEqpID,
                                        layer,
                                        lotID,
                                        origLotID,
                                        wipInitRun,
                                        productID,
                                        productVersion,
                                        ownerID,
                                        processID,
                                        stepID,
                                        toolID,
                                        startTime,
                                        endTime,
                                        inQty,
                                        state,
                                        eqpInfo,
                                        dispInfo,
                                        lotPriority,
                                        eqpRecipe,
                                        stateInfo,
                                        isGhostBar);

            var barKey = state != EqpState.DOWN ? bar.BarKey : "DOWN";

            if (barKey != string.Empty)
            {
                //SETUP 다음 BUSY로 이어진 BUSY Bar는 SETUP과 동일한 값 설정 하도록 함.
                if (bar.DispatchingInfo == null && bar.State == EqpState.BUSY)
                {
                    bar.DispatchingInfo = GetDispInfoBySetup(info, barKey);
                }

                info.AddItem(barKey, bar, this.IsProductInBarTitle);
            }

            //collect job change
            if (state == EqpState.SETUP)
            {
                AddJobChange(startTime);
            }
        }
Esempio n. 16
0
        public override void AddItem(string lotID, string processID, string stepSeq, string productID, DateTime tkin, DateTime tkout, int qty, EqpState state, DateTime toTime)
        {
            var info = this.TryGetItem(lotID);

            this.DoAddItem(lotID, processID, stepSeq, productID, qty, tkin, tkout, toTime, info as GanttInfo);
        }
Esempio n. 17
0
        private void FillData_EqpPlan(
            List <EqpPlan> planList,
            ViewMode viewMode,
            bool isFilterDownEqp,
            bool isFilterIDLE)
        {
            if (planList == null)
            {
                return;
            }

            var stepInfos = GetPlanStepList(planList);

            var fromTime = this.FromTime;
            var toTime   = this.ToTime;

            foreach (var item in planList)
            {
                EqpState state = Enums.ParseEqpState(item.EQP_STATUS);
                if (IsMatched_Plan(item, state, isFilterIDLE) == false)
                {
                    continue;
                }

                string shopID = item.SHOP_ID;
                string eqpID  = item.EQP_ID;

                EqpMaster.Eqp eqp;
                if (TryGetValidEqp(eqpID, out eqp) == false)
                {
                    continue;
                }

                string subEqpID       = item.SUB_EQP_ID;
                int?   subEqpCount    = item.SUB_EQP_COUNT;
                string eqpGoup        = eqp.EqpGroup;
                string productID      = StringHelper.ToSafeString(item.PRODUCT_ID);
                string productVersion = StringHelper.ToSafeString(item.PRODUCT_VERSION);
                string ownerType      = StringHelper.ToSafeString(item.OWNER_TYPE);

                string processID = StringHelper.ToSafeString(item.PROCESS_ID);
                string stepID    = StringHelper.ToSafeString(item.STEP_ID);

                string toolID = StringHelper.ToSafeString(item.TOOL_ID);
                string lotID  = StringHelper.ToSafeString(item.LOT_ID);

                DateTime startTime = item.START_TIME.GetValueOrDefault(toTime);
                DateTime endTime   = item.END_TIME.GetValueOrDefault(toTime);

                if (startTime < fromTime)
                {
                    startTime = fromTime;
                }

                int qty = (int)item.UNIT_QTY;
                if (state == EqpState.SETUP)
                {
                    qty = 0;
                }

                string layer      = GetLayer(shopID, stepID);
                string origLotID  = lotID;
                string wipInitRun = item.WIP_INIT_RUN;

                DataRow dispInfo = FindDispInfo(eqpID, subEqpID, state, startTime, endTime);

                string detailEqpID = GetDetailEqpID(eqpID, subEqpID);

                int    lotPriority = item.LOT_PRIORITY;
                string eqpRecipe   = item.IS_EQP_RECIPE;
                string stateInfo   = item.EQP_STATUS_INFO;

                List <string> stepList = FindPlanStepList(stepInfos, detailEqpID, stepID, state);

                foreach (string planStepID in stepList)
                {
                    string planLayer = GetLayer(shopID, planStepID);

                    string key = CommonHelper.CreateKey(detailEqpID, planLayer);
                    if (viewMode == ViewMode.EQPGROUP)
                    {
                        key = CommonHelper.CreateKey(detailEqpID, eqpGoup);
                    }

                    AddItem(key,
                            eqp,
                            subEqpID,
                            subEqpCount,
                            planLayer,
                            lotID,
                            origLotID,
                            wipInitRun,
                            productID,
                            productVersion,
                            ownerType,
                            processID,
                            planStepID,
                            toolID,
                            startTime,
                            endTime,
                            qty,
                            state,
                            dispInfo,
                            lotPriority,
                            eqpRecipe,
                            stateInfo
                            );
                }
            }

            //BUSY, SETUP, PM이 전혀 없는 설비 제외
            FilterDownEqp(isFilterDownEqp);
        }
Esempio n. 18
0
        private void AddItem(DataTable result, string eqpID, string eqpGrp, string chamberID, string layer, string lotID, string origLotID, string productID, string productVersion, string ownerType, string processID, string stepID, string toolID, DateTime startTime, DateTime endTime, int qty, EqpState state, string eqpID_2, DataRow dispatchingInfo)
        {
            DataRow row = result.NewRow();

            row[ColName.EqpID]      = eqpID;
            row[ColName.ChamberID]  = chamberID;
            row[ColName.EqpGroup]   = eqpGrp;
            row[ColName.LotID]      = lotID;
            row[ColName.ProductID]  = productID;
            row[ColName.ProductVer] = productVersion;
            row[ColName.Status]     = state.ToString();
            row[ColName.StartTime]  = DateHelper.Format(startTime);
            row[ColName.EndTime]    = DateHelper.Format(endTime);

            result.Rows.Add(row);
        }
Esempio n. 19
0
        private void FillData_LoadHist(DataTable result, DataView dvPlan, string targetShopID, string targetEqpID, bool showDownEqp)
        {
            //var runWipList = GetRunWipList(targetShopID);

            string           factoryStartTime          = ShopCalendar.StartTime.ToString().Replace(":", "");
            HashSet <string> sameValueContainer        = new HashSet <string>();
            Dictionary <string, List <DataRow> > datas = CollectionPlanData(dvPlan);

            var fromTime = this.StartDate;
            var toTime   = this.EndDate;

            foreach (List <DataRow> planDataRows in datas.Values)
            {
                int rowCount = planDataRows.Count;

                for (int j = 0; j < rowCount; j++)
                {
                    DataRow row     = planDataRows[j];
                    DataRow nextRow = j < (rowCount - 1) ? planDataRows[j + 1] : null;

                    string eqpID     = row.GetString(ColName.EqpID);
                    string chamberID = row.GetString(ColName.ChamberID);
                    string eqpGrp    = row.GetString(ColName.EqpGroup);

                    EqpMaster.Eqp eqp;
                    if (TryGetValidEqp(eqpID, out eqp) == false)
                    {
                        continue;
                    }


                    DateTime targetDate = DateUtility.DbToDate(row.GetString("TARGET_DATE"));


                    string[] data = SchedOut.LoadInfo.DetectNoise(SchedOut.Split(row), targetDate);

                    for (int k = 0; k < data.Length; k++)
                    {
                        var loadInfo = PackedTable.Split <SchedOut.LoadInfo>(data[k]);

                        string strStartTime = loadInfo.StartTime;

                        string shopID         = loadInfo.ShopID;
                        string productID      = loadInfo.ProductID;
                        string productVersion = loadInfo.ProductVersion;
                        string ownerType      = loadInfo.OwnerType;

                        string processID = loadInfo.ProcessID;
                        string stepID    = loadInfo.StepID;
                        string stdStep   = stepID;

                        string toolID = loadInfo.ProcessID;


                        string   lotID = loadInfo.LotID;
                        EqpState state = Enums.ParseEqpState(loadInfo.State);

                        if (string.IsNullOrEmpty(targetEqpID) == false && LikeUtility.Like(eqpID, targetEqpID) == false)
                        {
                            continue;
                        }

                        //상태시작시간
                        DateTime startTime = SchedOut.LHStateTime(targetDate, loadInfo.StartTime);
                        if (startTime >= toTime)
                        {
                            continue;
                        }

                        int qty = CommonHelper.ToInt32(loadInfo.Qty);
                        if (state == EqpState.SETUP)
                        {
                            qty = 0;
                        }

                        //현재데이터값
                        string nowValue = eqpID + ";" + state + ";" + processID + ";" + stepID + ";" + lotID + ";" + qty.ToString();
                        if (loadInfo.StartTime.CompareTo(factoryStartTime) == 0 && sameValueContainer.Contains(nowValue))
                        {
                            qty = 0;
                        }

                        sameValueContainer.Add(nowValue);

                        //상태종료시간
                        DateTime endTime = toTime;

                        //이전 OutTime에 현재 InTime 넣어주기
                        TryGetEndTime(data, targetDate, startTime, stepID, loadInfo.StartTime, k, ref endTime);

                        //IDLE과 IDLERUN을 없애기 위한 Merge
                        if (k < data.Length - 1)
                        {
                            var nextLoadInfo = PackedTable.Split <SchedOut.LoadInfo>(data[k + 1]);
                            endTime = SchedOut.LHStateTime(targetDate, nextLoadInfo.StartTime);
                        }
                        else if (nextRow != null)
                        {
                            string   nextEqpID      = nextRow.GetString("EQP_ID");
                            DateTime nextTargetDate = DateUtility.DbToDate(nextRow.GetString("TARGET_DATE"));

                            string[] nextDataTemp = PackedTable.Split(nextRow);
                            string[] nextData     = SchedOut.LoadInfo.DetectNoise(nextDataTemp, nextTargetDate);

                            if (nextData.Length > 0)
                            {
                                var nextLoadInfo = PackedTable.Split <SchedOut.LoadInfo>(nextData[0]);

                                //공장가동 시간(06시)의 전날 자료 무시(이전 데이터와 동일 데이터)
                                if (nextLoadInfo.StartTime.CompareTo(factoryStartTime) == 0)
                                {
                                    string nextValue = nextEqpID + ";" + nextLoadInfo.State + ";" + nextLoadInfo.ProcessID + ";" + nextLoadInfo.StepID + ";" + nextLoadInfo.LotID + ";" + nextLoadInfo.Qty.ToString();

                                    if (sameValueContainer.Contains(nextValue) && nextData.Length > 1)
                                    {
                                        nextLoadInfo = PackedTable.Split <SchedOut.LoadInfo>(nextData[1]);
                                    }
                                }

                                string endDate2 = DateHelper.DateToString(nextTargetDate) + nextLoadInfo.StartTime;
                                endTime = ShopCalendar.AdjustSectionDateTime(DateHelper.StringToDateTime(endDate2));
                            }
                        }

                        if (endTime <= fromTime)
                        {
                            continue;
                        }

                        //ProcessedTime is zoro
                        if (startTime >= endTime)
                        {
                            continue;
                        }

                        ////IDLE, IDLERUN
                        //if ((state == EqpState.IDLE || state == EqpState.IDLERUN))
                        //    continue;

                        string layer     = GetLayer(shopID, stepID);
                        string origLotID = lotID;

                        DataRow dispatchingInfo = FindDispInfo(eqpID, startTime);

                        AddItem(result,
                                eqpID,
                                eqpGrp,
                                chamberID,
                                layer,
                                lotID,
                                origLotID,
                                productID,
                                productVersion,
                                ownerType,
                                processID,
                                stepID,
                                toolID,
                                startTime,
                                endTime,
                                qty,
                                state,
                                eqpID,
                                dispatchingInfo);
                    }
                }
            }
        }
Esempio n. 20
0
 public GanttBar(string lotID, string processID, string stepSeq, string productID, DateTime tkin, DateTime tkout, int tiqty, int toqty, EqpState state)
     : base(tkin, tkout, tiqty, toqty, state)
 {
     this.LotID     = lotID;
     this.ProcessID = processID;
     this.StepSeq   = stepSeq;
     this.ProductID = productID;
 }
Esempio n. 21
0
        private List <string> FindPlanStepList(Dictionary <string, List <string> > infos, string detailEqpID, string stepID, EqpState state)
        {
            List <string> list = new List <string>();

            if (state == EqpState.DOWN || state == EqpState.PM)
            {
                if (infos != null && infos.Count > 0)
                {
                    List <string> stepList;
                    if (detailEqpID != null && infos.TryGetValue(detailEqpID, out stepList))
                    {
                        list.AddRange(stepList);
                    }
                }
            }

            if (list.Count == 0)
            {
                list.Add(stepID);
            }

            return(list);
        }