| | |
| | | */ |
| | | @Data |
| | | public class TaskProtocol { |
| | | private volatile String taskNoDirection; // 任务号(主属性) |
| | | private volatile Long taskNo; // 任务号(主属性) |
| | | private volatile Long targetPosition = 0L; // 目标位置 |
| | | private volatile Long currentPosition = 0L; // 当前位置 |
| | | |
| | | private volatile int isRunning = 0; // 运行状态 0:初始 1:等待执行 2:执行中 3:执行中断 4:完结 |
| | | |
| | | private volatile int taskStatus = 0; //作业模式 0:行走 1:取 2:放 |
| | | |
| | | private volatile boolean direction; // 执行方向(面朝轨道 定位值左小右大) true:左 false:右 |
| | | |
| | | public TaskProtocol(){} |
| | | |
| | | public TaskProtocol(Long taskNo, Long targetPosition, Long currentPosition, int isRunning, int taskStatus) { |
| | | public TaskProtocol(Long taskNo, Long targetPosition, int isRunning, int taskStatus, boolean direction) { |
| | | this.taskNo = taskNo; |
| | | this.targetPosition = targetPosition; |
| | | this.currentPosition = currentPosition; |
| | | this.isRunning = isRunning; |
| | | this.taskStatus = taskStatus; |
| | | this.direction = direction; |
| | | } |
| | | |
| | | public TaskProtocol(TaskProtocol taskProtocol) { |
| | | this.taskNo = taskProtocol.getTaskNo(); |
| | | this.targetPosition = taskProtocol.getTargetPosition(); |
| | | this.taskStatus = taskProtocol.getTaskStatus(); |
| | | this.direction = taskProtocol.direction; |
| | | } |
| | | |
| | | |
| | | public String gettaskNoDirection$(Long taskNo,int taskStatus){ |
| | | String taskStatusStr = "Walk"; |
| | | switch (taskStatus){ |
| | | case 1: |
| | | taskStatusStr = "Tack"; |
| | | case 2: |
| | | taskStatusStr = "Put"; |
| | | } |
| | | return taskNo+"_"+taskStatusStr; |
| | | } |
| | | } |