123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- //
- // Created by huli on 2021/3/16.
- //
- #ifndef NNXX_TESTS_PASSAGEWAY_TASK_H
- #define NNXX_TESTS_PASSAGEWAY_TASK_H
- #include "../error_code/error_code.h"
- #include "../task/task_command_manager.h"
- #include "../task/task_base.h"
- #include <mutex>
- #include "../tool/common_data.h"
- class Passageway_task:public Task_Base
- {
- public:
- //指令完成状态, 搬运器答复指令, 返回任务完成的情况
- enum Respons_status
- {
- RESPONS_WORKING = 0, //正常
- RESPONS_OVER = 1, //任务完成
- RESPONS_MINOR_ERROR = 100, //一般故障, 可恢复
- RESPONS_CRITICAL_ERROR = 101, //致命故障,不可恢复
- };
- //7号出口 转台方向
- enum Turntable_direction
- {
- TURNTABLE_DIRECTION_UNKNOWN = 0, //方向未知,
- TURNTABLE_DIRECTION_INSIDE = 1, //方向朝里,对接内门的小跑车
- TURNTABLE_DIRECTION_OUTSIDE = 2, //没车朝外,对接外门的出口
- };
- //出入口 门的开关状态
- enum Door_motion
- {
- DOOR_UNKNOWN = 0, //门的开关状态 未知, 或者工作到一半,正在工作中.
- DOOR_OPEN = 1, //开门
- DOOR_CLOSE = 2, //关门
- DOOR_ERROR = 3, //
- };
- Passageway_task();
- Passageway_task(const Passageway_task& other)= default;
- Passageway_task& operator =(const Passageway_task& other)= default;
- ~Passageway_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; //请求唯一码, 用作识别
- //请求的目标坐标和动作
- Door_motion m_request_inside_door_motion; //通道口 内门动作
- Door_motion m_request_outside_door_motion; //通道口 外门动作
- Turntable_direction m_request_turntable_direction; //通道口 转台方向
- //plc反馈给调度
- std::string m_respons_key; //应答的唯一码, 用作识别
- Respons_status m_respons_status; //指令完成状态, 搬运器答复指令, 返回任务完成的情况
- //答复的实际坐标和动作
- Door_motion m_respons_inside_door_motion; //通道口 内门动作
- Door_motion m_respons_outside_door_motion; //通道口 外门动作
- Turntable_direction m_respons_turntable_direction; //通道口 转台方向
- private:
- };
- #endif //NNXX_TESTS_PASSAGEWAY_TASK_H
|