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.

66 lines
2.1 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __KERNEL_MODULE_ATTENTION_CLOUD__
  2. #define __KERNEL_MODULE_ATTENTION_CLOUD__
  3. #include "kernelModule.h"
  4. #include "../../components/base/basicThread.h"
  5. #include "../../components/base/basicMutex.h"
  6. #include "../../components/base/basicEventHeap.h"
  7. #include <vector>
  8. #define ATTENTION_STATUS_NEW 0
  9. #define ATTENTION_STATUS_SHOWING 1
  10. #define ATTENTION_STATUS_RESTING 2
  11. #define ATTENTION_STATUS_ZOMBIE 3
  12. typedef struct S_AttentionTarget{
  13. float temperature;
  14. }AttentionTarget;
  15. typedef std::vector<AttentionTarget *> AttentionTargets;
  16. typedef struct S_CamCtlArea{
  17. uint64_t cam_id;
  18. uint64_t lts;
  19. C3D_DECART loc;
  20. float range;
  21. basicMutex block;
  22. bool busy;
  23. }CamCtlArea;
  24. typedef struct S_AttentionZone{
  25. C3D_DECART loc;
  26. float range;
  27. uint64_t ts;
  28. uint8_t status;
  29. CamCtlArea * cam_ctl;
  30. }AttentionZone;
  31. typedef std::vector<AttentionZone *> AttentionCloud;
  32. typedef std::vector<CamCtlArea *> CamCtlAreas;
  33. class kernelAttentionCloud : public kernelModule, public basicThread {
  34. private:
  35. basicEventHeap * m_pEvtHeap;
  36. AttentionCloud m_vCloud;
  37. CamCtlAreas m_vCameras;
  38. DBC_ATC_MODULE_DATA m_sModuleData;
  39. basicMutex m_mCloudsProtector;
  40. bool isCamBusy( uint64_t cam_id );
  41. bool registerAttention( /*uint32_t TargetRefID,*/ C3D_DECART L );
  42. bool checkLocation( C3D_DECART BASE, C3D_DECART N, float range );
  43. bool createMoveToEvt( uint32_t cam_id, C3D_DECART L );
  44. AttentionZone * getOldest();
  45. bool loadCameras();
  46. bool deleteCameras();
  47. protected:
  48. void m_fThreadProc(void);
  49. public:
  50. explicit kernelAttentionCloud( uint32_t id );
  51. ~kernelAttentionCloud();
  52. virtual bool reloadSettings();
  53. virtual bool startService();
  54. virtual bool stopService(bool force = false);
  55. virtual bool validate();
  56. virtual bool dispatchEvent(EVENT_CONTAINER * Evt);
  57. };
  58. #endif