示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }
示例#4
0
 internal NativeChannelDataReader()
 {
     _readerFunc     = GetFunctionForType(typeof(T));
     _arrayMarshaler = new NativeArrayMarshaler <T>();
 }