// // Created by zx on 2020/7/7. // #ifndef NNXX_TESTS_STOREPROCESS_H #define NNXX_TESTS_STOREPROCESS_H #include #include "dispatch_communicator.h" #include "TaskQueue/BaseTask.h" #include "Locate_communicator.h" #include "process_message.pb.h" class StoreProcessTask :public tq::BaseTask{ public: StoreProcessTask(unsigned int command_id); virtual ~StoreProcessTask(); Error_manager init_task(message::Command_info command_info, message::Locate_information locate_info,message::Car_info car_info); /* * 分配车位 */ Error_manager alloc_space(); protected: virtual void Main(); /* * 定位 */ Error_manager locate_step(); /* * 调度 */ Error_manager dispatch_step(); /* * 车位占用确认 */ Error_manager confirm_space_step(); /* * 车位解锁,当停车失败时需要车位解锁 */ Error_manager release_space_step(); /* * reset 进度信息 */ void reset_process_statu(); /* * 初始化 接收到的消息 */ void reset_recv_msg(); /* * 发布进度 */ static void publish_thread_func(StoreProcessTask* p_commander); void publish_step_status(); protected: message::Command_info m_command_info; unsigned int m_terminor_id; message::Car_info m_car_info; //当前流程的车辆标识(车牌号) //停车请求发送过来的测量数据,终端位置的测量数据 message::Locate_information m_locate_info; //以下的流程中产生的数据 message::Measure_response_msg m_measure_response_msg; //测量模块的测量数据 message::Parkspace_allocation_response_msg m_parcspace_alloc_response_msg; //分配的车位数据 message::Dispatch_response_msg m_dispatch_response_msg; //调度模块的反馈数据 std::mutex m_storing_statu_lock; message::Storing_process_statu_msg m_storing_process_statu_msg; //停车流程进度信息 private: std::thread* m_publish_statu_thread; //广播状态线程 Thread_condition m_publish_exit_condition; //发送的条件变量 }; #endif //NNXX_TESTS_STOREPROCESS_H