// // Created by zx on 2020/7/7. // #ifndef NNXX_TESTS_STOREPROCESS_H #define NNXX_TESTS_STOREPROCESS_H #include #include #include "dispatch_excutor.h" #include "process_task.h" #include "measure_excutor.h" #include "process_message.pb.h" class StoreProcessTask :public Process_task{ public: StoreProcessTask(unsigned int command_id,message::Car_info car_info); virtual ~StoreProcessTask(); Error_manager init_task(message::Locate_information locate_info); // 获取任务类型 virtual message::Process_type get_process_type()const{return message::eStoring;} /* * 控制流程到下一步 */ virtual Error_manager next_step(); /* * 根据当前流程状态,修改状态消息 */ void updata_step_statu(message::Step_statu statu); protected: virtual void Main(); /* * 分配车位 */ Error_manager alloc_space_step(); /* * 回退分配车位 */ Error_manager back_alloc_space_step(); /* * 定位 */ Error_manager locate_step(); /* * 回退定位 */ Error_manager back_locate_step(); /* * 检验结果 */ Error_manager compare_step(); /* * 回退检验 */ Error_manager back_compare_step(); /* * 调度 */ Error_manager dispatch_step(); /* * 回退调度 */ Error_manager back_dispatch_step(); /* * 车位占用确认 */ Error_manager confirm_space_step(); /* * 初始化 接收到的消息 */ void reset_msg(); virtual void publish_step_status(); protected: message::Locate_information m_locate_info; //保存请求 message::Parkspace_allocation_request_msg m_alloc_request_msg; message::Measure_request_msg m_measure_request_msg; message::Locate_information m_compare_location_data; message::Dispatch_request_msg m_dispatch_request_msg; message::Parkspace_confirm_alloc_request_msg m_confirm_request_msg; //停车请求发送过来的测量数据,终端位置的测量数据 message::Store_command_response_msg m_command_response_msg; //发送给终端的停车反馈 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; //调度模块的反馈数据 private: message::Storing_process_statu_msg m_process_msg; }; #endif //NNXX_TESTS_STOREPROCESS_H