| | |
| | | shuttleProtocol.setStatusSum(jsonObject.getObject("statusSum", NyShuttleProtocol.StatusSumClass.class)); |
| | | //非自动状态时间计时 |
| | | shuttleProtocol.setErrTime(jsonObject.getInteger("errTime")); |
| | | //最近一次在线时间 |
| | | shuttleProtocol.setLastOnlineTime(System.currentTimeMillis()); |
| | | |
| | | //小车处于运行中,将标记置为false |
| | | if (shuttleProtocol.getFree() == 0) { |
| | |
| | | shuttleProtocol.setXCurrent(shuttleProtocol.getXCurrent() + 1); |
| | | } |
| | | } |
| | | } else if (shuttleProtocol.getMoveType() == 2) {//循环跑 |
| | | } else if (shuttleProtocol.getMoveType() == 2) {//母轨道循环跑 |
| | | Integer xCurrent = shuttleProtocol.getXCurrent(); |
| | | Integer yCurrent = shuttleProtocol.getYCurrent(); |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | } else if (shuttleProtocol.getMoveType() == 3) {//子轨道循环跑 |
| | | Integer xCurrent = shuttleProtocol.getXCurrent(); |
| | | Integer yCurrent = shuttleProtocol.getYCurrent(); |
| | | |
| | | String locNo = Utils.getLocNo(xCurrent, yCurrent, lev); |
| | | //调度去目标位置 |
| | | if (shuttleProtocol.getCurrentLocNo().equals(locNo)) { |
| | | if (xCurrent.equals(shuttleProtocol.getXStart())) { |
| | | shuttleProtocol.setXCurrent(shuttleProtocol.getXTarget());//小车和目标位置一致,切换库位 |
| | | }else { |
| | | shuttleProtocol.setXCurrent(shuttleProtocol.getXStart());//小车和目标位置一致,切换库位 |
| | | } |
| | | } else { |
| | | boolean result = shuttleDispatchUtils.dispatchShuttle(commonService.getWorkNo(3), locNo); |
| | | if (result) {//调度成功 |
| | | if (xCurrent.equals(shuttleProtocol.getXStart())) { |
| | | shuttleProtocol.setXCurrent(shuttleProtocol.getXTarget());//切换库位 |
| | | }else { |
| | | shuttleProtocol.setXCurrent(shuttleProtocol.getXStart());//切换库位 |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |