예제 #1
0
        public void AddProduct(DateTime time, string lotID)
        {
            var oldShiftType = Equipment.EquipmentManager.Instance.GetShift(LastUpdateTime.TimeOfDay);
            var currentShiftType = Equipment.EquipmentManager.Instance.GetShift(time.TimeOfDay);
            if (oldShiftType != currentShiftType)
            {
                if (currentShiftType == Equipment.EquipmentManager.ShiftType.GY)
                {
                    AllClear();
                }
            }

            DayProductOutput.AddOutput(time);

            if (CurrentLotProductOutput == null)
            {
                CurrentLotProductOutput = new LotProductOutputInfo();
                CurrentLotProductOutput.LotID = lotID;
                LotProductOutputList.Add(CurrentLotProductOutput);
            }

            if (CurrentLotProductOutput.LotID != lotID)
            {
                TrackOutLot(time, CurrentLotProductOutput.LotID);
                TrackInLot(time, lotID);
                CurrentLotProductOutput.LotID = lotID;
                CurrentLotProductOutput.LastUpdateTime = time;
            }

            if (CurrentUnitPerHour == null)
            {
                CurrentUnitPerHour = new UnitPerHourInfo();
                CurrentUnitPerHour.LastUpdateTime = time;
                UnitPerHourList.Add(CurrentUnitPerHour);
            }

            if (CurrentUnitPerHour.LastUpdateTime.Hour != time.Hour)
            {
                UnitPerHourList.Add(new UnitPerHourInfo());
                CurrentUnitPerHour = UnitPerHourList.Last();
            }

            CurrentLotProductOutput.AddOutput(time, lotID);
            CurrentUnitPerHour.AddOutput(time);

            Save(time);

            LastUpdateTime = time;
        }
예제 #2
0
            public bool TryParse(string str, out LotProductOutputInfo result)
            {
                result = null;
                if (string.IsNullOrEmpty(str)) return false;

                result = new LotProductOutputInfo();

                try
                {
                    string[] splitData = str.Split(',');
                    foreach (var item in splitData)
                    {
                        string[] itemSplit = item.Split('=');
                        if (itemSplit.Length < 2) continue;

                        string value = itemSplit[1].Trim();

                        switch(itemSplit[0].Trim())
                        {
                            case "LotID" :
                                result.LotID = value;
                                break;

                            case "OutputCount":
                                {
                                    int temp;
                                    if (int.TryParse(value, out temp))
                                        result.OutputCount = temp;
                                }

                                break;

                            case "UPH":
                                {
                                    double temp;
                                    if (double.TryParse(value, out temp))
                                        result.UPH = temp;
                                }

                                break;

                            case "TrackInTime":
                                {
                                    DateTime temp;
                                    if (DateTime.TryParse(value, out temp))
                                        result.TrackInTime = temp;
                                }

                                break;

                            case "TrackOutTime":
                                {
                                    DateTime temp;
                                    if (DateTime.TryParse(value, out temp))
                                        result.TrackOutTime = temp;
                                }

                                break;

                            case "LastUpdateTime":
                                {
                                    DateTime temp;
                                    if (DateTime.TryParse(value, out temp))
                                        result.LastUpdateTime = temp;
                                }

                                break;
                        }
                    }
                }
                catch
                {
                    result = null;
                    return false;
                }

                return true;
            }
예제 #3
0
 public void CopyTo(LotProductOutputInfo dest)
 {
     dest.LastUpdateTime = this.LastUpdateTime;
     dest.LotID = this.LotID;
     dest.OutputCount = this.OutputCount;
     dest.TrackInTime = this.TrackInTime;
     dest.TrackOutTime = this.TrackOutTime;
     dest.UPH = this.UPH;
 }
예제 #4
0
        public void LoadLotProductOutput(DateTime date)
        {
            var loadTime = GetTimeForSamsungShift(date);

            StreamReader sr = null;

            try
            {
                string path = ROOT_PATH + loadTime.ToString("yyyy") + @"\" + loadTime.ToString("MM") + @"\" + loadTime.ToString("dd") + @"\";
                string filename = path + LotProductOutputInfo.FILE_NAME + loadTime.ToString(@"yyyy-MM-dd") + ".log";
                if (File.Exists(filename) == false) return;

                sr = new StreamReader(filename);
                while (sr.EndOfStream == false)
                {
                    LotProductOutputInfo obj = new LotProductOutputInfo();
                    obj.Load(sr);
                    LotProductOutputList.Add(obj);
                }
            }
            catch
            {
                if (sr != null)
                {
                    sr.Close();
                    sr.Dispose();
                }
            }
        }
        public void TrackInLot(DateTime time, string lotID)
        {
            var newObj = new LotProductOutputInfo();
            newObj.UseSetUPHOnTrackOut = UseSetUPHOnTrackOut;
            LotProductOutputList.Add(newObj);
            CurrentLotProductOutput = LotProductOutputList.Last();

            if (CurrentLotProductOutput != null)
                CurrentLotProductOutput.TrackInLot(time, lotID);

            Save(time);
        }
        public void AddProduct(DateTime time, string lotID, int count)
        {
            var oldShiftType = Equipment.MainEquipment.GetShift(LastUpdateTime.TimeOfDay);
            var currentShiftType = Equipment.MainEquipment.GetShift(time.TimeOfDay);
            if (oldShiftType != currentShiftType)
            {
                if (currentShiftType == Equipment.MainEquipment.ShiftType.GY)
                {
                    AllClear();
                }
            }

            DayProductOutput.AddOutput(time, count);

            if (CurrentLotProductOutput == null)
            {
                CurrentLotProductOutput = new LotProductOutputInfo();
                CurrentLotProductOutput.UseSetUPHOnTrackOut = UseSetUPHOnTrackOut;
                CurrentLotProductOutput.LotID = lotID;
                LotProductOutputList.Add(CurrentLotProductOutput);
            }

            if (CurrentLotProductOutput.LotID != lotID)
            {
                TrackOutLot(time, CurrentLotProductOutput.LotID);
                TrackInLot(time, lotID);
                CurrentLotProductOutput.LotID = lotID;
                CurrentLotProductOutput.LastUpdateTime = time;
            }

            if (UnitPerHourList != null && UnitPerHourList.Count > 0)
            {
                var last = UnitPerHourList.Last();
                if (last.StartTime.Date == time.Date)
                {
                    CurrentUnitPerHour = last;
                }
            }

            if (CurrentUnitPerHour == null)
            {
                CurrentUnitPerHour = new UnitPerHourInfo();
                CurrentUnitPerHour.LastUpdateTime = time;
                UnitPerHourList.Add(CurrentUnitPerHour);
            }

            if (CurrentUnitPerHour.LastUpdateTime.Hour != time.Hour)
            {
                UnitPerHourList.Add(new UnitPerHourInfo());
                CurrentUnitPerHour = UnitPerHourList.Last();
            }

            CurrentLotProductOutput.AddOutput(time, lotID, count);
            OnAddedLotProduct(this, new FAGenericEventArgs<LotProductOutputInfo>(CurrentLotProductOutput));

            CurrentUnitPerHour.AddOutput(time, count);

            Save(time);

            LastUpdateTime = time;

            UPEHString = GetUPEHString();
        }