|
@@ -72,144 +72,396 @@ area_list::area_list()
|
|
|
{
|
|
|
}
|
|
|
|
|
|
-void area_list::init_monkeycar_area()
|
|
|
-{
|
|
|
- std::unordered_map<int,std::shared_ptr<area>> map;
|
|
|
- const char *sql = "SELECT a.area_id, a.name, a.map_id, a.area_type_id, a.path, c.scale,\
|
|
|
- over_count_person, over_count_vehicle, over_time_person, over_time_vehicle, over_speed_vehicle, is_attendance ,b.monkeycar_coordinate,b.monkeycar_speed \
|
|
|
- FROM dat_area a ,dat_monkeycar_base_info b ,dat_map c\
|
|
|
- where a.area_id = b.monkeycar_areaid and a.map_id = c.map_id;";
|
|
|
- std::string Error;
|
|
|
- YADB::CDBResultSet DBRes;
|
|
|
- sDBConnPool.Query(sql,DBRes,Error);
|
|
|
- if(!Error.empty())
|
|
|
- log_error("monkeycar area init Error,%s",Error.c_str());
|
|
|
- int nCount = DBRes.GetRecordCount( Error );
|
|
|
- if (nCount > 0)
|
|
|
- {
|
|
|
- log_info( "init_monkey area. The record count=%d", nCount );
|
|
|
-
|
|
|
- while ( DBRes.GetNextRecod(Error) )
|
|
|
- {
|
|
|
- int area_id = 0;
|
|
|
- DBRes.GetField( "area_id",area_id, Error );
|
|
|
-
|
|
|
- int map_id = 0;
|
|
|
- DBRes.GetField( "map_id",map_id, Error );
|
|
|
-
|
|
|
- unsigned int area_type_id = 0;
|
|
|
- DBRes.GetField( "area_type_id",area_type_id, Error );
|
|
|
+//void area_list::init_monkeycar_area()
|
|
|
+//{
|
|
|
+// std::unordered_map<int,std::shared_ptr<area>> map;
|
|
|
+// const char *sql = "SELECT a.area_id, a.name, a.map_id, a.area_type_id, a.path, c.scale,\
|
|
|
+// over_count_person, over_count_vehicle, over_time_person, over_time_vehicle, over_speed_vehicle, is_attendance ,b.monkeycar_coordinate,b.monkeycar_speed \
|
|
|
+// FROM dat_area a ,dat_monkeycar_base_info b ,dat_map c\
|
|
|
+// where a.area_id = b.monkeycar_areaid and a.map_id = c.map_id;";
|
|
|
+// std::string Error;
|
|
|
+// YADB::CDBResultSet DBRes;
|
|
|
+// sDBConnPool.Query(sql,DBRes,Error);
|
|
|
+// if(!Error.empty())
|
|
|
+// log_error("monkeycar area init Error,%s",Error.c_str());
|
|
|
+// int nCount = DBRes.GetRecordCount( Error );
|
|
|
+// if (nCount > 0)
|
|
|
+// {
|
|
|
+// log_info( "init_monkey area. The record count=%d", nCount );
|
|
|
+
|
|
|
+// while ( DBRes.GetNextRecod(Error) )
|
|
|
+// {
|
|
|
+// int area_id = 0;
|
|
|
+// DBRes.GetField( "area_id",area_id, Error );
|
|
|
+
|
|
|
+// int map_id = 0;
|
|
|
+// DBRes.GetField( "map_id",map_id, Error );
|
|
|
+
|
|
|
+// unsigned int area_type_id = 0;
|
|
|
+// DBRes.GetField( "area_type_id",area_type_id, Error );
|
|
|
|
|
|
- int over_count_person = 0;
|
|
|
- DBRes.GetField( "over_count_person",over_count_person, Error );
|
|
|
+// int over_count_person = 0;
|
|
|
+// DBRes.GetField( "over_count_person",over_count_person, Error );
|
|
|
|
|
|
- int over_count_vehicle = 0;
|
|
|
- DBRes.GetField( "over_count_vehicle",over_count_vehicle, Error );
|
|
|
+// int over_count_vehicle = 0;
|
|
|
+// DBRes.GetField( "over_count_vehicle",over_count_vehicle, Error );
|
|
|
|
|
|
- int over_time_person = 0;
|
|
|
- DBRes.GetField( "over_time_person",over_time_person, Error );
|
|
|
+// int over_time_person = 0;
|
|
|
+// DBRes.GetField( "over_time_person",over_time_person, Error );
|
|
|
|
|
|
- int over_time_vehicle = 0;
|
|
|
- DBRes.GetField( "over_time_vehicle",over_time_vehicle, Error );
|
|
|
+// int over_time_vehicle = 0;
|
|
|
+// DBRes.GetField( "over_time_vehicle",over_time_vehicle, Error );
|
|
|
|
|
|
- std::string path;
|
|
|
- DBRes.GetField( "path",path, Error );
|
|
|
+// std::string path;
|
|
|
+// DBRes.GetField( "path",path, Error );
|
|
|
|
|
|
- float monkeycar_speed = 0;
|
|
|
- DBRes.GetField( "monkeycar_speed",monkeycar_speed, Error );
|
|
|
+// float monkeycar_speed = 0;
|
|
|
+// DBRes.GetField( "monkeycar_speed",monkeycar_speed, Error );
|
|
|
|
|
|
- std::string monkeycar_coor;
|
|
|
- DBRes.GetField( "monkeycar_coordinate",monkeycar_coor, Error );
|
|
|
+// std::string monkeycar_coor;
|
|
|
+// DBRes.GetField( "monkeycar_coordinate",monkeycar_coor, Error );
|
|
|
|
|
|
- float scale=0;
|
|
|
- DBRes.GetField( "scale",scale, Error );
|
|
|
+// float scale=0;
|
|
|
+// DBRes.GetField( "scale",scale, Error );
|
|
|
|
|
|
|
|
|
- log_info("init_area : id:%d,path:%s",area_id, path.c_str());
|
|
|
+// log_info("init_area : id:%d,path:%s",area_id, path.c_str());
|
|
|
|
|
|
- std::shared_ptr<db_area> da = std::make_shared<db_area>();
|
|
|
- da->m_default_speed = monkeycar_speed;
|
|
|
- da->m_point = init_path(monkeycar_coor);
|
|
|
+// std::shared_ptr<db_area> da = std::make_shared<db_area>();
|
|
|
+// da->m_default_speed = monkeycar_speed;
|
|
|
+// da->m_point = init_path(monkeycar_coor);
|
|
|
|
|
|
- std::shared_ptr<area> ap = std::make_shared<monkey_area>(da,area_id,over_count_person,over_time_person,scale,map_id,area_type_id);
|
|
|
+// std::shared_ptr<area> ap = std::make_shared<monkey_area>(da,area_id,over_count_person,over_time_person,scale,map_id,area_type_id);
|
|
|
|
|
|
- ap->m_bound=init_path(path);
|
|
|
- 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)
|
|
|
- log_info("point:monkey_coor:area_id:%d--x:%.2f,y:%.2f",area_id,p.x,p.y);
|
|
|
+// ap->m_bound=init_path(path);
|
|
|
+// 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)
|
|
|
+// log_info("point:monkey_coor:area_id:%d--x:%.2f,y:%.2f",area_id,p.x,p.y);
|
|
|
|
|
|
- map.insert({area_id,ap});
|
|
|
- }
|
|
|
- }
|
|
|
+// map.insert({area_id,ap});
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
- area_list::instance()->add(map);
|
|
|
+// area_list::instance()->add(map);
|
|
|
+//}
|
|
|
+
|
|
|
+void area_list::init_monkeycar_area(int id)
|
|
|
+{
|
|
|
+ std::string sql = "SELECT a.area_id, a.name, a.map_id, a.area_type_id, a.path, c.scale,\
|
|
|
+ over_count_person, over_count_vehicle, over_time_person, over_time_vehicle,\
|
|
|
+ over_speed_vehicle, is_attendance ,b.monkeycar_coordinate,b.monkeycar_speed \
|
|
|
+ FROM dat_area a ,dat_monkeycar_base_info b ,dat_map c\
|
|
|
+ where a.area_id = b.monkeycar_areaid and a.map_id = c.map_id";
|
|
|
+
|
|
|
+ if(-1 == id)
|
|
|
+ {
|
|
|
+ sql.append(";");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ sql.append(" AND a.area_id=");
|
|
|
+ sql.append(std::to_string(id));
|
|
|
+ sql.append(";");
|
|
|
+
|
|
|
+ std_debug("基础数据 monkeycar area 增加或修改区域 sql=%s", sql.c_str());
|
|
|
+ log_info("基础数据 monkeycar area 增加或修改区域 sql=%s", sql.c_str());
|
|
|
+ }
|
|
|
+
|
|
|
+ std::string Error;
|
|
|
+ YADB::CDBResultSet DBRes;
|
|
|
+ sDBConnPool.Query(sql.c_str(),DBRes,Error);
|
|
|
+ int nCount = DBRes.GetRecordCount( Error );
|
|
|
+ if (nCount < 1)
|
|
|
+ {
|
|
|
+ log_error("基础数据 monkeycar area 增加或修改失败,数据库中找不到: area_id=%d", id);
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+ std::unordered_map<int,std::shared_ptr<area>> map;
|
|
|
+ while ( DBRes.GetNextRecod(Error) )
|
|
|
+ {
|
|
|
+ int area_id = 0;
|
|
|
+ DBRes.GetField( "area_id",area_id, Error );
|
|
|
+
|
|
|
+ int map_id = 0;
|
|
|
+ DBRes.GetField( "map_id",map_id, Error );
|
|
|
+
|
|
|
+ unsigned int area_type_id = 0;
|
|
|
+ DBRes.GetField( "area_type_id",area_type_id, Error );
|
|
|
+
|
|
|
+ int over_count_person = 0;
|
|
|
+ DBRes.GetField( "over_count_person",over_count_person, Error );
|
|
|
+
|
|
|
+ int over_count_vehicle = 0;
|
|
|
+ DBRes.GetField( "over_count_vehicle",over_count_vehicle, Error );
|
|
|
+
|
|
|
+ int over_time_person = 0;
|
|
|
+ DBRes.GetField( "over_time_person",over_time_person, Error );
|
|
|
+
|
|
|
+ int over_time_vehicle = 0;
|
|
|
+ DBRes.GetField( "over_time_vehicle",over_time_vehicle, Error );
|
|
|
+
|
|
|
+ std::string path;
|
|
|
+ DBRes.GetField( "path",path, Error );
|
|
|
+
|
|
|
+ double monkeycar_speed = 0;
|
|
|
+ DBRes.GetField( "monkeycar_speed",monkeycar_speed, Error );
|
|
|
+
|
|
|
+ std::string monkeycar_coor;
|
|
|
+ DBRes.GetField( "monkeycar_coordinate",monkeycar_coor, Error );
|
|
|
+
|
|
|
+ double scale=0;
|
|
|
+ DBRes.GetField( "scale",scale, Error );
|
|
|
+
|
|
|
+ log_info("monkeycar area init_area : id:%d,path:%s",area_id, path.c_str());
|
|
|
+
|
|
|
+ if(-1 == id)
|
|
|
+ {
|
|
|
+ std::shared_ptr<db_area> da = std::make_shared<db_area>();
|
|
|
+ da->m_default_speed = monkeycar_speed;
|
|
|
+ da->m_point = init_path(monkeycar_coor);
|
|
|
+
|
|
|
+ std::shared_ptr<area> ap = std::make_shared<monkey_area>(da,area_id,over_count_person,
|
|
|
+ over_time_person,scale,map_id,area_type_id);
|
|
|
+
|
|
|
+ ap->m_bound=init_path(path);
|
|
|
+ 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)
|
|
|
+ log_info("point:monkey_coor:area_id:%d--x:%.2f,y:%.2f",area_id,p.x,p.y);
|
|
|
+
|
|
|
+ map.insert({area_id,ap});
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ std::shared_ptr<db_area> da = std::make_shared<db_area>();
|
|
|
+ da->m_default_speed = monkeycar_speed;
|
|
|
+ da->m_point = init_path(monkeycar_coor);
|
|
|
+
|
|
|
+ std::shared_ptr<area> ap = std::make_shared<monkey_area>(da,area_id,over_count_person,
|
|
|
+ over_time_person,scale,map_id,area_type_id);
|
|
|
+
|
|
|
+ ap->m_bound=init_path(path);
|
|
|
+ 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)
|
|
|
+ log_info("point:monkey_coor:area_id:%d--x:%.2f,y:%.2f",area_id,p.x,p.y);
|
|
|
+
|
|
|
+ auto tmp_ptr = area_list::instance()->get(id);
|
|
|
+ if(tmp_ptr)
|
|
|
+ {
|
|
|
+ area_list::instance()->remove(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ area_list::instance()->add(id, ap);
|
|
|
+
|
|
|
+ log_info("基础数据 monkeycar area增加或修改区域成功:区域id:%d,over_count_person:%d over_time_person:%d,\
|
|
|
+ scale:%.2f,map_id:%d,area_type_id:%d,over_count_vehicle:%d,over_time_vehicle:%d",
|
|
|
+ id,over_count_person, over_time_person,scale,map_id,area_type_id,
|
|
|
+ over_count_vehicle,over_time_vehicle);
|
|
|
+ std_debug("基础数据 monkeycar area增加或修改区域成功:区域id:%d,over_count_person:%d over_time_person:%d,\
|
|
|
+ scale:%.2f,map_id:%d,area_type_id:%d,over_count_vehicle:%d,over_time_vehicle:%d",
|
|
|
+ id,over_count_person, over_time_person,scale,map_id,area_type_id,
|
|
|
+ over_count_vehicle,over_time_vehicle);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(-1 == id)
|
|
|
+ {
|
|
|
+ log_info( "monkeycar area init_area. The record count=%d\n", nCount );
|
|
|
+ area_list::instance()->add(map);
|
|
|
+ }
|
|
|
}
|
|
|
-void area_list::init_from_db()
|
|
|
+
|
|
|
+void area_list::init_from_db(int id)
|
|
|
{
|
|
|
- std::unordered_map<int,std::shared_ptr<area>> map;
|
|
|
- const char *sql = "SELECT a.area_id, a.name, a.map_id, a.area_type_id, a.path,b.scale, \
|
|
|
- over_count_person, over_count_vehicle, over_time_person, over_time_vehicle, over_speed_vehicle, is_attendance \
|
|
|
- FROM dat_area a,dat_map b\
|
|
|
- where a.map_id = b.map_id and area_id not in (select monkeycar_areaid from dat_monkeycar_base_info);";
|
|
|
- std::string Error;
|
|
|
- YADB::CDBResultSet DBRes;
|
|
|
- sDBConnPool.Query(sql,DBRes,Error);
|
|
|
- if(!Error.empty())
|
|
|
- log_error("monkeycar area init Error,%s",Error.c_str());
|
|
|
- int nCount = DBRes.GetRecordCount( Error );
|
|
|
- if (nCount > 0)
|
|
|
- {
|
|
|
- log_info( "init_area. The record count=%d\n", nCount );
|
|
|
+ std::string sql = "SELECT a.area_id, a.name, a.map_id, a.area_type_id, a.path,b.scale, \
|
|
|
+ over_count_person, over_count_vehicle, over_time_person, over_time_vehicle, \
|
|
|
+ over_speed_vehicle, is_attendance \
|
|
|
+ FROM dat_area a,dat_map b\
|
|
|
+ where a.map_id = b.map_id and area_id not in \
|
|
|
+ (select monkeycar_areaid from dat_monkeycar_base_info)";
|
|
|
+
|
|
|
+ if(-1 == id)
|
|
|
+ {
|
|
|
+ sql.append(";");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ sql.append(" AND s.area_id=");
|
|
|
+ sql.append(std::to_string(id));
|
|
|
+ sql.append(";");
|
|
|
+
|
|
|
+ std_debug("基础数据 增加或修改区域 sql=%s", sql.c_str());
|
|
|
+ log_info("基础数据 增加或修改区域 sql=%s", sql.c_str());
|
|
|
+ }
|
|
|
+
|
|
|
+ std::string Error;
|
|
|
+ YADB::CDBResultSet DBRes;
|
|
|
+ sDBConnPool.Query(sql.c_str(),DBRes,Error);
|
|
|
+ int nCount = DBRes.GetRecordCount( Error );
|
|
|
+ if (nCount < 1)
|
|
|
+ {
|
|
|
+ log_error("基础数据 增加或修改失败,数据库中找不到: area_id=%d", id);
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+ std::unordered_map<int,std::shared_ptr<area>> map;
|
|
|
+ while ( DBRes.GetNextRecod(Error) )
|
|
|
+ {
|
|
|
+ int area_id = 0;
|
|
|
+ DBRes.GetField( "area_id",area_id, Error );
|
|
|
+
|
|
|
+ int map_id = 0;
|
|
|
+ DBRes.GetField( "map_id",map_id, Error );
|
|
|
+
|
|
|
+ unsigned int area_type_id = 0;
|
|
|
+ DBRes.GetField( "area_type_id",area_type_id, Error );
|
|
|
+
|
|
|
+ int over_count_person = 0;
|
|
|
+ DBRes.GetField( "over_count_person",over_count_person, Error );
|
|
|
+
|
|
|
+ int over_count_vehicle = 0;
|
|
|
+ DBRes.GetField( "over_count_vehicle",over_count_vehicle, Error );
|
|
|
+
|
|
|
+ int over_time_person = 0;
|
|
|
+ DBRes.GetField( "over_time_person",over_time_person, Error );
|
|
|
+
|
|
|
+ int over_time_vehicle = 0;
|
|
|
+ DBRes.GetField( "over_time_vehicle",over_time_vehicle, Error );
|
|
|
+
|
|
|
+ std::string path;
|
|
|
+ DBRes.GetField( "path",path, Error );
|
|
|
+
|
|
|
+ double scale = 0;
|
|
|
+ DBRes.GetField( "scale",scale, Error );
|
|
|
+
|
|
|
+ log_info("init_area : id:%d,path:%s",area_id, path.c_str());
|
|
|
+
|
|
|
+ if(-1 == id)
|
|
|
+ {
|
|
|
+ std::shared_ptr<area> ap = std::make_shared<area>(area_id,over_count_person,over_time_person,
|
|
|
+ scale,map_id,area_type_id);
|
|
|
|
|
|
- while ( DBRes.GetNextRecod(Error) )
|
|
|
- {
|
|
|
- int area_id = 0;
|
|
|
- DBRes.GetField( "area_id",area_id, Error );
|
|
|
+ ap->m_limit_vehicle_second = over_time_vehicle;
|
|
|
+ ap->m_limit_vehicle_count = over_count_vehicle;
|
|
|
|
|
|
- int map_id = 0;
|
|
|
- DBRes.GetField( "map_id",map_id, Error );
|
|
|
+ ap->m_bound=init_path(path);
|
|
|
+ for(const auto &p : ap->m_bound)
|
|
|
+ log_info("point:area_id:%d--x:%.2f,y:%.2f",area_id,p.x,p.y);
|
|
|
+
|
|
|
+ map.insert({area_id,ap});
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ auto tmp_ptr = area_list::instance()->get(id);
|
|
|
+ if(tmp_ptr)
|
|
|
+ {
|
|
|
+ tmp_ptr->update(over_count_person, over_time_person,scale,map_id,area_type_id,
|
|
|
+ over_count_vehicle,over_time_vehicle);
|
|
|
+ tmp_ptr->m_bound=init_path(path);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ std::shared_ptr<area> ap = std::make_shared<area>(area_id,over_count_person,over_time_person,
|
|
|
+ scale,map_id,area_type_id);
|
|
|
+
|
|
|
+ ap->m_limit_vehicle_second = over_time_vehicle;
|
|
|
+ ap->m_limit_vehicle_count = over_count_vehicle;
|
|
|
+
|
|
|
+ ap->m_bound=init_path(path);
|
|
|
+ for(const auto &p : ap->m_bound)
|
|
|
+ log_info("point:area_id:%d--x:%.2f,y:%.2f",area_id,p.x,p.y);
|
|
|
+
|
|
|
+ area_list::instance()->add(id, ap);
|
|
|
+ }
|
|
|
+
|
|
|
+ log_info("基础数据 增加或修改区域成功:区域id:%d,over_count_person:%d over_time_person:%d,scale:%.2f,map_id:%d\
|
|
|
+ ,area_type_id:%d,over_count_vehicle:%d,over_time_vehicle:%d",
|
|
|
+ id,over_count_person, over_time_person,scale,map_id,area_type_id,
|
|
|
+ over_count_vehicle,over_time_vehicle);
|
|
|
+ std_debug("基础数据 增加或修改区域成功:区域id:%d,over_count_person:%d over_time_person:%d,scale:%.2f,map_id:%d\
|
|
|
+ ,area_type_id:%d,over_count_vehicle:%d,over_time_vehicle:%d",
|
|
|
+ id,over_count_person, over_time_person,scale,map_id,area_type_id,
|
|
|
+ over_count_vehicle,over_time_vehicle);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(-1 == id)
|
|
|
+ {
|
|
|
+ log_info( "init_area. The record count=%d\n", nCount );
|
|
|
+ area_list::instance()->add(map);
|
|
|
+
|
|
|
+ init_monkeycar_area(-1);
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
- unsigned int area_type_id = 0;
|
|
|
- DBRes.GetField( "area_type_id",area_type_id, Error );
|
|
|
+//void area_list::init_from_db()
|
|
|
+//{
|
|
|
+// std::unordered_map<int,std::shared_ptr<area>> map;
|
|
|
+// const char *sql = "SELECT a.area_id, a.name, a.map_id, a.area_type_id, a.path,b.scale, \
|
|
|
+// over_count_person, over_count_vehicle, over_time_person, over_time_vehicle, over_speed_vehicle, is_attendance \
|
|
|
+// FROM dat_area a,dat_map b\
|
|
|
+// where a.map_id = b.map_id and area_id not in (select monkeycar_areaid from dat_monkeycar_base_info);";
|
|
|
+// std::string Error;
|
|
|
+// YADB::CDBResultSet DBRes;
|
|
|
+// sDBConnPool.Query(sql,DBRes,Error);
|
|
|
+// if(!Error.empty())
|
|
|
+// log_error("monkeycar area init Error,%s",Error.c_str());
|
|
|
+// int nCount = DBRes.GetRecordCount( Error );
|
|
|
+// if (nCount > 0)
|
|
|
+// {
|
|
|
+// log_info( "init_area. The record count=%d\n", nCount );
|
|
|
+
|
|
|
+// while ( DBRes.GetNextRecod(Error) )
|
|
|
+// {
|
|
|
+// int area_id = 0;
|
|
|
+// DBRes.GetField( "area_id",area_id, Error );
|
|
|
+
|
|
|
+// int map_id = 0;
|
|
|
+// DBRes.GetField( "map_id",map_id, Error );
|
|
|
+
|
|
|
+// unsigned int area_type_id = 0;
|
|
|
+// DBRes.GetField( "area_type_id",area_type_id, Error );
|
|
|
|
|
|
- int over_count_person = 0;
|
|
|
- DBRes.GetField( "over_count_person",over_count_person, Error );
|
|
|
+// int over_count_person = 0;
|
|
|
+// DBRes.GetField( "over_count_person",over_count_person, Error );
|
|
|
|
|
|
- int over_count_vehicle = 0;
|
|
|
- DBRes.GetField( "over_count_vehicle",over_count_vehicle, Error );
|
|
|
+// int over_count_vehicle = 0;
|
|
|
+// DBRes.GetField( "over_count_vehicle",over_count_vehicle, Error );
|
|
|
|
|
|
- int over_time_person = 0;
|
|
|
- DBRes.GetField( "over_time_person",over_time_person, Error );
|
|
|
+// int over_time_person = 0;
|
|
|
+// DBRes.GetField( "over_time_person",over_time_person, Error );
|
|
|
|
|
|
- int over_time_vehicle = 0;
|
|
|
- DBRes.GetField( "over_time_vehicle",over_time_vehicle, Error );
|
|
|
+// int over_time_vehicle = 0;
|
|
|
+// DBRes.GetField( "over_time_vehicle",over_time_vehicle, Error );
|
|
|
|
|
|
- std::string path;
|
|
|
- DBRes.GetField( "path",path, Error );
|
|
|
+// std::string path;
|
|
|
+// DBRes.GetField( "path",path, Error );
|
|
|
|
|
|
- double scale = 0;
|
|
|
- DBRes.GetField( "scale",scale, Error );
|
|
|
+// double scale = 0;
|
|
|
+// DBRes.GetField( "scale",scale, Error );
|
|
|
|
|
|
- log_info("init_area : id:%d,path:%s",area_id, path.c_str());
|
|
|
+// log_info("init_area : id:%d,path:%s",area_id, path.c_str());
|
|
|
|
|
|
- std::shared_ptr<area> ap = std::make_shared<area>(area_id,over_count_person,over_time_person,scale,map_id,area_type_id);
|
|
|
+// std::shared_ptr<area> ap = std::make_shared<area>(area_id,over_count_person,over_time_person,scale,map_id,area_type_id);
|
|
|
|
|
|
- ap->m_limit_vehicle_second = over_time_vehicle;
|
|
|
- ap->m_limit_vehicle_count = over_count_vehicle;
|
|
|
+// ap->m_limit_vehicle_second = over_time_vehicle;
|
|
|
+// ap->m_limit_vehicle_count = over_count_vehicle;
|
|
|
|
|
|
- ap->m_bound=init_path(path);
|
|
|
- for(const auto &p : ap->m_bound)
|
|
|
- log_info("point:area_id:%d--x:%.2f,y:%.2f",area_id,p.x,p.y);
|
|
|
+// ap->m_bound=init_path(path);
|
|
|
+// for(const auto &p : ap->m_bound)
|
|
|
+// log_info("point:area_id:%d--x:%.2f,y:%.2f",area_id,p.x,p.y);
|
|
|
|
|
|
- map.insert({area_id,ap});
|
|
|
- }
|
|
|
- }
|
|
|
+// map.insert({area_id,ap});
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
- area_list::instance()->add(map);
|
|
|
+// area_list::instance()->add(map);
|
|
|
|
|
|
- init_monkeycar_area();
|
|
|
-}
|
|
|
+// init_monkeycar_area();
|
|
|
+//}
|
|
|
std::vector<point> area_list::init_path(std::string &str)
|
|
|
{
|
|
|
if(str.empty())
|