FPDRAD-TYPES.h 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. // Copyright (c) 2006-2012 E-COM. All Rights Reserved.
  2. // All the information contained in this file remain the sole and exclusive
  3. // property of E-COM and shall not be disclosed by the recipient to a third
  4. // party without the prior consent of E-COM.
  5. /*! \file FPDRAD-TYEPS.h
  6. Abstract:
  7. This module is used for the FPDRADTYPES API.
  8. It includes :
  9. - the constants definitions.
  10. - the types definitions.
  11. */
  12. #ifndef FPDRAD_TYPES_H
  13. #define FPDRAD_TYPES_H
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. //! Warning codes
  18. typedef enum
  19. {
  20. LOW_PRIORITY_WARN = 0,
  21. WARN_SUCCESS = LOW_PRIORITY_WARN + 0, //探测器休眠 此时应禁止曝光
  22. NORMAL_PRIORITY_WARN = 1000,
  23. WARN_OTHERS = NORMAL_PRIORITY_WARN + 0, //
  24. WARN_BATTERY = NORMAL_PRIORITY_WARN + 1, //电量低
  25. WARN_WIFI = NORMAL_PRIORITY_WARN + 2, // wifi低
  26. WARN_TEMPRATURE = NORMAL_PRIORITY_WARN + 3, //温度高
  27. WARN_LOAD_CALFILE = NORMAL_PRIORITY_WARN + 4,// 加载校正文件失败
  28. WARN_LOAD_OFFSET_REF = NORMAL_PRIORITY_WARN + 5, //加载OFFSET校正文件失败
  29. WARN_LOAD_GAIN = NORMAL_PRIORITY_WARN + 6, //加载GAIN校正文件失败
  30. WARN_LOAD_DEFECTMAP = NORMAL_PRIORITY_WARN + 7, //加载坏点校正文件失败
  31. WARN_SELECT_DETECTOR = NORMAL_PRIORITY_WARN + 8, //切换探测器失败
  32. WARN_DENOTED_IMAGE_NONE = NORMAL_PRIORITY_WARN +9,
  33. } warning_status;
  34. //! Error codes
  35. typedef enum
  36. {
  37. LOW_PRIORITY_ERROR = 0, //提示错误,但不能恢复
  38. ERR_BATTERY = LOW_PRIORITY_ERROR + 1, //电量过低
  39. ERR_WIFI = LOW_PRIORITY_ERROR + 2, // wifi过低
  40. ERR_TEMPRATURE = LOW_PRIORITY_ERROR + 3, //温度过高
  41. ERR_SELECT_DETECTOR = LOW_PRIORITY_ERROR + 4, //切换探测器失败
  42. NORMAL_PRIORITY_ERROR = 1000,
  43. ERR_SLEEP = NORMAL_PRIORITY_ERROR + 1, //探测器休眠 此时应禁止曝光
  44. ERR_ACQ_FAILED = NORMAL_PRIORITY_ERROR + 2, //曝光后采集图像失败,但不能恢复图像
  45. ERR_RECOVER_IMAGE = NORMAL_PRIORITY_ERROR + 3, //曝光后采集图像失败,可恢复图像
  46. ERR_DISCONNECT = NORMAL_PRIORITY_ERROR + 4, //探测器连接中断
  47. ERR_DETECTOR_REQUEST = NORMAL_PRIORITY_ERROR + 5, //探测器请求曝光失败
  48. FATAL_PRIORITY_ERROR = 2000,
  49. ERR_INIT_FAILED = FATAL_PRIORITY_ERROR + 1, //初始化失败
  50. ERR_POWEROFF = FATAL_PRIORITY_ERROR + 2, //探测器没电关机
  51. ERR_LOAD_API = FATAL_PRIORITY_ERROR + 3, //加载API失败
  52. ERR_KEY_MISSED = FATAL_PRIORITY_ERROR + 4, //缺少探测器key文件
  53. ERR_BAD_PARAMETER = FATAL_PRIORITY_ERROR + 5, //参数设置有误
  54. ERR_COMMUNICATION = FATAL_PRIORITY_ERROR + 6, //探测器通信失败或错误
  55. } error_status;
  56. //! Activity state
  57. typedef enum
  58. {
  59. // System state
  60. STATE_BOOTUP = 1,
  61. STATE_INITIALIZING,
  62. STATE_STANDBY,
  63. STATE_SLEEP,
  64. STATE_WORK,
  65. STATE_CALIBRATION,
  66. STATE_CONVENIENT,
  67. STATE_ERROR
  68. } system_state;
  69. //! Application mode
  70. typedef enum
  71. {
  72. APPLICATION_MODE1,
  73. APPLICATION_MODE2,
  74. APPLICATION_MODE3
  75. } application_mode;
  76. //! Operating mode
  77. typedef enum
  78. {
  79. OM_DEFAULT,
  80. OM_RAD,
  81. OM_DUAL_ENERGY,
  82. OM_POSITIONING,
  83. OM_DIGITAL_TOMO,
  84. OM_RAW
  85. } operating_mode;
  86. //! Correction Type
  87. typedef enum {
  88. CT_NONE = 0x0,
  89. //! defines the Offset correction
  90. CT_OFFSET = 0x1,
  91. //! defines the Gain correction
  92. CT_GAIN = 0x2,
  93. //! defines the Defect correction
  94. CT_DEFECT = 0x4,
  95. //! defines the Butting Cross/Line Correction
  96. CT_BUTTING = 0x8,
  97. //! defines the Echo Line Correction
  98. CT_ECHO_LINE = 0x10,
  99. //! defines the pixels cluster defect Correction
  100. CT_PIXELS_CLUSTER_DEFECT = 0x20,
  101. //! defines the Clipping Correction
  102. CT_CLIPPING = 0x40,
  103. //! enables all possible corrections
  104. CT_ALL = 0xFFFF
  105. } correction_type;
  106. //! Image type
  107. typedef enum
  108. {
  109. IT_OFFSET = 1,
  110. IT_X,
  111. IT_DEFECT_MAP
  112. } image_type;
  113. //! Detector state
  114. typedef enum
  115. {
  116. DS_OPERATION = 1,
  117. DS_SERVICE,
  118. DS_DOWNLOAD,
  119. DS_STANDBY,
  120. DS_BOOT,
  121. DS_SLEEP,
  122. DS_ERROR,
  123. DS_NOTDEFINED = -1
  124. } detector_state;
  125. //! type of data
  126. typedef enum
  127. {
  128. DT_FLOAT_TYPE = 1, //< 32-bit floating point
  129. DT_USHORT_TYPE, //< 16-bit unsigned short
  130. } data_type;
  131. //! Image information
  132. typedef struct
  133. {
  134. //! Data size in bytes
  135. unsigned long dataSize;
  136. //! number of bits for a pixel
  137. unsigned short bitsPerPixel;
  138. //! Horizontal image pixel size
  139. unsigned short sizeX;
  140. //! Vertical image pixel size
  141. unsigned short sizeY;
  142. } ImageParameters;
  143. //! Global Image Structure
  144. typedef struct
  145. {
  146. //! memory pointer on the image buffer
  147. void * imgPtr;
  148. //! image parameters
  149. ImageParameters imgParam;
  150. } acquisition_image;
  151. //! structure of configuration parameters
  152. typedef struct
  153. {
  154. unsigned short nbDetectors;
  155. } config_parameters;
  156. //! structure of Hardware status
  157. typedef struct
  158. {
  159. unsigned short nbDetectors;
  160. //! structure of detector status
  161. struct DetectorStatus
  162. {
  163. float temperature; //< detector temperature
  164. struct BatteryStatus
  165. {
  166. bool present; //< battery present or not in the detector
  167. unsigned short charge; //< charge level of the battery (in %)
  168. } *batteryStatus;
  169. struct WifiStatus
  170. {
  171. bool present; //< WI-FI present or not in the detector
  172. unsigned short linkQuality; //< Link quality
  173. } *wifiStatus;
  174. } * detectorStatus;
  175. } hardware_status;
  176. //! detector pattern
  177. typedef enum
  178. {
  179. DP_NORMAL = 0, //< Normal image
  180. DP_STATIC, //< Digital static ramp
  181. DP_DYNAMIC, //< Digital dynamic ramp
  182. DP_ANALOG, //< Analog pattern
  183. DP_RANDOM //< Pseudo random pattern (GPSA)
  184. } detector_pattern;
  185. typedef enum
  186. {
  187. BIN0 = 0
  188. }binning_mode;
  189. typedef enum
  190. {
  191. XWINDOW_500MS,
  192. XWINDOW_1000MS
  193. }xwindow_mdoe;
  194. //! structure of exposure mode
  195. typedef struct
  196. {
  197. detector_pattern detectorPattern;
  198. binning_mode binningMode;
  199. xwindow_mdoe XWindowMode;
  200. }exposur_mode;
  201. typedef enum
  202. {
  203. // Image Pixel Module
  204. ECM_SAMPLES_PER_PIXEL, // 图像的采样通道数目:1
  205. ECM_ROW, // 图像行的数目(高)
  206. ECM_COLUMNS, // 图像列的数目(宽)
  207. ECM_BITS_ALLOCATED, // 为每个像素分配的位数
  208. ECM_BITS_STORED, // 每个像素存储占用的位数
  209. ECM_HIGH_BIT, // 最高位在分配的存储单元中的位置
  210. ECM_PIXEL_REPRESENTATION, // 每个像素的解释方式:0
  211. //ECM_PIXEL_ASPECT_RATIO, // 像素宽高比: 1:1
  212. // DX Detector Module
  213. ECM_DETECTOR_ACTIVE_TIME, // 曝光窗口
  214. ECM_DETECTOR_ACTIVATION_OFFSET_FROM_EXPOSURE, // 曝光开始后多长时间曝光窗口打开:0
  215. ECM_FIELD_OF_VIEW_SHAPE, //可视区(遮光器)形状Enumerated Values: RECTANGLE ROUND HEXAGONAL: 方形,原型,六角形;
  216. ECM_FIELD_OF_VIEW_DIMENSION, // RECTANGLE: row dimension followed by column. 宽\高
  217. // ROUND: diameter. 半径
  218. // HEXAGONAL: diameter of a circumscribed circle. 外切圆半径
  219. ECM_FIELD_OF_VIEW_ORIGIN, //
  220. ECM_FIELD_OF_VIEW_ROTATION, // 0, 90, 180, 270
  221. ECM_FIELD_OF_VIEW_HORIZAONTAL_FLIP, // NO YES;注意,先旋转后水平翻转
  222. ECM_IMAGE_PIXEL_SPACING, // 像素间距
  223. ECM_DETECTOR_TYPE, // 探测器类型:SCINTILLATOR
  224. ECM_DETECTOR_CONFIGURATION, // 面板:AREA
  225. ECM_DETECTOR_ID, // 采集当前图像的探测器的ID或者序列号
  226. ECM_DATE_OF_LAST_DETECTOR_CALIBRATION, // 上一次探测器校正的日期
  227. ECM_TIME_OF_LAST_DETECTOR_CALIBRATION, // 上一次探测器校正的时间
  228. ECM_EXPOSURE_ON_DETECTOR_SINCE_LAST_CALIBRATION,// 上次校正以来的曝光次数
  229. ECM_EXPOSURE_ON_DETECTOR_SINCE_MANUFACTURED, // 出厂以来的曝光次数
  230. ECM_DETECTOR_TIME_SINCE_LAST_EXPOSURE, // 上次曝光到这次曝光之间的间隔
  231. ECM_DETECTOR_BINNING, // 探测器像素和输出图像之间的合并关系
  232. ECM_DETECTOR_CONDITION_NOMINAL_FLAG, // YES NO;比如温度过高,就不是正常
  233. ECM_DETECTOR_TEMPERATURE, // 探测器温度
  234. ECM_SENSITIVITY, // 厂商自定义
  235. ECM_DETECTOR_ELEMENT_PHYSICAL_SIZE, // 探测器物理尺寸
  236. ECM_DETECTOR_ELEMENT_SPACING, // 探测器元素间隔
  237. ECM_DETECTOR_ACTIVE_SHAPE, // 有效区形状
  238. ECM_DETECTOR_ACTIVE_DIMENSION, // 有效区尺寸
  239. // RECTANGLE: row dimension followed by column. 宽\高
  240. // ROUND: diameter. 半径
  241. // HEXAGONAL: diameter of a circumscribed circle. 外切圆半径
  242. ECM_DETECTOR_ACTIVE_ORIGIN, // 有效区原点
  243. // X-Ray Detector Module
  244. ECM_PHYSICAL_DETECTOR_SIZE, // 探测器的物理尺寸,单位 mm Row size\column size
  245. ECM_POSITON_OF_ISO_CENTER_PROJECTION, //
  246. }ecm_info;
  247. typedef enum
  248. {
  249. EVT_CODE_NA = 0,
  250. EVT_PREPARE,
  251. //! Sent when the detector is ready to make an exposure
  252. EVT_READY,
  253. //! Sent when XWidnwow open begins
  254. EVT_XWINDOW_ON,
  255. //! Sent when XWidnwow open ends
  256. EVT_XWINDOW_OFF,
  257. //! Sent when exposure image transmission begins
  258. EVT_START_TRANSMIT,
  259. //! Sent when exposure image transmission ends
  260. EVT_END_TRANSMIT,
  261. EVT_START_INI,
  262. EVT_END_INI,
  263. EVT_START_XRAY_CALIBRATION,
  264. EVT_END_XRAY_CALIBRATION,
  265. EVT_ABORT_XRAY_CALIBRATION,
  266. EVT_CALI_NO_IMG, //For Konica only
  267. EVT_CALI_RESULT //For Konica only
  268. } ste_code;
  269. //! structure for event data
  270. typedef struct
  271. {
  272. //unsigned short size;
  273. //error_status error;
  274. //unsigned short detector;
  275. //void * data;
  276. char data;
  277. } event_data;
  278. typedef enum
  279. {
  280. SYN_EXP_PREPARE = 0,
  281. SYN_EXP_READY,
  282. SYN_EXP_XWINDOWON,
  283. SYN_EXP_OVER,
  284. SYN_EXP_EIPON,
  285. SYN_EXP_EIPOFF,
  286. }syn_exposure_status;
  287. typedef enum
  288. {
  289. SYN_EVT_SYSTEM_STATUS = 100,
  290. SYN_EVT_EXPOSURE_STATUS = 200,
  291. }syn_event_id;
  292. #ifdef __cplusplus
  293. }
  294. #endif
  295. #endif // FPDRAD_TYPES_H