#ifndef _HT_HARD_DLL_H
#define _HT_HARD_DLL_H

#ifndef DLL_API
#define DLL_API extern "C" __declspec(dllimport)
#endif
#define WIN_API __stdcall

typedef struct _HT_RELAY_CONTROL
{
	BOOL bCHEnable[4];
	WORD nCHVoltDIV[4];
	WORD nCHCoupling[4];
	BOOL bCHBWLimit[4];
	WORD nTrigSource;
	BOOL bTrigFilt;
	WORD nALT;
}RELAYCONTROL,*PRELAYCONTROL;

#ifndef struct_HT_CONTROL_DATA
#define struct_HT_CONTROL_DATA
typedef struct _HT_CONTROL_DATA
{
	WORD nCHSet;
        WORD nTimeDIV;
        WORD nTriggerSource;
        WORD nHTriggerPos;
	WORD nVTriggerPos;
	WORD nTriggerSlope;
	ULONG nBufferLen;
	ULONG nReadDataLen;
	ULONG nAlreadyReadLen;
    	WORD nALT;
	WORD nETSOpen;
	WORD nDriverCode;	
}CONTROLDATA,*PCONTROLDATA;
#endif

DLL_API WORD WINAPI dsoHTSearchDevice(short* pDevInfo);

DLL_API WORD WINAPI dsoHTDeviceConnect(WORD nDeviceIndex);

DLL_API WORD WINAPI dsoHTSetCHPos(WORD nDeviceIndex,WORD* pLevel,WORD nVoltDIV,WORD nPos,WORD nCH,WORD nDriverCode);

DLL_API WORD WINAPI dsoHTSetCHDirectLeverPos(WORD nDeviceIndex,WORD nPos,WORD nCH);

DLL_API WORD WINAPI dsoHTSetVTriggerLevel(WORD nDeviceIndex,WORD* pLevel,WORD nPos);

DLL_API WORD WINAPI dsoHTSetHTriggerLength(WORD nDeviceIndex,ULONG nBufferLen,WORD HTriggerPos,WORD nTimeDIV,WORD nYTFormat);

DLL_API WORD WINAPI dsoHTSetBufferSize(WORD nDeviceIndex,WORD nBufferSize);

DLL_API WORD WINAPI dsoHTSetCHAndTrigger(WORD nDeviceIndex,RELAYCONTROL RelayControl,WORD nDriverCode);

DLL_API WORD WINAPI dsoHTSetCHAndTriggerDirect(WORD nDeviceIndex,RELAYCONTROL RelayControl);

DLL_API WORD WINAPI dsoHTSetCHAndTriggerVB(WORD nDeviceIndex,WORD* pCHEnable,WORD* pCHVoltDIV,WORD* pCHCoupling,WORD* pCHBWLimit,WORD nTriggerSource,WORD nTriggerFilt,WORD nALT);

//DLL_API WORD WINAPI dsoHTSetTriggerAndSyncOutput(WORD nDeviceIndex,WORD nTriggerMode,WORD nTriggerSlope,WORD nPWCondition,ULONG nPW,USHORT nVideoStandard,USHORT nVedioSyncSelect,USHORT nVideoHsyncNumOption,WORD nSync);
DLL_API WORD WINAPI dsoHTSetTriggerAndSyncOutput(WORD nDeviceIndex,WORD nSynMode,WORD nlaTriggerMode,WORD nTriggerMode,WORD nTriggerSlope,WORD nPWCondition,ULONG nPW,USHORT nVideoStandard,USHORT nVedioSyncSelect,USHORT nVideoHsyncNumOption,WORD nSync);

DLL_API WORD WINAPI dsoHTSetSampleRate(WORD nDeviceIndex,WORD nTimeDIV,WORD nYTFormat);

DLL_API WORD WINAPI dsoHTInitSDRam(WORD nDeviceIndex);

DLL_API WORD WINAPI dsoHTStartCollectData(WORD nDeviceIndex);

DLL_API WORD WINAPI dsoHTStartTrigger(WORD nDeviceIndex);

DLL_API WORD WINAPI dsoHTForceTrigger(WORD nDeviceIndex);

DLL_API WORD WINAPI dsoHTGetState(WORD nDeviceIndex);

DLL_API WORD WINAPI dsoHTGetPackState(WORD nDeviceIndex);

DLL_API WORD WINAPI dsoHTGetSDRamInit(WORD nDeviceIndex);

DLL_API WORD WINAPI dsoHTGetData(WORD nDeviceIndex,WORD* pCH1Data,WORD* pCH2Data,WORD* pCH3Data,WORD* pCH4Data,PCONTROLDATA pControl/*,ULONG* p1,ULONG* p2,ULONG* p3*/);

DLL_API WORD WINAPI dsoHTGetScanData(WORD nDeviceIndex,WORD* pCH1Data,WORD* pCH2Data,WORD* pCH3Data,WORD* pCH4Data,PCONTROLDATA pControl);

DLL_API WORD WINAPI dsoHTReadCalibrationData(WORD nDeviceIndex,WORD* pLevel,WORD nLen);

DLL_API WORD WINAPI dsoHTWriteCalibrationData(WORD nDeviceIndex,WORD* pLevel,WORD nLen);

DLL_API WORD WINAPI dsoSDGetData(WORD nDeviceIndex,WORD* pCH1Data,WORD* pCH2Data,WORD* pCH3Data,WORD* pCH4Data,PCONTROLDATA pControl,WORD nInsertMode);

DLL_API WORD WINAPI dsoSDHTGetRollData(WORD nDeviceIndex,WORD* pCH1Data,WORD* pCH2Data,WORD* pCH3Data,WORD* pCH4Data,PCONTROLDATA pControl);

