| | |
| | | private static final int[][] execute = new int[][]{{1,4},{2,4},{3,4},{4,4},{5,6},{6,6},{7,4},{8,4},{9,3},{10,4},{11,4}}; |
| | | |
| | | private static final Integer jarMaxLoc = 7; |
| | | private static final Float jarTemperature = 80F; |
| | | private static final Float jarTemperature = 50F; |
| | | @Autowired |
| | | private CommonService commonService; |
| | | @Autowired |
| | |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getId(),2)!=0){ |
| | | break; |
| | | } |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),3)!=0){ |
| | | BasJar basJar = basJarMapper.selectById(jarSlave.getId()); |
| | | int count = basJarMastService.selectCount(new EntityWrapper<BasJarMast>().eq("jar_regin", basJar.getRegion()).lt("status", 17).gt("status", 11)); |
| | | if (count>0){ |
| | | break; |
| | | } |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),3)!=0){ |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),3)==7){ |
| | | JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId()); |
| | | JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol(); |
| | | if (jarOtherProtocol == null) { |
| | | break; |
| | | } |
| | | if (jarOtherProtocol.getJarTemperature()>jarTemperature){ |
| | | log.info("{}号硫化罐查询设备温度过高,等待降温....先执行入罐任务!!!",jarOtherProtocol.getJarNo()); |
| | | } else { |
| | | if (basJarMastService.getJarMastByJarIdCount(jarSlave.getId())>0){ |
| | | log.info("{}号硫化罐查询设备温度过高,先执行了入罐任务,执行完毕再进行冷却!!!",jarOtherProtocol.getJarNo()); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (basJarMastService.getJarMastByJarIdCount(jarSlave.getId())>=jarMaxLoc*2){ |
| | | break; |
| | |
| | | return false; |
| | | } |
| | | |
| | | int count = basJarMastService.selectCount(new EntityWrapper<BasJarMast>().eq("jar_regin", basJar.getRegion()).lt("status", 17).gt("status", 11)); |
| | | if (count>0){ |
| | | return false; |
| | | } |
| | | |
| | | //门作业 无 |
| | | //自动、空闲、右门关闭、 Other左门关闭 |
| | | if (jarProtocol.isAutoing() && jarProtocol.jarErr==0 |
| | |
| | | if (basJarMastList.size() != jarMaxLoc){ |
| | | return false; |
| | | } |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=0&&(basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=7)){ |
| | | return false; |
| | | } |
| | | // if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=0 |
| | | // && basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=7 |
| | | // && basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=14){ |
| | | // return false; |
| | | // } |
| | | |
| | | BasJarMast basJarMastSign = basJarMastList.get(0); |
| | | if (Cools.isEmpty(basJarMastSign)){ |
| | |
| | | if (basJarMastList10.size()==jarMaxLoc){ |
| | | return false; |
| | | } |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),4)!=0){ |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),4)!=0 && basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),4)!=7){ |
| | | return false; |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(basJar)){ |
| | | log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | | |
| | | //临时 |
| | | if (basJar.getJarCode()==1){ |
| | | JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId()); |
| | | JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol(); |
| | | if (jarOtherProtocol == null) { |
| | | return false; |
| | | } |
| | | |
| | | if (!jarOtherProtocol.isAutoing() || jarOtherProtocol.jarErr!=0 |
| | | || !jarOtherProtocol.isLeftDoor() || !jarOtherProtocol.isRightDoor() |
| | | || jarOtherProtocol.leftDoorOpen==1 || jarOtherProtocol.leftDoorClose==1 || jarOtherProtocol.rightDoorOpen==1 || jarOtherProtocol.rightDoorClose==1){ |
| | | log.error("{}号硫化罐查询设备不满足前往冷却池条件,代号2硫化罐门没开!!!",jarOtherProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //门作业 无 |
| | |
| | | if(basJarMastList.isEmpty()){ |
| | | if (wrkMastExecuteService.selectNoStartCharge(steSlave.getId())==0){ |
| | | if (wrkMastExecuteService.selectMoveStart(steSlave.getId())==0){ |
| | | continue; |
| | | boolean sign = true; |
| | | for (SteSlave.InStn inStn : steSlave.getSteInStn()){ |
| | | //检测站点状态 |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, inStn.getDevpPlcId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(inStn.getStaNo()); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.getWorkNo() > 0) { |
| | | // 获取硫化罐信息 |
| | | JarThread jarThread = (JarThread) SlaveConnection.get(SlaveType.Jar, inStn.getJarNo()); |
| | | JarProtocol jarProtocol = jarThread.getJarProtocol(); |
| | | if (jarProtocol == null) { |
| | | continue; |
| | | } |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | continue; |
| | | } |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | continue; |
| | | } |
| | | if (jarProtocol.getJarTemperature()>jarTemperature){ |
| | | continue; |
| | | } |
| | | sign = false; |
| | | } |
| | | } |
| | | if(sign){ |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | } |