using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace NIDAQmx
{
    public class AILowpassCutoff : BaseDevice
    {
        internal AILowpassCutoff(DAQmxSession session, string deviceName) : base(session, deviceName)
        {
            double[] val= new double[100];
            _Session.CheckResult(_Session.GetDelegate<Internal.AI.DAQmxGetDevAIDigFltrLowpassCutoffFreqDiscreteVals>()(DeviceName, ref val[0], (uint)val.Length));
            FreqDiscreteVals = val.Where(x=>x>0).ToArray();
            Range[] ranges= new Range[100];
            _Session.CheckResult(_Session.GetDelegate<Internal.AI.DAQmxGetDevAIDigFltrLowpassCutoffFreqRangeVals>()(DeviceName, ref Unsafe.As<Range, double>(ref ranges[0]), (uint)ranges.Length));
            FreqRangeVals = ranges.Where(x => x.Max != 0 && x.Min != 0).ToArray();
        }
        public double[] FreqDiscreteVals { get; }
        public Range[] FreqRangeVals { get; }
    }
}
