ant.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <math.h>
  4. #include "ant.h"
  5. #include "db_api/CDBSingletonDefine.h"
  6. template<> std::shared_ptr<sit_list>
  7. single_base<sit_list, int, std::shared_ptr<site>>::m_instance=std::make_shared<sit_list>();
  8. int site::index()const
  9. {
  10. return m_algo+(m_num_dims<<1);
  11. }
  12. site::site(int id)
  13. :m_algo(0)
  14. ,m_num_dims(0)
  15. ,m_id(id)
  16. ,m_path_empty(true)
  17. {
  18. }
  19. const algo_config&site::config()const
  20. {
  21. return g_config[index()];
  22. }
  23. #if 0
  24. static int str_split(char*s,char**rc)
  25. {
  26. char**o=rc;
  27. for(;*s;)
  28. {
  29. *o=strtok_r(s,",",&s);
  30. o++;
  31. }
  32. return o-rc;
  33. }
  34. void sit_list::read_ant_path(const char*fname)
  35. {
  36. FILE*fp=fopen(fname,"r");
  37. char buf[512],*p;
  38. int t,id,pid;
  39. char* s[20];
  40. while((p=fgets(buf,sizeof(buf),fp)))
  41. {
  42. t=str_split(buf,&s[0]);
  43. if(t<9)
  44. continue;
  45. id=atoi(s[0]);
  46. auto s_ = sit_list::instance()->get(id);
  47. if(s_==nullptr)
  48. continue;
  49. pid=atoi(s[1]);
  50. if(pid>2)
  51. continue;
  52. point p1(atof(s[2]),-atof(s[3]));
  53. point p2(atof(s[5]),-atof(s[6]));
  54. auto &sit_ = *s_;
  55. if(pid == 0)
  56. {
  57. line_v l(p1,p2);
  58. {
  59. point px = l.line::projection(sit_);
  60. sit_.set(px);
  61. for(int i=0;i<2;i++)
  62. {
  63. path p;
  64. p.m_slope[0] = atof(s[8]);
  65. p.m_line[0] = line_v(px,l[i]);
  66. sit_.m_ant[i].m_path.push_back(p);
  67. }
  68. }
  69. }
  70. else
  71. {
  72. ant &a = pid<0?sit_.m_ant[0]:sit_.m_ant[1];
  73. if(a.m_path.size()!=0)
  74. {
  75. path &p = a.m_path[0];
  76. p.m_line[abs(pid)-1] = line_v(p1,p2);
  77. p.m_slope[abs(pid)-1] = atof(s[8]);
  78. }
  79. else
  80. {
  81. path p;
  82. p.m_line[abs(pid)-1] = line_v(p1,p2);
  83. p.m_slope[abs(pid)-1] = atof(s[8]);
  84. a.m_path.push_back(p);
  85. }
  86. if(abs(pid)==1)
  87. sit_.set(p1);
  88. }
  89. }
  90. fclose(fp);
  91. for(auto&_s:sit_list::instance()->m_map)
  92. {
  93. auto & s = *(_s.second);
  94. if(s.m_id==-1)
  95. continue;
  96. s.swap();
  97. if((s.path(0).empty() && s.path(1).empty()))
  98. continue;
  99. s.m_path_empty=false;
  100. for(auto &a:s.m_ant)
  101. for(auto &p:a.m_path)
  102. {
  103. if(!p.m_line[0].empty())
  104. {
  105. point px = p.m_line[0].line::projection(a);
  106. p.m_line[0]=line_v(px,p.m_line[0][1]);
  107. }
  108. }
  109. //std_info("%s",s.to_string().c_str());
  110. log_info("%s",s.to_string().c_str());
  111. //std_info("%f----%f",s.x,s.y);
  112. }
  113. }
  114. //1, 101, 1, '101-1', 4727, 75, 0, 0, '2017-08-29 10:21:14'
  115. void sit_list::read_sit_list(const char*fname)
  116. {
  117. FILE*fp=fopen(fname,"r");
  118. char buf[512];
  119. int t,id;
  120. char* s[20];
  121. while(fgets(buf,sizeof(buf),fp))
  122. {
  123. t=str_split(buf,&s[0]);
  124. if(t<8)
  125. continue;
  126. id=atoi(s[1]);
  127. int antid=atoi(s[2])-1;
  128. if(antid>=2)
  129. continue;
  130. auto tmp = m_instance->get(id);
  131. if(tmp==nullptr)
  132. tmp = std::make_shared<site>(id);
  133. tmp->m_ant[antid].set(atof(s[4]),-atof(s[5]));
  134. sit_list::instance()->add(id,tmp);
  135. //std_info("211111 id=%dsize = %d",id,instance()->m_map.size());
  136. //m_list[id].m_id=id;
  137. //m_list[id].m_ant[antid].set(atof(s[4]),-atof(s[5]));
  138. }
  139. for(auto&sit_:sit_list::instance()->m_map)
  140. {
  141. auto & sit = *(sit_.second);
  142. if(sit.m_id==-1)
  143. continue;
  144. if(sit.m_ant[0]==sit.m_ant[1])
  145. {
  146. log_warn("%d分站天线坐标相等.",sit.m_id);
  147. }
  148. sit.set( (sit.m_ant[0].x+sit.m_ant[1].x)/2,(sit.m_ant[0].y+sit.m_ant[1].y)/2);
  149. }
  150. fclose(fp);
  151. }
  152. #endif
  153. #if 0
  154. void sit_list::read_sit_list()
  155. {
  156. std::unordered_map<int,std::shared_ptr<site>> map;
  157. const char *sql = "SELECT antenna_id, a.reader_id, idx, a.x, a.y, a.z, a.angle \
  158. FROM dat_antenna a, dat_reader r \
  159. WHERE a.reader_id = r.reader_id;";
  160. std::string Error;
  161. YADB::CDBResultSet DBRes;
  162. sDBConnPool.Query(sql,DBRes,Error);
  163. uint64_t nCount = DBRes.GetRecordCount( Error );
  164. if (nCount > 0)
  165. {
  166. log_info( "init_antenna. The record count=%ld\n", nCount );
  167. while ( DBRes.GetNextRecod(Error) )
  168. {
  169. int reader_id = 0;
  170. DBRes.GetField( "reader_id",reader_id, Error );
  171. int idx=0;
  172. DBRes.GetField( "idx",idx, Error );
  173. int antid = idx-1;
  174. if(antid >= 2)
  175. continue;
  176. double x= 0;
  177. DBRes.GetField( "x",x, Error );
  178. double y= 0;
  179. DBRes.GetField( "y",y, Error );
  180. double z= 0;
  181. DBRes.GetField( "z",z, Error );
  182. std::shared_ptr<site> site_ptr=nullptr;
  183. auto it = map.find(reader_id);
  184. if(it==map.end())
  185. {
  186. site_ptr = std::make_shared<site>(reader_id);
  187. map.insert({reader_id,site_ptr});
  188. }
  189. else
  190. site_ptr=it->second;
  191. site_ptr->m_ant[antid].set(x,-y);
  192. log_info("reand_ant..%d,%d,%.2f,%.2f",reader_id,antid,x,y);
  193. }
  194. }
  195. sit_list::instance()->add(map);
  196. for(auto&sit_:map)
  197. {
  198. auto & sit = *(sit_.second);
  199. if(sit.m_id==-1)
  200. continue;
  201. if(sit.m_ant[0]==sit.m_ant[1])
  202. {
  203. log_warn("%d分站天线坐标相等.",sit.m_id);
  204. }
  205. sit.set( (sit.m_ant[0].x+sit.m_ant[1].x)/2,(sit.m_ant[0].y+sit.m_ant[1].y)/2);
  206. }
  207. }
  208. void sit_list::read_ant_path()
  209. {
  210. std::unordered_map<int,std::shared_ptr<site>> map;
  211. const char *sql = "SELECT reader_id,tof_flag,b_x,b_y,b_z,e_x,e_y,e_z,spacing_ratio FROM dat_reader_path_tof_n;";
  212. std::string Error;
  213. YADB::CDBResultSet DBRes;
  214. sDBConnPool.Query(sql,DBRes,Error);
  215. uint64_t nCount = DBRes.GetRecordCount( Error );
  216. if(nCount<=0)
  217. log_error("init_ant_path error :%s",Error.c_str());
  218. if (nCount > 0)
  219. {
  220. log_info( "init_ant_path. The record count=%ld\n", nCount );
  221. while ( DBRes.GetNextRecod(Error) )
  222. {
  223. int reader_id = 0;
  224. DBRes.GetField( "reader_id",reader_id, Error );
  225. auto site_ptr=sit_list::instance()->get(reader_id);
  226. if(nullptr==site_ptr)
  227. continue;
  228. int pid=0;
  229. DBRes.GetField( "tof_flag",pid, Error );
  230. double b_x= 0;
  231. DBRes.GetField( "b_x",b_x, Error );
  232. double b_y= 0;
  233. DBRes.GetField( "b_y",b_y, Error );
  234. double b_z= 0;
  235. DBRes.GetField( "b_z",b_z, Error );
  236. double e_x= 0;
  237. DBRes.GetField( "e_x",e_x, Error );
  238. double e_y= 0;
  239. DBRes.GetField( "e_y",e_y, Error );
  240. double e_z= 0;
  241. DBRes.GetField( "e_z",e_z, Error );
  242. double spacing_ratio = 0;
  243. DBRes.GetField( "spacing_ratio",spacing_ratio, Error );
  244. log_info("ant_path:%d,%.2f,%.2f,%.2f,%.2f",reader_id,b_x,b_y,e_x,e_y);
  245. point p1(b_x,-b_y);
  246. point p2(e_x,-e_y);
  247. auto &sit_ = *site_ptr;
  248. if(pid == 0)
  249. {
  250. line_v l(p1,p2);
  251. {
  252. point px = l.line::projection(sit_);
  253. sit_.set(px);
  254. for(int i=0;i<2;i++)
  255. {
  256. path p;
  257. p.m_slope[0] = spacing_ratio;
  258. p.m_line[0] = line_v(px,l[i]);
  259. sit_.m_ant[i].m_path.push_back(p);
  260. }
  261. }
  262. }
  263. else
  264. {
  265. ant &a = pid<0?sit_.m_ant[0]:sit_.m_ant[1];
  266. if(a.m_path.size()!=0)
  267. {
  268. path &p = a.m_path[0];
  269. p.m_line[abs(pid)-1] = line_v(p1,p2);
  270. p.m_slope[abs(pid)-1] = spacing_ratio;
  271. }
  272. else
  273. {
  274. path p;
  275. p.m_line[abs(pid)-1] = line_v(p1,p2);
  276. p.m_slope[abs(pid)-1] = spacing_ratio;
  277. a.m_path.push_back(p);
  278. }
  279. if(abs(pid)==1)
  280. sit_.set(p1);
  281. }
  282. }
  283. }
  284. for(auto&_s:sit_list::instance()->m_map)
  285. {
  286. auto & s = *(_s.second);
  287. if(s.m_id==-1)
  288. continue;
  289. s.swap();
  290. if((s.path(0).empty() && s.path(1).empty()))
  291. continue;
  292. s.m_path_empty=false;
  293. for(auto &a:s.m_ant)
  294. for(auto &p:a.m_path)
  295. {
  296. if(!p.m_line[0].empty())
  297. {
  298. point px = p.m_line[0].line::projection(a);
  299. p.m_line[0]=line_v(px,p.m_line[0][1]);
  300. }
  301. }
  302. //std_info("%s",s.to_string().c_str());
  303. log_info("%s",s.to_string().c_str());
  304. //std_info("%f----%f",s.x,s.y);
  305. }
  306. }
  307. #endif
  308. void sit_list::read_ant_path(int id)
  309. {
  310. std::string sql = "SELECT reader_id,tof_flag,b_x,b_y,b_z,e_x,e_y,e_z,spacing_ratio FROM dat_reader_path_tof_n";
  311. if(-1 == id)
  312. {
  313. sql.append(";");
  314. }
  315. else
  316. {
  317. sql.append(" AND reader_id=");
  318. sql.append(std::to_string(id));
  319. sql.append(";");
  320. std_debug("修改path sql=%s", sql.c_str());
  321. log_info("修改path sql=%s", sql.c_str());
  322. }
  323. std::string Error;
  324. YADB::CDBResultSet DBRes;
  325. sDBConnPool.Query(sql.c_str(),DBRes,Error);
  326. int nCount = DBRes.GetRecordCount( Error );
  327. if (nCount < 1)
  328. {
  329. log_error("修改path失败,数据库中找不到(dat_reader_path_tof_n): 分站id=%d", id);
  330. return ;
  331. }
  332. while ( DBRes.GetNextRecod(Error) )
  333. {
  334. int reader_id = 0;
  335. DBRes.GetField( "reader_id",reader_id, Error );
  336. auto site_ptr=sit_list::instance()->get(reader_id);
  337. if(nullptr==site_ptr)
  338. continue;
  339. int pid=0;
  340. DBRes.GetField( "tof_flag",pid, Error );
  341. double b_x= 0;
  342. DBRes.GetField( "b_x",b_x, Error );
  343. double b_y= 0;
  344. DBRes.GetField( "b_y",b_y, Error );
  345. double b_z= 0;
  346. DBRes.GetField( "b_z",b_z, Error );
  347. double e_x= 0;
  348. DBRes.GetField( "e_x",e_x, Error );
  349. double e_y= 0;
  350. DBRes.GetField( "e_y",e_y, Error );
  351. double e_z= 0;
  352. DBRes.GetField( "e_z",e_z, Error );
  353. double spacing_ratio = 0;
  354. DBRes.GetField( "spacing_ratio",spacing_ratio, Error );
  355. log_info("ant_path:%d,%.2f,%.2f,%.2f,%.2f",reader_id,b_x,b_y,e_x,e_y);
  356. point p1(b_x,-b_y);
  357. point p2(e_x,-e_y);
  358. auto &sit_ = *site_ptr;
  359. if(-1!=id)//清空path
  360. {
  361. sit_.clear_path();
  362. log_info( "修改path 清空path,分站id=%d\n", id );
  363. std_debug( "修改path 清空path,分站id=%d\n", id );
  364. }
  365. if(pid == 0)
  366. {
  367. line_v l(p1,p2);
  368. {
  369. point px = l.line::projection(sit_);
  370. sit_.set(px);
  371. for(int i=0;i<2;i++)
  372. {
  373. path p;
  374. p.m_slope[0] = spacing_ratio;
  375. p.m_line[0] = line_v(px,l[i]);
  376. sit_.m_ant[i].m_path.push_back(p);
  377. }
  378. }
  379. }
  380. else
  381. {
  382. ant &a = pid<0?sit_.m_ant[0]:sit_.m_ant[1];
  383. if(a.m_path.size()!=0)
  384. {
  385. path &p = a.m_path[0];
  386. p.m_line[abs(pid)-1] = line_v(p1,p2);
  387. p.m_slope[abs(pid)-1] = spacing_ratio;
  388. }
  389. else
  390. {
  391. path p;
  392. p.m_line[abs(pid)-1] = line_v(p1,p2);
  393. p.m_slope[abs(pid)-1] = spacing_ratio;
  394. a.m_path.push_back(p);
  395. }
  396. if(abs(pid)==1)
  397. sit_.set(p1);
  398. }
  399. }
  400. if(-1==id)
  401. {
  402. log_info( "read_ant_path. The record count=%ld\n", nCount );
  403. for(auto&_s:sit_list::instance()->m_map)
  404. {
  405. _s.second->deal_path();
  406. }
  407. }
  408. else
  409. {
  410. auto sit_ptr=sit_list::instance()->get(id);
  411. if(sit_ptr)
  412. {
  413. sit_ptr->deal_path();
  414. log_info( "修改path成功,分站id=%d\n", id );
  415. std_debug( "修改path成功,分站id=%d\n", id );
  416. }
  417. }
  418. }
  419. void sit_list::init_site(int id)
  420. {
  421. std::string sql = "SELECT reader_id, reader_type_id, dat_reader.map_id, \
  422. area_id, device_type_id, dimension, dat_map.scale\
  423. FROM dat_reader, dat_map where \
  424. dat_reader.map_id=dat_map.map_id and state=0";
  425. if(-1 == id)
  426. {
  427. sql.append(";");
  428. }
  429. else
  430. {
  431. sql.append(" AND reader_id=");
  432. sql.append(std::to_string(id));
  433. sql.append(";");
  434. std_debug("增加或修改分站 sql=%s", sql.c_str());
  435. log_info("增加或修改分站 sql=%s", sql.c_str());
  436. }
  437. std::string Error;
  438. YADB::CDBResultSet DBRes;
  439. sDBConnPool.Query(sql.c_str(),DBRes,Error);
  440. int nCount = DBRes.GetRecordCount( Error );
  441. if (nCount < 1)
  442. {
  443. log_error("增加或修改失败,数据库中找不到: 分站id=%d", id);
  444. return ;
  445. }
  446. log_info( "增加或修改 init_site. The record count=%ld\n", nCount );
  447. while ( DBRes.GetNextRecod(Error) )
  448. {
  449. int reader_id = 0;
  450. DBRes.GetField( "reader_id",reader_id, Error );
  451. auto site_ptr=sit_list::instance()->get(reader_id);
  452. if(nullptr==site_ptr)
  453. {
  454. site_ptr = std::make_shared<site>(reader_id);
  455. sit_list::instance()->add(reader_id,site_ptr);
  456. }
  457. int reader_type_id = 0;
  458. DBRes.GetField( "reader_type_id",reader_type_id, Error );
  459. int map_id = 0;
  460. DBRes.GetField( "map_id",map_id, Error );
  461. int area_id = 0;
  462. DBRes.GetField( "area_id",area_id, Error );
  463. int device_type_id = 0;
  464. DBRes.GetField( "device_type_id",device_type_id, Error );
  465. int dimension = 0;
  466. DBRes.GetField( "dimension",dimension, Error );
  467. double scale= 0;
  468. DBRes.GetField( "scale",scale, Error );
  469. site_ptr->m_reader_type_id = reader_type_id;
  470. site_ptr->m_map_id = map_id;
  471. site_ptr->m_area_id = area_id;
  472. site_ptr->m_device_type_id = device_type_id;
  473. site_ptr->m_dimension = dimension;
  474. site_ptr->m_scale = scale;
  475. }
  476. }
  477. void sit_list::read_sit_list(int id)
  478. {
  479. std::string sql = "SELECT antenna_id, a.reader_id, idx, a.x, a.y, a.z, a.angle \
  480. FROM dat_antenna a, dat_reader r \
  481. WHERE a.reader_id = r.reader_id";
  482. if(-1 == id)
  483. {
  484. sql.append(";");
  485. }
  486. else
  487. {
  488. sql.append(" AND antenna_id=");
  489. sql.append(std::to_string(id));
  490. sql.append(";");
  491. std_debug("基础数据 增加或修改天线 sql=%s", sql.c_str());
  492. log_info("基础数据 增加或修改天线 sql=%s", sql.c_str());
  493. }
  494. std::string Error;
  495. YADB::CDBResultSet DBRes;
  496. sDBConnPool.Query(sql.c_str(),DBRes,Error);
  497. int nCount = DBRes.GetRecordCount( Error );
  498. if (nCount < 1)
  499. {
  500. log_error("基础数据 增加或修改失败,数据库中找不到: 天线id=%d", id);
  501. return ;
  502. }
  503. std::unordered_map<int,std::shared_ptr<site>> map;
  504. while ( DBRes.GetNextRecod(Error) )
  505. {
  506. int antenna_id = 0;
  507. DBRes.GetField( "antenna_id",antenna_id, Error );
  508. int reader_id = 0;
  509. DBRes.GetField( "reader_id",reader_id, Error );
  510. int idx=0;
  511. DBRes.GetField( "idx",idx, Error );
  512. int antid = idx-1;
  513. if(antid >= 2)
  514. continue;
  515. double x= 0;
  516. DBRes.GetField( "x",x, Error );
  517. double y= 0;
  518. DBRes.GetField( "y",y, Error );
  519. double z= 0;
  520. DBRes.GetField( "z",z, Error );
  521. if(-1 == id)
  522. {
  523. std::shared_ptr<site> site_ptr=nullptr;
  524. auto it = map.find(reader_id);
  525. if(it==map.end())
  526. {
  527. site_ptr = std::make_shared<site>(reader_id);
  528. map.insert({reader_id,site_ptr});
  529. }
  530. else
  531. site_ptr=it->second;
  532. site_ptr->m_ant[antid].m_id = antenna_id;
  533. site_ptr->m_ant[antid].set(x,-y);
  534. log_info("reand_ant..%d,%d,%.2f,%.2f",reader_id,antid,x,y);
  535. }
  536. else
  537. {
  538. auto site_ptr = sit_list::instance()->get(reader_id);
  539. if(site_ptr)
  540. {
  541. site_ptr->m_ant[antid].set(x,-y);
  542. site_ptr->set_ex();
  543. }
  544. log_info("基础数据 增加或修改天线成功:天线id:%d,分站id:%d",id,reader_id);
  545. std_debug("基础数据 增加或修改天线成功:天线id:%d,分站id:%d",id,reader_id);
  546. }
  547. }
  548. if(-1 == id)
  549. {
  550. log_info( "init_antenna. The record count=%ld\n", nCount );
  551. sit_list::instance()->add(map);
  552. for(auto&sit_:map)
  553. {
  554. sit_.second->set_ex();
  555. }
  556. }
  557. }
  558. #if 0
  559. void sit_list::init_site()
  560. {
  561. const char *sql = "SELECT reader_id, reader_type_id, dat_reader.map_id, \
  562. area_id, device_type_id, dimension, dat_map.scale\
  563. FROM dat_reader, dat_map where \
  564. dat_reader.map_id=dat_map.map_id and state=0;";
  565. std::string Error;
  566. YADB::CDBResultSet DBRes;
  567. sDBConnPool.Query(sql,DBRes,Error);
  568. uint64_t nCount = DBRes.GetRecordCount( Error );
  569. if (nCount > 0)
  570. {
  571. log_info( "init_site. The record count=%ld\n", nCount );
  572. while ( DBRes.GetNextRecod(Error) )
  573. {
  574. int reader_id = 0;
  575. DBRes.GetField( "reader_id",reader_id, Error );
  576. auto site_ptr=sit_list::instance()->get(reader_id);
  577. if(nullptr==site_ptr)
  578. {
  579. site_ptr = std::make_shared<site>(reader_id);
  580. sit_list::instance()->add(reader_id,site_ptr);
  581. }
  582. int reader_type_id = 0;
  583. DBRes.GetField( "reader_type_id",reader_type_id, Error );
  584. int map_id = 0;
  585. DBRes.GetField( "map_id",map_id, Error );
  586. int area_id = 0;
  587. DBRes.GetField( "area_id",area_id, Error );
  588. int device_type_id = 0;
  589. DBRes.GetField( "device_type_id",device_type_id, Error );
  590. int dimension = 0;
  591. DBRes.GetField( "dimension",dimension, Error );
  592. double scale= 0;
  593. DBRes.GetField( "scale",scale, Error );
  594. site_ptr->m_reader_type_id = reader_type_id;
  595. site_ptr->m_map_id = map_id;
  596. site_ptr->m_area_id = area_id;
  597. site_ptr->m_device_type_id = device_type_id;
  598. site_ptr->m_dimension = dimension;
  599. site_ptr->m_scale = scale;
  600. }
  601. }
  602. }
  603. #endif
  604. algo_config site::g_config[]=
  605. {
  606. { "tof-1", 1, 2, 0.1, 1 },
  607. { "tdoa-1", 2, 2, 0.1, 1 },
  608. { "tof-2", 2, 3, 0.1, 1 },
  609. { "tdoa-2", 3, 3, 0.1, 1 },
  610. { "tof-3", 3, 4, 0.1, 1 },
  611. { "tdoa-3", 4, 4, 0.1, 1 }
  612. };
  613. #ifdef _TEST
  614. int main()
  615. {
  616. log_init("./log.ini");
  617. //sit_list *sl = sit_list::instance();
  618. sit_list::instance()->load("data_reader_antenna.txt","path_tof.txt");
  619. sit_list::instance()->get(209)->solving(0,100);
  620. sit_list::instance()->get(209)->solving(1,100.5);
  621. //std_info("---%d",(*sl)[209].m_ant[0].m_path.size());
  622. //std_info("---%d",(*sl)[209][0].size());
  623. //std_info("---%s",(*sl)[209][0][0][0].to_string().c_str());
  624. }
  625. #endif