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.

104 lines
2.7 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
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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 = 10,
  34. EVT_TARGET_WHITE = 11,
  35. EVT_TARGET_BLACK = 12,
  36. EVT_CAPTURE_START = 13,
  37. EVT_CAPTURE_END = 14,
  38. EVT_CAPTURE_DONE = 15,
  39. EVT_ERROR = 255
  40. } basicEventTypeID;
  41. typedef enum E_basicEventClassID{
  42. EVT_CLASS_SYSTEM = 0,
  43. EVT_CLASS_SENSOR = 1,
  44. EVT_CLASS_VIDEO = 2,
  45. EVT_CLASS_IMAGE = 3
  46. } basicEventClassID;
  47. typedef struct S_basicEvent{
  48. int m_nSourceUID;
  49. int m_nDestinationUID;
  50. basicEventClassID m_eClass;
  51. basicEventTypeID m_eType;
  52. struct tm sTS;
  53. char *m_pHumanReadableMsg;
  54. void *m_pEvtData;
  55. } basicEvent;
  56. /*
  57. typedef struct S_alarmDataEvent{
  58. uint32_t mRange;
  59. uint32_t mSampleID;
  60. uint32_t mStartID;
  61. uint32_t mEndID;
  62. uint16_t mCount;
  63. uint32_t mWidth;
  64. uint32_t mInfo;
  65. } alarmDataEvent;
  66. */
  67. #include "../../alg/generic/Transform.h"
  68. typedef struct S_TARGET_DATA {
  69. C3D_WGS84_LOC source_position;
  70. C3D_SPH_DEGREES local_target;
  71. C3D_DECART system_target;
  72. C3D_WGS84_LOC global_target;
  73. float area;
  74. }TARGET_DATA;
  75. typedef struct S_CLIENT_EVENT{
  76. uint8_t type; //basicEventTypeID
  77. uint32_t uts; //Time Stamp Seconds
  78. uint16_t ums; //Time Stamp milliseconds
  79. uint32_t th_id;
  80. uint8_t k_id; // for Slave + 0x08
  81. uint16_t range;
  82. uint8_t w_cnt;
  83. uint32_t a_th_node;
  84. } CLIENT_EVENT;
  85. typedef std::queue<CLIENT_EVENT*> EventsFIFO;
  86. void utilizeBasicEvent( basicEvent &Evt );
  87. void utilizeBasicEvent( basicEvent *Evt );
  88. basicEvent *createBasicEvent(unsigned int SRC, basicEventClassID Class, basicEventTypeID Type, char *Msg = NULL, void *Data = NULL);
  89. basicEvent *createBasicTargetedEvent(unsigned int SRC, unsigned int DST, basicEventClassID Class, basicEventTypeID Type, char *Msg = NULL, void *Data = NULL);
  90. typedef std::queue< basicEvent > EventQueue;
  91. typedef std::queue< basicEvent *> pEventQueue;
  92. typedef std::vector< basicEvent > EventVector;
  93. typedef std::vector< basicEvent *> pEventVector;
  94. #endif