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.

100 lines
2.5 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
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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. typedef struct S_TARGET_DATA {
  68. float local_;
  69. }TARGET_DATA;
  70. typedef struct S_CLIENT_EVENT{
  71. uint8_t type; //basicEventTypeID
  72. uint32_t uts; //Time Stamp Seconds
  73. uint16_t ums; //Time Stamp milliseconds
  74. uint32_t th_id;
  75. uint8_t k_id; // for Slave + 0x08
  76. uint16_t range;
  77. uint8_t w_cnt;
  78. uint32_t a_th_node;
  79. } CLIENT_EVENT;
  80. typedef std::queue<CLIENT_EVENT*> EventsFIFO;
  81. void utilizeBasicEvent( basicEvent &Evt );
  82. void utilizeBasicEvent( basicEvent *Evt );
  83. basicEvent *createBasicEvent(unsigned int SRC, basicEventClassID Class, basicEventTypeID Type, char *Msg = NULL, void *Data = NULL);
  84. basicEvent *createBasicTargetedEvent(unsigned int SRC, unsigned int DST, basicEventClassID Class, basicEventTypeID Type, char *Msg = NULL, void *Data = NULL);
  85. typedef std::queue< basicEvent > EventQueue;
  86. typedef std::queue< basicEvent *> pEventQueue;
  87. typedef std::vector< basicEvent > EventVector;
  88. typedef std::vector< basicEvent *> pEventVector;
  89. #endif