123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- //
- // Created by huli on 2021/9/25.
- //
- #ifndef NNXX_TESTS_DISPATCH_GROUND_LIDAR_H
- #define NNXX_TESTS_DISPATCH_GROUND_LIDAR_H
- #include "../error_code/error_code.h"
- #include <glog/logging.h>
- #include <thread>
- #include <mutex>
- #include "../tool/thread_condition.h"
- #include "../tool/common_data.h"
- #include "../tool/time_tool.h"
- #include "../task/task_base.h"
- #include "../message/dispatch_message.pb.h"
- #include "../message/measure_message.pb.h"
- #include "../dispatch/dispatch_communication.h"
- //调度地面雷达
- class Dispatch_ground_lidar
- {
- public:
- //调度plc状态
- enum Dispatch_ground_lidar_status
- {
- DISPATCH_GROUND_LIDAR_UNKNOW = 0, //未知
- DISPATCH_GROUND_LIDAR_READY = 1, //准备,待机
- DISPATCH_GROUND_LIDAR_FAULT = 10, //故障
- DISPATCH_GROUND_LIDAR_DISCONNECT = 11, //断连
- };
- public:
- Dispatch_ground_lidar();
- Dispatch_ground_lidar(const Dispatch_ground_lidar& other)= default;
- Dispatch_ground_lidar& operator =(const Dispatch_ground_lidar& other)= default;
- ~Dispatch_ground_lidar();
- public://API functions
- //调度地面雷达 初始化
- Error_manager dispatch_plc_init(int plc_id, int ground_lidar_id);
- //调度地面雷达 反初始化
- Error_manager dispatch_plc_uninit();
- //调度地面雷达 执行状态消息
- Error_manager execute_for_ground_status_msg(message::Ground_status_msg &ground_status_msg);
- public://get or set member variable
- Dispatch_ground_lidar_status get_dispatch_ground_lidar_status();
- protected://member functions
- protected://member variable
- std::atomic<Dispatch_ground_lidar_status> m_dispatch_ground_lidar_status;//调度地面雷达的状态
- int m_plc_id; //设备id, 索引, 就是楚天车库的单元号.
- int m_ground_lidar_id; //地面雷达的id
- std::mutex m_lock; //锁
- private:
- };
- #endif //NNXX_TESTS_DISPATCH_GROUND_LIDAR_H
|