trm_drivingface.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef TRM_DRIVINGFACE_H
  2. #define TRM_DRIVINGFACE_H
  3. #include <string>
  4. #include <vector>
  5. #include "point.h"
  6. #define ZERO_PRECISION 1E-3 //为零的精度
  7. struct time_point:public point{
  8. time_t m_t; //此坐标当前记录到队列的时间
  9. };
  10. /*
  11. * 掘进机的三率业务类
  12. *
  13. */
  14. struct drivingface_biz{
  15. uint64_t m_rec_time; //接收时间
  16. uint64_t m_record_totals; //当前记录点个数
  17. uint64_t m_record_cycle_start_time; //开始记录的起始时间
  18. double m_record_min_dist; //周期内最小距离值
  19. double m_record_max_dist; //周期内最大距离值
  20. double m_record_avg_dist; //当前记录内的平均距离
  21. bool m_b_first_record; //是否开始新一条数据的记录标志位
  22. std::string m_str_record; //记录1分钟内距离和时间信息
  23. std::vector<time_point> m_vt_points; //存储1分钟内点的坐标
  24. drivingface_biz(){
  25. m_record_totals = 0;
  26. m_record_cycle_start_time = 0;
  27. m_record_avg_dist = 0.0;
  28. m_b_first_record = true;
  29. m_str_record = "";
  30. }
  31. };
  32. struct drivingface_card:public point,public drivingface_biz
  33. {
  34. uint64_t m_drivingface_id;
  35. std::string m_card_id;
  36. uint64_t m_vehicle_id;
  37. uint64_t m_area_id;
  38. uint64_t m_relay_small_reader_id; //中继小分站
  39. uint64_t m_locate_small_reader_id; //定位小分站
  40. uint64_t m_big_reader_id; //定位大分站,用于区分方向
  41. uint64_t m_dept_id;
  42. double m_schedule_tunnelling_times; //计划排数
  43. double m_drifting_footage_unit; //排数的间距
  44. double m_schedule_work_times; //计划工作时长
  45. bool m_old_state; //之前掘进机的状态
  46. bool m_cur_state; //当前掘进机的状态
  47. bool m_restart; //是否重启中(true = 没更新最大位置)
  48. double m_max_distance; //最大距离
  49. point m_max_point; //最大距离时的位置信
  50. std::vector<point> m_vt_ref_points; //掘进面资料维护表中的数据
  51. double m_total_ref_point_dist; //基准点之间的累计距离
  52. double m_fOffset; //掘进面资料维护表中的数据-偏移数据
  53. drivingface_card():point(0,0,0){
  54. m_drivingface_id = m_area_id = m_relay_small_reader_id = m_locate_small_reader_id = m_big_reader_id = m_dept_id = 0;
  55. m_schedule_tunnelling_times = m_drifting_footage_unit = m_max_distance = 0.0;
  56. m_old_state = m_cur_state = false;
  57. m_restart = true;
  58. m_vehicle_id = 0;
  59. m_card_id = "";
  60. m_fOffset = 0;
  61. m_total_ref_point_dist = 0;
  62. }
  63. ~drivingface_card(){};
  64. };
  65. //typedef std::unordered_map<std:string,std::shared_ptr<drivingface_card>> unMapDrivingfaceCard;
  66. #endif