PegasusStructDefs.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. //=================================================================================================
  2. /*!
  3. @file PegasusStructDefs.h
  4. @ingroup Software group
  5. @author Jean-Francois Hammond
  6. @brief Main API
  7. */
  8. //=================================================================================================
  9. /*=================================================================================================
  10. Copyright (C) 2011
  11. ANRAD Corporation
  12. This software is the sole property of ANRAD Corporation and may not be copied or
  13. reproduced in any way without prior written permission from ANRAD Corporation.
  14. This software is intended for use in systems produced by ANRAD Corporation.
  15. This software or any other copies thereof may not be provided or otherwise
  16. made available to any other person without written permission from ANRAD
  17. Corporation. No title to and ownership of the software is hereby transferred.
  18. The information in this software is subject to change without notice and
  19. should not be construed as a commitment by ANRAD Corporation.
  20. =================================================================================================*/
  21. #ifndef PegasusStructDefs_H
  22. #define PegasusStructDefs_H
  23. #pragma pack(push, enter_PegasusStructDefsh) // Save the current packing alignment
  24. // Set packing alignment to 8 or 16 bytes for all data structures in this file // This is done to prevent compatibility problems due to different compilers / options
  25. #ifdef _WIN64
  26. #pragma pack(16)
  27. #else
  28. #ifdef _WIN32
  29. #pragma pack(8)
  30. #else
  31. #error "_WIN32 is not define"
  32. #endif
  33. #endif
  34. //
  35. //==================================== [ INCLUDE FILES ] ==========================================
  36. #define PEGASUS_CALIBRATION_GAIN "GAIN"
  37. #define PEGASUS_CALIBRATION_SHADING "SHADING"
  38. #define PEGASUS_CALIBRATION_DEFECT "DEFECT"
  39. //
  40. //==================================== [ DEFINES ] ================================================
  41. #define PEGASUS_MAX_STRING_LENGTH 512
  42. #define PEGASUS_MAX_TARGET_FILTER_LENGTH 256
  43. /* This type specifies information about the detector. */
  44. typedef struct {
  45. PEGASUS_Context current_context; /* Context currently loaded on the detector. */
  46. PEGASUS_State pegasusState;
  47. PEGASUS_DetectorState detectorState; /* State of the detector (for debugging purposes). */
  48. float temperature; /* Current temperature of the detector. */
  49. } PEGASUS_Info;
  50. typedef struct {
  51. char detectorID[PEGASUS_MAX_STRING_LENGTH]; /* Detector's board ID. */
  52. char panelId[PEGASUS_MAX_STRING_LENGTH]; /* Detector's TFT panel ID. */
  53. char sysRelease[PEGASUS_MAX_STRING_LENGTH]; /* Detector's system configuration release. */
  54. char cpuBootVer[PEGASUS_MAX_STRING_LENGTH]; /* Bool loader software version. */
  55. char cpuVer[PEGASUS_MAX_STRING_LENGTH]; /* Micro-controller software version. */
  56. char fpgaVer[PEGASUS_MAX_STRING_LENGTH]; /* FPGAVer firmware version. */
  57. char fpgaT0[PEGASUS_MAX_STRING_LENGTH]; /* FPGA Top 0 firmware version. */
  58. char fpgaT1[PEGASUS_MAX_STRING_LENGTH]; /* FPGA Top 1 firmware version. */
  59. char fpgaT2[PEGASUS_MAX_STRING_LENGTH]; /* FPGA Top 2 firmware version. */
  60. char fpgaT3[PEGASUS_MAX_STRING_LENGTH]; /* FPGA Top 3 firmware version. */
  61. char fpgaB0[PEGASUS_MAX_STRING_LENGTH]; /* FPBA Bottom 0 firmware version. */
  62. char fpgaB1[PEGASUS_MAX_STRING_LENGTH]; /* FPBA Bottom 1 firmware version. */
  63. char fpgaB2[PEGASUS_MAX_STRING_LENGTH]; /* FPBA Bottom 2 firmware version. */
  64. char fpgaB3[PEGASUS_MAX_STRING_LENGTH]; /* FPBA Bottom 3 firmware version. */
  65. } PEGASUS_FirmwareInfo;
  66. /* This type specifies information about the firmware version. */
  67. typedef struct {
  68. char cpuBootVer[PEGASUS_MAX_STRING_LENGTH]; /* Bool loader software version. */
  69. char cpuVer[PEGASUS_MAX_STRING_LENGTH]; /* Micro-controller software version. */
  70. char fpgaVer[PEGASUS_MAX_STRING_LENGTH]; /* FPGAVer firmware version. */
  71. char fpgaT0[PEGASUS_MAX_STRING_LENGTH]; /* FPGA Top 0 firmware version. */
  72. char fpgaT1[PEGASUS_MAX_STRING_LENGTH]; /* FPGA Top 1 firmware version. */
  73. char fpgaT2[PEGASUS_MAX_STRING_LENGTH]; /* FPGA Top 2 firmware version. */
  74. char fpgaT3[PEGASUS_MAX_STRING_LENGTH]; /* FPGA Top 3 firmware version. */
  75. char fpgaB0[PEGASUS_MAX_STRING_LENGTH]; /* FPBA Bottom 0 firmware version. */
  76. char fpgaB1[PEGASUS_MAX_STRING_LENGTH]; /* FPBA Bottom 1 firmware version. */
  77. char fpgaB2[PEGASUS_MAX_STRING_LENGTH]; /* FPBA Bottom 2 firmware version. */
  78. char fpgaB3[PEGASUS_MAX_STRING_LENGTH]; /* FPBA Bottom 3 firmware version. */
  79. } PEGASUS_FirmwareVersion;
  80. typedef struct {
  81. PEGASUS_BoardType board_type; /* Board type. */
  82. PEGASUS_FirmwareDetectorType fw_detector_type; /* Firmware detector type. */
  83. char detectorID[PEGASUS_MAX_STRING_LENGTH]; /* Detector's board ID. */
  84. char panelId[PEGASUS_MAX_STRING_LENGTH]; /* Detector's TFT panel ID. */
  85. char sysRelease[PEGASUS_MAX_STRING_LENGTH]; /* Detector's system configuration release. */
  86. } PEGASUS_DetectorConfiguration;
  87. typedef struct {
  88. int imagingMode;
  89. int rawWidth; /* Number of pixels for each line of a raw frame produced by the detector. */
  90. int rawHeight; /* Number of lines of a raw frame produced by the detector. */
  91. int rawSize; /* total image size in byte */
  92. int rawPixelSize; /* number of bytes per pixel */
  93. int width; /* Number of pixels for each line of an image produced by the detector. */
  94. int height; /* Number of lines of an image produced by the detector. */
  95. int size; /* total image size in byte */
  96. int pixelSize; /* number of bytes per pixel */
  97. int aecWidth; /* Number of pixels for each line of an aec image produced by the detector. */
  98. int aecHeight; /* Number of lines of an aec image produced by the detector. */
  99. int aecSize; /* total image size in byte */
  100. int aecPixelSize; /* number of bytes per pixel */
  101. } PEGASUS_ImageInfo;
  102. /* This type specifies information about the detector. */
  103. typedef struct {
  104. PEGASUS_DetectorType detector_type; /* Detector type. */
  105. PEGASUS_Context current_context; /* Context currently loaded on the detector. */
  106. PEGASUS_FirmwareInfo firmwareInfo;
  107. PEGASUS_ImageInfo imageInfo;
  108. float temperature; /* Current temperature of the detector. */
  109. PEGASUS_State pegasusState;
  110. PEGASUS_DetectorState detectorState; /* State of the detector (for debugging purposes). */
  111. char eclipseVersion[PEGASUS_MAX_STRING_LENGTH]; /* Eclipse software version. */
  112. char pegasusVersion[PEGASUS_MAX_STRING_LENGTH]; /* Eclipse software version. */
  113. } PEGASUS_DetailedInfo;
  114. /* This type specifies information about the detector. */
  115. typedef struct {
  116. PEGASUS_ProductType productType; /* Product Type. */
  117. PEGASUS_DetectorConfiguration detectorConfiguration; /* Detector configuration. */
  118. PEGASUS_Context current_context; /* Context currently loaded on the detector. */
  119. PEGASUS_FirmwareVersion firmwareVersion; /* Firmware version of the detector. */
  120. PEGASUS_ImageInfo imageInfo;
  121. float temperature; /* Current temperature of the detector. */
  122. PEGASUS_State pegasusState;
  123. PEGASUS_DetectorState detectorState; /* State of the detector (for debugging purposes). */
  124. char eclipseVersion[PEGASUS_MAX_STRING_LENGTH]; /* Eclipse software version. */
  125. char pegasusVersion[PEGASUS_MAX_STRING_LENGTH]; /* Eclipse software version. */
  126. } PEGASUS_SystemDetailedInfo;
  127. typedef struct {
  128. int numTopTempSensorExceededWarningLimit;
  129. int numBottomTempSensorExceededWarningLimit;
  130. int numTopTempSensorExceededShutdownLimit;
  131. int numBottomTempSensorExceededShutdownLimit;
  132. int numExposures;
  133. int numMinutesOn;
  134. int numExposureSequences;
  135. } PEGASUS_DetectorStats;
  136. typedef struct {
  137. int numTempSensor1ExceededWarningLimit;
  138. int numTempSensor2ExceededWarningLimit;
  139. int numTempSensor3ExceededWarningLimit;
  140. int numTempSensor1ExceededShutdownLimit;
  141. int numTempSensor2ExceededShutdownLimit;
  142. int numTempSensor3ExceededShutdownLimit;
  143. int numExposures;
  144. int numMinutesOn;
  145. } PEGASUS_DetectorStatsLMAM3;
  146. /* This type specifies information about the image cropping information. */
  147. typedef struct {
  148. int cropOffsetCol; /* Input value : Number of pixels for each line of a full image produced by the detector. */
  149. int cropOffsetRow; /* Input value : Number of lines of a full image produced by the detector. */
  150. int cropWidth; /* Input value : Number of pixels for each line of a full image produced by the detector. */
  151. int cropHeight; /* Input value : Number of lines of a full image produced by the detector. */
  152. } PEGASUS_ImageCropInfo;
  153. /* This type specifies information about the image. */
  154. typedef struct {
  155. PEGASUS_ImageCropInfo cropInfo; /* Input value : Number of pixels for each line of a full image produced by the detector. */
  156. void *pImage; /* Output value : Image buffer */
  157. } PEGASUS_Image;
  158. /* This type specifies information about the exposure. */
  159. typedef struct {
  160. int imageLeft;
  161. double mas;
  162. int kv;
  163. bool use_grid;
  164. bool use_AEC;
  165. PEGASUS_TargetFilter targetFilter;
  166. PEGASUS_FocusType focus;
  167. PEGASUS_Context context;
  168. PEGASUS_State pegasusState;
  169. } PEGASUS_ExposureData;
  170. /*
  171. This type specifies information about the acquisition properties.
  172. NOTE: If target filter array length is not sufficient, then the
  173. last element in the target filter array will be used for next image.
  174. */
  175. typedef struct {
  176. int targetFilterArrayLength; // Target filter array length
  177. PEGASUS_TargetFilter targetFilterArray[PEGASUS_MAX_TARGET_FILTER_LENGTH]; // Pointer to receive target filter array
  178. bool isAecMode; // Specify if AEC mode to use.
  179. PEGASUS_Context context; // Specify context to use.
  180. } PEGASUS_AcquisitionProperties;
  181. typedef void PEGASUS_EventRegistrationCallback(
  182. PEGASUS_EventType event, // Input value : event code
  183. PEGASUS_ErrorCode error, // Input value : error code
  184. void *pContext // Input value : pContext
  185. );
  186. typedef void PEGASUS_MultiEventRegistrationCallback(
  187. PEGASUS_MultiEventType event, // Input value : multi event code
  188. PEGASUS_ErrorCode error, // Input value : error code
  189. int sequenceId, // Input value : sequence Id
  190. int imageIndex // Input value : image index
  191. );
  192. typedef void PEGASUS_ProgressionEventCallback(
  193. int progression, // Input value : progression en % (0% - 100%) ou simplement un compte (0 ??)
  194. char taskName[PEGASUS_MAX_STRING_LENGTH] // Input value : task name
  195. );
  196. /*
  197. SERVICE INTERFACE
  198. */
  199. typedef struct {
  200. int width; /* Number of pixels for each line of an image produced by the detector. */
  201. int height; /* Number of lines of an image produced by the detector. */
  202. int size; /* Total image size in byte */
  203. int pixelSize; /* Number of bytes per pixel */
  204. PEGASUS_PixelFormat pixelFormat; /* Pixel format */
  205. } PEGASUS_ServiceImageInfo;
  206. /* This type specifies information about date. */
  207. typedef struct {
  208. int year;
  209. int month;
  210. int day;
  211. int hour;
  212. int minute;
  213. int second;
  214. } PEGASUS_Date;
  215. /* This type specifies information about one calibration table. */
  216. typedef struct {
  217. PEGASUS_Date date; /* Date of the calibration. */
  218. } PEGASUS_CalibrationTableInfo;
  219. #define PEGASUS_NB_SHADING_TABLE 6
  220. /* This type specifies information about all calibration tables. */
  221. typedef struct {
  222. PEGASUS_CalibrationTableInfo gain;
  223. PEGASUS_CalibrationTableInfo defect;
  224. PEGASUS_CalibrationTableInfo shading[PEGASUS_NB_SHADING_TABLE];
  225. } PEGASUS_CalibrationInfo;
  226. /* This type specifies information about a calibration type. */
  227. typedef struct {
  228. size_t len;
  229. PEGASUS_Date date;
  230. float temperature;
  231. } PEGASUS_CalibrationStats;
  232. // This structure is used to define a weak line/column defect
  233. typedef struct {
  234. PEGASUS_DefectType defectType;
  235. int value;
  236. int ref1;
  237. int ref2;
  238. } PEGASUS_WeakDefect;
  239. // This structure is used to define a pixel/line/column defect
  240. typedef struct {
  241. PEGASUS_DefectType defectType;
  242. int column;
  243. int row;
  244. } PEGASUS_GenericDefect;
  245. // This structure is used to return image information
  246. typedef struct {
  247. int sequenceId;
  248. int imageIndex;
  249. float temperature;
  250. int width;
  251. int height;
  252. int pixelSize;
  253. int size;
  254. PEGASUS_Context context;
  255. PEGASUS_TargetFilter targetFilter;
  256. bool isAec;
  257. } PEGASUS_ImageInformation;
  258. //
  259. //==================================== [ EXTERNS ] ================================================
  260. //
  261. //==================================== [ STATIC GLOBAL ] ==========================================
  262. //
  263. //==================================== [ PROTOTYPES ] =============================================
  264. // Return to original packing alignment
  265. #pragma pack(pop, enter_PegasusStructDefsh)
  266. #endif /* PegasusStructDefs_H */