1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #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)
- ,m_stat_attendance(AS_INIT)
- ,m_attendance_start_time(std::chrono::seconds(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:
- ///考勤状态 0初始状态 1 没在考勤 2 考勤;参看ATTENDANCE_STATUS
- int m_stat_attendance;
- ///考勤开始时间
- std::chrono::system_clock::time_point m_attendance_start_time;
- public:
- int site_id() const
- {
- return m_site_id;
- }
- bool is_invalid()
- {
- return -1==m_site_id;
- }
- bool is_attendance()
- {
- return AS_ATTENDANCE == m_stat_attendance;
- }
- };
- #endif
|