trm_drivingface_module.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef TRM_DRIVINGFACE_MODULE_H
  2. #define TRM_DRIVINGFACE_MODULE_H
  3. #include <mutex>
  4. #include <memory>
  5. #include <unordered_map>
  6. #include <time.h>
  7. #include "db_api/CDBSingletonDefine.h"
  8. #include "trm_drivingface.h"
  9. #include "struct_def.h"
  10. #include "tools.hpp"
  11. #include "trm_reader_info.h"
  12. struct trm_drivingface_module{
  13. public:
  14. trm_drivingface_module():m_restart(false){}
  15. public:
  16. int init_all(bool status);
  17. inline void set_restart(const bool status){m_restart = status;}
  18. inline bool get_restart(){return m_restart;}
  19. int init_reader();
  20. int init_drivingface_card(const std::string & sz_drivingface_id = "-1");
  21. //掘进面偏移数据
  22. int init_drivingface_ref_points(const std::string & sz_drivingface_id = "-1");
  23. int init_drivingface_nearest_info(std::shared_ptr<drivingface_card> pCard);
  24. public:
  25. int deal_drivingface_service(std::shared_ptr<drivingface_card> pCard, std::shared_ptr<card_pos> p_tcp_card);
  26. int deal_drivingface_trm(std::shared_ptr<drivingface_card> pCard);
  27. int deal_drivingface_regular_cycle(std::shared_ptr<drivingface_card> pCard, const point& p); //正常正规循环率处理逻辑
  28. int deal_drivingface_real_distance(std::shared_ptr<drivingface_card> pCard, const point& p); //正常计算掘进机排数信息处理逻辑
  29. int deal_drivingface_regular_cycle(); //超时正规循环率处理逻辑
  30. int deal_drivingface_real_distance(); //超时计算掘进机排数信息处理逻辑
  31. int save_drivingface_regular_cycle(std::shared_ptr<drivingface_card> pCard, const point& p);//保存掘进排数信息 //写库
  32. double get_drivingface_schedule_value(const uint64_t& id,const uint8_t type); //查询数据库获得排数信息
  33. /* 平滑掘进机进尺的距离信息
  34. * @param value:距离
  35. * */
  36. void smooth_row_spacing(double& value,const double& sv);
  37. public:
  38. std::shared_ptr<drivingface_card> get_drivingfase_card(std::string card_id);
  39. std::shared_ptr<drivingface_card> get_drivingfase_card(uint64_t drivingface_id);
  40. std::shared_ptr<map_info> get_map_info(int map_id);
  41. //移除掘进面
  42. void remove_drivingface(int drivingface_id );
  43. public:
  44. //掘进机
  45. typedef std::unordered_map<std::string,std::shared_ptr<drivingface_card>> MAP_DRIVINGFACE_CARD;
  46. MAP_DRIVINGFACE_CARD mp_drivingface_card_list;
  47. SimulateReaderMap mp_simulate_reader_list;
  48. private:
  49. bool m_restart;
  50. };
  51. #endif