| | |
| | | } |
| | | } |
| | | } |
| | | }else {//跑库位 |
| | | } else if (shuttleProtocol.getMoveType() == 1) {//跑库位 |
| | | Integer xCurrent = shuttleProtocol.getXCurrent(); |
| | | if (xCurrent > shuttleProtocol.getXTarget()) {//当X值大于X目标值,进行归零且Y方向+1 |
| | | shuttleProtocol.setXCurrent(shuttleProtocol.getXStart()); |
| | |
| | | shuttleProtocol.setXCurrent(shuttleProtocol.getXCurrent() + 1); |
| | | } |
| | | } |
| | | } else if (shuttleProtocol.getMoveType() == 2) {//循环跑 |
| | | Integer xCurrent = shuttleProtocol.getXCurrent(); |
| | | Integer yCurrent = shuttleProtocol.getYCurrent(); |
| | | |
| | | String locNo = Utils.getLocNo(xCurrent, yCurrent, lev); |
| | | //调度去目标位置 |
| | | if (shuttleProtocol.getCurrentLocNo().equals(locNo)) { |
| | | if (yCurrent.equals(shuttleProtocol.getYStart())) { |
| | | shuttleProtocol.setYCurrent(shuttleProtocol.getYTarget());//小车和目标位置一致,切换库位 |
| | | }else { |
| | | shuttleProtocol.setYCurrent(shuttleProtocol.getYStart());//小车和目标位置一致,切换库位 |
| | | } |
| | | } else { |
| | | boolean result = shuttleDispatchUtils.dispatchShuttle(commonService.getWorkNo(3), locNo); |
| | | if (result) {//调度成功 |
| | | if (yCurrent.equals(shuttleProtocol.getYStart())) { |
| | | shuttleProtocol.setYCurrent(shuttleProtocol.getYTarget());//切换库位 |
| | | }else { |
| | | shuttleProtocol.setYCurrent(shuttleProtocol.getYStart());//切换库位 |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |