StoreProcessTask.h 2.6 KB

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