1
0

site_area.h 1008 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef __SITE_AREA_HOVER_HPP__
  2. #define __SITE_AREA_HOVER_HPP__
  3. #include <point.h>
  4. #include<chrono>
  5. #include "common.h"
  6. //每张卡包含这样一个对象,保存最后一个分站区域;只有tof一维有这个需求
  7. //1、记录卡进出分站的时间,地点
  8. //2、用于考勤
  9. struct site_area_hover
  10. {
  11. site_area_hover()
  12. :m_site_id(-1)
  13. ,m_enter_time(0)
  14. ,m_last_time(0)
  15. {
  16. }
  17. //调用时机:
  18. //1、tof一维收到第一个数据点时,以pt=0调用
  19. //2、数据点解析完毕之后调用
  20. void on_point(uint32_t card_id,int site_id,const point*pt,int32_t type);
  21. private:
  22. void enter_site(uint32_t card_id,int enter_site,int32_t type);
  23. void leave_site(uint32_t card_id,int enter_site,int32_t type);
  24. private:
  25. int m_site_id;
  26. time_t m_enter_time,m_last_time;
  27. point m_enter_point,m_last_point;
  28. public:
  29. int site_id() const
  30. {
  31. return m_site_id;
  32. }
  33. bool is_invalid()
  34. {
  35. return -1==m_site_id;
  36. }
  37. };
  38. #endif