System_Manager.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // Created by zx on 2020/1/3.
  3. //
  4. #ifndef SYSTEM_MANAGER_H
  5. #define SYSTEM_MANAGER_H
  6. #include "../laser/Laser.h"
  7. #include "../plc/plc_communicator.h"
  8. #include "../locate/locater.h"
  9. #include "../terminor/terminal_command_executor.h"
  10. class System_Manager
  11. {
  12. public:
  13. System_Manager();
  14. ~System_Manager();
  15. //初始化各个模块,包括雷达,plc,locater,terminor
  16. //1,读取运行环境下setting目录下的laser.prototxt,plc.prototxt,locater.prototxt,terminal.prototxt
  17. //2,根据配置创建雷达,plc,locater,terminal
  18. Error_manager init();
  19. //读取protobuf 配置文件
  20. //file:文件
  21. //parameter:要读取的配置
  22. static bool read_proto_param(std::string file, ::google::protobuf::Message& parameter);
  23. protected:
  24. //plc指令回调函数,当plc收到测量指令后,调用此回调函数
  25. //terminal_id:收到指令的终端编号
  26. //owner:this指针
  27. static Error_manager plc_command_callback(int terminal_id,void* owner);
  28. protected:
  29. std::vector<Laser_base*> m_laser_vector;
  30. std::vector<Terminor_Command_Executor*> m_terminal_vector;
  31. Locater* mp_locater;
  32. Plc_Communicator* mp_plc;
  33. ///terminoal 配置
  34. Terminal::Terminor_parameter_all m_terminal_parameter_all;
  35. };
  36. #endif //SYSTEM_MANAGER_H