1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #ifndef __SITE_AREA_HOVER_HPP__
- #define __SITE_AREA_HOVER_HPP__
- #include <point.h>
- #include <chrono>
- #include "common.h"
- //每张卡包含这样一个对象,保存最后一个分站区域;只有tof一维有这个需求
- //1、记录卡进出分站的时间,地点
- //2、用于考勤
- struct site_area_hover
- {
- site_area_hover()
- :m_site_id(-1)
- ,m_enter_time(0)
- ,m_last_time(0)
- {
- }
- //调用时机:
- //1、tof一维收到第一个数据点时,以pt=0调用
- //2、数据点解析完毕之后调用
- void on_point(uint32_t card_id,int site_id,const point*pt,int32_t type);
- private:
- void enter_site(uint32_t card_id,int enter_site,int32_t type);
- void leave_site(uint32_t card_id,int enter_site,int32_t type);
- private:
- int m_site_id;
- time_t m_enter_time,m_last_time;
- point m_enter_point,m_last_point;
- public:
- int get_att_type() const;
- int site_id() const
- {
- return m_site_id;
- }
- bool is_invalid() const
- {
- return -1==m_site_id;
- }
- };
- #endif
|