IRayFpdSysEx_MAM.h 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. /**
  2. * File: FpdSysEx.h
  3. *
  4. * Purpose: Main access interface of iRay flat panel not public.
  5. *
  6. * @author Haitao.Ning
  7. * @version 1.0 2015/02/02
  8. *
  9. * Copyright (C) 2009, 2015, iRay Technology (Shanghai) Ltd.
  10. *
  11. */
  12. #ifndef _IRAY_FPD_SYSTEM_INTERFACE_EX_H_
  13. #define _IRAY_FPD_SYSTEM_INTERFACE_EX_H_
  14. #include "IRayFpdSys_MAM.h"
  15. #define IRAY_FPD_PROC_NAME_GET_AUTHORITY "GetAuthority"
  16. #define IRAY_FPD_PROC_NAME_GET_PRODUCT_COUNT "GetProdCount"
  17. #define IRAY_FPD_PROC_NAME_GET_PRODUCT_LIST "GetProdList"
  18. #define IRAY_FPD_PROC_NAME_GET_ATTRS_COUNT "GetAttrsCount"
  19. #define IRAY_FPD_PROC_NAME_GET_ATTR_IDLIST "GetAttrIDList"
  20. #define IRAY_FPD_PROC_NAME_GET_ATTR_INFO "GetAttrInfo"
  21. #define IRAY_FPD_PROC_NAME_GET_ENUM_ITEMS_COUNT "GetEnumItemsCount"
  22. #define IRAY_FPD_PROC_NAME_GET_ENUM_ITEM_LIST "GetEnumItemList"
  23. #define IRAY_FPD_PROC_NAME_GET_CMD_COUNT "GetCommandCount"
  24. #define IRAY_FPD_PROC_NAME_GET_CMD_LIST "GetCommandInfoList"
  25. #define IRAY_FPD_PROC_NAME_GET_CMD_PARAM_COUNT "GetCmdParamCount"
  26. #define IRAY_FPD_PROC_NAME_GET_CMD_PARAM_INFO "GetCmdParamInfo"
  27. #define IRAY_FPD_PROC_NAME_GET_ERROR_INFO "GetErrInfo"
  28. #define IRAY_MAX_NAME_LEN 128
  29. #define IRAY_MAX_DESC_LEN 256
  30. #pragma pack(push, 1)
  31. typedef struct _tagProdInfo
  32. {
  33. int nProdNo;
  34. char szName[IRAY_MAX_NAME_LEN];
  35. char szDescription[IRAY_MAX_DESC_LEN];
  36. }ProdInfo;
  37. enum PARAM_VALIDATOR
  38. {
  39. Enm_ParamValidator_Null = 0,
  40. Enm_ParamValidator_MinMax = 1,
  41. Enm_ParamValidator_Enum = 2,
  42. Enm_ParamValidator_FilePath = 3,
  43. Enm_ParamValidator_IP = 4,
  44. Enm_ParamValidator_MAC = 5,
  45. Enm_ParamValidator_FpdSN = 6,
  46. };
  47. typedef struct _tagAttrInfo
  48. {
  49. int nAttrID;
  50. enum IRAY_VAR_TYPE nDataType; // DataType
  51. int bIsConfigItem; // 0: not a config item, 1: is a config item
  52. int bIsWritable; // 0: not writable, 1: is writable
  53. int bIsEnum; // 0: not a enum, 1: is a enum
  54. int nPrecision; // 0: integer, 1: 0.1, 2: 0.01, 3: 0.001...
  55. float fMinValue;
  56. float fMaxValue;
  57. char szPath[IRAY_MAX_NAME_LEN]; // Group information
  58. char szName[IRAY_MAX_NAME_LEN];
  59. char szDisplayName[IRAY_MAX_NAME_LEN];
  60. char szUnit[IRAY_MAX_NAME_LEN];
  61. char szDescription[IRAY_MAX_DESC_LEN];
  62. char szEnumTypeName[IRAY_MAX_NAME_LEN];
  63. enum PARAM_VALIDATOR eValidator;
  64. }AttrInfo;
  65. typedef struct _tagEnumItem
  66. {
  67. int nVal;
  68. char szName[IRAY_MAX_NAME_LEN];
  69. char szDescription[IRAY_MAX_DESC_LEN];
  70. }EnumItem;
  71. typedef struct _tagCmdItem
  72. {
  73. int nCmdID;
  74. char szName[IRAY_MAX_NAME_LEN];
  75. }CmdInfo;
  76. typedef struct _tagCmdParamInfo
  77. {
  78. enum IRAY_VAR_TYPE nDataType; // DataType
  79. int bIsDataBlock; // 0: not a data block, 1: is a data block
  80. int bIsEnum; // 0: not a enum, 1: is a enum
  81. float fMinValue;
  82. float fMaxValue;
  83. char szName[IRAY_MAX_NAME_LEN];
  84. char szEnumTypeName[IRAY_MAX_DESC_LEN];
  85. enum PARAM_VALIDATOR eValidator;
  86. }CmdParamInfo;
  87. typedef struct _tagErrorInfo
  88. {
  89. int nErrorCode;
  90. char szDescription[IRAY_MAX_DESC_LEN];
  91. char szSolution[IRAY_MAX_DESC_LEN];
  92. }ErrorInfo;
  93. #pragma pack(pop)
  94. /**
  95. * FnGetAuthority: Define a function type for DLL export function "GetAuthority"
  96. *
  97. * GetAuthority: Get access level
  98. *
  99. * @param pAuthority [out] 0x00000000: basic access, 0x11111111: full factory access
  100. *
  101. * @return 0: succeed, Non-Zero: error code
  102. *
  103. * @see Enm_Authority
  104. */
  105. typedef int(*FnGetAuthority)(int *pAuthority);
  106. /**
  107. * FnGetProdCount: Define a function type for DLL export function "GetProdCount"
  108. *
  109. * GetProdCount: Query the count of iRay Detector Products
  110. *
  111. * @param pCount [out] buffer to receive the result
  112. *
  113. * @return 0: succeed, Non-Zero: error code
  114. */
  115. typedef int(*FnGetProdCount)(int* pCount);
  116. /**
  117. * FnGetProdList: Define a function type for DLL export function "GetProdList"
  118. *
  119. * GetProdList: Query the product list,
  120. * please call GetProdCount previously to get the size for result receiving buffer.
  121. *
  122. * @param pProdList [out] buffer to receive the result
  123. * @param nCount [in] size of the buffer, must equals the result of "GetProdCount"
  124. *
  125. * @return 0: succeed, Non-Zero: error code
  126. *
  127. * @see GetProdCount
  128. */
  129. typedef int(*FnGetProdList)(ProdInfo pProdList[], int nCount);
  130. /**
  131. * FnGetErrInfo: Define a function type for DLL export function "GetErrInfo"
  132. *
  133. * GetErrInfo: Query information of a certain error by error code
  134. *
  135. * @param nErrorCode [in] specify the error code
  136. * @param pInfo [out] buffer to receive the result
  137. *
  138. * @return 0: succeed, Non-Zero: error code
  139. */
  140. typedef int(*FnGetErrInfo)(int nErrorCode, ErrorInfo* pInfo);
  141. /**
  142. * FnGetEnumItemsCount: Define a function type for DLL export function "GetEnumItemsCount"
  143. *
  144. * GetEnumItemsCount: Query the element count of a certain Enum type,
  145. * usually this function is used while attribute value displaying if the value is an Enum.
  146. *
  147. * @param pszEnumTypeName [in] specify the type name of the Enum
  148. * @param pCount [out] buffer to receive the result
  149. *
  150. * @return 0: succeed, Non-Zero: error code
  151. */
  152. typedef int(*FnGetEnumItemsCount)(char* pszEnumTypeName, int* pCount);
  153. /**
  154. * FnGetEnumItemList: Define a function type for DLL export function "GetEnumItemList"
  155. *
  156. * GetEnumItemList: Query the element list of a certain Enum type,
  157. * please call GetEnumItemsCount previously to get the size for result receiving buffer.
  158. *
  159. * @param pszEnumTypeName [in] specify the type name of the Enum
  160. * @param pItemList [out] buffer to receive the result, each element of the array is an EnumItem struct
  161. * @param nCount [in] size of the buffer, must equals the result of "GetEnumItemsCount"
  162. *
  163. * @return 0: succeed, Non-Zero: error code
  164. *
  165. * @see GetEnumItemsCount
  166. */
  167. typedef int(*FnGetEnumItemList)(char* pszEnumTypeName, EnumItem pItemList[], int nCount);
  168. /**
  169. * FnGetAttrsCount: Define a function type for DLL export function "GetAttrsCount"
  170. *
  171. * GetAttrsCount: Query the count of all public attributes
  172. *
  173. * @param nDetectorID [in] specify a detector
  174. * @param pCount [out] buffer to receive the result
  175. *
  176. * @return 0: succeed, Non-Zero: error code
  177. */
  178. typedef int(*FnGetAttrsCount)(int nDetectorID, int* pCount);
  179. /**
  180. * FnGetAttrIDList: Define a function type for DLL export function "GetAttrIDList"
  181. *
  182. * GetAttrIDList: Query public attribute list,
  183. * please call GetAttrsCount previously to get the size for result receiving buffer.
  184. *
  185. * @param nDetectorID [in] specify a detector
  186. * @param pnIDList [out] buffer to receive the result, each element of the array is an attribute ID
  187. * @param nCount [in] size of the buffer, must equals the result of "GetAttrsCount"
  188. *
  189. * @return 0: succeed, Non-Zero: error code
  190. *
  191. * @see GetAttrsCount
  192. */
  193. typedef int(*FnGetAttrIDList)(int nDetectorID, int pnIDList[], int nCount);
  194. /**
  195. * FnGetAttrInfo: Define a function type for DLL export function "GetAttrInfo"
  196. *
  197. * GetAttrInfo: Query the information of a certain attribute,
  198. * the information include data type, min/max value, display name..., even enum name for UI displaying.
  199. *
  200. * @param nDetectorID [in] specify a detector
  201. * @param nAttrID [in] specify an attribute
  202. * @param pInfo [out] buffer to receive the result
  203. *
  204. * @return 0: succeed, Non-Zero: error code
  205. */
  206. typedef int(*FnGetAttrInfo)(int nDetectorID, int nAttrID, AttrInfo* pInfo);
  207. /**
  208. * FnGetCommandCount: Define a function type for DLL export function "GetCommandCount"
  209. *
  210. * GetCommandCount: Query the count of SDK supported Commands
  211. *
  212. * @param nDetectorID [in] specify a detector
  213. * @param pCount [out] buffer to receive the result
  214. *
  215. * @return 0: succeed, Non-Zero: error code
  216. */
  217. typedef int(*FnGetCommandCount)(int nDetectorID, int* pCount);
  218. /**
  219. * FnGetCommandInfoList: Define a function type for DLL export function "GetCommandInfoList"
  220. *
  221. * GetCommandInfoList: Query the Command list,
  222. * please call GetCommandCount perviously to get the size for result receiving buffer.
  223. *
  224. * @param nDetectorID [in] specify a detector
  225. * @param pCmdList [out] buffer to receive the result
  226. * @param nCount [in] size of the buffer, must equals the result of "GetCommandCount"
  227. *
  228. * @return 0: succeed, Non-Zero: error code
  229. *
  230. * @see GetCommandCount
  231. */
  232. typedef int(*FnGetCommandInfoList)(int nDetectorID, CmdInfo pCmdList[], int nCount);
  233. /**
  234. * FnGetCmdParamCount: Define a function type for DLL export function "GetCmdParamCount"
  235. *
  236. * GetCmdParamCount: Query the parameter count of a certain Command
  237. *
  238. * @param nDetectorID [in] specify a detector
  239. * @param nCmdID [in] specify the Command
  240. * @param pCount [out] buffer to receive the result
  241. *
  242. * @return 0: succeed, Non-Zero: error code
  243. */
  244. typedef int(*FnGetCmdParamCount)(int nDetectorID, int nCmdID, int* pCount);
  245. /**
  246. * FnGetEnumItemList: Define a function type for DLL export function "GetCmdParamInfo"
  247. *
  248. * GetCmdParamInfo: Query the parameter infomation list for a certain Command,
  249. * please call GetCmdParamCount previously to get the size for result receiving buffer.
  250. *
  251. * @param nDetectorID [in] specify a detector
  252. * @param nCmdID [in] specify the Command
  253. * @param pInfoList [out] buffer to receive the result, each element of the array is an CmdParamInfo struct
  254. * @param nCount [in] size of the buffer, must equals the result of "GetCmdParamCount"
  255. *
  256. * @return 0: succeed, Non-Zero: error code
  257. *
  258. * @see GetCmdParamCount
  259. */
  260. typedef int(*FnGetCmdParamInfo)(int nDetectorID, int nCmdID, CmdParamInfo pInfoList[], int nCount);
  261. #endif