using NIDAQmx.DAQmxEnum;
using System.Runtime.CompilerServices;

namespace NIDAQmx
{
    public class AIVoltage : BaseDevice
    {
        internal AIVoltage(DAQmxSession session, string deviceName) : base(session, deviceName)
        {
            Range[] values = new Range[100];
            _Session.CheckResult(_Session.GetDelegate<Internal.AI.DAQmxGetDevAIVoltageRngs>()(DeviceName, ref Unsafe.As<Range, double>(ref values[0]),(uint)values.Length));
            VoltageRngs = values.Where(x => x.Min != 0 && x.Max != 0).ToArray();
        }

        public Range[] VoltageRngs { get; }
    }
}
