StoreProcessTask.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. protected:
  29. virtual void Main();
  30. /*
  31. * 定位
  32. */
  33. Error_manager locate_step();
  34. /*
  35. * 回退定位
  36. */
  37. Error_manager back_locate_step();
  38. /*
  39. * 检验结果
  40. */
  41. Error_manager compare_step();
  42. /*
  43. * 回退检验
  44. */
  45. Error_manager back_compare_step();
  46. /*
  47. * 调度
  48. */
  49. Error_manager dispatch_step();
  50. /*
  51. * 回退调度
  52. */
  53. Error_manager back_dispatch_step();
  54. /*
  55. * 车位占用确认
  56. */
  57. Error_manager confirm_space_step();
  58. /*
  59. * 初始化 接收到的消息
  60. */
  61. void reset_msg();
  62. virtual void publish_step_status();
  63. /*
  64. * 根据当前流程状态,生成状态消息
  65. */
  66. void updata_step_statu_msg(message::Step_statu statu);
  67. protected:
  68. message::Locate_information m_locate_info;
  69. //保存请求
  70. message::Parkspace_allocation_request_msg m_alloc_request_msg;
  71. message::Measure_request_msg m_measure_request_msg;
  72. message::Locate_information m_compare_location_data;
  73. message::Dispatch_request_msg m_dispatch_request_msg;
  74. message::Parkspace_confirm_alloc_request_msg m_confirm_request_msg;
  75. //停车请求发送过来的测量数据,终端位置的测量数据
  76. message::Measure_response_msg m_measure_response_msg; //测量模块的测量数据
  77. message::Parkspace_allocation_response_msg m_parcspace_alloc_response_msg; //分配的车位数据
  78. message::Dispatch_response_msg m_dispatch_response_msg; //调度模块的反馈数据
  79. private:
  80. message::Storing_process_statu_msg m_process_msg;
  81. };
  82. #endif //NNXX_TESTS_STOREPROCESS_H