| | |
| | | || (!rgvProtocol.getStatusType().equals(RgvStatusType.IDLE) && !rgvProtocol.getStatusType().equals(RgvStatusType.ROAM))) { |
| | | return false; |
| | | } |
| | | RgvProtocol rgvProtocolOther = RgvStatusCache.getRgvStatus(slave.getId()); |
| | | RgvTaskProtocol rgvTaskProtocolOther = RgvTaskCache.getRgvStatus(slave.getId()); |
| | | |
| | | if (rgvProtocolOther == null) { |
| | | return true; |
| | | } |
| | | if (rgvProtocolOther.statusEnable) { |
| | | if (rgvProtocolOther.getModeType().equals(RgvModeType.AUTO) |
| | | && rgvProtocolOther.getStatusType().equals(RgvStatusType.IDLE) |
| | | && rgvProtocolOther.getLoaded()==0) { |
| | | return false; |
| | | } |
| | | if (rgvProtocol.getLoaded()!=0) { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | public boolean rgvOtherIDLE(RgvSlave slave) { |
| | | public boolean rgvOtherIDLE(RgvSlave slave,Integer staNo) { |
| | | RgvProtocol rgvProtocol = RgvStatusCache.getRgvStatus(slave.getId()); |
| | | RgvTaskProtocol rgvTaskProtocol = RgvTaskCache.getRgvStatus(slave.getId()); |
| | | |
| | |
| | | return false; |
| | | } |
| | | RgvProtocol rgvProtocolOther = RgvStatusCache.getRgvStatus(slave.getOtherId()); |
| | | RgvTaskProtocol rgvTaskProtocolOther = RgvTaskCache.getRgvStatus(slave.getOtherId()); |
| | | |
| | | if (rgvProtocolOther == null) { |
| | | return true; |
| | | } |
| | | if (rgvProtocolOther.statusEnable) { |
| | | if (rgvProtocolOther.getModeType().equals(RgvModeType.AUTO) |
| | | && rgvProtocolOther.getStatusType().equals(RgvStatusType.IDLE) |
| | | && rgvProtocolOther.getLoaded()==0) { |
| | | BasDevpPosition basDevpPosition = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", staNo)); |
| | | if (Math.abs(basDevpPosition.getPlcPosition()-rgvProtocol.getRgvPos()) |
| | | >= |
| | | Math.abs(basDevpPosition.getPlcPosition()-rgvProtocolOther.getRgvPos())){ |
| | | return false; |
| | | } |
| | | } |
| | |
| | | for (RgvSlave.RgvStn inSta : rgvSlave.getRgvInSta()) { |
| | | TaskWrk taskWrk = deviceDetection(inSta); |
| | | if (taskWrk != null) { |
| | | if (taskWrk.getTaskNo().equals(taskNoNow)) continue; |
| | | if (taskWrk.getWrkNo().toString().equals(taskNoNow)) continue; |
| | | taskWrkList.add(taskWrk); |
| | | staList.add(inSta.getStaNo()); |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (!sign){ |
| | | if (!sign && belongToRange.size()==1){ |
| | | if (rgvOtherIDLEOther(rgvSlave)){ |
| | | if (!rgvOtherIDLE(rgvSlave)){ |
| | | if (!rgvOtherIDLE(rgvSlave,belongToRange.get(0))){ |
| | | sign=true; |
| | | } |
| | | } |
| | |
| | | BasDevpPosition basDevpPositionSou = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", rgvStn.getStaNo())); |
| | | BasDevpPosition basDevpPositionEnd = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", targetPointConvert)); |
| | | //执行 |
| | | issuedTake.setTaskNo(Long.valueOf(taskWrk.getTaskNo())); |
| | | issuedTake.setTaskNo(Long.valueOf(taskWrk.getWrkNo())); |
| | | issuedTake.setTaskStatus(2); |
| | | issuedTake.setTaskNoDirection(issuedTake.gettaskNoDirection$(issuedTake.getTaskNo(), issuedTake.getTaskStatus())); |
| | | issuedTake.setTargetPosition(basDevpPositionSou.getPlcPosition()); |
| | |
| | | issuedTake.setDirection(basDevpPositionSou.getRgvSign()==1); |
| | | |
| | | |
| | | issuedPut.setTaskNo(Long.valueOf(taskWrk.getTaskNo())); |
| | | issuedPut.setTaskNo(Long.valueOf(taskWrk.getWrkNo())); |
| | | issuedPut.setTaskStatus(3); |
| | | issuedPut.setTaskNoDirection(issuedPut.gettaskNoDirection$(issuedPut.getTaskNo(), issuedPut.getTaskStatus())); |
| | | issuedPut.setTargetPosition(basDevpPositionEnd.getPlcPosition()); |