| | |
| | | } |
| | | return null; |
| | | } |
| | | public boolean deviceDetection(RgvSlave.RgvStn inSta,Integer rgvNo) { |
| | | ArrayList<Integer> arrayList = new ArrayList<Integer>() {{ |
| | | add(1009); |
| | | add(1011); |
| | | add(1012); |
| | | add(1014); |
| | | add(1016); |
| | | }}; |
| | | try{ |
| | | |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, inSta.getDevpPlcId()); |
| | | ArrayList<Integer> listW = new ArrayList<Integer>(); |
| | | ArrayList<Integer> listL = new ArrayList<Integer>(); |
| | | for (Integer staNo : arrayList){ |
| | | StaProtocol staProtocol = devpThread.getStation().get(staNo); |
| | | if (staProtocol == null) { |
| | | RgvErrCache.updateRgvErr(rgvNo,staNo+"站点数据丢失"); |
| | | return false; |
| | | } |
| | | // 判断是否满足取货条件 |
| | | if (staProtocol.getWorkNo() != 0) { |
| | | if (!listW.contains(staProtocol.getWorkNo())) { |
| | | listW.add(staProtocol.getWorkNo()); |
| | | } |
| | | } |
| | | // 判断是否满足取货条件 |
| | | if (staProtocol.isLoading()) { |
| | | if (!listL.contains(staProtocol.getStaNo())) { |
| | | listL.add(staProtocol.getStaNo()); |
| | | } |
| | | } |
| | | } |
| | | if (listW.size()>=3){ |
| | | RgvErrCache.updateRgvErr(rgvNo,"等待1012拣选,防止堵塞"); |
| | | return false; |
| | | } |
| | | if (listL.size()>=3){ |
| | | RgvErrCache.updateRgvErr(rgvNo,"等待1012拣选,防止堵塞"); |
| | | return false; |
| | | } |
| | | } catch (Exception e){ |
| | | RgvErrCache.updateRgvErr(rgvNo,"1012检测异常:"+e.getMessage()); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | public boolean rgvOtherStatusEnable(RgvSlave slave) { |
| | | RgvProtocol rgvProtocolOther = RgvStatusCache.getRgvStatus(slave.getOtherId()); |
| | |
| | | if (targetPointConvert == null) { |
| | | return false; |
| | | } |
| | | if (targetPointConvert == 1009){ |
| | | if (!deviceDetection(rgvStn, rgvSlave.getId())){ |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | BasDevpPosition basDevpPositionSou = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", rgvStn.getStaNo())); |
| | | BasDevpPosition basDevpPositionEnd = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", targetPointConvert)); |