示例#1
0
            public void CalculateTimeInSteps()
            {
                LotActivityRaw lastActivity = null;

                foreach (LotActivityRaw a in LotActivitiesRaw)
                {
                    // Time in step
                    if (a.TrackOut != null)
                    {
                        a.TimeInStep = a.TrackOut - a.TrackIn;
                    }
                    else
                    {
                        a.TimeInStep = null;
                    }

                    // Time before step and after step
                    if (lastActivity != null && lastActivity.TrackOut != null)
                    {
                        a.TimeBeforeStep           = a.TrackIn - lastActivity.TrackOut;
                        lastActivity.TimeAfterStep = a.TimeBeforeStep;
                    }

                    lastActivity = a;
                }
            }
示例#2
0
        public LotActivity(LotActivityRaw raw)
        {
            // Connect the two to each other
            RawActivities = new List <LotActivityRaw>();

            RawActivities.Add(raw);
            raw.LotActivity = this;
        }
示例#3
0
        public RealSnapshot GetWIPSnapshot(DateTime time, int waferQtyThreshold)
        {
            if (time < StartDate || time > EndDate)
            {
                throw new Exception($"WIP snapshot cannot be generated for time {time}, it is is out of bounds of these LotTraces");
            }
            else
            {
                List <RealLot> lots = new List <RealLot>();

                foreach (LotTrace trace in All)
                {
                    // Make sure that lot activities are ordered on track-in
                    //trace.LotActivitiesRaw = trace.LotActivitiesRaw.OrderBy(x => x.TrackIn).ToList();

                    if (trace.LotActivities.Any() && time >= trace.StartDate && time < trace.EndDate)
                    {
                        // Find current LotActivity and RawActivity
                        LotActivity activity = trace.GetLotActivityAt(time);

                        LotActivityRaw raw = trace.GetLotActivityRawAt(time);

                        if (activity != null && raw != null)
                        {
                            RealLot newLot;

                            if (trace.HasStart && trace.HasEnd)
                            {
                                newLot = new RealLot(activity, raw, trace.StartDate, trace.EndDate, time);
                            }
                            else if (trace.HasStart && !trace.HasEnd)
                            {
                                newLot = new RealLot(activity, raw, trace.StartDate, null, time);
                            }
                            else if (!trace.HasStart && trace.HasEnd)
                            {
                                newLot = new RealLot(activity, raw, null, trace.EndDate, time);
                            }
                            else
                            {
                                newLot = new RealLot(activity, raw, null, null, time);
                            }


                            lots.Add(newLot);
                        }
                    }
                }

                RealSnapshot snapshot = new RealSnapshot(time, lots, waferQtyThreshold);

                return(snapshot);
            }
        }
示例#4
0
        public List <Tuple <DateTime, RealLot> > GetRealLotStarts()
        {
            List <Tuple <DateTime, RealLot> > lotStarts = new List <Tuple <DateTime, RealLot> >();

            foreach (LotTrace trace in All.Where(x => x.HasStart && x.LotActivities.Any() && x.LotActivitiesRaw.Any()))
            {
                LotActivity activity = trace.LotActivities.First();

                LotActivityRaw raw = trace.LotActivitiesRaw.First();

                RealLot newLot = new RealLot(activity, raw, trace.StartDate, trace.EndDate);

                lotStarts.Add(new Tuple <DateTime, RealLot>(trace.StartDate, newLot));
            }

            return(lotStarts);
        }
示例#5
0
            public LotActivityRaw GetLotActivityRawAt(DateTime time)
            {
                if (time >= StartDate && time <= EndDate)
                {
                    for (int i = 0; i < LotActivitiesRaw.Count; i++)
                    {
                        LotActivityRaw activity = LotActivitiesRaw[i];

                        if (activity.TrackOut > time)
                        {
                            return(LotActivitiesRaw[i]);
                        }
                    }
                    Console.WriteLine($"WARNING: LotActivityRaw for {LotActivitiesRaw.First().LotId} not found for time {time}, but time is within start and end date.");
                    return(null);
                }
                else
                {
                    throw new Exception($"Time {time} is outside range of known lot activites for lot {LotId}.");
                }
            }
示例#6
0
        public void AddLotActivityRaw(LotActivityRaw raw)
        {
            RawActivities.Add(raw);

            raw.LotActivity = this;
        }