/// <summary> /// Get a data source with all the current data /// </summary> public BrainflowDataSource GetDataSourceWithCurrentData() { lock (UnfilteredData) { var currentData = UnfilteredData.ToList(); currentData.Reverse(); return(new BrainflowDataSource(BoardId, NumberOfChannels, SampleRate, currentData)); } }
static void Main(string[] args) { AzureStackStorageHelper storageHelper = new AzureStackStorageHelper( ConfigurationManager.AppSettings["AzureStackStorageConnectionString"], ConfigurationManager.AppSettings["AzureStackStorageContainer"]); string ns = (random.Next(2) == 1) ? "N" : "S"; string ew = (random.Next(2) == 1) ? "E" : "W"; UnfilteredData data = new UnfilteredData(random.Next(15000) / 100, random.Next(15000) / 100, random.Next(10) + 25, $"{random.Next(90)} {random.Next(60)} {random.Next(60)}{ns}", $"{random.Next(180)} {random.Next(60)} {random.Next(60)}{ew}", (random.Next(10000) + 100000).ToString()); Console.WriteLine(storageHelper.UploadDataToAzureStorage($"SensorData_{DateTime.UtcNow.ToString("MM-dd-yyyy_hhmmss")}", data.ToString())); }
/// <summary> /// Get a range of raw samples starting at 'from' seconds, and ending at 'to' seconds, relative to the timestamp of the newest sample /// </summary> public IBFSample[] GetRawChunk(double from, double to) { return(UnfilteredData.Where(x => x.TimeStamp >= from && x.TimeStamp <= to).ToArray()); }