using NIDAQmx.DAQmxEnum;
using NIDAQmxConst;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NIDAQmx
{
    public class CIChannelFactory : ChannelFactory
    {
        internal CIChannelFactory(DAQmx daqmx) : base(daqmx)
        {
        }
        public CIChannel CreateFreq(string counter, string nameToAssignToChannel, double minVal, double maxVal, CIFreqUnits units, AnalogActiveEdge edge, CIMeasMeth measMethod, double measTime, uint divisor,string customScaleName="")
        {
            return Exc<CIChannel>(p=>p.CreateFreq,counter,nameToAssignToChannel,minVal,maxVal,units,edge,measMethod,measTime,divisor,customScaleName);
        }
        public CIChannel CreatePeriod(string counter,string nameToAssignToChannel, double minVal, double maxVal, CIPeriodUnits units, AnalogActiveEdge edge, CIMeasMeth measMethod, double measTime, uint divisor, string customScaleName="")
        {
            return Exc<CIChannel>(p=>p.CreatePeriod,counter,nameToAssignToChannel,minVal, maxVal,units,edge,measMethod,measTime,divisor,customScaleName);
        }
        public CIChannel CreateCountEdges(string counter,string nameToAssignToChannel, AnalogActiveEdge edge= AnalogActiveEdge.Rising, uint initialCount=0, CICountEdgesDir countDirection= CICountEdgesDir.CountDown)
        {
            return Exc<CIChannel>(p=>p.CreateCountEdges,counter,nameToAssignToChannel,edge,initialCount,countDirection);
        }
        public CIChannel CreatePulseWidth(string counter,string nameToAssignToChannel, double minVal, double maxVal, CIPeriodUnits units = CIPeriodUnits.Seconds, AnalogActiveEdge startingEdge = AnalogActiveEdge.Rising,string customScaleName="")
        {
            return Exc<CIChannel>(p=>p.CreatePulseWidth,counter,nameToAssignToChannel,minVal,maxVal,units,startingEdge,customScaleName);
        }
        public CIChannel CreateSemiPeriod(string counter, string nameToAssignToChannel, double minVal, double maxVal, CIPeriodUnits units = CIPeriodUnits.Seconds,string customScaleName="")
        {
            return Exc<CIChannel>(p => p.CreateSemiPeriod, counter, nameToAssignToChannel, minVal, maxVal, units, customScaleName);
        }
        public CIChannel CreateTwoEdgeSep(string counter,string nameToAssignToChannel, double minVal, double maxVal, CIPeriodUnits units, AnalogActiveEdge firstEdge, AnalogActiveEdge secondEdge,string customScaleName="")
        {
            return Exc<CIChannel>(p=>p.CreateTwoEdgeSep, counter, nameToAssignToChannel, minVal,maxVal,units,firstEdge,secondEdge,customScaleName);
        }
        public CIChannel CreatePulseFreq(string counter,string nameToAssignToChannel, double minVal, double maxVal, PulseFreqUnits units= PulseFreqUnits.Hz)
        {
            return Exc<CIChannel>(p=>p.CreatePulseFreq, counter, nameToAssignToChannel,minVal,maxVal,units);
        }
        public CIChannel CreatePulseTime(string counter,string nameToAssignToChannel, double minVal, double maxVal, PulseTimeUnits units= PulseTimeUnits.Seconds)
        {
            return Exc<CIChannel>(p=>p.CreatePulseTime, counter, nameToAssignToChannel,minVal, maxVal,units);
        }
        public CIChannel CreatePulseTicks(string counter,string nameToAssignToChannel, string sourceTerminal, double minVal, double maxVal)
        {
            return Exc<CIChannel>(p => p.CreatePulseTicks, counter, nameToAssignToChannel, sourceTerminal, minVal, maxVal);
        }
        public CIChannel CreateLinEncoder(string counter, string nameToAssignToChannel, DecodingType decodingType, bool ZidxEnable, double ZidxVal, CIZIndexPhase ZidxPhase, CILinEncoderUnits units, double distPerPulse, double initialPos, string customScaleName="")
        {
            return Exc<CIChannel>(p=>p.CreateLinEncoder, counter, nameToAssignToChannel, decodingType, ZidxEnable, ZidxVal, ZidxPhase, units, distPerPulse, initialPos, customScaleName);
        }
        public CIChannel CreateAngEncoder(string counter,string nameToAssignToChannel, DecodingType decodingType= DecodingType.X1, bool ZidxEnable=false, double ZidxVal=0, CIZIndexPhase ZidxPhase = CIZIndexPhase.AHighBHigh, CIAngEncoderUnits units= CIAngEncoderUnits.Radians, uint pulsesPerRev=24, double initialAngle=0,string customScaleName="")
        {
            return Exc<CIChannel>(p => p.CreateAngEncoder, counter, nameToAssignToChannel, decodingType, ZidxEnable, ZidxVal, ZidxPhase, units, units, units,pulsesPerRev,initialAngle, customScaleName);
        }
        public CIChannel CreateLinVelocity(string counter,string nameToAssignToChannel, double minVal, double maxVal, DecodingType decodingType, VelocityUnits units, double distPerPulse, string customScaleName="")
        {
            return Exc<CIChannel>(p => p.CreateLinVelocity, counter, nameToAssignToChannel, minVal, maxVal, decodingType, units, distPerPulse, customScaleName);
        }
        public CIChannel CreateAngVelocity(string counter,string nameToAssignToChannel, double minVal, double maxVal, DecodingType decodingType, VelocityAngEncoderUnits units, uint pulsesPerRev,string customScaleName="")
        {
            return Exc<CIChannel>(p => p.CreateAngVelocity, counter, nameToAssignToChannel, minVal, maxVal, decodingType, units, pulsesPerRev, customScaleName);
        }
        public CIChannel CreateGPSTimestamp(string counter,string nameToAssignToChannel, TimestampUnits units = TimestampUnits.Seconds, GPSSyncMethod syncMethod = GPSSyncMethod.IRIGB, string customScaleName="")
        {
            return Exc<CIChannel>(p => p.CreateGPSTimestamp, counter, nameToAssignToChannel, units, syncMethod, customScaleName);
        }
    }
}
