public bool TryParse(string str, out DayProductOutputInfo result) { result = null; if (string.IsNullOrEmpty(str)) return false; result = new DayProductOutputInfo(); 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 "TotalOutputCount": { int temp; if (int.TryParse(value, out temp)) result.TotalOutputCount = temp; } break; case "DayOutputCount": { int temp; if (int.TryParse(value, out temp)) result.DayOutputCount = temp; } break; case "SwingOutputCount": { int temp; if (int.TryParse(value, out temp)) result.SwingOutputCount = temp; } break; case "GYOutputCount": { int temp; if (int.TryParse(value, out temp)) result.GYOutputCount = temp; } break; case "LastUpdateTime": { DateTime temp; if (DateTime.TryParse(value, out temp)) result.LastUpdateTime = temp; } break; } } } catch { result = null; return false; } return true; }
public ProductOutputManager() { LotProductOutputList = new ObservableCollection<LotProductOutputInfo>(); UnitPerHourList = new ObservableCollection<UnitPerHourInfo>(); DayProductOutput = new DayProductOutputInfo(); }
public void CopyTo(DayProductOutputInfo dest) { dest.TotalOutputCount = this.TotalOutputCount; dest.DayOutputCount = this.DayOutputCount; dest.SwingOutputCount = this.SwingOutputCount; dest.GYOutputCount = this.GYOutputCount; dest.LastUpdateTime = this.LastUpdateTime; }
public ProductOutputManager() { LotProductOutputList = new FAFramework.Utility.ThreadSafeObservableCollection<LotProductOutputInfo>(); UnitPerHourList = new FAFramework.Utility.ThreadSafeObservableCollection<UnitPerHourInfo>(); DayProductOutput = new DayProductOutputInfo(); Run = true; Thread thread = new Thread( delegate() { while (Run) { Action log; if (_logQueue.Count > 0) { lock (threadRoot) { log = _logQueue.Dequeue(); } log(); } Thread.Sleep(10); } }); thread.Start(); }