passageway.h 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. protected://member functions
  24. //把任务单写入到内存中, 子类必须重载
  25. Error_manager write_task_to_memory(std::shared_ptr<Task_Base> p_task);
  26. //更新设备底层通信数据, 子类必须重载
  27. Error_manager update_device_communication();
  28. //从内存中读数据到任务单, 子类必须重载
  29. Error_manager check_and_read_memory_to_task(std::shared_ptr<Task_Base> p_task);
  30. //取消下发的指令, 子类必须重载, 用来向下发送命令取消任务.
  31. Error_manager cancel_command();
  32. protected://member variable
  33. public:
  34. //调度下发到plc
  35. std::string m_request_key; //请求唯一码, 用作识别
  36. //请求的目标坐标和动作
  37. Door_motion m_request_inside_door_motion; //通道口 内门动作
  38. Door_motion m_request_outside_door_motion; //通道口 外门动作
  39. Turntable_direction m_request_turntable_direction; //通道口 转台方向
  40. //plc反馈给调度
  41. std::string m_respons_key; //应答的唯一码, 用作识别
  42. Respons_status m_respons_status; //指令完成状态, 搬运器答复指令, 返回任务完成的情况
  43. //答复的实际坐标和动作
  44. Door_motion m_respons_inside_door_motion; //通道口 内门动作
  45. Door_motion m_respons_outside_door_motion; //通道口 外门动作
  46. Turntable_direction m_respons_turntable_direction; //通道口 转台方向
  47. //硬件状态, 目前只做显示判断
  48. std::chrono::system_clock::time_point m_status_updata_time; //状态更新时间点
  49. unsigned char m_last_heartbeat; //上一次的心跳
  50. //通道口的设备状态数据,
  51. Hardware_device_status m_actual_device_status; //通道口的硬件设备状态
  52. Load_status m_actual_inside_load_status; //通道口的内部负载状态, 门内地感是否有车.
  53. Load_status m_actual_outside_load_status; //通道口的外部负载状态, 门外地感是否有车.
  54. Overstep_the_boundary m_actual_front_overstep_the_boundary; //通道口 汽车前边界
  55. Overstep_the_boundary m_actual_back_overstep_the_boundary; //通道口 汽车后边界
  56. Overstep_the_boundary m_actual_height_overstep_the_boundary; //通道口 车辆是否超高
  57. Load_status m_actual_outside_door_sensor; //通道口 的外门处的传感器, 判断是否有车经过外门
  58. //通道口的真实状态, 可能是路径中间的坐标
  59. Door_motion m_actual_inside_door_motion; //通道口 内门动作
  60. Door_motion m_actual_outside_door_motion; //通道口 外门动作
  61. Load_status m_actual_turntable_load_status; //通道口 转盘负载状态, 是否有车.
  62. Turntable_direction m_actual_turntable_direction; //通道口 转台方向
  63. //搬运器设备的错误码
  64. unsigned char m_actual_error_code[50]; //搬运器设备的故障信息位
  65. unsigned char m_actual_warning_code[50]; //搬运器设备的警告信息位
  66. std::string m_actual_error_description;//搬运器设备的错误描述
  67. private:
  68. };
  69. #endif //NNXX_TESTS_PASSAGEWAY_H