StoreProcessTask.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. //
  2. // Created by zx on 2020/7/7.
  3. //
  4. #ifndef NNXX_TESTS_STOREPROCESS_H
  5. #define NNXX_TESTS_STOREPROCESS_H
  6. #include <parkspace_allocation_message.pb.h>
  7. #include <terminal_message.pb.h>
  8. #include "dispatch_excutor.h"
  9. #include "process_task.h"
  10. #include "measure_excutor.h"
  11. #include "process_message.pb.h"
  12. class StoreProcessTask :public Process_task{
  13. public:
  14. StoreProcessTask(unsigned int command_id,message::Car_info car_info);
  15. virtual ~StoreProcessTask();
  16. Error_manager init_task(message::Locate_information locate_info);
  17. /*
  18. * 获取任务类型
  19. */
  20. virtual tq::TaskCategory GetCategory() const{ return message::eStoring;}
  21. /*
  22. * 控制流程到下一步
  23. */
  24. virtual Error_manager next_step();
  25. protected:
  26. virtual void Main();
  27. /*
  28. * 分配车位
  29. */
  30. Error_manager alloc_space_step();
  31. /*
  32. * 回退分配车位
  33. */
  34. Error_manager back_alloc_space_step();
  35. /*
  36. * 定位
  37. */
  38. Error_manager locate_step();
  39. /*
  40. * 回退定位
  41. */
  42. Error_manager back_locate_step();
  43. /*
  44. * 检验结果
  45. */
  46. Error_manager compare_step();
  47. /*
  48. * 回退检验
  49. */
  50. Error_manager back_compare_step();
  51. /*
  52. * 调度
  53. */
  54. Error_manager dispatch_step();
  55. /*
  56. * 回退调度
  57. */
  58. Error_manager back_dispatch_step();
  59. /*
  60. * 车位占用确认
  61. */
  62. Error_manager confirm_space_step();
  63. /*
  64. * 初始化 接收到的消息
  65. */
  66. void reset_msg();
  67. virtual void publish_step_status();
  68. /*
  69. * 根据当前流程状态,修改状态消息
  70. */
  71. void updata_step_statu(message::Step_statu statu);
  72. protected:
  73. message::Locate_information m_locate_info;
  74. //保存请求
  75. message::Parkspace_allocation_request_msg m_alloc_request_msg;
  76. message::Measure_request_msg m_measure_request_msg;
  77. message::Locate_information m_compare_location_data;
  78. message::Dispatch_request_msg m_dispatch_request_msg;
  79. message::Parkspace_confirm_alloc_request_msg m_confirm_request_msg;
  80. //停车请求发送过来的测量数据,终端位置的测量数据
  81. message::Store_command_response_msg m_command_response_msg; //发送给终端的停车反馈
  82. message::Measure_response_msg m_measure_response_msg; //测量模块的测量数据
  83. message::Parkspace_allocation_response_msg m_parcspace_alloc_response_msg; //分配的车位数据
  84. message::Dispatch_response_msg m_dispatch_response_msg; //调度模块的反馈数据
  85. private:
  86. message::Storing_process_statu_msg m_process_msg;
  87. };
  88. #endif //NNXX_TESTS_STOREPROCESS_H