Browse Source

Merge branch 'master' of http://local.beijingyongan.com:3000/linux-dev/ya-serv

lixioayao 6 years ago
parent
commit
acfa158ff5
4 changed files with 40 additions and 24 deletions
  1. 5 0
      card_base.cpp
  2. 23 23
      card_message_handle.cpp
  3. 1 1
      main.cpp
  4. 11 0
      znet.cpp

+ 5 - 0
card_base.cpp

@@ -70,6 +70,11 @@ void card_location_base::on_message(zloop<task*> * loop,const message_locinfo&lo
 	}
 	else
 	{
+		if(site_ptr->is_path_empty())
+		{
+			log_warn("接收到分站%d的数据,CT=%d,但是分站路径为空",site_ptr->id(),loc.m_card_ct);
+		}
+
 		m_message_handle->on_message(loop,loc,is_history);
 	}
 }

+ 23 - 23
card_message_handle.cpp

@@ -14,13 +14,13 @@ struct one_ct_message_handle
 {
 	static loc_tool_main m_loc_tool;
 	ev::timer m_min_timer,m_max_timer;
-    //loc_message.
+	//loc_message.
 	std::vector<loc_message> m_msg_list;
 	card_location_base*m_card;
 	const algo_config*m_ac=nullptr;
 	int  m_ct;
 	bool m_min_timeout=false;
-    ev::dynamic_loop * m_loop = nullptr;
+	ev::dynamic_loop * m_loop = nullptr;
 	one_ct_message_handle(card_location_base*card)
 	{
 		m_card=card;
@@ -42,7 +42,7 @@ struct one_ct_message_handle
 		{
 			m_max_timer.stop();
 			calc_location();
-            return;
+			return;
 		}
 		m_min_timeout=true;
 	}
@@ -53,23 +53,23 @@ struct one_ct_message_handle
 		calc_location();
 	}
 
-    void set(ev::dynamic_loop * loop)
-    {
-        m_loop = loop;
+	void set(ev::dynamic_loop * loop)
+	{
+		m_loop = loop;
 
-        m_min_timer.set(*m_loop);
-	    m_min_timer.set<one_ct_message_handle,&one_ct_message_handle::on_min_timer>(this);
-	    m_max_timer.set(*m_loop);
-	    m_max_timer.set<one_ct_message_handle,&one_ct_message_handle::on_max_timer>(this);
-    }
+		m_min_timer.set(*m_loop);
+		m_min_timer.set<one_ct_message_handle,&one_ct_message_handle::on_min_timer>(this);
+		m_max_timer.set(*m_loop);
+		m_max_timer.set<one_ct_message_handle,&one_ct_message_handle::on_max_timer>(this);
+	}
 
 	void on_message(ev::dynamic_loop *loop,const message_locinfo&loc)
 	{
-        if(m_loop == nullptr && loop!=nullptr)
-            set(loop);
-        else if(loop == nullptr)
-          return;
-   		if(!m_msg_list.empty()&& m_ct!=loc.m_card_ct)
+		if(m_loop == nullptr && loop!=nullptr)
+			set(loop);
+		else if(loop == nullptr)
+			return;
+		if(!m_msg_list.empty()&& m_ct!=loc.m_card_ct)
 		{
 			m_msg_list.clear();
 		}
@@ -85,10 +85,10 @@ struct one_ct_message_handle
 			m_ct=loc.m_card_ct;
 			m_ac=&s->config();
 			m_min_timeout=false;
-            //这里构造loc_message 保存数据
+			//这里构造loc_message 保存数据
 			m_msg_list.push_back(loc_message(s,loc.m_tof,loc.m_time_stamp,loc.m_card_id,
-							loc.m_card_ct,loc.m_card_type,loc.m_ant_id,loc.m_rav,loc.m_acc,
-							loc.m_sync_ct,loc.m_rssi));
+						loc.m_card_ct,loc.m_card_type,loc.m_ant_id,loc.m_rav,loc.m_acc,
+						loc.m_sync_ct,loc.m_rssi));
 
 			//启动本CT的最小、最大两个定时器
 			m_min_timer.start(m_ac->min_wait_time);
@@ -97,8 +97,8 @@ struct one_ct_message_handle
 		}
 
 		m_msg_list.push_back(loc_message(s,loc.m_tof,loc.m_time_stamp,loc.m_card_id,
-						loc.m_card_ct,loc.m_card_type,loc.m_ant_id,loc.m_rav,loc.m_acc,
-						loc.m_sync_ct,loc.m_rssi));
+					loc.m_card_ct,loc.m_card_type,loc.m_ant_id,loc.m_rav,loc.m_acc,
+					loc.m_sync_ct,loc.m_rssi));
 
 		if(m_min_timeout && (int)m_msg_list.size()>=m_ac->best_msg_cnt)
 		{
@@ -107,7 +107,7 @@ struct one_ct_message_handle
 		}
 	}
 
-    void calc_location()
+	void calc_location()
 	{
 		auto v = m_msg_list;
 		if(v.empty())
@@ -119,7 +119,7 @@ struct one_ct_message_handle
 
 		std::vector<point> rc=std::move(m_loc_tool.calc_location(v));
 		log_info("calc_location:%d size:%d",m_card->m_id,rc.size());
-        
+
 		if(!rc.empty()) m_card->on_location(std::move(rc),v);
 
 		reset();

+ 1 - 1
main.cpp

@@ -149,7 +149,7 @@ void usage(char ** argv)
     }
     else if(cmd == "--version" || cmd == "-v")
     {
-        printf("yals (采集程序) 2.0.0\n");
+        printf("yals (采集程序) 2.0.0 build 11\n");
     }
     else
     {

+ 11 - 0
znet.cpp

@@ -558,3 +558,14 @@ service_handle*service_handle::instance(service_callback*sc)
 	return &_impl;
 }
 
+
+
+
+
+
+
+
+
+
+
+