TiRayDef.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. #ifndef TIRAY_DEF_H
  2. #define TIRAY_DEF_H
  3. typedef enum {
  4. Err_Success = 0,
  5. Err_SystemFailure = 1, //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. } TiRayModel;
  28. typedef enum {
  29. Cmd_ReadAttribute = 1,
  30. Cmd_WriteAttribute,
  31. Cmd_Photo,
  32. Cmd_UploadOffsetTemplate,
  33. Cmd_UploadGainTemplate,
  34. Cmd_UpdateFirmware,
  35. Cmd_ResetInner,
  36. Cmd_StopPhoto,
  37. Cmd_FetchHistoricalImageList,
  38. Cmd_FetchHistoricalImage,
  39. } TiRayCommand;
  40. typedef enum {
  41. Attr_WorkMode = 2, //int WorkMode
  42. Attr_BinningMode, //int BinningMode
  43. Attr_CalibrationMode, //int CalibrationMode
  44. Attr_PhotoInterval, //int interval
  45. Attr_PhotoNumber, //int number
  46. Attr_SelfClearInterval, //int interval
  47. Attr_GainLevel, //int level
  48. Attr_ROI, //int x1, int y1, int x2, int y2
  49. Attr_AEDSensitivity, //int sensitivity
  50. Attr_AEDDelay, //int delay
  51. Attr_WifiMode, //int Wi-Fi mode ap or station
  52. Attr_WifiApSSID, //string Wi-Fi ap ssid
  53. Attr_WifiApPSK, //string Wi-Fi ap psk
  54. Attr_WifiStationSSID, //string Wi-Fi station ssid
  55. Attr_WifiStationPSK, //string Wi-Fi station psk
  56. Attr_HibernationTimeout, //int Hibernation after timeout for wireless detector
  57. Attr_BiasVoltMode, //int BiasVoltMode for GZ0404
  58. Attr_BiasVoltage, //float bias voltage for GZ0404
  59. //The following attributes currently apply only to DY2530W
  60. Attr_BatteryStatus = 1000, //int battery_level, int charging_status
  61. Attr_WifiStatus, //int signal_intensity, int link_quality(percent)
  62. Attr_Humiture, //int Celsius temperature, int humidity(percent)
  63. Attr_DeviceTime, //device datetime
  64. Attr_ExpiredTime, //device activation expired time
  65. Attr_DeviceSN, //device serial number
  66. Attr_ControllerVersion,
  67. Attr_FpgaVersion,
  68. Attr_ArmVersion,
  69. } TiRayAttribute;
  70. typedef enum {
  71. Evt_DetectorConnect = 1,
  72. Evt_DetectorDisconnect,
  73. Evt_ReadAttribute = 1000,
  74. Evt_WriteAttribute,
  75. Evt_ImageReceived,
  76. Evt_UploadProgress,
  77. Evt_UploadTimeout,
  78. Evt_UpdateFinish,
  79. Evt_ExposureStatus, //1 closed 0 open
  80. Evt_FetchHistoricalImageList,
  81. Evt_FetchHistoricalImage,
  82. } TiRayEvent;
  83. typedef enum {
  84. WorkMode_Idle = 0,
  85. WorkMode_AED = 2,
  86. WorkMode_SyncOut,
  87. WorkMode_SyncIn = 5,
  88. WorkMode_Prep,
  89. WorkMode_Continuous,
  90. WorkMode_Inner,
  91. WorkMode_FreeSync,
  92. } WorkMode;
  93. typedef enum {
  94. Binning_None,
  95. Binning_2X1,
  96. Binning_2X2,
  97. } BinningMode;
  98. typedef enum {
  99. CalibrationMode_None = 1,
  100. CalibrationMode_Gain,
  101. CalibrationMode_Offset,
  102. CalibrationMode_Defect,
  103. } CalibrationMode;
  104. typedef enum {
  105. Gain,
  106. Offset,
  107. Mean,
  108. GainV2,
  109. } TemplateType;
  110. typedef enum {
  111. AP,
  112. Station,
  113. } WifiMode;
  114. typedef enum {
  115. LowVoltage,
  116. HighVoltage,
  117. } BiasVoltMode;
  118. #pragma pack(push, 1)
  119. typedef struct {
  120. char Ip[20];
  121. unsigned short Port; //not used for now
  122. int EnableLog;
  123. } StartupOption;
  124. typedef struct {
  125. enum {TiRayInt, TiRayFloat, TiRayBuffer, TiRayInt64} Type;
  126. union {
  127. int IntValue;
  128. long long Int64Value;
  129. float FloatValue;
  130. struct {
  131. char* DataValue;
  132. int DataLen;
  133. };
  134. };
  135. } TiRayVariant;
  136. #pragma pack(pop)
  137. #endif // #ifndef TIRAY_DEF_H