private void Parse(string line, int lineNumber) { string[] splitLine = line.Split(';'); EDADatasetEntry datasetEntry = new EDADatasetEntry { Timestamp = (lineNumber - 1) * EDADataset.SamplingRate, EDA = double.Parse(splitLine.ElementAt(1), CultureInfo.InvariantCulture.NumberFormat) }; Dataset.DataEntries.Add(datasetEntry); }
public Tuple <EDADatasetEntry, EDADatasetEntry> GetPreviousNext(double timestamp) { EDADatasetEntry previous = null; EDADatasetEntry next = null; foreach (EDADatasetEntry dataEntry in DataEntries) { if (dataEntry.Timestamp <= timestamp) { previous = dataEntry; } else if (dataEntry.Timestamp > timestamp) { next = dataEntry; break; } } Tuple <EDADatasetEntry, EDADatasetEntry> result = new Tuple <EDADatasetEntry, EDADatasetEntry>(previous, next); return(result); }