|
|
|
|
|
|
|
|
|
|
|
#ifndef __MV_GIGE_DEVICE_H__
|
|
|
|
|
|
#define __MV_GIGE_DEVICE_H__
|
|
|
|
|
|
|
|
|
|
|
|
#include "MvDeviceBase.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace MvCamCtrl
|
|
|
|
|
|
{
|
|
|
|
|
|
class CMvGigEDevice : public IMvDevice
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
// ch:<3A><><EFBFBD><EFBFBD><EFBFBD>豸
|
|
|
|
|
|
// en:Open Device
|
|
|
|
|
|
virtual int Open(unsigned int nAccessMode = MV_ACCESS_Exclusive, unsigned short nSwitchoverKey = 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ch:<3A>ر<EFBFBD><D8B1>豸
|
|
|
|
|
|
// en:Close Device
|
|
|
|
|
|
virtual int Close();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ch:<3A>ж<EFBFBD><D0B6>豸<EFBFBD><E8B1B8>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>falseʱ<65><CAB1><EFBFBD>ɴ<EFBFBD><C9B4><EFBFBD><EFBFBD>豸
|
|
|
|
|
|
// en:Determines the status of the device, only if false is returned, the device can be opened
|
|
|
|
|
|
virtual bool IsOpen();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ch:<3A><><EFBFBD><EFBFBD>ץͼ
|
|
|
|
|
|
// en:Start Grabbing
|
|
|
|
|
|
virtual int StartGrabbing();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ch:ֹͣץͼ
|
|
|
|
|
|
// en:Stop Grabbing
|
|
|
|
|
|
virtual int StopGrabbing();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ch:<3A><>ȡ<EFBFBD>豸<EFBFBD><E8B1B8>Ϣ
|
|
|
|
|
|
// en:Get Device Information
|
|
|
|
|
|
virtual int GetDeviceInfo(MV_CC_DEVICE_INFO&);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** @fn GetGenICamXML(unsigned char* pData, unsigned int nDataSize, unsigned int* pnDataLen)
|
|
|
|
|
|
* @brief <EFBFBD><EFBFBD>ȡ<EFBFBD>豸<EFBFBD><EFBFBD>XML<EFBFBD>ļ<EFBFBD>
|
|
|
|
|
|
* @param pData [IN][OUT] - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
|
|
|
|
|
|
nDataSize [IN] - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С
|
|
|
|
|
|
pnDataLen [OUT] - xml <EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return <EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>MV_OK<EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
* @note <EFBFBD><EFBFBD>pDataΪNULL<EFBFBD><EFBFBD>nDataSize<EFBFBD><EFBFBD>ʵ<EFBFBD>ʵ<EFBFBD>xml<EFBFBD>ļ<EFBFBD>Сʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><EFBFBD><EFBFBD>pnDataLen<EFBFBD><EFBFBD><EFBFBD><EFBFBD>xml<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><EFBFBD>
|
|
|
|
|
|
* <EFBFBD><EFBFBD>pDataΪ<EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>㹻<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>pnDataLen<EFBFBD><EFBFBD><EFBFBD><EFBFBD>xml<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
* @fn GetGenICamXML(unsigned char* pData, unsigned int nDataSize, unsigned int* pnDataLen)
|
|
|
|
|
|
* @brief Get Device XML File
|
|
|
|
|
|
* @param pData [IN][OUT] - Cache Address to copy in
|
|
|
|
|
|
nDataSize [IN] - Cache Size
|
|
|
|
|
|
pnDataLen [OUT] - XML File Data Length
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return Success, return MV_OK; Fail, return Error Code
|
|
|
|
|
|
* @note When pData is NULL or nDataSize is smaller than the actual xml file, do not copy data, return xml file size from the pnDataLen;
|
|
|
|
|
|
* When pData is a valid cache address and the cache is large enough, the full data is copied and the xml file size is returned by pnDataLen.
|
|
|
|
|
|
*/
|
|
|
|
|
|
virtual int GetGenICamXML(unsigned char* pData, unsigned int nDataSize, unsigned int* pnDataLen);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** @fn GetOneFrame(unsigned char * pData , unsigned int nDataSize, MV_FRAME_OUT_INFO* pFrameInfo)
|
|
|
|
|
|
* @brief <EFBFBD><EFBFBD>ȡһ֡ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
* @param pData [IN][OUT] - <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>
|
|
|
|
|
|
nDataLen [IN] - <EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
pFrameInfo [OUT] - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֡<EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return <EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>MV_OK<EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
* @fn GetOneFrame(unsigned char * pData , unsigned int nDataSize, MV_FRAME_OUT_INFO* pFrameInfo)
|
|
|
|
|
|
* @brief Get One Frame Image Data
|
|
|
|
|
|
* @param pData [IN][OUT] - Data Pointer
|
|
|
|
|
|
nDataLen [IN] - Data Length
|
|
|
|
|
|
pFrameInfo [OUT] - Output Frame Information
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return Success, return MV_OK; Fail, return Error Code
|
|
|
|
|
|
*/
|
|
|
|
|
|
virtual int GetOneFrame(unsigned char * pData , unsigned int nDataSize, MV_FRAME_OUT_INFO* pFrameInfo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ch:<3A><>ȡGenICamʹ<6D>õĴ<C3B5><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
// en:Get the transport layer agent class used by GenICam
|
|
|
|
|
|
virtual TlProxy GetTlProxy();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virtual ~CMvGigEDevice( void );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CMvGigEDevice( const MV_CC_DEVICE_INFO* pInfo );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ch:<3A><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
|
// en:Get Net Information
|
|
|
|
|
|
virtual int GetNetTransInfo(MV_NETTRANS_INFO* pstInfo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ch:ǿ<><C7BF>IP
|
|
|
|
|
|
// en:Force IP
|
|
|
|
|
|
virtual int ForceIp(unsigned int nIP);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ch:<3A><><EFBFBD><EFBFBD>IP<49><50>ʽ
|
|
|
|
|
|
// en:Configure IP Mode
|
|
|
|
|
|
virtual int SetIpConfig(unsigned int nType);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ch:<3A><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><CDB5><EFBFBD>Ϣ
|
|
|
|
|
|
// en:Get Various Types of Information
|
|
|
|
|
|
virtual int GetAllMatchInfo(MV_ALL_MATCH_INFO* pstInfo);
|
|
|
|
|
|
|
|
|
|
|
|
// ch:ע<><D7A2><EFBFBD><EFBFBD>Ϣ<EFBFBD>쳣<EFBFBD>ص<EFBFBD>
|
|
|
|
|
|
// en:Register Message Exception Callback
|
|
|
|
|
|
virtual int RegisterExceptionCallBack(void(__stdcall* cbException)(unsigned int nMsgType, void* pUser),
|
|
|
|
|
|
void* pUser);
|
|
|
|
|
|
|
|
|
|
|
|
virtual int SetSingleShot(void(__stdcall* cbSingleShot)(unsigned char* pData , unsigned int nDataLen,
|
|
|
|
|
|
MV_FRAME_OUT_INFO* pFrameInfo, void* pUser),
|
|
|
|
|
|
void* pUser);
|
|
|
|
|
|
|
|
|
|
|
|
// ch:<3A><><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD>ɼ<EFBFBD>ģʽ
|
|
|
|
|
|
// en:Set Device Aquisition Mode
|
|
|
|
|
|
virtual int SetAcquisitionMode(MV_CAM_ACQUISITION_MODE enMode);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ch:<3A>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
// en:Device Local Update
|
|
|
|
|
|
virtual int LocalUpgrade(const void *pFilePathName);
|
|
|
|
|
|
|
|
|
|
|
|
// ch:<3A><>ȡ<EFBFBD><C8A1>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
// en:Get Current Update Process
|
|
|
|
|
|
virtual int GetUpgradeProcess(unsigned int* pnProcess);
|
|
|
|
|
|
|
|
|
|
|
|
virtual int GetOptimalPacketSize();
|
|
|
|
|
|
|
|
|
|
|
|
// ch:<3A><>ʾһ֡ͼ<D6A1><CDBC>
|
|
|
|
|
|
// en:Display One Frame Image
|
|
|
|
|
|
virtual int Display(void* hWnd);
|
|
|
|
|
|
|
|
|
|
|
|
virtual int SetNetTransMode(unsigned int nType);
|
|
|
|
|
|
|
|
|
|
|
|
virtual int ReadMemory(void *pBuffer, int64_t nAddress, int64_t nLength);
|
|
|
|
|
|
|
|
|
|
|
|
virtual int WriteMemory(const void *pBuffer, int64_t nAddress, int64_t nLength);
|
|
|
|
|
|
|
|
|
|
|
|
// ch:<3A><><EFBFBD><EFBFBD>ֵ 0<><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
// en:Return Value 0 driver exception, 1 driver work properly
|
|
|
|
|
|
virtual int IsDriverWorking();
|
|
|
|
|
|
|
|
|
|
|
|
// ch:0<><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
// en:0: Do not throw; 1: Throw
|
|
|
|
|
|
virtual int SetThrowAbnormalImage(int bThrow);
|
|
|
|
|
|
|
|
|
|
|
|
// ch:<3A><><EFBFBD><EFBFBD>SDK<44>ڲ<EFBFBD>ͼ<EFBFBD><EFBFBD><F1BBBAB4>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ[1, 30]<5D><><EFBFBD><EFBFBD>ץͼǰ<CDBC><C7B0><EFBFBD><EFBFBD>
|
|
|
|
|
|
// en:Set the number of the internal image cache nodes in SDK, range [1, 30], called before capture
|
|
|
|
|
|
virtual int SetImageNodeNum(unsigned int nNum);
|
|
|
|
|
|
|
|
|
|
|
|
// ch:<3A><><EFBFBD><EFBFBD>gvcp<63><70>ʱʱ<CAB1><CAB1>
|
|
|
|
|
|
// en:Set Gvcp Timeout
|
|
|
|
|
|
virtual int SetGvcpTimeout(unsigned int nTimeout);
|
|
|
|
|
|
|
|
|
|
|
|
// ch:ע<><D7A2>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD>ݻص<DDBB>
|
|
|
|
|
|
// en:Register Image Data Callback
|
|
|
|
|
|
virtual int RegisterImageCallBack(void(__stdcall* cbOutput)(unsigned char * pData, MV_FRAME_OUT_INFO* pFrameInfo, void* pUser),
|
|
|
|
|
|
void* pUser);
|
|
|
|
|
|
// ch:ע<><D7A2>EVENT<4E><54>Ϣ<EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD>ѷ<EFBFBD><D1B7><EFBFBD>
|
|
|
|
|
|
// en:Register Event Message Callback
|
|
|
|
|
|
virtual int RegisterEventCallBack(void(__stdcall* cbEvent)(unsigned int nUserDefinedId, void* pUser),
|
|
|
|
|
|
void* pUser);
|
|
|
|
|
|
|
|
|
|
|
|
// ch:ע<><D7A2>ȫ<EFBFBD><C8AB>EVENT<4E><54>Ϣ<EFBFBD>ص<EFBFBD>
|
|
|
|
|
|
// en:Register all event Callback, chunk
|
|
|
|
|
|
virtual int RegisterAllEventCallBack(void(__stdcall* cbEvent)(MV_EVENT_OUT_INFO * pEventInfo, void* pUser),void* pUser);
|
|
|
|
|
|
|
|
|
|
|
|
// ch:ע<>ᵥ<EFBFBD><E1B5A5>EVENT<4E><54>Ϣ<EFBFBD>ص<EFBFBD>
|
|
|
|
|
|
// en:Register event Callback, chunk
|
|
|
|
|
|
virtual int RegisterEventCallBack(const char* pEventName,void(__stdcall* cbEvent)(MV_EVENT_OUT_INFO * pEventInfo, void* pUser),
|
|
|
|
|
|
void* pUser);
|
|
|
|
|
|
|
|
|
|
|
|
// ch:ע<><D7A2>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD>ݻص<DDBB>,chunk
|
|
|
|
|
|
// en:Register Image Data Callback, chunk
|
|
|
|
|
|
virtual int RegisterImageCallBackEx(void(__stdcall* cbOutput)(unsigned char * pData, MV_FRAME_OUT_INFO_EX* pFrameInfo, void* pUser),void* pUser);
|
|
|
|
|
|
|
|
|
|
|
|
virtual int RegisterImageCallBackForRGB(void(__stdcall* cbOutput)(unsigned char * pData, MV_FRAME_OUT_INFO_EX* pFrameInfo, void* pUser),void* pUser);
|
|
|
|
|
|
virtual int RegisterImageCallBackForBGR(void(__stdcall* cbOutput)(unsigned char * pData, MV_FRAME_OUT_INFO_EX* pFrameInfo, void* pUser),void* pUser);
|
|
|
|
|
|
|
|
|
|
|
|
virtual int GetOneFrameEx(unsigned char * pData , unsigned int nDataSize, MV_FRAME_OUT_INFO_EX* pFrameInfo);
|
|
|
|
|
|
|
|
|
|
|
|
virtual int GetImageForRGB(unsigned char * pData , unsigned int nDataSize, MV_FRAME_OUT_INFO_EX* pFrameInfo, int nMsec);
|
|
|
|
|
|
virtual int GetImageForBGR(unsigned char * pData , unsigned int nDataSize, MV_FRAME_OUT_INFO_EX* pFrameInfo, int nMsec);
|
|
|
|
|
|
|
|
|
|
|
|
virtual int GetOneFrameTimeout(unsigned char * pData , IN unsigned int nDataSize, IN OUT MV_FRAME_OUT_INFO_EX* pFrameInfo, int nMsec);
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
CDevRefs* m_pRefs;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* __MV_GIGE_DEVICE_H__ */
|