loc_point.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #ifndef _LOC_POINT_HPP_
  2. #define _LOC_POINT_HPP_
  3. #include "point.h"
  4. #include "line_fit.h"
  5. struct loc_message;
  6. struct loc_point:point
  7. {
  8. int64_t m_time;
  9. int m_ct;
  10. uint32_t m_cid;
  11. int m_sid;
  12. float m_acc;
  13. float m_rav;
  14. int m_cred_level;
  15. int m_tof[2];
  16. //float m_rsp[2];
  17. int m_step;
  18. double m_area;
  19. point m_sol[2];
  20. double m_dist;
  21. double m_speed;
  22. int m_stat;
  23. bool m_useless;
  24. double m_dist1; //smooth phase 1
  25. double m_dist2; //smooth phase 3
  26. double m_smooth_x;
  27. double m_smooth_y;
  28. fit_result m_k;
  29. fit_result&set_k(const fit_result&k)
  30. {
  31. return m_k=k;
  32. }
  33. loc_point();
  34. const point& operator[](int i)const
  35. {
  36. return m_sol[i];
  37. }
  38. point& operator[](int i)
  39. {
  40. return m_sol[i];
  41. }
  42. double loc_dist(const point&pt)const
  43. {
  44. return m_sol[0].dist_direct(pt);
  45. }
  46. double loc_dist(const loc_point&lp)const
  47. {
  48. return m_sol[0].dist_direct(lp.m_sol[0]);
  49. }
  50. bool is_same_site(const loc_point&o)const
  51. {
  52. return m_sid==o.m_sid;
  53. }
  54. double time_off(const loc_point&o)const
  55. {
  56. return (o.m_time-m_time)/1000.;
  57. }
  58. double ct_off(const loc_point&o)const
  59. {
  60. return o.m_ct-m_ct;
  61. }
  62. void debug_out(const char * str="")const ;
  63. void set_sol(int i,const point&p) ;
  64. bool b_50m()const
  65. {
  66. static int tof_50m=50/(15.65*2.996*1e-4);
  67. return m_tof[0]==0?m_tof[1]>tof_50m:m_tof[0]>tof_50m;
  68. }
  69. loc_point& reset() ;
  70. int inc_cl(int cred_level) ;
  71. int set_cl(int cred_level) ;
  72. int cl()const ;
  73. void set_source(const loc_message&li,const loc_message&li2) ;
  74. void set_source(const loc_message&li) ;
  75. };
  76. #endif