You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
4.6 KiB
C

5 years ago
#ifndef __MV_DEVICE_BASE_H__
#define __MV_DEVICE_BASE_H__
#include "MvInclude.h"
namespace MvCamCtrl
{
interface IMvDevice
{
// ch:<3A><><EFBFBD><EFBFBD><EFBFBD>
// en:Open Device
virtual int Open(unsigned int nAccessMode = MV_ACCESS_Exclusive, unsigned short nSwitchoverKey = 0) = 0;
// ch:<3A>ر<EFBFBD><D8B1>
// en:Close Device
virtual int Close() = 0;
// 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, which can be opened only if false is returned
virtual bool IsOpen() = 0;
// ch:<3A><><EFBFBD><EFBFBD>ץͼ
// en:Start Grabbing
virtual int StartGrabbing() = 0;
// ch:ֹͣץͼ
// en:Stop Grabbing
virtual int StopGrabbing() = 0;
// ch:<3A><>ȡ<EFBFBD><EFBFBD><E8B1B8>Ϣ
// en:Get Device Information
virtual int GetDeviceInfo(MV_CC_DEVICE_INFO&) = 0;
/** @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 the 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 smaller than the actual xml file, do not copy the data, return xml file size from 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) = 0;
/** @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) = 0;
// ch:<3A><>ȡGenICamʹ<6D>õĴ<C3B5><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// en:Gets the transport layer agent class used by GenICam
virtual TlProxy GetTlProxy() = 0;
virtual ~IMvDevice( void ){};
};
interface IDeviceFactory
{
// ch:ö<><C3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// en:Enumerate all devices within the subnet that correspond to the specified transport protocol
virtual int EnumDevices( unsigned int nTLayerType , MV_CC_DEVICE_INFO_LIST& stDevList ) = 0;
// ch:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// en:Create a device agent class
virtual IMvDevice* CreateDevice( const MV_CC_DEVICE_INFO& device ) = 0;
// ch:<3A><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><E8B1B8><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>Դ
// en:Destroy the internal resources of the specified device
virtual int DestroyDevice( IMvDevice* ) = 0;
// ch:<3A>ж<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>Է<EFBFBD><D4B7><EFBFBD>
// en:Determines whether the specified device is accessible
virtual bool IsDeviceAccessible( const MV_CC_DEVICE_INFO& deviceInfo) = 0;
};
}
#endif /* __MV_DEVICE_BASE_H__ */