public RingCollection <SensorValue> CreateHistory(RingCollection <SensorValue> values) { values.Clear(); // Create a sorted list of all sensor log times List <DateTime> times = new List <DateTime>(); foreach (ISensor s in used) { foreach (SensorValue v in s.Values) { times.Add(v.Time); } } times.Sort((a, b) => b.CompareTo(a)); foreach (DateTime cur in times) { float val = ParseOutput(cur); values.Append(new SensorValue(val, cur)); } if (values.Count > 0) { values.Last = new SensorValue(ParseOutput(), DateTime.UtcNow); } return(values); }
public void ClearHistory() { values.Clear(); }