site_area.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 get_att_type() const;
  30. int site_id() const
  31. {
  32. return m_site_id;
  33. }
  34. bool is_invalid() const
  35. {
  36. return -1==m_site_id;
  37. }
  38. };
  39. #endif