classdef SPlibrary
    %UNTITLED8 이 클래스의 요약 설명 위치
    %   자세한 설명 위치
       
    properties
        sTotChnl   
        sDevType = zeros(1,10)
        strModel = strings(1,10)
        lIntTime = zeros(1,10)
        sTotPixelNum = zeros(1,10)
        sRealPixelNum = zeros(1,10)
        sStartOpticalBlank = zeros(1,10)
        sAvgTime = zeros(1,10)
        sTrgMode = zeros(1,10)
        sIntMode = zeros(1,10)
        sExtMode = zeros(1,10)        
    end
    
    methods        
        function LoadLibrary(~)
            if not(libisloaded('SPdbUSBm'))
               loadlibrary('SPdbUSBm.dll','SPdbUSBm.h')           
            end
        end
         
        function unLoadLibrary(~)
            if (libisloaded('SPdbUSBm'))
               unloadlibrary SPdbUSBm           
            end
        end
        
        function result = TestAllChannels(~,orderby)
           result = calllib('SPdbUSBm','spTestAllChannels',orderby);            
        end
        
        function result = GetModel(~,sChannel)
           result = calllib('SPdbUSBm','spGetModel',sChannel);            
        end
        
        function result = SetupAllChannels(~)
           result = calllib('SPdbUSBm','spSetupAllChannels');            
        end
        
        function result = SetupGivenChannel(~,sChannel)
           result = calllib('SPdbUSBm','spSetupGivenChannel',sChannel);            
        end
        
        function result = InitAllChannels(~,sCCDType)
           result = calllib('SPdbUSBm','spInitAllChannels',sCCDType);            
        end
        
        function result = InitGivenChannel(~,sCCDType,sChannel)
           result = calllib('SPdbUSBm','spInitGivenChannel',sCCDType,sChannel);            
        end
        
        function result = SetIntEx(~,lIntTime,sChannel)
           result = calllib('SPdbUSBm','spSetIntEx',lIntTime,sChannel);            
        end
        
        function result = SetDblIntEx(~,lIntTime,sChannel)
           result = calllib('SPdbUSBm','spSetDblIntEx',lIntTime,sChannel);            
        end
        
        function result = SetTrgEx(~,sTrgType,sChannel)
           result = calllib('SPdbUSBm','spSetTrgEx',sTrgType,sChannel);            
        end
        
        function result = ReadDataEx(~,lpArray,sChannel)
           result = calllib('SPdbUSBm','spReadDataEx',lpArray,sChannel);            
        end
        
        function result = CloseAllChannels(~)
           result = calllib('SPdbUSBm','spCloseAllChannels');            
        end
        
        function result = CloseGivenChannel(~,sChannel)
           result = calllib('SPdbUSBm','spCloseGivenChannel',sChannel);            
        end
        
        function result = PolyCalc(~,ceofs,order,x,y)
           result = calllib('SPdbUSBm','spPolyCalc',ceofs,order,x,y);            
        end
               
        function result = PolyFit(~,x,y,numPts,coefs,order)
           result = calllib('SPdbUSBm','spPolyFit',x,y,numPts,coefs,order);            
        end      
        
        function result = SetIntMode(~,sIntMode,dIntTime,sChannel)
           result = calllib('SPdbUSBm','spSetIntMode',sIntMode,dIntTime,sChannel);            
        end
        
        function result = SetExtEdgeMode(~,sEdgeMode,sChannel)
           result = calllib('SPdbUSBm','spSetExtEdgeMode',sEdgeMode,sChannel);            
        end
        
       function result = GetDevIsNew(~,sChannel)
           result = calllib('SPdbUSBm','spGetDevIsNew',sChannel);            
        end
        
        function result = DevInfo(~,strModel,strSerial,sChannel)
           result = calllib('SPdbUSBm','spDevInfo',strModel,strSerial,sChannel);            
        end
        
        function result = GetWLTable(~,dWLTable,sChannel)
           result = calllib('SPdbUSBm','spGetWLTable',dWLTable,sChannel);            
        end   
    end
end

