// // Created by huli on 2020/10/20. // #ifndef NNXX_TESTS_CARRIER_TASK_H #define NNXX_TESTS_CARRIER_TASK_H #include "../error_code/error_code.h" #include "../task/task_command_manager.h" #include "../task/task_base.h" #include "../tool/common_data.h" #include class Carrier_task :public Task_Base { public: //指令完成状态, 搬运器答复指令, 返回任务完成的情况 enum Respons_status { RESPONS_WORKING = 0, //正常 RESPONS_OVER = 1, //任务完成 RESPONS_MINOR_ERROR = 100, //一般故障, 可恢复 RESPONS_CRITICAL_ERROR = 101, //致命故障,不可恢复 }; //小跑车的夹杆 enum Clamp_motion { E_CLAMP_NO_ACTION = 0, //无动作. E_CLAMP_TIGHT = 1, //夹紧夹杆 E_CLAMP_LOOSE = 2, //松开夹杆 }; //中跑车和平层轨道的对接 enum Joint_motion { E_JOINT_NO_ACTION = 0, //无动作. E_JOINT_HOLD_OUT = 1, //伸出对接,之后中跑车可以x轴移动,电梯不能Z轴移动 E_JOINT_TAKE_BACK = 2, //收回对接,之后中跑车固定在电梯上不能X轴移动,电梯可以Z轴移动 }; public: Carrier_task(); Carrier_task(const Carrier_task& other)= default; Carrier_task& operator =(const Carrier_task& other)= default; ~Carrier_task(); public://API functions public://get or set member variable protected://member functions public://member variable std::mutex m_lock; //锁 int m_step;//长流程细分为短流程, m_step 控制短流程的步骤 Common_data::Dispatch_process_type m_dispatch_process_type; //调度任务类型 //调度下发到plc std::string m_request_key; //请求唯一码, 用作识别 //请求的目标坐标和动作 float m_request_x; //搬运器坐标x轴, 中跑车控制横向移动 float m_request_y; //搬运器坐标y轴, 小跑车控制纵向移动 float m_request_z; //搬运器坐标z轴, 电梯控制上下移动 float m_request_y1; //搬运器坐标y1轴, 小跑车控制纵向移动(前轮抓杆) float m_request_y2; //搬运器坐标y2轴, 小跑车控制纵向移动(后轮抓杆) Clamp_motion m_request_clamp_motion; //小跑车夹车杆. 0=无动作,1=夹紧,2=松开 Joint_motion m_request_joint_motion_x; //电梯与X轴的横向轨道对接,0=无动作,1=进行对接, 2=松开对接 Joint_motion m_request_joint_motion_y; //小跑车与Y轴的横向轨道对接,0=无动作,1=进行对接, 2=松开对接 int m_request_space_id; //搬运器空间位置的id. int m_request_floor_id; //搬运器楼层位置的id. float m_request_wheelbase; //搬运器小跑车的抓车杆前后轮距. //plc反馈给调度 std::string m_respons_key; //应答的唯一码, 用作识别 Respons_status m_respons_status; //指令完成状态, 搬运器答复指令, 返回任务完成的情况 //答复的实际坐标和动作 float m_respons_x; //搬运器坐标x轴, 中跑车控制横向移动 float m_respons_y; //搬运器坐标y轴, 小跑车控制纵向移动 float m_respons_z; //搬运器坐标z轴, 电梯控制上下移动 float m_respons_y1; //搬运器坐标y1轴, 小跑车控制纵向移动(前轮抓杆) float m_respons_y2; //搬运器坐标y2轴, 小跑车控制纵向移动(后轮抓杆) Clamp_motion m_respons_clamp_motion; //小跑车夹车杆. 0=无动作,1=夹紧,2=松开 Joint_motion m_respons_joint_motion_x; //电梯与X轴的横向轨道对接,0=无动作,1=进行对接, 2=松开对接 Joint_motion m_respons_joint_motion_y; //小跑车与Y轴的横向轨道对接,0=无动作,1=进行对接, 2=松开对接 int m_respons_space_id; //搬运器空间位置的id. int m_respons_floor_id; //搬运器楼层位置的id. float m_respons_wheelbase; //搬运器小跑车的抓车杆前后轮距. private: }; #endif //NNXX_TESTS_CARRIER_TASK_H