PickupProcessTask.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. //
  2. // Created by zx on 2020/7/7.
  3. //
  4. #ifndef NNXX_TESTS_TAKEPROCESS_H
  5. #define NNXX_TESTS_TAKEPROCESS_H
  6. #include <parkspace_allocation_message.pb.h>
  7. #include "process_message.pb.h"
  8. #include "error_code.h"
  9. #include "process_task.h"
  10. #include "dispatch_excutor.h"
  11. #include "terminal_message.pb.h"
  12. class PickupProcessTask :public Process_task{
  13. public:
  14. PickupProcessTask(unsigned int terminal_id,message::Car_info car_info);
  15. virtual ~PickupProcessTask();
  16. Error_manager init_task();
  17. // 获取任务类型
  18. virtual message::Process_type get_process_type()const{return message::ePicking;};
  19. /*
  20. * 控制流程到下一步
  21. */
  22. virtual Error_manager next_step();
  23. /*
  24. * 根据当前流程状态,修改状态消息
  25. */
  26. void updata_step_statu(message::Step_statu statu);
  27. protected:
  28. virtual void Main();
  29. /*
  30. * 查询车位
  31. */
  32. Error_manager search_space_step();
  33. /*
  34. * 回退查询车位
  35. */
  36. Error_manager back_search_space_step();
  37. /*
  38. * 执行取车动作请求,并等待执行完成
  39. */
  40. Error_manager dispatch_step();
  41. /*
  42. * 回退执行取车动作请求,并等待执行完成
  43. */
  44. Error_manager back_dispatch_step();
  45. /*
  46. * 等待车辆离开
  47. */
  48. Error_manager wait_for_leave_step();
  49. /*
  50. * 回退等待车辆离开
  51. */
  52. Error_manager back_wait_for_leave_step();
  53. /*
  54. * 清除车位表中对应的车位
  55. */
  56. Error_manager release_space_step();
  57. virtual void publish_step_status();
  58. /*
  59. * 初始化 接收到的消息
  60. */
  61. void reset_msg();
  62. protected:
  63. private:
  64. //查询到的车位信息
  65. message::Parkspace_search_request_msg m_search_request_msg;
  66. message::Parkspace_search_response_msg m_search_response_msg;
  67. message::Parkspace_release_request_msg m_release_request_msg;
  68. message::Parkspace_release_response_msg m_release_response_msg;
  69. //取车调度反馈信息
  70. message::Pickup_command_response_msg m_command_response_msg;
  71. message::Dispatch_request_msg m_dispatch_request_msg;
  72. message::Dispatch_response_msg m_dispatch_response_msg;
  73. message::Picking_process_statu_msg m_process_msg;
  74. };
  75. #endif //NNXX_TESTS_TAKEPROCESS_H