using NIDAQmx.DAQmxEnum;
using NIDAQmxConst;

namespace NIDAQmx
{
    public class AOTrigger : BaseDevice
    {
        internal AOTrigger(DAQmxSession session, string deviceName) : base(session, deviceName)
        {
            int val = 0;
            _Session.CheckResult(_Session.GetDelegate<Internal.Internal.DAQmxGetDevAOTrigUsage>()(DeviceName, ref val));
            List<TriggerUsageTypeBits> bits = new List<TriggerUsageTypeBits>();
            Enum.GetValues<TriggerUsageTypeBits>().ToList().ForEach(x =>
            {
                if ((val & (int)x) == (int)x) bits.Add(x);
            });
            TrigUsage = bits.ToArray();
        }
        public TriggerUsageTypeBits[] TrigUsage { get; }
    }
}
