|
@@ -63,6 +63,7 @@ void sit_list::read_ant_path(int id)
|
|
|
return ;
|
|
|
}
|
|
|
|
|
|
+ log_info( "read_ant_path. The record count=%ld\n", nCount );
|
|
|
while ( DBRes.GetNextRecod(Error) )
|
|
|
{
|
|
|
int reader_id = 0;
|
|
@@ -103,7 +104,6 @@ void sit_list::read_ant_path(int id)
|
|
|
{
|
|
|
sit_.clear_path();
|
|
|
log_info( "修改path 清空path,分站id=%d\n", id );
|
|
|
- std_debug( "修改path 清空path,分站id=%d\n", id );
|
|
|
}
|
|
|
|
|
|
if(pid == 0)
|
|
@@ -144,7 +144,6 @@ void sit_list::read_ant_path(int id)
|
|
|
|
|
|
if(-1==id)
|
|
|
{
|
|
|
- log_info( "read_ant_path. The record count=%ld\n", nCount );
|
|
|
for(auto&_s:sit_list::instance()->m_map)
|
|
|
{
|
|
|
_s.second->deal_path();
|
|
@@ -157,7 +156,6 @@ void sit_list::read_ant_path(int id)
|
|
|
{
|
|
|
sit_ptr->deal_path();
|
|
|
log_info( "修改path成功,分站id=%d\n", id );
|
|
|
- std_debug( "修改path成功,分站id=%d\n", id );
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -193,7 +191,7 @@ void sit_list::init_site(int id)
|
|
|
return ;
|
|
|
}
|
|
|
|
|
|
- log_info( "增加或修改 init_site. The record count=%ld\n", nCount );
|
|
|
+ log_info( "init_site. The record count=%ld\n", nCount );
|
|
|
|
|
|
while ( DBRes.GetNextRecod(Error) )
|
|
|
{
|
|
@@ -253,7 +251,6 @@ void sit_list::read_sit_list(int id)
|
|
|
sql.append(std::to_string(id));
|
|
|
sql.append(";");
|
|
|
|
|
|
- std_debug("基础数据 增加或修改天线 sql=%s", sql.c_str());
|
|
|
log_info("基础数据 增加或修改天线 sql=%s", sql.c_str());
|
|
|
}
|
|
|
|
|
@@ -267,7 +264,7 @@ void sit_list::read_sit_list(int id)
|
|
|
return ;
|
|
|
}
|
|
|
|
|
|
- std::unordered_map<int,std::shared_ptr<site>> map;
|
|
|
+ log_info( "init_antenna. The record count=%ld\n", nCount );
|
|
|
while ( DBRes.GetNextRecod(Error) )
|
|
|
{
|
|
|
int antenna_id = 0;
|
|
@@ -296,16 +293,11 @@ void sit_list::read_sit_list(int id)
|
|
|
{
|
|
|
std::shared_ptr<site> site_ptr=nullptr;
|
|
|
site_ptr = sit_list::instance()->get(reader_id);
|
|
|
- //auto it = map.find(reader_id);
|
|
|
- //if(it==map.end())
|
|
|
- // {
|
|
|
- // site_ptr = std::make_shared<site>(reader_id);
|
|
|
- // map.insert({reader_id,site_ptr});
|
|
|
- //}
|
|
|
if(!site_ptr)
|
|
|
continue;
|
|
|
site_ptr->m_ant[antid].m_id = antenna_id;
|
|
|
site_ptr->m_ant[antid].set(x,-y);
|
|
|
+ site_ptr->set_ex();
|
|
|
log_info("reand_ant..%d,%d,%.2f,%.2f",reader_id,antid,x,y);
|
|
|
}
|
|
|
else
|
|
@@ -314,22 +306,9 @@ void sit_list::read_sit_list(int id)
|
|
|
if(site_ptr)
|
|
|
{
|
|
|
site_ptr->m_ant[antid].set(x,-y);
|
|
|
-
|
|
|
site_ptr->set_ex();
|
|
|
}
|
|
|
-
|
|
|
log_info("基础数据 增加或修改天线成功:天线id:%d,分站id:%d",id,reader_id);
|
|
|
- std_debug("基础数据 增加或修改天线成功:天线id:%d,分站id:%d",id,reader_id);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if(-1 == id)
|
|
|
- {
|
|
|
- log_info( "init_antenna. The record count=%ld\n", nCount );
|
|
|
- sit_list::instance()->add(map);
|
|
|
- for(auto&sit_:map)
|
|
|
- {
|
|
|
- sit_.second->set_ex();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -353,65 +332,6 @@ void site::on_power_status(bool ac_down)//电源状态
|
|
|
event_tool::instance()->handle_event(OT_DEVICE_READER,ET_READER_POWER_BY_BATTERY,id(),tool_time::now_to_seconds(),ac_down,m_power_ac_down);
|
|
|
log_info("[event warning: reader power supply by battery] reader_id: Power %d->%d.",id(),!m_power_ac_down,m_power_ac_down);
|
|
|
}
|
|
|
-
|
|
|
-#if 0
|
|
|
-void sit_list::init_site()
|
|
|
-{
|
|
|
- const char *sql = "SELECT reader_id, reader_type_id, dat_reader.map_id, \
|
|
|
- area_id, device_type_id, dimension, dat_map.scale\
|
|
|
- FROM dat_reader, dat_map where \
|
|
|
- dat_reader.map_id=dat_map.map_id and state=0;";
|
|
|
-
|
|
|
- std::string Error;
|
|
|
- YADB::CDBResultSet DBRes;
|
|
|
- sDBConnPool.Query(sql,DBRes,Error);
|
|
|
- uint64_t nCount = DBRes.GetRecordCount( Error );
|
|
|
- if (nCount > 0)
|
|
|
- {
|
|
|
- log_info( "init_site. The record count=%ld\n", nCount );
|
|
|
-
|
|
|
- while ( DBRes.GetNextRecod(Error) )
|
|
|
- {
|
|
|
- int reader_id = 0;
|
|
|
- DBRes.GetField( "reader_id",reader_id, Error );
|
|
|
-
|
|
|
- auto site_ptr=sit_list::instance()->get(reader_id);
|
|
|
- if(nullptr==site_ptr)
|
|
|
- {
|
|
|
- site_ptr = std::make_shared<site>(reader_id);
|
|
|
- sit_list::instance()->add(reader_id,site_ptr);
|
|
|
- }
|
|
|
-
|
|
|
- int reader_type_id = 0;
|
|
|
- DBRes.GetField( "reader_type_id",reader_type_id, Error );
|
|
|
-
|
|
|
- int map_id = 0;
|
|
|
- DBRes.GetField( "map_id",map_id, Error );
|
|
|
-
|
|
|
- int area_id = 0;
|
|
|
- DBRes.GetField( "area_id",area_id, Error );
|
|
|
-
|
|
|
- int device_type_id = 0;
|
|
|
- DBRes.GetField( "device_type_id",device_type_id, Error );
|
|
|
-
|
|
|
- int dimension = 0;
|
|
|
- DBRes.GetField( "dimension",dimension, Error );
|
|
|
-
|
|
|
- double scale= 0;
|
|
|
- DBRes.GetField( "scale",scale, Error );
|
|
|
-
|
|
|
- site_ptr->m_reader_type_id = reader_type_id;
|
|
|
- site_ptr->m_map_id = map_id;
|
|
|
- site_ptr->m_area_id = area_id;
|
|
|
-
|
|
|
- site_ptr->m_device_type_id = device_type_id;
|
|
|
-
|
|
|
- site_ptr->m_dimension = dimension;
|
|
|
- site_ptr->m_scale = scale;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-#endif
|
|
|
algo_config site::g_config[]=
|
|
|
{
|
|
|
{ "tof-1", 1, 2, 0.1, 1 },
|