Beispiel #1
0
        private static void SetWipStayHours(this QTimeInfo info, string lotID, DateTime planStartTime)
        {
            if (info.HasQTime() == false)
            {
                return;
            }

            foreach (var it in info.List)
            {
                string fromStepID = it.FromStep.StepID;
                var    finds      = InputMart.Instance.WipStayHoursDict.FindRows(lotID, fromStepID);
                if (finds == null)
                {
                    continue;
                }

                var find = finds.FirstOrDefault();
                if (find == null)
                {
                    continue;
                }

                DateTime fromStepOutTime = LcdHelper.Min(find.FROM_STEP_OUT_TIME, planStartTime);
                if (fromStepOutTime == DateTime.MinValue)
                {
                    continue;
                }

                it.FromStepOutTime = fromStepOutTime;
            }
        }
Beispiel #2
0
        private static void Allocate_State(this DcnBucket bck, EqpStatusInfo info, DateTime startTime, DateTime endTime, DateTime now)
        {
            if (info == null)
            {
                return;
            }

            if (info.Duration <= 0)
            {
                return;
            }

            DateTime st = LcdHelper.Max(info.StartTime, startTime);
            DateTime et = LcdHelper.Min(info.EndTime, endTime);

            if (st < et)
            {
                DcnPlan plan = new DcnPlan()
                {
                    Product      = null,
                    Target       = null,
                    AllocQty     = 0,
                    TactTime     = 0,
                    EqpStartTime = st,
                    EqpEndTime   = et,
                    AllocTime    = now,
                    EqpID        = bck.EqpID,
                    EqpState     = info.MesStatus.ToString()
                };

                bck.LastEqpEndTime = et;
                bck.Plans.Add(plan);
            }

            if (info.EndTime > et)
            {
                info.StartTime = et;
            }
            else
            {
                //clear
                info.StartTime = DateTime.MinValue;
                info.EndTime   = DateTime.MinValue;
            }
        }