dispatch_ground_lidar.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // Created by huli on 2021/9/25.
  3. //
  4. #ifndef NNXX_TESTS_DISPATCH_GROUND_LIDAR_H
  5. #define NNXX_TESTS_DISPATCH_GROUND_LIDAR_H
  6. #include "../error_code/error_code.h"
  7. #include <glog/logging.h>
  8. #include <thread>
  9. #include <mutex>
  10. #include "../tool/thread_condition.h"
  11. #include "../tool/common_data.h"
  12. #include "../tool/time_tool.h"
  13. #include "../task/task_base.h"
  14. #include "../message/dispatch_message.pb.h"
  15. #include "../message/measure_message.pb.h"
  16. #include "../dispatch/dispatch_communication.h"
  17. //调度地面雷达
  18. class Dispatch_ground_lidar
  19. {
  20. public:
  21. //调度plc状态
  22. enum Dispatch_ground_lidar_status
  23. {
  24. DISPATCH_GROUND_LIDAR_UNKNOW = 0, //未知
  25. DISPATCH_GROUND_LIDAR_READY = 1, //准备,待机
  26. DISPATCH_GROUND_LIDAR_FAULT = 10, //故障
  27. DISPATCH_GROUND_LIDAR_DISCONNECT = 11, //断连
  28. };
  29. public:
  30. Dispatch_ground_lidar();
  31. Dispatch_ground_lidar(const Dispatch_ground_lidar& other)= default;
  32. Dispatch_ground_lidar& operator =(const Dispatch_ground_lidar& other)= default;
  33. ~Dispatch_ground_lidar();
  34. public://API functions
  35. //调度地面雷达 初始化
  36. Error_manager dispatch_plc_init(int plc_id, int ground_lidar_id);
  37. //调度地面雷达 反初始化
  38. Error_manager dispatch_plc_uninit();
  39. //调度地面雷达 执行状态消息
  40. Error_manager execute_for_ground_status_msg(message::Ground_status_msg &ground_status_msg);
  41. public://get or set member variable
  42. Dispatch_ground_lidar_status get_dispatch_ground_lidar_status();
  43. protected://member functions
  44. protected://member variable
  45. std::atomic<Dispatch_ground_lidar_status> m_dispatch_ground_lidar_status;//调度地面雷达的状态
  46. int m_plc_id; //设备id, 索引, 就是楚天车库的单元号.
  47. int m_ground_lidar_id; //地面雷达的id
  48. std::mutex m_lock; //锁
  49. private:
  50. };
  51. #endif //NNXX_TESTS_DISPATCH_GROUND_LIDAR_H