You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
3.0 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
7 years ago
​
​
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
7 years ago
​
​
​
​
​
​
​
​
7 years ago
7 years ago
​
​
​
​
7 years ago
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Dr.Frucht Systems Ltd.
  3. // Copyright © 2000-2016. All Rights Reserved.
  4. // Version 2.0 3/30/2016
  5. // Last modification: 3/30/2016
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: basicEvent.h
  9. // AUTHOR: gagua
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of basicEvent.h
  13. //----------------------------------------------------------------------------
  14. //
  15. #ifndef __BASIC_EVENT_HEADER__
  16. #define __BASIC_EVENT_HEADER__
  17. #include <time.h>
  18. #include <malloc.h>
  19. #include <string.h>
  20. #include <queue>
  21. #include "basicTypes.h"
  22. typedef enum E_basicEventTypeID {
  23. EVT_NOINIT = 0,
  24. EVT_READY = 1,
  25. EVT_ALARM = 2,
  26. EVT_COMMAND = 3,
  27. EVT_KEY = 4,
  28. EVT_JOYSTICK = 5,
  29. EVT_STUDY = 6,
  30. EVT_BUSY = 7,
  31. EVT_FLIP = 8,
  32. EVT_SCAN = 9,
  33. EVT_TARGET_1D = 10, // CLD - No Target Cords, using Device Cords as Target
  34. EVT_TARGET_2D_WHITE = 11, // 2D System - Range Angle Width
  35. EVT_TARGET_2D_BLACK = 12, // 2D System - Range Angle Width
  36. EVT_TARGET_3D_WHITE = 13, // 3D System - Range Azimuth Elevation [Width]
  37. EVT_TARGET_3D_BLACK = 14, // 3D System - Range Azimuth Elevation [Width]
  38. EVT_CAPTURE_START = 13,
  39. EVT_CAPTURE_END = 14,
  40. EVT_CAPTURE_DONE = 15,
  41. EVT_ERROR = 16
  42. } basicEventTypeID;
  43. #define MAX_EVENT_ID 17
  44. typedef enum E_basicEventClassID{
  45. EVT_CLASS_SYSTEM = 0,
  46. EVT_CLASS_SENSOR = 1,
  47. EVT_CLASS_VIDEO = 2,
  48. EVT_CLASS_IMAGE = 3
  49. } basicEventClassID;
  50. typedef struct S_basicEvent{
  51. int m_nSourceUID;
  52. int m_nDestinationUID;
  53. basicEventClassID m_eClass;
  54. basicEventTypeID m_eType;
  55. struct tm sTS;
  56. char *m_pHumanReadableMsg;
  57. void *m_pEvtData;
  58. } basicEvent;
  59. /*
  60. typedef struct S_alarmDataEvent{
  61. uint32_t mRange;
  62. uint32_t mSampleID;
  63. uint32_t mStartID;
  64. uint32_t mEndID;
  65. uint16_t mCount;
  66. uint32_t mWidth;
  67. uint32_t mInfo;
  68. } alarmDataEvent;
  69. */
  70. #include "../../alg/generic/Transform.h"
  71. typedef struct S_TARGET_DATA {
  72. C3D_WGS84_LOC source_position;
  73. C3D_SPH_DEGREES local_target;
  74. C3D_DECART system_target;
  75. C3D_WGS84_LOC global_target;
  76. float area;
  77. }TARGET_DATA;
  78. typedef struct S_CLIENT_EVENT{
  79. uint8_t type; //basicEventTypeID
  80. uint32_t uts; //Time Stamp Seconds
  81. uint16_t ums; //Time Stamp milliseconds
  82. uint32_t th_id;
  83. uint8_t k_id; // for Slave + 0x08
  84. uint16_t range;
  85. uint8_t w_cnt;
  86. uint32_t a_th_node;
  87. } CLIENT_EVENT;
  88. typedef std::queue<CLIENT_EVENT*> EventsFIFO;
  89. void utilizeBasicEvent( basicEvent &Evt );
  90. void utilizeBasicEvent( basicEvent *Evt );
  91. basicEvent *createBasicEvent(unsigned int SRC, basicEventClassID Class, basicEventTypeID Type, char *Msg = NULL, void *Data = NULL);
  92. basicEvent *createBasicTargetedEvent(unsigned int SRC, unsigned int DST, basicEventClassID Class, basicEventTypeID Type, char *Msg = NULL, void *Data = NULL);
  93. typedef std::queue< basicEvent > EventQueue;
  94. typedef std::queue< basicEvent *> pEventQueue;
  95. typedef std::vector< basicEvent > EventVector;
  96. typedef std::vector< basicEvent *> pEventVector;
  97. #endif