TiRayDef.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. #ifndef TIRAY_DEF_H
  2. #define TIRAY_DEF_H
  3. typedef enum {
  4. Err_Success,
  5. Err_SystemFailure, //system internal error
  6. Err_WrongModel, //the specified model is incorrect
  7. Err_DetectorNonExists, //the specified detector with the given ID does not exist
  8. Err_NetworkFailure, //the network communication has failed
  9. Err_InvalidParam, //the provided parameters are incorrect
  10. Err_UploadInProgress, //the upload is in progress
  11. Err_Busy, //the device is busy processing, can't do anything else.
  12. Err_Timeout, //process timed out
  13. Err_ImageNotExist, //image not exist when fetch historical image
  14. } TiRayError;
  15. typedef enum {
  16. Model_GQ1613,
  17. Model_DY1613,
  18. Model_LT1719,
  19. Model_DY4343,
  20. Model_DY2530W,
  21. Model_DY2121,
  22. Model_DY4343D,
  23. Model_GZ0404,
  24. Model_DY3543W,
  25. Model_DY4343W,
  26. Model_DY3543,
  27. Model_DY2430DP,
  28. Model_DY2530D,
  29. } TiRayModel;
  30. typedef enum {
  31. Cmd_ReadAttribute = 1,
  32. Cmd_WriteAttribute,
  33. Cmd_Photo,
  34. Cmd_UploadOffsetTemplate, //upload offset template to detector
  35. Cmd_UploadGainTemplate, //upload gain template to detector
  36. Cmd_UpdateFirmware,
  37. Cmd_ResetInner,
  38. Cmd_StopPhoto,
  39. Cmd_FetchHistoricalImageList,
  40. Cmd_FetchHistoricalImage,
  41. Cmd_DownloadOffsetTemplate, //download offset template from detector to pc
  42. Cmd_DownloadGainTemplate, //download gain template from detector to pc
  43. } TiRayCommand;
  44. typedef enum {
  45. Attr_WorkMode = 2, //int WorkMode
  46. Attr_BinningMode, //int BinningMode
  47. Attr_CalibrationMode, //int CalibrationMode
  48. Attr_PhotoInterval, //int interval
  49. Attr_PhotoNumber, //int number
  50. Attr_SelfClearInterval, //int interval
  51. Attr_GainLevel, //int level
  52. Attr_ROI, //int x1, int y1, int x2, int y2
  53. Attr_AEDSensitivity, //int sensitivity
  54. Attr_AEDDelay, //int delay
  55. Attr_WifiMode, //int Wi-Fi mode ap or station
  56. Attr_WifiApSSID, //string Wi-Fi ap ssid
  57. Attr_WifiApPSK, //string Wi-Fi ap psk
  58. Attr_WifiStationSSID, //string Wi-Fi station ssid
  59. Attr_WifiStationPSK, //string Wi-Fi station psk
  60. Attr_HibernationTimeout, //int Hibernation after timeout for wireless detector, at least 60 seconds
  61. Attr_BiasVoltMode, //int BiasVoltMode [GZ0404]
  62. Attr_BiasVoltage, //float bias voltage [GZ0404]
  63. Attr_OverlayNumber, //int image overlay number
  64. Attr_OverlayMode, //int image overlay mode
  65. Attr_RefDac, //int ref dac
  66. Attr_WifiStationHostIp, //string Wi-Fi station mode host ip
  67. Attr_WifiStationDeviceIp, //string Wi-Fi station mode detector ip
  68. //readonly attribute
  69. Attr_BatteryStatus = 1000, //int battery_level, int charging_status
  70. Attr_WifiStatus, //int signal_intensity, int link_quality(percent)
  71. Attr_Humiture, //int Celsius temperature, int humidity(percent)
  72. Attr_DeviceTime, //device datetime
  73. Attr_ExpiredTime, //device activation expired time
  74. Attr_DeviceSN, //device serial number
  75. Attr_CtrlVersion,
  76. Attr_FpgaVersion,
  77. Attr_McuVersion,
  78. Attr_ConnectionType,
  79. } TiRayAttribute;
  80. typedef enum {
  81. Evt_DetectorConnect = 1,
  82. Evt_DetectorDisconnect,
  83. Evt_ReadAttribute = 1000,
  84. Evt_WriteAttribute,
  85. Evt_ImageReceived,
  86. Evt_UploadProgress,
  87. Evt_UploadTimeout,
  88. Evt_UpdateFinish,
  89. Evt_ExposureStatus, //1 closed 0 open
  90. Evt_FetchHistoricalImageList,
  91. Evt_FetchHistoricalImage,
  92. Evt_DownloadOffsetTemplate,
  93. Evt_DownloadGainTemplate,
  94. Evt_DetectorStatus, //0 idle 1 busy
  95. } TiRayEvent;
  96. typedef enum {
  97. WorkMode_Idle,
  98. WorkMode_AED = 2,
  99. WorkMode_SyncOut,
  100. WorkMode_SyncIn = 5,
  101. WorkMode_Prep,
  102. WorkMode_Continuous,
  103. WorkMode_Inner,
  104. WorkMode_FreeSync,
  105. WorkMode_DDR,
  106. } WorkMode;
  107. typedef enum {
  108. Binning_None,
  109. Binning_2X1,
  110. Binning_2X2,
  111. } BinningMode;
  112. typedef enum {
  113. CalibrationMode_None = 1,
  114. CalibrationMode_Gain,
  115. CalibrationMode_Offset,
  116. CalibrationMode_Defect,
  117. } CalibrationMode;
  118. typedef enum {
  119. TemplateType_Gain,
  120. TemplateType_Offset,
  121. TemplateType_Mean,
  122. TemplateType_GainV2,
  123. } TemplateType;
  124. typedef enum {
  125. WifiMode_AP,
  126. WifiMode_Station,
  127. } WifiMode;
  128. typedef enum {
  129. ConnectionType_None,
  130. ConnectionType_Wired,
  131. ConnectionType_Wireless
  132. } ConnectionType;
  133. typedef enum {
  134. BiasVoltMode_LowVoltage,
  135. BiasVoltMode_HighVoltage,
  136. } BiasVoltMode;
  137. typedef enum {
  138. OverlayMode_Average, //overlay value = sum / number
  139. OverlayMode_Additive, //overlay value = sum
  140. } OverlayMode;
  141. #pragma pack(push, 1)
  142. typedef struct {
  143. char Ip[20];
  144. unsigned short Port; //not used for now
  145. int EnableLog;
  146. } StartupOption;
  147. typedef struct {
  148. enum {TiRayInt, TiRayFloat, TiRayBuffer, TiRayInt64} Type;
  149. union {
  150. int IntValue;
  151. long long Int64Value;
  152. float FloatValue;
  153. struct {
  154. char* DataValue;
  155. int DataLen;
  156. };
  157. };
  158. } TiRayVariant;
  159. #pragma pack(pop)
  160. #endif // #ifndef TIRAY_DEF_H