panelinfostruct.h 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. #pragma once
  2. typedef int FPD_EVENT;
  3. #define PNL_READY 1 //panel ready
  4. #define PNL_WINDOWON 2 //x-ray enable window on
  5. #define PNL_WINDOWOFF 3 //x-ray enable window off
  6. #define PNL_READING 4 //正在读图
  7. #define PNL_PREPARE 5 //正在准备,如calibration,结束standby等
  8. #define PNL_STANDBY 6 //standby模式
  9. #define PNL_ABORT 7 //放弃曝光
  10. #define PNL_IMGREDATA 8 //图像;
  11. #define PNL_WAKEBEGIN 9 //正在唤醒
  12. #define PNL_WAKEEND 10 //已经被唤醒
  13. #define PNL_OFFSET_CALSTATUS 11 //offset校正的状态
  14. #define PNL_GAIN_CALSTATUS 12 //gain校正的状态
  15. #define PNL_DEFECT_CALSTATUS 13 //defect校正的状态
  16. #define PNL_READING_PROGRESS 14 //读图状态
  17. #define PNL_DOSE 15 //dose值
  18. #define PNL_PREVIEWIMAGE_INFO 16 //preview图像信息
  19. #define PNL_FULLIMAGE_INFO 17 //full图像信息
  20. #define PNL_XRAY_WINDOWTIME 18 //曝光窗口大小
  21. #define PNL_SYNCMODE 19 //同步模式
  22. #define PNL_IMGREDATA_PREVIEW 20 //PREVIEW图像;
  23. #define PNL_HAVE_PREVIEW 21 // 是否有preview
  24. #define PNL_XRAY_CAL_NO_IMAGE 22 // 校正无图像
  25. #define PNL_FRAME_POST 23 // 校正无图像
  26. #define PNL_STATE 24 // 探测器状态
  27. #define PNL_ERR_CODE 25 // 探测器错误
  28. #define PNL_TEMPERATURE 26 // 温度值
  29. #define PNL_TEMPERATURE_STATE 27 //温度状态
  30. #define PNL_FRMAE_ERR_NOTIFY 28 //FrameErrNotify
  31. #define PNL_HAVE_IMG_CAL 29 //校正有无图标记
  32. #define PNL_OFFSET_TOTALNUM 30
  33. #define PNL_XRAY_TOTALNUM 31
  34. #define PNL_CAL_ACTIVE 32
  35. #define PNL_CAL_RUNNING 33
  36. #define PNL_CAL_PROCESS_COUNTER 34
  37. #define PNL_CAL_PAUSE 35
  38. #define PNL_CAL_RESULT 36
  39. #define PNL_CAL_END 37
  40. typedef int (WINAPI *callbackFPDEvent)(FPD_EVENT eventid, LPINT datastructure, void* pCustomData);
  41. //---------------------------------------------------------------------------------------
  42. //
  43. // 结构名称:ECOM_IMAGE_INFO
  44. // 结构说明:用来保存图像数据。
  45. //
  46. //---------------------------------------------------------------------------------------
  47. typedef struct tagImgInfo
  48. {
  49. unsigned int nWidth; // 影像宽
  50. unsigned int nHeight; // 影像高
  51. unsigned int nBits; // 影像大小(总数据位)
  52. WORD *pwData; // 影像数据结构头指针
  53. }ECOM_IMAGE_INFO;
  54. typedef struct tagPanelInfo
  55. {
  56. int nColumn; // 影像宽
  57. int nRow; // 影像高
  58. int nBits; // 影像大小(总数据位)
  59. float fDetectorTemprature;
  60. float fDetectorElementPhysicalSize;
  61. float fDetectorElementSpacing;
  62. string strDetectorType;
  63. string strDetectorID;
  64. string strDetectorBinning;
  65. //COleDateTime dtLastCalibrationDateTime;
  66. tagPanelInfo& operator =(const tagPanelInfo &PanelInfo)
  67. {
  68. nColumn = PanelInfo.nColumn;
  69. nRow = PanelInfo.nRow;
  70. nBits = PanelInfo.nBits;
  71. fDetectorTemprature = PanelInfo.fDetectorTemprature;
  72. fDetectorElementPhysicalSize = PanelInfo.fDetectorElementPhysicalSize;
  73. fDetectorElementSpacing = PanelInfo.fDetectorElementSpacing;
  74. strDetectorType=PanelInfo.strDetectorType;
  75. strDetectorID=PanelInfo.strDetectorID;
  76. strDetectorBinning= PanelInfo.strDetectorBinning;
  77. //dtLastCalibrationDateTime = PanelInfo.dtLastCalibrationDateTime;
  78. return *this;
  79. }
  80. }ECOM_PANEL_INFO;
  81. typedef struct
  82. {
  83. int nFullWidth;
  84. int nFullHeight;
  85. int nWidthOffset;
  86. int nHeightOffset;
  87. bool bPreviewEnable;
  88. int nPreviewWidth;
  89. int nPreviewHeight;
  90. }Image;
  91. typedef struct
  92. {
  93. int nRefrencePV;
  94. int nAvgNum;
  95. int nKV;
  96. float fMA;
  97. float fMS;
  98. string strProcContent;
  99. }RefrenceCal;
  100. typedef struct Panel
  101. {
  102. int nPanelNumber;
  103. int nPanelID;
  104. int nCOMPort;
  105. int nPanelChannel;
  106. int nPanelState;
  107. int nCalibrationMode;
  108. int nPanelExpWindowMode;
  109. int nSaturationValue;
  110. int nSaveRawDataMode;
  111. int nMiddleFilter;
  112. int nAutoBadPixel;
  113. int nFlatImgCheck;
  114. int nDarkImgCheck;
  115. int nIPPort;
  116. int nExpWindow;//
  117. int nOffsetType; //
  118. float fTempUpperLimit;
  119. float fTempMaxLimit;
  120. float fTempLowerLimit;
  121. int nSyncMode;
  122. int nStandardEXI;
  123. int nHighPowerTimeOut;
  124. int nGridSuppress;
  125. int nDoseOfEXI;
  126. int nReserved1;
  127. int nReserved2;
  128. int nReserved3;
  129. int nReadImageFromLocal;
  130. string strPanelType;
  131. string strDemoImage;
  132. string strLastCalibrationDate;
  133. string strPanelFileName;
  134. string strIPAddress;
  135. string strPanelSerial;
  136. Image ImageStruct;
  137. string PixelSpacing;
  138. string ActiveDimension;
  139. string DetectorActiveTime;
  140. string DetectorActivationOffsetFromExposure;
  141. string FieldofViewShape;
  142. string ViewDimension;
  143. string DetectorType;
  144. string DetectorConfiguration;
  145. string strTimeofLastDetectorCalibration;
  146. string ConditionsNominalFlag;
  147. string Sensitivity;
  148. string DetectorElementPhysicalSize;
  149. string DetectorElementSpacing;
  150. string DetectorActiveShape;
  151. string DetectorActiveDimension;
  152. string DetectorActiveOrigin;
  153. string LossyImageCompression;
  154. string RescaleType;
  155. string PixelIntensityRelationship;
  156. string ImageReferUGY;
  157. string UGYShowType;
  158. string FactorEXI2UGY;
  159. Panel()
  160. {
  161. nPanelNumber = 0;
  162. nPanelID = 0;
  163. nCOMPort = 0;
  164. nPanelChannel = 0;
  165. nPanelState = 0;
  166. nCalibrationMode = 0;
  167. nPanelExpWindowMode = 0;
  168. nSaturationValue = 0;
  169. nSaveRawDataMode = 0;
  170. nMiddleFilter = 0;
  171. nAutoBadPixel = 0;
  172. nFlatImgCheck = 0;
  173. nDarkImgCheck = 0;
  174. nIPPort = 0;
  175. nExpWindow = 0;
  176. nGridSuppress = 0;
  177. fTempUpperLimit = 0.0f;
  178. fTempMaxLimit = 0.0f;
  179. fTempLowerLimit = 0.0f;
  180. nReserved1 = 0;
  181. nReserved2 = 0;
  182. nReserved3 = 0;
  183. nSyncMode = 0;
  184. nStandardEXI = 0;
  185. nDoseOfEXI = 0;
  186. nHighPowerTimeOut = 0;
  187. strPanelType = "";
  188. strDemoImage = "";
  189. strLastCalibrationDate = "";
  190. strPanelFileName ="";
  191. strIPAddress = "";
  192. strPanelSerial = "";
  193. nReadImageFromLocal = 1;
  194. //memset(ImageStruct, 0, sizeof(Image));
  195. //memset(vecRefrenceCal, 0, sizeof(vector<RefrenceCal>));
  196. PixelSpacing = "";
  197. ActiveDimension = "";
  198. DetectorActiveTime = "";
  199. DetectorActivationOffsetFromExposure = "";
  200. FieldofViewShape = "";
  201. ViewDimension = "";
  202. DetectorType = "";
  203. DetectorConfiguration = "";
  204. strTimeofLastDetectorCalibration = "";
  205. ConditionsNominalFlag = "";
  206. Sensitivity = "";
  207. DetectorElementPhysicalSize = "";
  208. DetectorElementSpacing = "";
  209. DetectorActiveShape = "";
  210. DetectorActiveDimension = "";
  211. DetectorActiveOrigin = "";
  212. LossyImageCompression = "";
  213. RescaleType = "";
  214. PixelIntensityRelationship = "";
  215. ImageReferUGY = "";
  216. UGYShowType = "";
  217. FactorEXI2UGY = "";
  218. }
  219. Panel& operator =(const Panel &panel)
  220. {
  221. nPanelNumber = panel.nPanelNumber;
  222. nPanelID = panel.nPanelID;
  223. nCOMPort = panel.nCOMPort;
  224. nPanelChannel = panel.nPanelChannel;
  225. nPanelState = panel.nPanelState;
  226. nCalibrationMode = panel.nCalibrationMode;
  227. nPanelExpWindowMode = panel.nPanelExpWindowMode;
  228. nSaturationValue = panel.nSaturationValue;
  229. nSaveRawDataMode = panel.nSaveRawDataMode;
  230. nMiddleFilter = panel.nMiddleFilter;
  231. nAutoBadPixel = panel.nAutoBadPixel;
  232. nFlatImgCheck = panel.nFlatImgCheck;
  233. nDarkImgCheck = panel.nDarkImgCheck;
  234. nIPPort = panel.nIPPort;
  235. nExpWindow = panel.nExpWindow;
  236. fTempUpperLimit = panel.fTempUpperLimit;
  237. fTempMaxLimit = panel.fTempMaxLimit;
  238. fTempLowerLimit = panel.fTempLowerLimit;
  239. nSyncMode = panel.nSyncMode;
  240. nStandardEXI = panel.nStandardEXI;
  241. nDoseOfEXI = panel.nDoseOfEXI;
  242. nHighPowerTimeOut = panel.nHighPowerTimeOut;
  243. nReserved1 = panel.nReserved1;
  244. nReserved2 = panel.nReserved2;
  245. nReserved3 = panel.nReserved3;
  246. nGridSuppress = panel.nGridSuppress;
  247. strPanelType=panel.strPanelType;
  248. strDemoImage=panel.strDemoImage;
  249. strLastCalibrationDate=panel.strLastCalibrationDate;
  250. strPanelFileName=panel.strPanelFileName;
  251. strIPAddress=panel.strIPAddress;
  252. strPanelSerial=panel.strPanelSerial;
  253. nReadImageFromLocal = panel.nReadImageFromLocal;
  254. ImageStruct = panel.ImageStruct;
  255. PixelSpacing = panel.PixelSpacing;
  256. ActiveDimension = panel.ActiveDimension;
  257. DetectorActiveTime = panel.DetectorActiveTime;
  258. DetectorActivationOffsetFromExposure = panel.DetectorActivationOffsetFromExposure;
  259. FieldofViewShape = panel.FieldofViewShape;
  260. ViewDimension = panel.ViewDimension;
  261. DetectorType = panel.DetectorType;
  262. DetectorConfiguration = panel.DetectorConfiguration;
  263. strTimeofLastDetectorCalibration = panel.strTimeofLastDetectorCalibration;
  264. ConditionsNominalFlag = panel.ConditionsNominalFlag;
  265. Sensitivity = panel.Sensitivity;
  266. DetectorElementPhysicalSize = panel.DetectorElementPhysicalSize;
  267. DetectorElementSpacing = panel.DetectorElementSpacing;
  268. DetectorActiveShape = panel.DetectorActiveShape;
  269. DetectorActiveDimension = panel.DetectorActiveDimension;
  270. DetectorActiveOrigin = panel.DetectorActiveOrigin;
  271. LossyImageCompression = panel.LossyImageCompression;
  272. RescaleType = panel.RescaleType;
  273. PixelIntensityRelationship = panel.PixelIntensityRelationship;
  274. ImageReferUGY = panel.ImageReferUGY;
  275. UGYShowType = panel.UGYShowType;
  276. FactorEXI2UGY = panel.FactorEXI2UGY;
  277. return *this;
  278. }
  279. }Panel;
  280. typedef enum FPD_ERR
  281. {
  282. FPD_ERR_NONE =0,
  283. FPD_ERR_INI,
  284. FPD_ERR_COMMUNICATION,
  285. FPD_ERR_SLEEP,
  286. FPD_ERR_DEEP_SLEEP,
  287. FPD_ERR_SHUTDOWN,
  288. FPD_ERR_LOST_OFFSET,
  289. FPD_ERR_LOST_GAIN,
  290. FPD_ERR_LOST_DEFECT,
  291. FPD_ERR_LOST_FULL_IMAGE,
  292. FPD_ERR_LOW_DOSE_IMAGE,
  293. FPD_RECOVER_IMAGE_FAILED,
  294. FPD_ERR_NEED_RESET
  295. };