passageway_task.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //
  2. // Created by huli on 2021/3/16.
  3. //
  4. #ifndef NNXX_TESTS_PASSAGEWAY_TASK_H
  5. #define NNXX_TESTS_PASSAGEWAY_TASK_H
  6. #include "../error_code/error_code.h"
  7. #include "../task/task_command_manager.h"
  8. #include "../task/task_base.h"
  9. #include <mutex>
  10. class Passageway_task:public Task_Base
  11. {
  12. public:
  13. //指令完成状态, 搬运器答复指令, 返回任务完成的情况
  14. enum Respons_status
  15. {
  16. RESPONS_WORKING = 0, //正常
  17. RESPONS_OVER = 1, //任务完成
  18. RESPONS_MINOR_ERROR = 100, //一般故障, 可恢复
  19. RESPONS_CRITICAL_ERROR = 101, //致命故障,不可恢复
  20. };
  21. //7号出口 转台方向
  22. enum Turntable_direction
  23. {
  24. TURNTABLE_DIRECTION_UNKNOWN = 0, //方向未知,
  25. TURNTABLE_DIRECTION_INSIDE = 1, //方向朝里,对接内门的小跑车
  26. TURNTABLE_DIRECTION_OUTSIDE = 2, //没车朝外,对接外门的出口
  27. };
  28. //出入口 门的开关状态
  29. enum Door_motion
  30. {
  31. DOOR_UNKNOWN = 0, //门的开关状态 未知, 或者工作到一半,正在工作中.
  32. DOOR_OPEN = 1, //开门
  33. DOOR_CLOSE = 2, //关门
  34. DOOR_ERROR = 3, //
  35. };
  36. Passageway_task();
  37. Passageway_task(const Passageway_task& other)= default;
  38. Passageway_task& operator =(const Passageway_task& other)= default;
  39. ~Passageway_task();
  40. public://API functions
  41. public://get or set member variable
  42. protected://member functions
  43. public://member variable
  44. std::mutex m_lock; //锁
  45. //调度下发到plc
  46. std::string m_request_key; //请求唯一码, 用作识别
  47. //请求的目标坐标和动作
  48. Door_motion m_request_inside_door_motion; //通道口 内门动作
  49. Door_motion m_request_outside_door_motion; //通道口 外门动作
  50. Turntable_direction m_request_turntable_direction; //通道口 转台方向
  51. //plc反馈给调度
  52. std::string m_respons_key; //应答的唯一码, 用作识别
  53. Respons_status m_respons_status; //指令完成状态, 搬运器答复指令, 返回任务完成的情况
  54. //答复的实际坐标和动作
  55. Door_motion m_respons_inside_door_motion; //通道口 内门动作
  56. Door_motion m_respons_outside_door_motion; //通道口 外门动作
  57. Turntable_direction m_respons_turntable_direction; //通道口 转台方向
  58. private:
  59. };
  60. #endif //NNXX_TESTS_PASSAGEWAY_TASK_H