passageway_task.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. int m_step;//长流程细分为短流程, m_step 控制短流程的步骤
  46. //调度下发到plc
  47. std::string m_request_key; //请求唯一码, 用作识别
  48. //请求的目标坐标和动作
  49. Door_motion m_request_inside_door_motion; //通道口 内门动作
  50. Door_motion m_request_outside_door_motion; //通道口 外门动作
  51. Turntable_direction m_request_turntable_direction; //通道口 转台方向
  52. //plc反馈给调度
  53. std::string m_respons_key; //应答的唯一码, 用作识别
  54. Respons_status m_respons_status; //指令完成状态, 搬运器答复指令, 返回任务完成的情况
  55. //答复的实际坐标和动作
  56. Door_motion m_respons_inside_door_motion; //通道口 内门动作
  57. Door_motion m_respons_outside_door_motion; //通道口 外门动作
  58. Turntable_direction m_respons_turntable_direction; //通道口 转台方向
  59. private:
  60. };
  61. #endif //NNXX_TESTS_PASSAGEWAY_TASK_H