loc_point.h 1.5 KB

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