passageway.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. //
  2. // Created by huli on 2021/3/16.
  3. //
  4. #ifndef NNXX_TESTS_PASSAGEWAY_H
  5. #define NNXX_TESTS_PASSAGEWAY_H
  6. #include "../dispatch/passageway_task.h"
  7. #include "../dispatch/dispatch_device_base.h"
  8. #include "../tool/common_data.h"
  9. //一楼的出入口,通道口
  10. class Passageway:public Dispatch_device_base
  11. {
  12. public:
  13. Passageway();
  14. Passageway(const Passageway& other)= default;
  15. Passageway& operator =(const Passageway& other)= default;
  16. ~Passageway();
  17. public://API functions
  18. //检查任务类型, 子类必须重载, 用来检查输入的任务是否为子类所需的.
  19. Error_manager check_task_type(std::shared_ptr<Task_Base> p_task);
  20. public://get or set member variable
  21. //获取硬件设备的状态, 必须子类继承
  22. Hardware_device_status get_actual_device_status();
  23. virtual std::string get_current_command_key();
  24. protected://member functions
  25. //把任务单写入到内存中, 子类必须重载
  26. Error_manager write_task_to_memory(std::shared_ptr<Task_Base> p_task);
  27. //更新设备底层通信数据, 子类必须重载
  28. Error_manager update_device_communication();
  29. //从内存中读数据到任务单, 子类必须重载
  30. Error_manager check_and_read_memory_to_task(std::shared_ptr<Task_Base> p_task);
  31. //取消下发的指令, 子类必须重载, 用来向下发送命令取消任务.
  32. Error_manager cancel_command();
  33. protected://member variable
  34. public:
  35. //调度下发到plc
  36. std::string m_request_key; //请求唯一码, 用作识别
  37. //请求的目标坐标和动作
  38. Door_motion m_request_inside_door_motion; //通道口 内门动作
  39. Door_motion m_request_outside_door_motion; //通道口 外门动作
  40. Turntable_direction m_request_turntable_direction; //通道口 转台方向
  41. //plc反馈给调度
  42. std::string m_respons_key; //应答的唯一码, 用作识别
  43. Respons_status m_respons_status; //指令完成状态, 搬运器答复指令, 返回任务完成的情况
  44. //答复的实际坐标和动作
  45. Door_motion m_respons_inside_door_motion; //通道口 内门动作
  46. Door_motion m_respons_outside_door_motion; //通道口 外门动作
  47. Turntable_direction m_respons_turntable_direction; //通道口 转台方向
  48. //硬件状态, 目前只做显示判断
  49. std::chrono::system_clock::time_point m_status_updata_time; //状态更新时间点
  50. unsigned char m_last_heartbeat; //上一次的心跳
  51. //通道口的设备状态数据,
  52. Hardware_device_status m_actual_device_status; //通道口的硬件设备状态
  53. Load_status m_actual_inside_load_status; //通道口的内部负载状态, 门内地感是否有车.
  54. Load_status m_actual_outside_load_status; //通道口的外部负载状态, 门外地感是否有车.
  55. Overstep_the_boundary m_actual_front_overstep_the_boundary; //通道口 汽车前边界
  56. Overstep_the_boundary m_actual_back_overstep_the_boundary; //通道口 汽车后边界
  57. Overstep_the_boundary m_actual_height_overstep_the_boundary; //通道口 车辆是否超高
  58. Load_status m_actual_outside_door_sensor; //通道口 的外门处的传感器, 判断是否有车经过外门
  59. //通道口的真实状态, 可能是路径中间的坐标
  60. Door_motion m_actual_inside_door_motion; //通道口 内门动作
  61. Door_motion m_actual_outside_door_motion; //通道口 外门动作
  62. Load_status m_actual_turntable_load_status; //通道口 转盘负载状态, 是否有车.
  63. Turntable_direction m_actual_turntable_direction; //通道口 转台方向
  64. //搬运器设备的错误码
  65. unsigned char m_actual_error_code[50]; //搬运器设备的故障信息位
  66. unsigned char m_actual_warning_code[50]; //搬运器设备的警告信息位
  67. std::string m_actual_error_description;//搬运器设备的错误描述
  68. private:
  69. };
  70. #endif //NNXX_TESTS_PASSAGEWAY_H