StoreProcessTask.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. virtual message::Process_type get_process_type()const{return message::eStoring;}
  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 alloc_space_step();
  33. /*
  34. * 回退分配车位
  35. */
  36. Error_manager back_alloc_space_step();
  37. /*
  38. * 定位
  39. */
  40. Error_manager locate_step();
  41. /*
  42. * 回退定位
  43. */
  44. Error_manager back_locate_step();
  45. /*
  46. * 检验结果
  47. */
  48. Error_manager compare_step();
  49. /*
  50. * 回退检验
  51. */
  52. Error_manager back_compare_step();
  53. /*
  54. * 调度
  55. */
  56. Error_manager dispatch_step();
  57. /*
  58. * 回退调度
  59. */
  60. Error_manager back_dispatch_step();
  61. /*
  62. * 车位占用确认
  63. */
  64. Error_manager confirm_space_step();
  65. /*
  66. * 初始化 接收到的消息
  67. */
  68. void reset_msg();
  69. virtual void publish_step_status();
  70. protected:
  71. message::Locate_information m_locate_info;
  72. //保存请求
  73. message::Parkspace_allocation_request_msg m_alloc_request_msg;
  74. message::Measure_request_msg m_measure_request_msg;
  75. message::Locate_information m_compare_location_data;
  76. message::Dispatch_request_msg m_dispatch_request_msg;
  77. message::Parkspace_confirm_alloc_request_msg m_confirm_request_msg;
  78. //停车请求发送过来的测量数据,终端位置的测量数据
  79. message::Store_command_response_msg m_command_response_msg; //发送给终端的停车反馈
  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