DLL_API WORD WINAPI dsoSDHTGetScanData(WORD nDeviceIndex,WORD* pCH1Data,WORD* pCH2Data,WORD* pCH3Data,WORD* pCH4Data,PCONTROLDATA pControl);

DLL_API WORD WINAPI dsoHTGetRollData(WORD nDeviceIndex,WORD* pCH1Data,WORD* pCH2Data,WORD* pCH3Data,WORD* pCH4Data,PCONTROLDATA pControl);

DLL_API WORD WINAPI dsoHTOpenRollMode(WORD nDeviceIndex);

DLL_API WORD WINAPI dsoHTCloseRollMode(WORD nDeviceIndex);

DLL_API WORD WINAPI dsoHTSetPeakDetect(WORD nDeviceIndex,WORD nTimeDIV,WORD nYTFormat);

DLL_API WORD WINAPI dsoHTClosePeakDetect(WORD nDeviceIndex);

DLL_API ULONG WINAPI dsoHTGetHardFC(WORD nDeviceIndex);

DLL_API WORD WINAPI dsoHTSetHardFC(WORD nDeviceIndex,WORD nType);

DLL_API WORD WINAPI dsoHTResetCnter(WORD nDeviceIndex);

DLL_API WORD WINAPI dsoHTStartRoll(WORD nDeviceIndex);

DLL_API ULONG WINAPI dsoGetHardVersion(WORD DeviceIndex);

DLL_API WORD WINAPI dsoGetDriverVersion(WORD DeviceIndex,UCHAR* pBuffer);

DLL_API WORD WINAPI dsoUSBModeSetIPAddr(WORD DeviceIndex,ULONG nIP,ULONG nSubnetMask,ULONG nGateway,USHORT nPort,BYTE* pMac);

DLL_API WORD WINAPI dsoUSBModeGetIPAddr(WORD DeviceIndex,ULONG* pIP,ULONG* pSubMask,ULONG* pGateway,WORD* pPort,BYTE* pMac);

DLL_API WORD WINAPI dsoOpenLan(WORD DeviceIndex,WORD nMode);

DLL_API WORD WINAPI dsoOpenWIFIPower(WORD DeviceIndex);

DLL_API WORD WINAPI dsoResetWIFI(WORD DeviceIndex);

DLL_API WORD WINAPI dsoGetFPGAVersion(WORD DeviceIndex);

DLL_API BOOL WINAPI dsoSetUSBBus(WORD DeviceIndex);

DLL_API BOOL WINAPI dsoSetSPIBus(WORD DeviceIndex);

DLL_API BOOL WINAPI dsoSetHardInfo(WORD DeviceIndex,UCHAR* pBuffer);

DLL_API BOOL WINAPI dsoGetHardInfo(WORD DeviceIndex,UCHAR* pBuffer);

DLL_API BOOL WINAPI dsoWriteFlash(WORD DeviceIndex,UCHAR* pBuffer);

DLL_API BOOL WINAPI dsoReadFlash(WORD DeviceIndex,UCHAR* pBuffer);

DLL_API BOOL WINAPI dsoGetDeviceSN(WORD DeviceIndex,UCHAR* pBuffer);

DLL_API WORD WINAPI dsoGetLANEnable(WORD DeviceIndex,short* pEnable);
DLL_API BOOL WINAPI ReadFPGAVersion(WORD DeviceIndex,UCHAR* VerBuf);
//-----------LA-----------------
DLL_API BOOL WINAPI laSetTrigSource(WORD DeviceIndex,unsigned char nSour);
DLL_API BOOL WINAPI laSetTriEdge(WORD DeviceIndex,unsigned char Edg);
DLL_API BOOL WINAPI laSetTriDataRange(WORD DeviceIndex,unsigned int Max,unsigned int Min,unsigned int Sh,unsigned char Mo);
DLL_API BOOL WINAPI laSetTriDataTime(WORD DeviceIndex,unsigned int Max,unsigned int Min,unsigned char Mo);
DLL_API BOOL WINAPI laSetTriDataEqu(WORD DeviceIndex,unsigned int Dat,unsigned int Sh,unsigned char So);
DLL_API BOOL WINAPI laSetTriIntr(WORD DeviceIndex,bool Equ,bool Time,bool Range);
DLL_API BOOL WINAPI laSetTrigNow(WORD DeviceIndex,bool bEn);
DLL_API BOOL WINAPI SetTrigRelease(WORD DeviceIndex,long nRelTime);
DLL_API BOOL WINAPI laReadEEROM(WORD DeviceIndex,WORD *nVal);
DLL_API BOOL WINAPI laWriteEEROM(WORD DeviceIndex,WORD *nVal);
DLL_API BOOL WINAPI laSetVolt(WORD DeviceIndex,float Volt1,float Volt2);
//-----------DDS--------------
DLL_API ULONG WINAPI ddsSetOnOff(WORD DeviceIndex,short nOnOff);
DLL_API ULONG WINAPI ddsSetFrequency(WORD DeviceIndex,double dbFre,WORD* pWaveNum,WORD* pPeriodNum);
DLL_API ULONG WINAPI ddsDownload(WORD DeviceIndex,WORD iWaveNum, WORD* pData);
DLL_API ULONG WINAPI ddsSetSyncOut(WORD DeviceIndex, BOOL bEnable);
DLL_API ULONG WINAPI ddsSetCmd(WORD DeviceIndex, USHORT nSingle);
//DLL_API ULONG WINAPI ddsSetPowerOn(WORD DeviceIndex,BOOL bEnable);

// -----------SDK----------------
DLL_API BOOL WINAPI dsoGetDisplayDataFromSourceDataSingle(short *pDisplayData,WORD *pSourceData,WORD *LeverPos,ULONG nDataLen,WORD nCH,WORD nHeight);






//

#endif
