Exemple #1
0
        public async Task <List <TimestampAndValue> > GetSamples()
        {
            List <TimestampAndValue> returnedSamples = new List <TimestampAndValue>();

            using (var reader = new StreamReader(Path))
            {
                while (!reader.EndOfStream)
                {
                    var line = await reader.ReadLineAsync();

                    var values = line.Split(',');
                    TimestampAndValue timestampAndValue = new TimestampAndValue();
                    timestampAndValue.Timestamp = DateTime.Parse(values[0], CultureInfo.CurrentCulture);

                    timestampAndValue.Sample = double.Parse(values[1]);
                    returnedSamples.Add(timestampAndValue);
                }
            }
            return(returnedSamples);
        }
 private static bool isSampleInSameBin(DateTime maxTimeStamp, TimestampAndValue timestampAndValue)
 {
     return(timestampAndValue.Timestamp < maxTimeStamp);
 }