|
@@ -29,9 +29,7 @@
|
|
|
#define READER_SEND_STATE_TIMEOUT 30 // (2* 60 * 60)
|
|
|
#define OVER_TIME (480 * 60)
|
|
|
|
|
|
-//#define CARD_TYPE_ADHOC 3
|
|
|
#define MAX_SEMACOUNT 64
|
|
|
-//#define INVALID_COORDINATE -1
|
|
|
|
|
|
//算法类型
|
|
|
//#define ALGORITHM_TYPE_TOF
|
|
@@ -78,6 +76,10 @@ const int MAX_READER_TDOA_PATH_NUMS = 10; //
|
|
|
const int LIGHT_CTRL_DELAY = 1000;
|
|
|
const int MAX_REBOUND_COUNTS = 5;
|
|
|
|
|
|
+#define OFFSET_THRE_IN_LINE 1 //判断是否在线段上,允许的误差为1米,用于isinline
|
|
|
+#define ZERO_PRECISION 1E-3 //为零的精度
|
|
|
+#define MAX_REBOUND_COUNTS 5
|
|
|
+
|
|
|
enum ALARM_FLAG{
|
|
|
//AF_CARD_OVER_COUNT = 1,
|
|
|
//AF_CARD_AREA_OVER_COUNT,
|
|
@@ -119,13 +121,6 @@ enum STATUS_DEVICE{
|
|
|
STATUS_DEVICE_ERROR
|
|
|
};
|
|
|
|
|
|
-enum STATUS_MOVING
|
|
|
-{
|
|
|
- STATUS_MOVING_MOTIONLESS = 0,
|
|
|
- STATUS_MOVING_MOTION,
|
|
|
- STATUS_MOVING_IDLING
|
|
|
-};
|
|
|
-
|
|
|
enum STATUS_CARD
|
|
|
{
|
|
|
STATUS_NORMAL = 0, //正常
|
|
@@ -286,6 +281,7 @@ enum ALGO_RETURN_VALUE{
|
|
|
DIST_COUNT_LESS_THAN_TWO = 10001,
|
|
|
DIST_COUNT_LESS_FOR_TIMESTAMP_ERROR,
|
|
|
DIST_COUNT_LESS_FOR_SYNC_NUM_DIFFER_FIVE,
|
|
|
+ DIST_COUNT_CARD_CUR_CT_LESS_LAST,
|
|
|
|
|
|
ALGO_CALC_SOLUTION = 30001,
|
|
|
ALGO_CALC_NO_SOLUTION_WITH_TWO_DATA,
|
|
@@ -308,7 +304,7 @@ enum ALGO_RETURN_VALUE{
|
|
|
|
|
|
extern unsigned int g_nAlgoFailedCounts[ALGO_LOC_TOTAL]; //全局的统计所有次数
|
|
|
extern unsigned int g_nAlgoFailedCycleCounts[ALGO_LOC_TOTAL]; //指定周期内的所有统计次数
|
|
|
-extern ULONGLONG g_ullCurTime;
|
|
|
+extern DWORD g_ullCurTime;
|
|
|
|
|
|
#define ALGORITHM_FAILED(nType) { \
|
|
|
g_nAlgoFailedCounts[nType]++; \
|
|
@@ -1126,7 +1122,7 @@ public:
|
|
|
bool is_hist;
|
|
|
bool is_need_cal;
|
|
|
bool m_bUseFilter;
|
|
|
- bool isoutput; //是否输出到json
|
|
|
+ bool isoutput; //是否输出到json
|
|
|
bool is_red_light;
|
|
|
|
|
|
bool is_mine_over_time; // 是否井下超时
|
|
@@ -1141,11 +1137,10 @@ public:
|
|
|
time_t time_area_over_speed;
|
|
|
time_t time_low_power;
|
|
|
time_t time_red_light; //闯红灯时间
|
|
|
- time_t last_locate_time; // 最后定位时间
|
|
|
+ time_t last_locate_time; // 最后定位时间
|
|
|
|
|
|
void reset();
|
|
|
void set_reader(std::shared_ptr<Reader> preader);
|
|
|
- //void set_reader(std::weak_ptr<Reader> preader);
|
|
|
void add_dist(_coordinate* dist);
|
|
|
void add_dist(std::shared_ptr<_coordinate> dist);
|
|
|
void remove_dist_head();
|
|
@@ -1169,7 +1164,11 @@ public:
|
|
|
|
|
|
INT64 m_event_list[CARD_EVENT_COUNT]; // 保存事件Id
|
|
|
public:
|
|
|
+ //算法相关参数及函数
|
|
|
+ bool is_algo_first_location; //表示算法的第一次定位
|
|
|
+
|
|
|
std::shared_ptr<nspLocate::LocateRecord> locate;
|
|
|
+ std::list<std::shared_ptr<POS>> idle_pos_list;
|
|
|
|
|
|
void algo_tof(int cnt);
|
|
|
void algo_tdoa(int cnt);
|
|
@@ -1188,7 +1187,12 @@ public:
|
|
|
int ChooseOneSolution(std::shared_ptr<ReceiveDataMap> pRdm, std::vector<std::shared_ptr<POS>> udm_pos, std::shared_ptr<POS>& pos);// 输出唯一解
|
|
|
int CheckSolution(std::shared_ptr<POS>& p); // 验证唯一解合法性,如速度、加速度
|
|
|
int CheckSulutionByStream(std::shared_ptr<POS> p); //参数使用非引用,即不可修改其值
|
|
|
+ int GetStream(double x1,double y1,double x2,double y2); //获得上下行方向
|
|
|
+ int CalcPositionBySpeed(std::shared_ptr<POS>& pos,double v);
|
|
|
+
|
|
|
+ bool CheckStreamUniformity(double x1,double y1,double x2,double y2,int nStream);
|
|
|
bool IsExistPath(int left,int right);
|
|
|
+<<<<<<< HEAD
|
|
|
int CopySolution(std::shared_ptr<POS> source,std::shared_ptr<POS>& dest);
|
|
|
int CalcPositionBySpeed(std::shared_ptr<POS>& pos,double v);
|
|
|
|
|
@@ -1196,6 +1200,10 @@ public:
|
|
|
int GetDeltaT(map<unsigned long long,std::shared_ptr<_coordinate>> dl);
|
|
|
int CheckCardStatus();
|
|
|
|
|
|
+=======
|
|
|
+ bool IsIdleStatus(std::shared_ptr<POS> pos);
|
|
|
+ bool IsRebound(std::shared_ptr<POS> pos); //判断是否回退
|
|
|
+>>>>>>> newprotocal
|
|
|
public:
|
|
|
// 滤波算法相关
|
|
|
std::unique_ptr<CKalmanFilter> m_pKalmanFilter;
|
|
@@ -1220,7 +1228,6 @@ public:
|
|
|
void EnableFilter(int nType);
|
|
|
int FindDistMap(int cardstamp);
|
|
|
int KalmanFilterProcess(std::shared_ptr<POS>& pos);
|
|
|
- int InitAlgoParam();
|
|
|
bool CheckCrossCycle();
|
|
|
bool isRebound(std::shared_ptr<POS> pos); //判断是否回跳
|
|
|
public:
|
|
@@ -1264,6 +1271,8 @@ public:
|
|
|
std::shared_ptr<POS> GetPosFromFittingData(); //从拟合数据获取定位坐标
|
|
|
int CheckSolutionByFit(int ret,std::shared_ptr<POS>& pos);
|
|
|
int CheckSolutionBySpeed(std::shared_ptr<POS>& pos);
|
|
|
+
|
|
|
+ bool CheckCardCtValid(); //检查卡的ct有效性
|
|
|
private:
|
|
|
bool b_long_interval; //上一次定位的间隔时间差大于10s
|
|
|
|
|
@@ -1298,15 +1307,14 @@ public: //
|
|
|
double distance_last; // 距离
|
|
|
int64_t flying_time_last; // 飞行时间
|
|
|
int power_state_last; // 电量
|
|
|
-
|
|
|
int ins_direction; //上一次的惯导合成方向
|
|
|
int direction; //上下行概念
|
|
|
-
|
|
|
int reader_id_last; //上一次定位时间戳的分站id
|
|
|
|
|
|
string str_his_time;
|
|
|
string str_rec_time;
|
|
|
|
|
|
+<<<<<<< HEAD
|
|
|
public:
|
|
|
//格子算法的代码
|
|
|
bool bInitalCellPath;
|
|
@@ -1376,6 +1384,9 @@ public:
|
|
|
//测试函数
|
|
|
int OutputCmdLog(int n);
|
|
|
|
|
|
+=======
|
|
|
+ public:
|
|
|
+>>>>>>> newprotocal
|
|
|
//呼叫信息
|
|
|
int call_type;
|
|
|
std::vector<int> vt_deal_call_reader_id;
|
|
@@ -1396,8 +1407,8 @@ public:
|
|
|
class Dept
|
|
|
{
|
|
|
public:
|
|
|
- Dept();
|
|
|
- ~Dept();
|
|
|
+ Dept(){};
|
|
|
+ ~Dept(){};
|
|
|
Dept(int id, string name);
|
|
|
private:
|
|
|
public:
|
|
@@ -1411,8 +1422,8 @@ public:
|
|
|
class OccLevel
|
|
|
{
|
|
|
public:
|
|
|
- OccLevel();
|
|
|
- ~OccLevel();
|
|
|
+ OccLevel(){};
|
|
|
+ ~OccLevel(){};
|
|
|
OccLevel(int id);
|
|
|
private:
|
|
|
public:
|