示例#1
0
        public static void InitPM(this FabEqp eqp)
        {
            if (eqp.PMList == null)
            {
                eqp.PMList = new List <PMSchedule>();
            }

            List <PMSchedule> pmlist = DownMaster.GetPmList(eqp);

            if (eqp.State == ResourceState.Down && eqp.StatusInfo.MesStatus == MesEqpStatus.PM)
            {
                //EqpStatus PM 상태 반영
                FabPMSchedule initPM = CreateHelper.CreateFabPMSchedule(eqp.StatusInfo.StartTime, (int)eqp.StatusInfo.Duration, ScheduleType.PM, 0, 0);
                eqp.PMList.Add(initPM);

                //설비상태가 PM일경우 24시간 이내 PM은 무시
                DateTime pmFenceDate = ModelContext.Current.StartTime.AddDays(1);
                foreach (PMSchedule item in pmlist)
                {
                    if (item.StartTime < pmFenceDate)
                    {
                        continue;
                    }

                    eqp.PMList.Add(item);
                }
            }
            else
            {
                eqp.PMList.AddRange(pmlist);
            }
        }