| | |
| | | */ |
| | | public synchronized void crnMove() { |
| | | for (CrnSlave crn : slaveProperties.getCrn()) { |
| | | if (crn.getId() == 1) { |
| | | continue; |
| | | } |
| | | |
| | | // 获取堆垛机信息 |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId()); |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | |
| | | if (null == waitWrkMast) { |
| | | News.error(""+mark+" - 1"+" - 10"+" - {}库位异常,未检索到相应工作档!", shallowLocNo); |
| | | } else { |
| | | waitWrkMast.setIoPri(15D); |
| | | waitWrkMast.setModiTime(new Date()); |
| | | if (wrkMastMapper.updateById(waitWrkMast) == 0) { |
| | | News.error(""+mark+" - 1"+" - 11"+" - 调整工作档优先级失败!工作号={}", waitWrkMast.getWrkNo()); |
| | | if (waitWrkMast.getWrkSts() != 14 && waitWrkMast.getIoType() > 100) { |
| | | waitWrkMast.setIoPri(15D); |
| | | waitWrkMast.setModiTime(new Date()); |
| | | if (wrkMastMapper.updateById(waitWrkMast) == 0) { |
| | | News.error(""+mark+" - 1"+" - 11"+" - 调整工作档优先级失败!工作号={}", waitWrkMast.getWrkNo()); |
| | | } |
| | | continue; |
| | | } |
| | | continue; |
| | | } |
| | | |
| | | } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("D")) { |
| | |
| | | |
| | | if (crnProtocol.getCrnNo() == 1) { |
| | | //判断堆垛机和当前任务是否处于一个巷道 |
| | | if (Utils.getLaneByLocNo(wrkMast.getLocNo()) != crnProtocol.getCrnLane()) { |
| | | if (Utils.getLaneByLocNo(wrkMast.getSourceLocNo()) != crnProtocol.getCrnLane()) { |
| | | //判断堆垛机所在巷道是否存在其他任务,如存在则优先执行 |
| | | List<WrkMast> currentWrkMasts = wrkMastService.selectLaneWrkMast(crnProtocol.getCrnLane(), false); |
| | | if (!currentWrkMasts.isEmpty()) { |
| | |
| | | ArrayList<Integer> list = new ArrayList<Integer>(){{add(2003);add(2002);}}; |
| | | for (Integer staNo : list) { |
| | | Integer devpId = null; |
| | | Integer rgvStaNoDevpId = null; |
| | | Integer rgvStaNo = null; |
| | | if (staNo == 2003) { |
| | | devpId = 1; |
| | | rgvStaNo = 2002; |
| | | rgvStaNoDevpId = 2; |
| | | }else { |
| | | devpId = 2; |
| | | rgvStaNo = 2003; |
| | | rgvStaNoDevpId = 1; |
| | | } |
| | | |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devpId); |
| | |
| | | |
| | | if (staProtocol.isAutoing() |
| | | && staProtocol.isLoading() |
| | | // && staProtocol.isInEnable() |
| | | && staProtocol.isInEnable() |
| | | && staProtocol.getWorkNo() > 0 |
| | | ) { |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>() |
| | |
| | | } |
| | | |
| | | if (wrkMast.getWrkSts() == 201) { |
| | | continue; |
| | | } |
| | | |
| | | SiemensDevpThread devpThread2 = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, rgvStaNoDevpId); |
| | | if (devpThread2 == null) { |
| | | continue; |
| | | } |
| | | StaProtocol staProtocolRgvStaNo = devpThread2.getStation().get(rgvStaNo); |
| | | if (staProtocolRgvStaNo == null) { |
| | | continue; |
| | | } |
| | | |
| | | if (!staProtocolRgvStaNo.isAutoing()) { |
| | | continue; |
| | | } |
| | | |
| | | if (staProtocolRgvStaNo.isLoading()) { |
| | | continue; |
| | | } |
| | | |
| | | // 获取RGV信息 |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, 1); |
| | | if (rgvThread == null) { |
| | | continue; |
| | | } |
| | | |
| | | RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | if (rgvProtocol == null) { |
| | | continue; |
| | | } |
| | | |
| | | if (rgvProtocol.statusType1 != RgvStatusType.IDLE && rgvProtocol.getTaskNo1() != 0) { |
| | | continue; |
| | | } |
| | | |
| | | Object object = redisUtil.get(RedisConstantType.RGV_MOVE_LOCK + wrkMast.getWrkNo()); |
| | | if (object != null) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | wrkMast.setWrkSts(201L);//201.RGV搬运中 |
| | | wrkMast.setModiTime(new Date()); |
| | | wrkMastService.updateById(wrkMast); |
| | | redisUtil.set(RedisConstantType.RGV_MOVE_LOCK + wrkMast.getWrkNo(), "lock", 60 * 60); |
| | | } |
| | | } |
| | | } |
| | |
| | | continue; |
| | | } |
| | | |
| | | if (wrkMast.getWrkSts() != 201) { |
| | | continue; |
| | | } |
| | | |
| | | Integer devpId = null; |
| | | Integer devpStaNo = null; |
| | | String locNo = null; |