|
@@ -403,6 +403,8 @@ std::shared_ptr<area> area_list::create(int type,int id,int limit_count_person,
|
|
|
return std::make_shared<area>(id,limit_count_person,limit_time_person,scale,mapid,b_type);
|
|
|
}
|
|
|
}
|
|
|
+#define PERSON_ATT_MASK 0X00000010
|
|
|
+#define CAR_ATT_MASK 0X00000020
|
|
|
void area_list::init_from_db(int id/*=-1*/)
|
|
|
{
|
|
|
do{
|
|
@@ -435,7 +437,8 @@ void area_list::init_from_db(int id/*=-1*/)
|
|
|
log_error("基础数据 增加或修改失败,数据库中找不到: area_id=%d:%s", id,sql.c_str());
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
+ int downmine_index,patt_index,catt_index;
|
|
|
+ downmine_index=patt_index=catt_index=0;
|
|
|
std::unordered_map<int,std::shared_ptr<area>> map;
|
|
|
while ( DBRes.GetNextRecod(Error) )
|
|
|
{
|
|
@@ -491,7 +494,9 @@ void area_list::init_from_db(int id/*=-1*/)
|
|
|
ap->m_speed=std::move(map_);
|
|
|
ap->m_is_work_area = is_work_area;
|
|
|
ap->m_area_type=area_type_id;
|
|
|
-
|
|
|
+ if(area_type_id==AREA_TYPE_DOWNMINE)downmine_index++;
|
|
|
+ if(b_type&PERSON_ATT_MASK)patt_index++;
|
|
|
+ if(b_type&CAR_ATT_MASK)catt_index++;
|
|
|
ap->m_bound=init_path(path,area_id);
|
|
|
for(const auto &p : ap->m_bound)
|
|
|
log_info("point:area_id:%d--x:%.2f,y:%.2f",area_id,p.x,p.y);
|
|
@@ -535,6 +540,9 @@ void area_list::init_from_db(int id/*=-1*/)
|
|
|
|
|
|
if(-1 == id)
|
|
|
{
|
|
|
+ assert(downmine_index>0);
|
|
|
+ assert(patt_index==1);
|
|
|
+ assert(catt_index>0);
|
|
|
log_info( "init_area. The record count=%d\n", nCount );
|
|
|
area_list::instance()->add(map);
|
|
|
}
|