ParameterNode.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. #ifndef __DAHUA_GENICAM_GENERAL_PARAMETERS_H__
  2. #define __DAHUA_GENICAM_GENERAL_PARAMETERS_H__
  3. #include "Defs.h"
  4. #include "Camera.h"
  5. #include "Infra/CString.h"
  6. GENICAM_NAMESPACE_BEGIN
  7. class CIntNode;
  8. class CDoubleNode;
  9. class CEnumNode;
  10. class CBoolNode;
  11. class CCmdNode;
  12. class CStringNode;
  13. typedef Memory::TSharedPtr<CIntNode> CIntNodePtr;
  14. typedef Memory::TSharedPtr<CDoubleNode> CDoubleNodePtr;
  15. typedef Memory::TSharedPtr<CEnumNode> CEnumNodePtr;
  16. typedef Memory::TSharedPtr<CBoolNode> CBoolNodePtr;
  17. typedef Memory::TSharedPtr<CCmdNode> CCmdNodePtr;
  18. typedef Memory::TSharedPtr<CStringNode> CStringNodePtr;
  19. /// \~chinese
  20. /// \brief 常用参数对象接口
  21. /// \defgroup config 属性配置相关操作接口
  22. /// \~english
  23. /// \brief common parameter object interface
  24. /// \defgroup config Property Operation interface
  25. /// @{
  26. /// \~chinese
  27. /// \brief Class CNodeBase 属性操作基类接口
  28. /// \~english
  29. /// \brief Class CNodeBase property operation base class interface
  30. class GENICAM_API CNodeBase
  31. {
  32. public:
  33. virtual ~CNodeBase();
  34. public:
  35. /// \~chinese
  36. /// \brief 属性是否可用
  37. /// \return 可用返回true,否则返回false
  38. /// \~english
  39. /// \brief check the property is available or not
  40. /// \return available:true, not available:false
  41. bool isAvailable() const;
  42. /// \~chinese
  43. /// \brief 属性是否可读
  44. /// \return 可读返回true,否则返回false
  45. /// \~english
  46. /// \brief check the property is readable or not
  47. /// \return readable:true, not readable:false
  48. bool isReadable() const;
  49. /// \~chinese
  50. /// \brief 属性是否可写
  51. /// \return 可写返回true,否则返回false
  52. /// \~english
  53. /// \brief check the property is writeable or not
  54. /// \return writeable:true, not writeable:false
  55. bool isWriteable() const;
  56. /// \~chinese
  57. /// \brief 属性是否Streamable
  58. /// \return 是则返回true,否则返回false
  59. /// \~english
  60. /// \brief check the property is streamable or not
  61. /// \return streamable:true, not streamable:false
  62. bool isStreamable() const;
  63. /// \~chinese
  64. /// \brief 判断属性是否有效
  65. /// \return 是则返回true,否则返回false
  66. /// \~english
  67. /// \brief check the property is valid or not
  68. /// \return valid:true, invalid:false
  69. bool isValid() const;
  70. protected:
  71. CNodeBase(const ICameraPtr& ptrCamera, const char* pParamName);
  72. CNodeBase(const CNodeBase& other);
  73. CNodeBase& operator= (const CNodeBase& other);
  74. protected:
  75. class Impl;
  76. Impl* m_pImpl;
  77. };
  78. /// \~chinese
  79. /// \brief Class IIntNode 整型属性操作类
  80. /// \~english
  81. /// \brief Class IIntNode integer property operation class
  82. class GENICAM_API CIntNode : public CNodeBase
  83. {
  84. public:
  85. CIntNode(const ICameraPtr& ptrCamera, const char* pParamName);
  86. ~CIntNode();
  87. public:
  88. /// \~chinese
  89. /// \brief 获取属性值
  90. /// \param [out] val 获取到的属性值
  91. /// \return 成功返回true,否则false
  92. /// \~english
  93. /// \brief get property's value
  94. /// \param [out] val the property's value
  95. /// \return success:true, fail:false
  96. bool getValue(int64_t& val) const;
  97. /// \~chinese
  98. /// \brief 设置属性值
  99. /// \param [in] val 待设置的属性值
  100. /// \return 成功则返回true,否则返回false
  101. /// \~english
  102. /// \brief set the property's value
  103. /// \param [in] val the value to be set for this property
  104. /// \return success:true, fail:false
  105. bool setValue(int64_t val);
  106. /// \~chinese
  107. /// \brief 获取属性可设最小值
  108. /// \param [out] val 获取到的属性最小值
  109. /// \return 成功返回true,否则false
  110. /// \~english
  111. /// \brief get the property's minimum value that can be set
  112. /// \param [out] val the property's minimum value
  113. /// \return success:true, fail:false
  114. bool getMinVal(int64_t& val) const;
  115. /// \~chinese
  116. /// \brief 获取属性可设最大值
  117. /// \param [out] val 获取到的属性最大值
  118. /// \return 成功返回true,否则false
  119. /// \~english
  120. /// \brief get the property's maximum value that can be set
  121. /// \param [out] val the property's maximum value
  122. /// \return success:true, fail:false
  123. bool getMaxVal(int64_t& val) const;
  124. /// \~chinese
  125. /// \brief 获取属性步长
  126. /// \param [out] val 获取到的属性步长
  127. /// \return 成功返回true,否则false
  128. /// \~english
  129. /// \brief get property's increment
  130. /// \param [out] val the property's increment
  131. /// \return success:true, fail:false
  132. bool getIncrement(int64_t& val) const;
  133. };
  134. /// \~chinese
  135. /// \brief Class IDoubleNode 浮点数属性操作类
  136. /// \~english
  137. /// \brief Class IDoubleNode float property operation class
  138. class GENICAM_API CDoubleNode : public CNodeBase
  139. {
  140. public:
  141. CDoubleNode(const ICameraPtr& ptrCamera, const char* pParamName);
  142. ~CDoubleNode();
  143. public:
  144. /// \~chinese
  145. /// \brief 获取属性值
  146. /// \param [out] val 获取到的属性值
  147. /// \return 成功返回true,否则false
  148. /// \~english
  149. /// \brief get property's value
  150. /// \param [out] val the property's value
  151. /// \return success:true, fail:false
  152. bool getValue(double& val) const;
  153. /// \~chinese
  154. /// \brief 设置属性值
  155. /// \param [in] val 待设置的属性值
  156. /// \return 成功则返回true,否则返回false
  157. /// \~english
  158. /// \brief set property's value
  159. /// \param [in] val the value to be set for this property
  160. /// \return success:true, fail:false
  161. bool setValue(double val);
  162. /// \~chinese
  163. /// \brief 获取属性可设最小值
  164. /// \param [out] val 获取到的属性最小值
  165. /// \return 成功返回true,否则false
  166. /// \~english
  167. /// \brief get the property's minimum value that can be set
  168. /// \param [out] val the property's minimum value
  169. /// \return success:true, fail:false
  170. bool getMinVal(double& val) const;
  171. /// \~chinese
  172. /// \brief 获取属性可设最大值
  173. /// \param [out] val 获取到的属性最大值
  174. /// \return 成功返回true,否则false
  175. /// \~english
  176. /// \brief get the property's maximum value that can be set
  177. /// \param [out] val the property's maximum value
  178. /// \return success:true, fail:false
  179. bool getMaxVal(double& val) const;
  180. };
  181. /// \~chinese
  182. /// \brief Class IEnumNode 枚举型属性操作类
  183. /// \~english
  184. /// \brief Class IEnumNode EnumNode property operation class
  185. class GENICAM_API CEnumNode : public CNodeBase
  186. {
  187. public:
  188. CEnumNode(const ICameraPtr& ptrCamera, const char* pParamName);
  189. ~CEnumNode();
  190. public:
  191. /// \~chinese
  192. /// \brief 获取枚举属性symbol值
  193. /// \param [out] val 获取到的属性值
  194. /// \return 成功返回true,否则false
  195. /// \~english
  196. /// \brief get symbol value of enum property
  197. /// \param [out] val the property's value
  198. /// \return success:true, fail:false
  199. bool getValueSymbol(Infra::CString& val) const;
  200. /// \~chinese
  201. /// \brief 设置枚举属性symbol值
  202. /// \param [in] strSymbolName 待设置的属性值
  203. /// \return 成功则返回true,否则返回false
  204. /// \~english
  205. /// \brief set symbol value of enum property
  206. /// \param [in] strSymbolName the value waiting to be set for this property
  207. /// \return success:true, fail:false
  208. bool setValueBySymbol(const Infra::CString& strSymbolName);
  209. /// \~chinese
  210. /// \brief 获取枚举属性可设置的symbol值列表
  211. /// \return 返回属性当前可设置symbol值列表
  212. /// \~english
  213. /// \brief Get the list of Enum property symbol value which can be set
  214. /// \return Return the list of Enum property symbol value which can be set now
  215. Infra::TVector<Infra::CString> getEnumSymbolList() const;
  216. };
  217. /// \~chinese
  218. /// \brief Class IBoolNode 布尔型属性操作类
  219. /// \~english
  220. /// \brief Class IBoolNode BoolNode property operation class
  221. class GENICAM_API CBoolNode : public CNodeBase
  222. {
  223. public:
  224. CBoolNode(const ICameraPtr& ptrCamera, const char* pParamName);
  225. ~CBoolNode();
  226. public:
  227. /// \~chinese
  228. /// \brief 获取属性值
  229. /// \param [out] val 获取到的属性值
  230. /// \return 成功返回true,否则false
  231. /// \~english
  232. /// \brief get property's value
  233. /// \param [out] val the property's value
  234. /// \return success:true, fail:false
  235. bool getValue(bool& val) const;
  236. /// \~chinese
  237. /// \brief 设置属性值
  238. /// \param [in] val 待设置的属性值
  239. /// \return 成功则返回true,否则返回false
  240. /// \~english
  241. /// \brief set property's value
  242. /// \param [in] val the value to be set for this property
  243. /// \return success:true, fail:false
  244. bool setValue(bool val);
  245. };
  246. /// \~chinese
  247. /// \brief Class ICmdNode 命令型属性操作类
  248. /// \~english
  249. /// \brief Class ICmdNode CmdNode property operation class
  250. class GENICAM_API CCmdNode : public CNodeBase
  251. {
  252. public:
  253. CCmdNode(const ICameraPtr& ptrCamera, const char* pParamName);
  254. ~CCmdNode();
  255. public:
  256. /// \~chinese
  257. /// \brief 执行命令类型属性
  258. /// \return 成功则返回true,否则返回false
  259. /// \~english
  260. /// \brief execute command property
  261. /// \return success:true, fail:false
  262. bool execute();
  263. };
  264. /// \~chinese
  265. /// \brief Class IStringNode 命令型属性操作类
  266. /// \~english
  267. /// \brief Class IStringNode StringNode property operation class
  268. class GENICAM_API CStringNode : public CNodeBase
  269. {
  270. public:
  271. CStringNode(const ICameraPtr& ptrCamera, const char* pParamName);
  272. ~CStringNode();
  273. public:
  274. /// \~chinese
  275. /// \brief 获取属性值
  276. /// \param [out] outStr 获取到的属性值
  277. /// \return 成功返回true,否则false
  278. /// \~english
  279. /// \brief get property's value
  280. /// \param [out] outStr the property's value
  281. /// \return success:true, fail:false
  282. bool getValue(Infra::CString &outStr);
  283. /// \~chinese
  284. /// \brief 设置属性值
  285. /// \param [in] inStr 待输入的属性值
  286. /// \return 成功则返回true,否则返回false
  287. /// \~english
  288. /// \brief set the property's value
  289. /// \param [in] inStr the value to be set for this property
  290. /// \return success:true, fail:false
  291. bool setValue(const Infra::CString &inStr);
  292. };
  293. /// @}
  294. GENICAM_NAMESPACE_END
  295. #endif // __DAHUA_GENICAM_GENERAL_PARAMETERS_H__