private void OnSignalDataReceived(IntPtr devicePtr, ChannelInfo info, SignalDataArray dataArray, IntPtr userData) { if (DevicePtr != devicePtr) { return; } var data = new NativeArrayMarshaler <double>().MarshalArray(dataArray.DoubleArray, dataArray.SamplesCount); free_SignalDataArray(dataArray); SignalChannelDataReceived?.Invoke(this, new SignalChannelData(data, info, dataArray.FirstSampleCount)); }
private void OnIntDataReceived(IntPtr devicePtr, ChannelInfo info, IntDataArray dataArray, IntPtr userData) { if (DevicePtr != devicePtr) { return; } var data = new NativeArrayMarshaler <int>().MarshalArray(dataArray.IntArray, dataArray.SamplesCount); free_IntDataArray(dataArray); IntChannelDataReceived?.Invoke(this, new ChannelData <int>(data, info)); }
private void OnDoubleDataReceived(IntPtr devicePtr, ChannelInfo info, DoubleDataArray dataArray, IntPtr userData) { if (DevicePtr != devicePtr) { return; } var data = new NativeArrayMarshaler <double>().MarshalArray(dataArray.DoubleArray, dataArray.SamplesCount); free_DoubleDataArray(dataArray); DoubleChannelDataReceived?.Invoke(this, new ChannelData <double>(data, info)); }
internal NativeChannelDataReader() { _readerFunc = GetFunctionForType(typeof(T)); _arrayMarshaler = new NativeArrayMarshaler <T>(); }