StoreProcessTask.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 "TaskQueue/BaseTask.h"
  9. #include "Locate_communicator.h"
  10. class StoreProcessTask :public tq::BaseTask{
  11. public:
  12. StoreProcessTask();
  13. virtual ~StoreProcessTask();
  14. Error_manager init_task(unsigned int command_id, unsigned int terminor_id,
  15. message::Locate_information locate_info,message::Car_info car_info);
  16. /*
  17. * 分配车位
  18. */
  19. Error_manager alloc_space();
  20. protected:
  21. virtual void Main();
  22. /*
  23. * 定位
  24. */
  25. Error_manager locate_step();
  26. /*
  27. * 调度
  28. */
  29. Error_manager dispatch_step();
  30. /*
  31. * 车位占用确认
  32. */
  33. Error_manager confirm_space_step();
  34. /*
  35. * 车位解锁,当停车失败时需要车位解锁
  36. */
  37. Error_manager release_space_step();
  38. protected:
  39. unsigned int m_command_id;
  40. unsigned int m_terminor_id;
  41. message::Car_info m_car_info; //当前流程的车辆标识(车牌号)
  42. //停车请求发送过来的测量数据,终端位置的测量数据
  43. message::Locate_information m_locate_info;
  44. //以下的流程中产生的数据
  45. message::Measure_response_msg m_measure_response_msg; //测量模块的测量数据
  46. message::Parkspace_allocation_response_msg m_parcspace_alloc_response_msg; //分配的车位数据
  47. message::Dispatch_response_msg m_dispatch_response_msg; //调度模块的反馈数据
  48. public:
  49. bool mb_completed;
  50. };
  51. #endif //NNXX_TESTS_STOREPROCESS_H