HbiError.h 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. /*---------------------------------------------------------------------------
  2. * Copyright (c) 2019 DT Image Technology (Shanghai) Co., Ltd
  3. * All rights reserved.
  4. *
  5. * File name: HbiError. h
  6. * Document ID:
  7. * Summary: flat-panel detector error message header file
  8. *
  9. * Current version: 3.0
  10. * Author: mhyang
  11. * Date: November 20, 2020
  12. * Copyright (c) 2019 地太科特影像科技有限公司
  13. * All rights reserved.
  14. *
  15. * 文件名称: HbiError.h
  16. * 文件标识:
  17. * 摘 要: 平板探测器错误信息头文件
  18. *
  19. * 当前版本: 3.0
  20. * 作 者: mhyang
  21. * 完成日期: 2020/11/20
  22. ----------------------------------------------------------------------------*/
  23. #ifndef __HB_DLL_ERROR_H_
  24. #define __HB_DLL_ERROR_H_
  25. enum HBIRETCODE {
  26. HBI_SUCCSS = 0,
  27. HBI_ERR_ININT_FAILED = 8000,
  28. HBI_ERR_OPEN_DETECTOR_FAILED = 8001,
  29. HBI_ERR_INVALID_PARAMS = 8002,
  30. HBI_ERR_CONNECT_FAILED = 8003,
  31. HBI_ERR_MALLOC_FAILED = 8004,
  32. HBI_ERR_RELIMGMEM_FAILED = 8005,
  33. HBI_ERR_RETIMGMEM_FAILED = 8006,
  34. HBI_ERR_NODEVICE = 8007,
  35. HBI_ERR_DISCONNECT = 8008,
  36. HBI_ERR_DEVICE_BUSY = 8009,
  37. HBI_ERR_SENDDATA_FAILED = 8010,
  38. HBI_ERR_RECEIVE_DATA_FAILED = 8011,
  39. HBI_ERR_COMMAND_DISMATCH = 8012,
  40. HBI_ERR_NO_IMAGE_RAW = 8013,
  41. HBI_ERR_PTHREAD_ACTIVE_FAILED = 8014,
  42. HBI_ERR_STOP_ACQUISITION = 8015,
  43. HBI_ERR_INSERT_FAILED = 8016,
  44. HBI_ERR_GET_CFG_FAILED = 8017,
  45. HBI_NOT_SUPPORT = 8018,
  46. HBI_REGISTER_CALLBACK_FAILED = 8019,
  47. HBI_SEND_MESSAGE_FAILD = 8020,
  48. HBI_ERR_WORKMODE = 8021,
  49. HBI_FAILED = 8022,
  50. HBI_FILE_NOT_EXISTS = 8023,
  51. HBI_COMM_TYPE_ERR = 8024,
  52. HBI_TYPE_IS_NOT_EXISTS = 8025,
  53. HBI_SAVE_FILE_FAILED = 8026,
  54. HBI_INIT_PARAM_FAILED = 8027,
  55. HBI_INIT_FILE_NOT_EXIST = 8028,
  56. HBI_INVALID_FLAT_PANEL = 8029,
  57. HBI_INVALID_DLL_HANDLE = 8031,
  58. HBI_FPD_IS_DISCONNECT = 8032,
  59. HBI_ERR_DETECTOR_NUMBER = 8033,
  60. HBI_ERR_DATA_CHECK_FAILED = 8034,
  61. HBI_ERR_CFG_ISEMPTY = 8035,
  62. HBI_ERR_OPEN_WIZARD_FAILED = 8036,
  63. HBI_ERR_WIZARD_ALREADY_EXIST = 8037,
  64. HBI_DIRECTORY_NOT_EXISTS = 8038,
  65. HBI_UNREGISTER_CALLBACK = 8039,
  66. HBI_ERR_IMAGE_ISEMPTY = 8040,
  67. HBI_ERR_ABNORMMAL_IMAGE = 8041,
  68. HBI_PREPARATION_COMPLETE = 8042,
  69. HBI_ERR_FILE_EXCEPTION = 8043,
  70. HBI_ERR_COMM_TYPE = 8044,
  71. HBI_ERR_INVALID_MODE = 8045,
  72. HBI_ERR_FIRM_CONFIG_DATA = 8046,
  73. HBI_ERR_IS_NULL = 8047,
  74. HBI_ERR_ROM_PARAMETER = 8048,
  75. HBI_ERR_FILE_TYPE = 8049,
  76. HBI_END = 8050
  77. };
  78. struct CodeStringTable
  79. {
  80. int num;
  81. int HBIRETCODE;
  82. const char *errString;
  83. };
  84. static const CodeStringTable CrErrStrList[] = {
  85. { 0, HBI_SUCCSS, "Success" },
  86. { 1, HBI_ERR_ININT_FAILED, "Init dll failed" },
  87. { 2, HBI_ERR_OPEN_DETECTOR_FAILED, "Open device driver failed" },
  88. { 3, HBI_ERR_INVALID_PARAMS, "Parameter error" },
  89. { 4, HBI_ERR_CONNECT_FAILED, "Connect failed" },
  90. { 5, HBI_ERR_MALLOC_FAILED, "Malloc memory failed" },
  91. { 6, HBI_ERR_RELIMGMEM_FAILED, "Releaseimagemem fail" },
  92. { 7, HBI_ERR_RETIMGMEM_FAILED, "ReturnImageMem fail" },
  93. { 8, HBI_ERR_NODEVICE, "No Init DLL Instance" },
  94. { 9, HBI_ERR_DISCONNECT, "Is Disconnect" },
  95. { 10, HBI_ERR_DEVICE_BUSY, "Fpd is busy" },
  96. { 11, HBI_ERR_SENDDATA_FAILED, "SendData failed" },
  97. { 12, HBI_ERR_RECEIVE_DATA_FAILED, "Receive Data failed" },
  98. { 13, HBI_ERR_COMMAND_DISMATCH, "Command dismatch" },
  99. { 14, HBI_ERR_NO_IMAGE_RAW, "No Image raw" },
  100. { 15, HBI_ERR_PTHREAD_ACTIVE_FAILED, "Pthread active failed" },
  101. { 16, HBI_ERR_STOP_ACQUISITION, "Pthread stop data acquisition failed" },
  102. { 17, HBI_ERR_INSERT_FAILED, "insert calibrate mode failed" },
  103. { 18, HBI_ERR_GET_CFG_FAILED, "get Fpd config failed" },
  104. { 19, HBI_NOT_SUPPORT, "not surport yet" },
  105. { 20, HBI_REGISTER_CALLBACK_FAILED, "failed to register callback function" },
  106. { 21, HBI_SEND_MESSAGE_FAILD, "send message failed" },
  107. { 22, HBI_ERR_WORKMODE, "switch work mode failed" },
  108. { 23, HBI_FAILED, "operation failed" },
  109. { 24, HBI_FILE_NOT_EXISTS, "file does not exist" },
  110. { 25, HBI_COMM_TYPE_ERR, "communication is not exist"},
  111. { 26, HBI_TYPE_IS_NOT_EXISTS, "this type is not exists"},
  112. { 27, HBI_SAVE_FILE_FAILED, "save file failed"},
  113. { 28, HBI_INIT_PARAM_FAILED, "Init dll param failed"},
  114. { 29, HBI_INIT_FILE_NOT_EXIST, "Init dll config file is not exist"},
  115. { 30, HBI_INVALID_FLAT_PANEL, "Invalid flat panel detector"},
  116. { 31, HBI_INVALID_DLL_HANDLE, "Invalid dll instance handle"},
  117. { 32, HBI_FPD_IS_DISCONNECT, "Fpd is disconnect"},
  118. { 33, HBI_ERR_DETECTOR_NUMBER, "Detector number error"},
  119. { 34, HBI_ERR_DATA_CHECK_FAILED, "Data Check failed"},
  120. { 35, HBI_ERR_CFG_ISEMPTY, "The configuration variable is empty"},
  121. { 36, HBI_ERR_OPEN_WIZARD_FAILED, "Open template wizard failed"},
  122. { 37, HBI_ERR_WIZARD_ALREADY_EXIST, "template wizard already exist"},
  123. { 38, HBI_DIRECTORY_NOT_EXISTS, "File directory is not exists"},
  124. { 39, HBI_UNREGISTER_CALLBACK, "Unregistered callbacke function"},
  125. { 40, HBI_ERR_IMAGE_ISEMPTY, "Image is empty"},
  126. { 41, HBI_ERR_ABNORMMAL_IMAGE, "Abnormal image"},
  127. { 42, HBI_PREPARATION_COMPLETE, "Preparation complete"},
  128. { 43, HBI_ERR_FILE_EXCEPTION, "File exception"},
  129. { 44, HBI_ERR_COMM_TYPE, "Wrong communication type"},
  130. { 45, HBI_ERR_INVALID_MODE, "This mode contains incorrect parameters"},
  131. { 46, HBI_ERR_FIRM_CONFIG_DATA, "Firmware parameter data is abnormal"},
  132. { 47, HBI_ERR_IS_NULL, "The pointer is NULL"},
  133. { 48, HBI_ERR_ROM_PARAMETER, "ROM includes incorrect parameters"},
  134. { 49, HBI_ERR_FILE_TYPE, "File type exception"},
  135. { 50, HBI_END, "Exit monitoring"}
  136. };
  137. ///*********************************************
  138. //*Description: Get the current error information through the return code
  139. //*Function: GetHbiErrorString
  140. //*Parameter: CodeStringTable * inTable returns the code table
  141. //*Int count Number of return codes
  142. //*Int recode return code
  143. //*Return value:
  144. //*Const char * Returns a string
  145. //*Remarks: BY MH.YANG 2019/12/09
  146. //*********************************************/
  147. //const char *GetHbiErrorString(CodeStringTable* inTable, int count, int recode)
  148. //{
  149. // const char *retString = "Unknown";
  150. // for(int i = 0; i < count; i++) {
  151. // if(inTable[i].HBIRETCODE == recode) {
  152. // retString = inTable[i].errString;
  153. // break;
  154. // }
  155. // }
  156. // return retString;
  157. //}
  158. //int main()
  159. //{
  160. // static const CodeStringTable CrErrStrList[] = {
  161. // { 0, HBI_SUCCSS, "Success" },
  162. // { 1, HBI_ERR_OPEN_DETECTOR_FAILED, "Open device driver failed" },
  163. // { 2, HBI_ERR_INVALID_PARAMS, "Parameter error" },
  164. // { 3, HBI_ERR_CONNECT_FAILED, "Connect failed" },
  165. // { 4, HBI_ERR_MALLOC_FAILED, "Malloc memory failed" },
  166. // { 5, HBI_ERR_RELIMGMEM_FAILED, "Releaseimagemem fail" },
  167. // { 6, HBI_ERR_RETIMGMEM_FAILED, "ReturnImageMem fail" },
  168. // { 7, HBI_ERR_NODEVICE, "No Device" },
  169. // { 8, HBI_ERR_DISCONNECT, "No Device,Try again" },
  170. // { 9, HBI_ERR_DEVICE_BUSY, "Device busy" },
  171. // { 10, HBI_ERR_SENDDATA_FAILED, "SendData failed" },
  172. // { 11, HBI_ERR_RECEIVE_DATA_FAILED, "Receive Data failed" },
  173. // { 12, HBI_ERR_COMMAND_DISMATCH, "Command dismatch" },
  174. // { 13, HBI_ERR_NO_IMAGE_RAW, "No Image raw" },
  175. // { 14, HBI_ERR_PTHREAD_ACTIVE_FAILED, "Pthread active failed" },
  176. // { 15, HBI_ERR_STOP_ACQUISITION, "Pthread stop data acquisition failed" },
  177. // { 16, HBI_ERR_INSERT_FAILED, "insert calibrate mode failed" },
  178. // { 17, HBI_ERR_GET_CFG_FAILED, "get device config failed" },
  179. // { 16, HBI_NOT_SUPPORT, "not surport yet" },
  180. // };
  181. // int nCode = 8001;
  182. // const char *tmpString = GetErrString(CodeStringTable, sizeof(CrErrStrList)/sizeof(CodeStringTable), uValue);
  183. // printf("nCode=%d,tmpString=%s\n", nCode, tmpString);
  184. // return 0;
  185. //}
  186. #endif // __HB_DLL_ERROR_H_