|
@@ -83,7 +83,7 @@ struct location_card
|
|
|
|
|
|
if(point::eq(p.x,pt.x,0.2) && point::eq(p.y,pt.y,0.2)) return false;
|
|
|
double dis1=m_p.dist(pt);
|
|
|
- if(dis1<1.5)return false;
|
|
|
+ if(dis1<2)return false;
|
|
|
double dis = p.dist(pt);
|
|
|
double arg = make_arg(pt,p);
|
|
|
//查看路径方向是否改变
|
|
@@ -211,7 +211,7 @@ struct location_card
|
|
|
const char * sql = "replace into his_location (obj_id,card_type_id,ident,begin_time,map_id,area_id,begin_pt,direction)"
|
|
|
"values(%d,%d,%d,'%s',%d,%d,'%.2f,%.2f',%f);";
|
|
|
snprintf(nsql,512,sql,m_objid,m_type,m_cardid,tool_time::to_str(m_timestamp/1000).c_str(),m_mapid,m_areaid,m_p.x,m_p.y,m_arg);
|
|
|
- log_info("his_location[%d]:%s",m_cardid,nsql);
|
|
|
+ log_info("his_location[%d,%lu]:%s",m_cardid,m_timestamp,nsql);
|
|
|
sDBConnPool.PushAsync(nsql);
|
|
|
}
|
|
|
void update(const point &p,uint64_t timestamp)
|
|
@@ -225,7 +225,7 @@ struct location_card
|
|
|
if(std::isnan(avge_speed)|| std::isinf(avge_speed))avge_speed=0;
|
|
|
|
|
|
snprintf(nsql,512,sql,tool_time::to_str(timestamp/1000).c_str(),avge_speed,m_objid,tool_time::to_str(m_timestamp/1000).c_str());
|
|
|
- log_info("his_location[%d]:%s",m_cardid,nsql);
|
|
|
+ log_info("his_location[%d]:%s[%lu,%lu]",m_cardid,nsql,timestamp,m_timestamp);
|
|
|
sDBConnPool.PushAsync(nsql);
|
|
|
}
|
|
|
std::vector<point> find_path(const point &p1,const point &p2)
|
|
@@ -266,7 +266,7 @@ struct location_card
|
|
|
pt.y=-pt.y;dis+=_p.dist(pt);_p=pt;
|
|
|
});
|
|
|
uint64_t t=timestamp/1000 - m_timestamp/1000;
|
|
|
- if(t==0)return true;
|
|
|
+ if(t==0||dis<0.1)return true;
|
|
|
double avge_speed= dis/t;
|
|
|
|
|
|
for(const point & pp:rc)
|