123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- #ifndef __INCLUDE_HIS_LOCATION_HPP
- #define __INCLUDE_HIS_LOCATION_HPP
- #include <complex>
- #include <queue>
- #include "point.h"
- #include "loc_point.h"
- //速度
- //区域 地图变换
- //运动方向
- //路径变换
- struct location_card
- {
- location_card(uint32_t id,uint64_t type,uint32_t objid);
- uint32_t m_cardid; //卡id
- uint16_t m_type; //卡类型
- uint32_t m_objid;
- double m_arg; //运动方向角度值
- int m_areaid; //区域
- int m_mapid; //地图
- int m_siteid; //分站
- uint64_t m_timestamp; //入库后的时间
- point m_p; //入库后的点
- int m_direct_index;
- uint64_t last_timestamp;
- bool m_isInsert ; //是否
- static uint32_t m_difftime;//进入盲区得时长限制 时长
- static int m_distance; //进入盲区后,第一个点与之前得距离 像素距离
- void set_cid(uint32_t cid){ m_objid=cid; }
- struct mini_data
- {
- mini_data(const point &p,uint64_t t)
- :p(p)
- ,time(t)
- {}
- point p;
- uint64_t time;
- };
- std::queue<mini_data> m_d;
- void init();
- void init_att(const point &pt,uint64_t time);
- void set_invalid();
- //当前m_arg运动方向角度值 是否有效 0x12345678无效
- bool is_valid();
- //计算运动方向角度值
- double make_arg(const point &pt,const point &p);
- void set(const point &pt,uint64_t time);
- // 是否在路径上改变方向
- bool line_changed(const point &pt);//,int &df)
- // 判断速度变化
- bool is_speed_changed(const point& pt,uint64_t time);
- // 超时
- bool time_out(const point &p,uint64_t time);
- // 区域变化
- bool is_area_changed(int new_areaid);
- // 地图变化
- bool is_map_changed(int new_mapid);
- // 计算当前点是否需要记录到DB中
- void push(uint64_t timestamp,const point & p,int32_t areaid,int32_t mapid,int32_t siteid,bool bclose = false);
- void insert();
- void insert_simplify(const loc_point &pt, uint64_t timestamp);
- void insert_cell_card(const loc_point &pt, uint64_t timestamp);
- void insert_cell_reader(const loc_point &pt, uint64_t timestamp);
- void insert_vehicle_worktime(uint32_t card_id, uint64_t timestamp);
- void insert(uint64_t timestamp, const point & p, int32_t areaid, int32_t mapid, int32_t siteid, double scale);
- void update(const point &p,uint64_t timestamp,int flag=0,int dflag=0);
- // 操作路径上点的集合
- std::vector<point> find_path(const point &p1,const point &p2);
- //virtual bool handle_message(const point &p,uint64_t timestamp)=0;
- bool handle_message(const point &p,uint64_t timestamp);
- // 处理获取到点的集合,在路径上
- bool handle_path(std::vector<point> &rc,uint64_t timestamp,bool flag);
- };
- #endif
|