loc_point.h 1.6 KB

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