| | |
| | | import com.zy.core.ThreadHandler; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.OutputQueue; |
| | | import com.zy.core.enums.ShuttleRunDirection; |
| | | import com.zy.core.enums.ShuttleStatusType; |
| | | import com.zy.core.enums.ShuttleTaskModeType; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.enums.*; |
| | | import com.zy.core.model.ShuttleSlave; |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.command.ShuttleAssignCommand; |
| | |
| | | if (null == shuttleProtocol) { |
| | | shuttleProtocol = new ShuttleProtocol(); |
| | | shuttleProtocol.setShuttleNo(slave.getId().shortValue()); |
| | | shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.IDLE); |
| | | } |
| | | |
| | | //----------读取四向穿梭车状态----------- |
| | |
| | | command.setRunDirection((short) (assignCommand.getTaskMode() - 4)); |
| | | command.setCommandEnd((short) 1); |
| | | break; |
| | | case 9://状态复位 |
| | | command.setCommandWord((short) 0); |
| | | //设置四向穿梭车为空闲状态 |
| | | shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.IDLE); |
| | | //任务号清零 |
| | | shuttleProtocol.setTaskNo((short) 0); |
| | | break; |
| | | default: |
| | | } |
| | | |
| | | command.setCommandEnd((short) 1); |
| | |
| | | } |
| | | //删除redis |
| | | redisUtil.del("wrk_no_" + map.get("wrk_no").toString()); |
| | | |
| | | //对主线程抛出等待确认状态waiting |
| | | shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.WAITING); |
| | | |
| | | News.info("四向穿梭车任务执行完成等待确认中,穿梭车号={},任务数据={}", shuttleProtocol.getShuttleNo(), JSON.toJSON(command)); |
| | | } |
| | | |
| | | } |