示例#1
0
        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);
        }
示例#2
0
        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);
        }