BioRadioDeviceManagerCreateVirtualDevice Method |
Namespace: GLNeuroTech.Devices.BioRadio
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using GLNeuroTech.Devices.BioRadio; namespace BioRadioAPIExamples { class ParseMemoryFile { public static void ParseFile(string filePath) { var deviceManager = new BioRadioDeviceManager(); var virtualDevice = deviceManager.CreateVirtualDevice(filePath); var deviceInstance = (BioRadioDevice) virtualDevice.BaseDevice; // Loop over the file until we reach the end. while (!virtualDevice.EndOfFileReached) { // Iterate through the BioPotential signals and read all samples. // This example assumes the input file only contains biopotential data, and no data in the other device signal groups. foreach (var signal in deviceInstance.BioPotentialSignals) { var data = signal.GetScaledValueArray(); foreach (var value in data) { Console.Write("{0} ", value); } } // Feed the next chunk of file data. This causes the VirtualDeviceAdapter to parse the next set // of data and make it available on its BaseDevice's Signal instances. virtualDevice.FeedNextChunk(); } } } }