StoreProcessTask.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 "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. virtual message::Process_type get_process_type()const{return message::eStoring;}
  18. /*
  19. * 控制流程到下一步
  20. */
  21. virtual Error_manager next_step();
  22. /*
  23. * 根据当前流程状态,修改状态消息
  24. */
  25. void updata_step_statu(message::Step_statu statu);
  26. protected:
  27. virtual void Main();
  28. /*
  29. * 分配车位
  30. */
  31. Error_manager alloc_space_step();
  32. /*
  33. * 回退分配车位
  34. */
  35. Error_manager back_alloc_space_step();
  36. /*
  37. * 检验结果
  38. */
  39. Error_manager compare_step();
  40. /*
  41. * 回退检验
  42. */
  43. Error_manager back_compare_step();
  44. /*
  45. * 调度
  46. */
  47. Error_manager dispatch_step();
  48. /*
  49. * 回退调度
  50. */
  51. Error_manager back_dispatch_step();
  52. /*
  53. * 车位占用确认
  54. */
  55. Error_manager confirm_space_step();
  56. /*
  57. * 初始化 接收到的消息
  58. */
  59. void reset_msg();
  60. virtual void publish_step_status();
  61. protected:
  62. message::Locate_information m_locate_info;
  63. //保存请求
  64. message::Parkspace_allocation_request_msg m_alloc_request_msg;
  65. message::Measure_request_msg m_measure_request_msg;
  66. message::Locate_information m_compare_location_data;
  67. message::Dispatch_request_msg m_dispatch_request_msg;
  68. message::Parkspace_confirm_alloc_request_msg m_confirm_request_msg;
  69. //停车请求发送过来的测量数据,终端位置的测量数据
  70. message::Store_command_response_msg m_command_response_msg; //发送给终端的停车反馈
  71. message::Measure_response_msg m_measure_response_msg; //测量模块的测量数据
  72. message::Parkspace_allocation_response_msg m_parcspace_alloc_response_msg; //分配的车位数据
  73. message::Dispatch_response_msg m_dispatch_response_msg; //调度模块的反馈数据
  74. private:
  75. message::Storing_process_statu_msg m_process_msg;
  76. };
  77. #endif //NNXX_TESTS_STOREPROCESS_H