Browse Source

解决采煤机飞

lixioayao 5 years ago
parent
commit
114bdef5f5
4 changed files with 18 additions and 3 deletions
  1. 7 0
      ant.cpp
  2. 5 2
      loc_point.cpp
  3. 1 0
      loc_point.h
  4. 5 1
      select_tool.h

+ 7 - 0
ant.cpp

@@ -441,6 +441,13 @@ void sit_list::read_ant_path(int id)
 		}
 
 		sit_ptr->set_path(vl.second);
+        point p;
+        if(!sit_ptr->m_path_empty) {p=(*sit_ptr)[0][0][0].line::projection(*sit_ptr);sit_ptr->set(p);}
+        if(p==*sit_ptr)
+            log_info("[site_path]%s",sit_ptr->to_string().c_str());
+        else
+            log_info("[site_path_diff](%f,%f)--%f--%s",p.x,p.y,p.dist(*sit_ptr),sit_ptr->to_string().c_str());
+
 	}
 
 	card_path::init();

+ 5 - 2
loc_point.cpp

@@ -9,6 +9,7 @@ loc_point::loc_point()
     :m_time(0)
     ,m_ct(-1)
 	,m_cid(-1)
+    ,m_type(-1)
     ,m_sid(-1)
     ,m_acc(0)
     ,m_rav(0)
@@ -49,12 +50,12 @@ void loc_point::debug_out(const char *str)const
 {
     char time_buff[128];
 #if 1
-    logn_info(3,"t=%s,sit=%d,card=%d,ct=%d,cred=%d,"
+    logn_info(3,"t=%s,sit=%d,card=%d,ct=%d,cred=%d,type=%d"
             "tof1=%d,tof2=%d,pt=(%.2lf,"
             "%.2lf),rsp=%d,acc=%.2f,dist=%.2lf,dist1=%.2lf,dist2=%.2lf,rav=%.2f,speed:%.2f\n",
             now(time_buff,m_time), m_sid, 
 			m_cid,
-			m_ct, m_cred_level,
+			m_ct, m_cred_level,m_type,
             m_tof[0], m_tof[1],  x,
             y ,(m_rsp[0]+m_rsp[1])>>1,m_acc,
             m_dist1,m_dist,m_dist2, m_rav,m_speed
@@ -89,6 +90,7 @@ void loc_point::set_source(const loc_message&li,const loc_message&li2)
 {
     m_sid = li.m_sit->m_id;
 	m_cid = li.m_card_id;
+    m_type=li.m_card_type;
     m_time=std::min(li.m_loc_time,li2.m_loc_time);
     m_ct=li.m_card_ct;
     m_acc=li.m_acc *10;// 1270.;
@@ -104,6 +106,7 @@ void loc_point::set_source(const loc_message&li)
 {
     m_sid = li.m_sit->m_id;
 	m_cid = li.m_card_id;
+    m_type=li.m_card_type;
     m_time=li.m_loc_time;
     m_ct=li.m_card_ct;
     m_acc=li.m_acc *10;// 1270.;

+ 1 - 0
loc_point.h

@@ -11,6 +11,7 @@ struct loc_point:point
 	int64_t m_time;
 	int     m_ct;
 	uint32_t m_cid;
+    uint8_t  m_type;
     int     m_sid;
 	float	m_acc;
 	float	m_rav;

+ 5 - 1
select_tool.h

@@ -196,7 +196,11 @@ struct person_point_filter:select_point_object
 		{
 			select_one_ant(c,vp);
 		}
-
+        loc_point &refc=m_d(1);
+        if(c.m_type==4 && c.cl()<=20 && refc.is_same_site(c) && refc.time_off(c)<3 && vp.size(0)>=2)
+        {
+            log_info("{test_lemon}first point:site=%d,card=%d,(%f,%f) else:(%f,%f),cred:%d,size:%d",c.m_sid,c.m_cid,vp[0].x,vp[0].y,vp[1].x,vp[1].y,c.cl(),vp.size());
+        }
 	}
 	virtual fit_result * get_best_fit()
 	{