提交 | 用户 | age
|
4b03ae
|
1 |
|
Q |
2 |
#ifndef __MV_DEVICE_BASE_H__
|
|
3 |
#define __MV_DEVICE_BASE_H__
|
|
4 |
|
|
5 |
#include "MvInclude.h"
|
|
6 |
|
|
7 |
namespace MvCamCtrl
|
|
8 |
{
|
|
9 |
|
|
10 |
interface IMvDevice
|
|
11 |
{
|
|
12 |
|
|
13 |
// 打开设备
|
|
14 |
virtual int Open(unsigned int nAccessMode = MV_ACCESS_Exclusive, unsigned short nSwitchoverKey = 0) = 0;
|
|
15 |
|
|
16 |
|
|
17 |
// 关闭设备
|
|
18 |
virtual int Close() = 0;
|
|
19 |
|
|
20 |
|
|
21 |
// 判断设备的状态,仅当返回false时,可打开设备
|
|
22 |
virtual bool IsOpen() = 0;
|
|
23 |
|
|
24 |
|
|
25 |
// 开启抓图
|
|
26 |
virtual int StartGrabbing() = 0;
|
|
27 |
|
|
28 |
|
|
29 |
// ֹͣץͼ
|
|
30 |
virtual int StopGrabbing() = 0;
|
|
31 |
|
|
32 |
|
|
33 |
// 获取设备信息
|
|
34 |
virtual int GetDeviceInfo(MV_CC_DEVICE_INFO&) = 0;
|
|
35 |
|
|
36 |
|
|
37 |
/** @fn GetGenICamXML(unsigned char* pData, unsigned int nDataSize, unsigned int* pnDataLen)
|
|
38 |
* @brief 获取设备的XML文件
|
|
39 |
* @param pData [IN][OUT] - 待拷入的缓存地址
|
|
40 |
nDataSize [IN] - 缓存大小
|
|
41 |
pnDataLen [OUT] - xml 文件数据长度
|
|
42 |
*
|
|
43 |
* @return 成功,返回MV_OK;失败,返回错误码
|
|
44 |
* @note 当pData为NULL或nDataSize比实际的xml文件小时,不拷贝数据,由pnDataLen返回xml文件大小;
|
|
45 |
* 当pData为有效缓存地址,且缓存足够大时,拷贝完整数据,并由pnDataLen返回xml文件大小。
|
|
46 |
*/
|
|
47 |
virtual int GetGenICamXML(unsigned char* pData, unsigned int nDataSize, unsigned int* pnDataLen) = 0;
|
|
48 |
|
|
49 |
|
|
50 |
/** @fn GetOneFrame(unsigned char * pData , unsigned int nDataSize, MV_FRAME_OUT_INFO* pFrameInfo)
|
|
51 |
* @brief 获取一帧图像数据
|
|
52 |
* @param pData [IN][OUT] - 数据指针
|
|
53 |
nDataLen [IN] - 数据长度
|
|
54 |
pFrameInfo [OUT] - 输出的帧信息
|
|
55 |
*
|
|
56 |
* @return 成功,返回MV_OK;失败,返回错误码
|
|
57 |
*/
|
|
58 |
virtual int GetOneFrame(unsigned char * pData , unsigned int nDataSize, MV_FRAME_OUT_INFO* pFrameInfo) = 0;
|
|
59 |
|
|
60 |
|
|
61 |
// 获取GenICam使用的传输层代理类
|
|
62 |
virtual TlProxy GetTlProxy() = 0;
|
|
63 |
|
|
64 |
virtual ~IMvDevice( void ){};
|
|
65 |
};
|
|
66 |
|
|
67 |
|
|
68 |
interface IDeviceFactory
|
|
69 |
{
|
|
70 |
|
|
71 |
// 枚举子网内,指定的传输协议对应的所有设备
|
|
72 |
virtual int EnumDevices( unsigned int nTLayerType , MV_CC_DEVICE_INFO_LIST& stDevList ) = 0;
|
|
73 |
|
|
74 |
|
|
75 |
// 创建设备代理类
|
|
76 |
virtual IMvDevice* CreateDevice( const MV_CC_DEVICE_INFO& device ) = 0;
|
|
77 |
|
|
78 |
|
|
79 |
// 销毁指定设备的内部资源
|
|
80 |
virtual int DestroyDevice( IMvDevice* ) = 0;
|
|
81 |
|
|
82 |
|
|
83 |
// 判断指定的设备是否可以访问
|
|
84 |
virtual bool IsDeviceAccessible( const MV_CC_DEVICE_INFO& deviceInfo) = 0;
|
|
85 |
};
|
|
86 |
|
|
87 |
|
|
88 |
|
|
89 |
}
|
|
90 |
|
|
91 |
#endif /* __MV_DEVICE_BASE_H__ */
|