Browse Source

m_area_type 保存区域业务逻辑值

lixioayao 6 years ago
parent
commit
d22a7215dc
2 changed files with 4 additions and 11 deletions
  1. 4 4
      area.cpp
  2. 0 7
      main.cpp

+ 4 - 4
area.cpp

@@ -108,7 +108,7 @@ void area::change_business(uint32_t new_bits)
 
 	uint32_t del=((m_area_type^new_bits)|m_area_type)^m_area_type;
 	uint32_t add=((m_area_type^new_bits)|new_bits)^new_bits;
-
+    log_info("change_area_business:%d,b_type:%d,area_type:%d [del:%d, add:%d]",m_id,new_bits,m_area_type,del,add);
 	if(del==0 && add==0)
 		return;
 
@@ -291,7 +291,7 @@ void area_list::init_monkeycar_area(int id)
             da->m_default_speed = monkeycar_speed;
             da->m_point = init_path(monkeycar_coor,area_id);
             std::shared_ptr<area> ap = std::make_shared<monkey_area>(da,area_id,over_count_person, over_time_person,scale,map_id,b_type);
-            ap->update(over_count_person, over_time_person,scale,map_id,area_type_id, over_count_vehicle,over_time_vehicle);
+            ap->update(over_count_person, over_time_person,scale,map_id,b_type, over_count_vehicle,over_time_vehicle);
 
             ap->m_bound=init_path(path,area_id);
             for(const auto &p : ap->m_bound)
@@ -314,7 +314,7 @@ void area_list::init_monkeycar_area(int id)
 				area_list::instance()->add(area_id,ap);
 
             ap->m_bound=init_path(path,area_id);
-            ap->update(over_count_person, over_time_person,scale,map_id,area_type_id, over_count_vehicle,over_time_vehicle);
+            ap->update(over_count_person, over_time_person,scale,map_id,b_type, over_count_vehicle,over_time_vehicle);
             for(const auto &p : ap->m_bound)
               log_info("point:monkey:area_id:%d--x:%.2f,y:%.2f",area_id,p.x,p.y);
             for(const auto &p : da->m_point)
@@ -450,7 +450,7 @@ void area_list::init_from_db(int id/*=-1*/)
 				newobj=true;
             }
 
-            tmp_ptr->update(over_count_person, over_time_person,scale,map_id,area_type_id, over_count_vehicle,over_time_vehicle);
+            tmp_ptr->update(over_count_person, over_time_person,scale,map_id,b_type, over_count_vehicle,over_time_vehicle);
             tmp_ptr->m_speed=std::move(map_);
             tmp_ptr->m_bound=init_path(path,area_id);
             tmp_ptr->m_is_work_area = is_work_area;

+ 0 - 7
main.cpp

@@ -69,13 +69,6 @@ struct Init_Setting
             std_info("连接webServer[%s] 失败,采集服务器无法启动!",url.c_str());
             exit(0);
         }
-
-		if(0)
-		{
-			std::vector<char> b(1024*1024);
-			usleep(1000*1000);
-		}
-
 		CYaSetting::Init_sys_setting();
         sit_list::instance()->load_from_db();
         card_list::instance()->init_card_from_db();