Explorar o código

卡历史的坐标使用合法坐标。修复一人多卡升井清理内存的bug

lixioayao %!s(int64=5) %!d(string=hai) anos
pai
achega
9a4c4c1b8e
Modificáronse 4 ficheiros con 10 adicións e 8 borrados
  1. 1 1
      cardMgr.cpp
  2. 7 1
      card_base.cpp
  3. 1 3
      card_car.cpp
  4. 1 3
      card_person.cpp

+ 1 - 1
cardMgr.cpp

@@ -36,7 +36,7 @@ void cardMgr::onMessage(const Msg &m)
 }
 void cardMgr::clear(uint64_t cardid)
 {
-	auto v = m_cgraph.getcard(cardid);
+	auto v = getcard(cardid);
 	for(const auto & cid:v)
 	{
         log_info("LemonHash_up_mine:%lu&%lu",cardid,cid);

+ 7 - 1
card_base.cpp

@@ -81,6 +81,7 @@ void card_location_base::on_location(const std::vector<point>&vp,const std::vect
 {
 	loc_point pt = m_sel_tool->select_solution(vp,lm);
 	pt.y=-pt.y;
+	auto site_ptr=get_area_tool()->m_site;
 	if(pt.m_useless)
 	{
 		x = tool_other::round(pt.x,3);
@@ -93,12 +94,17 @@ void card_location_base::on_location(const std::vector<point>&vp,const std::vect
 		double acc = lm[0].m_acc;
         m_acc = lm[0].m_acc;
 		log_info("useful:type:%d,card_id:%d,ct:%d,timestamp:%llu, loc_point,x:%f,y:%f acc:%.2f",m_type,m_id,m_ct,m_time,x,y,acc);
+
+        int sid=0,mapid=0;
+        if(site_ptr){sid=site_ptr->m_area_id;mapid=site_ptr->m_map_id;}
+        //if(auto st=m_area_tool->m_site)sid=st->m_area_id;
+	    m_his_location_card->push(m_time,pt,sid,mapid);
+
 		do_business(lm.front().m_sit, pt, acc);
 	}
 	else
 	{
 		int sid=0;
-		auto site_ptr=get_area_tool()->m_site;
 
 		if(site_ptr)
 		{

+ 1 - 3
card_car.cpp

@@ -95,9 +95,7 @@ void car::make_package()
 	cp.is_on_duty=on_duty;
     //log_info("%s,down_time:%f,today:%lu,duty:%u",tool_other::type_id_to_str(m_type,m_id).c_str(),cp.down_time,tool_time::morning_of_today_ms(),on_duty);
 	upt_card_pos(cp,pt);
-    int sid=0;
-    if(auto st=m_area_tool->m_site)sid=st->m_area_id;
-	m_his_location_card->push(pt.m_time,pt,sid,cp.map_id);
+    //int sid=0; if(auto st=m_area_tool->m_site)sid=st->m_area_id; m_his_location_card->push(pt.m_time,pt,sid,cp.map_id);
 
 	uint64_t _now=tool_time::now_to_ms();
 	uint64_t t=_now>m_timeval?_now-m_timeval:m_timeval-_now;

+ 1 - 3
card_person.cpp

@@ -139,9 +139,7 @@ void person::on_timer()
 	cp.is_on_duty= m_mine_tool->is_on_duty();
 	upt_card_pos(cp,pt);
 	log_info("on_timer here ...%d,%lld,%.2f,%.2f,%d,%d--%d",m_id,_time,pt.x,pt.y,cp.map_id,cp.area_info.size(),person::m_limit_detained_time);
-    int sid=0;
-    if(auto st=m_area_tool->m_site)sid=st->m_area_id;
-	m_his_location_card->push(_time,pt,sid,cp.map_id);
+    //int sid=0; if(auto st=m_area_tool->m_site)sid=st->m_area_id; m_his_location_card->push(_time,pt,sid,cp.map_id);
 
 	uint64_t _now=tool_time::now_to_ms();
 	uint64_t t=_now>m_timeval?_now-m_timeval:m_timeval-_now;