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.

91 lines
2.3 KiB

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_ERROR = 255
  37. } basicEventTypeID;
  38. typedef enum E_basicEventClassID{
  39. EVT_CLASS_SYSTEM = 0,
  40. EVT_CLASS_SENSOR = 1,
  41. EVT_CLASS_VIDEO = 2,
  42. EVT_CLASS_IMAGE = 3
  43. } basicEventClassID;
  44. typedef struct S_basicEvent{
  45. int m_nSourceUID;
  46. int m_nDestinationUID;
  47. basicEventClassID m_eClass;
  48. basicEventTypeID m_eType;
  49. struct tm sTS;
  50. char *m_pHumanReadableMsg;
  51. void *m_pEvtData;
  52. } basicEvent;
  53. typedef struct S_CLIENT_EVENT{
  54. uint8_t type; //basicEventTypeID
  55. uint32_t uts; //Time Stamp Seconds
  56. uint16_t ums; //Time Stamp milliseconds
  57. uint32_t th_id;
  58. uint8_t k_id; // for Slave + 0x08
  59. uint16_t range;
  60. uint8_t w_cnt;
  61. uint32_t a_th_node;
  62. } CLIENT_EVENT;
  63. /*typedef struct S_alarmDataEvent{
  64. uint32_t mRange;
  65. uint32_t mSampleID;
  66. uint32_t mStartID;
  67. uint32_t mEndID;
  68. uint16_t mCount;
  69. uint32_t mWidth;
  70. uint32_t mInfo;
  71. } alarmDataEvent;
  72. */
  73. void utilizeBasicEvent( basicEvent &Evt );
  74. void utilizeBasicEvent( basicEvent *Evt );
  75. basicEvent *createBasicEvent(unsigned int SRC, basicEventClassID Class, basicEventTypeID Type, char *Msg = NULL, void *Data = NULL);
  76. basicEvent *createBasicTargetedEvent(unsigned int SRC, unsigned int DST, basicEventClassID Class, basicEventTypeID Type, char *Msg = NULL, void *Data = NULL);
  77. typedef std::queue< basicEvent > EventQueue;
  78. typedef std::queue< basicEvent *> pEventQueue;
  79. typedef std::vector< basicEvent > EventVector;
  80. typedef std::vector< basicEvent *> pEventVector;
  81. #endif