|
@@ -78,8 +78,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<1.5)return false;
|
|
|
double dis = p.dist(pt);
|
|
|
double arg = make_arg(pt,p);
|
|
|
log_info("his_location:line_changed:%d,%f,m_arg:%f,%s,%f,%f",m_cardid,arg,m_arg, (arg-m_arg > -1e-10 && arg-m_arg<1e-10)?"same":"not same",m_arg-arg,dis);
|
|
@@ -113,7 +112,7 @@ struct location_card
|
|
|
}
|
|
|
bool time_out(const point &p,uint64_t time)
|
|
|
{
|
|
|
- if(time-m_timestamp>=60*1000 && !(p == m_p))
|
|
|
+ if(time-m_timestamp>=10*60*1000 && !(p == m_p))
|
|
|
return true;
|
|
|
return false;
|
|
|
}
|
|
@@ -162,8 +161,8 @@ struct location_card
|
|
|
bool flag=false;
|
|
|
bool iflag=false;
|
|
|
flag=handle_message(p,timestamp);
|
|
|
- if(time_out(p,timestamp))
|
|
|
- if(!flag)iflag=true;
|
|
|
+ //if(time_out(p,timestamp))
|
|
|
+ // if(!flag)iflag=true;
|
|
|
if(is_speed_changed(p,timestamp))
|
|
|
if(!flag)iflag=true;
|
|
|
if(is_area_changed(areaid))
|
|
@@ -193,7 +192,7 @@ struct location_card
|
|
|
{
|
|
|
std::string tabName=getTabName();
|
|
|
char nsql[512]={0};
|
|
|
- const char * sql = "update his_location set last_time='%s',speed=%.2f where obj_id=%d and begin_time='%s';";
|
|
|
+ const char * sql = "update his_location set last_time='%s',speed=%.2f where obj_id=%d and begin_time='%s' and last_time is null;";
|
|
|
double dist = m_p.dist(p);
|
|
|
double t = timestamp - m_timestamp;
|
|
|
double avge_speed= dist/t*1000;
|
|
@@ -286,8 +285,10 @@ struct location_vehicle:location_card
|
|
|
bool flag =false;
|
|
|
if(line_changed(p))
|
|
|
{
|
|
|
- log_info("his_location:line_changed %d ",m_cardid);
|
|
|
flag=true;
|
|
|
+ //如果有拐点,说明是丢失信号后,飞跃得过程
|
|
|
+// std::vector<point> rc=card_path::inst().find_path(point(m_d.back().p.x,-m_d.back().p.y),point(p.x,-p.y));
|
|
|
+ log_info("his_location:line_changed %d ",m_cardid);
|
|
|
update(m_d.back().p,m_d.back().time);
|
|
|
set(m_d.back().p,m_d.back().time);init_att();
|
|
|
}
|