StoreProcessTask.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. #include "process_message.pb.h"
  11. class StoreProcessTask :public tq::BaseTask{
  12. public:
  13. StoreProcessTask(unsigned int command_id);
  14. virtual ~StoreProcessTask();
  15. Error_manager init_task(message::Command_info command_info,
  16. message::Locate_information locate_info,message::Car_info car_info);
  17. /*
  18. * 分配车位
  19. */
  20. Error_manager alloc_space();
  21. protected:
  22. virtual void Main();
  23. /*
  24. * 定位
  25. */
  26. Error_manager locate_step();
  27. /*
  28. * 调度
  29. */
  30. Error_manager dispatch_step();
  31. /*
  32. * 车位占用确认
  33. */
  34. Error_manager confirm_space_step();
  35. /*
  36. * 车位解锁,当停车失败时需要车位解锁
  37. */
  38. Error_manager release_space_step();
  39. /*
  40. * reset 进度信息
  41. */
  42. void reset_process_statu();
  43. /*
  44. * 初始化 接收到的消息
  45. */
  46. void reset_recv_msg();
  47. protected:
  48. message::Command_info m_command_info;
  49. unsigned int m_terminor_id;
  50. message::Car_info m_car_info; //当前流程的车辆标识(车牌号)
  51. //停车请求发送过来的测量数据,终端位置的测量数据
  52. message::Locate_information m_locate_info;
  53. //以下的流程中产生的数据
  54. message::Measure_response_msg m_measure_response_msg; //测量模块的测量数据
  55. message::Parkspace_allocation_response_msg m_parcspace_alloc_response_msg; //分配的车位数据
  56. message::Dispatch_response_msg m_dispatch_response_msg; //调度模块的反馈数据
  57. std::mutex m_storing_statu_lock;
  58. message::Storing_process_statu m_storing_process_statu; //停车流程进度信息
  59. };
  60. #endif //NNXX_TESTS_STOREPROCESS_H