wangzhengquan
2020-06-16 262e468646df05544cfa78b6e9e973b61397ecf1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef __USG_INDIRECTALG_H__
#define __USG_INDIRECTALG_H__
#include "usg_common.h"
#include "graph.h"
struct Record
{
    std::string id;
    time_t timestamp;
    Point coordinate;
};
 
struct Status;
 
class IndirectAlg {
 
 
    Figure frame;
    //逆行持续时间,要超过这个时间才算逆行
    time_t keepTime;
    // 代表正确行走方向的向量
    Vector2 direction;
    // 状态缓存
    std::map<std::string, Status *> statusMap;
 
    std::atomic<bool> mterminate;
    std::thread mthread;
    void  threadRoutine();
   
public:
    
    IndirectAlg();
    IndirectAlg(const std::initializer_list<Edge> & edges, const time_t & _keepTime, const Vector2 & _direction);
    /**
     * @points  组成观测区域的彼此相邻的点
     * @_keepTime 保持时间
     * @_direction 正确行进的方向方向
     */
    IndirectAlg(const std::initializer_list<Point> & points, const time_t & _keepTime, const Vector2 & _direction);
 
    ~IndirectAlg();
 
    void printRecord(int tag, Record &record);
    /**
     * 是否逆行
    */
    bool isRetrograde(Record &record);
 
 
 
};
 
#endif