| | |
| | | break; |
| | | } |
| | | case 3: |
| | | // if (jarWrkMastExecuteGenerate2(jarSlave,sign)){ |
| | | // break; |
| | | // } |
| | | if (jarWrkMastExecuteGenerate2(jarSlave,sign)){ |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e){ |
| | |
| | | add(2); |
| | | }}); |
| | | for (BasJarMast basJarMast : basJarMastList){ |
| | | // 获取硫化罐信息 |
| | | JarThread jarThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getId()); |
| | | JarProtocol jarProtocol = jarThread.getJarProtocol(); |
| | | if (jarProtocol == null) { |
| | | return false; |
| | | JarSlave.StaStn staStn = null; |
| | | for (JarSlave.StaStn staStn1 : jarSlave.getJarInSta()){ |
| | | if (staStn1.getStaNo().equals(basJarMast.getEnterStaNo())){ |
| | | staStn = staStn1; |
| | | } |
| | | } |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | if (Cools.isEmpty(staStn)){ |
| | | continue; |
| | | } |
| | | //检测站点状态 |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, staStn.getDevpPlcId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(staStn.getStaNo()); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.getWorkNo()==basJarMast.getWrkNo().intValue()){ |
| | | |
| | | JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId()); |
| | | JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol(); |
| | | if (jarOtherProtocol == null) { |
| | | return false; |
| | | } |
| | | //检测RGV状态 |
| | | StaProtocol staProtocolRGV = devpThread.getStation().get(staStn.getRgvNo()); |
| | | if (staProtocolRGV == null) { |
| | | continue; |
| | | } else { |
| | | staProtocolRGV = staProtocolRGV.clone(); |
| | | } |
| | | if (staProtocolRGV.isRGV1() && !staProtocolRGV.isRGV2() && !staProtocolRGV.isRGV3() && !staProtocolRGV.isRGV4() && !staProtocolRGV.isRGV5() && !staProtocolRGV.isRGV6()){ |
| | | // 获取硫化罐信息 |
| | | JarThread jarThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getId()); |
| | | JarProtocol jarProtocol = jarThread.getJarProtocol(); |
| | | if (jarProtocol == null) { |
| | | return false; |
| | | } |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | |
| | | JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId()); |
| | | JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol(); |
| | | if (jarOtherProtocol == null) { |
| | | return false; |
| | | } |
| | | // if (jarOtherProtocol.modeType != JarModeType.AUTO){ |
| | | // continue; |
| | | // } |
| | | |
| | | BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo()); |
| | | if (Cools.isEmpty(basJar)){ |
| | | log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | | BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo()); |
| | | if (Cools.isEmpty(basJar)){ |
| | | log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | | |
| | | //门作业 无 |
| | | //自动、空闲、右门关闭、 Other左门关闭 |
| | | if (jarProtocol.isAutoing() && !jarProtocol.isRightDoor() && jarProtocol.jarErr==0 |
| | | && jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0 |
| | | && !jarOtherProtocol.isLeftDoor() && jarOtherProtocol.leftDoorOpen==0 && jarOtherProtocol.leftDoorClose==0){ |
| | | if (jarProtocol.statusType == JarStatusType.IDLE && !jarProtocol.isLeftDoor() && basJarMast.getStatus()==0){ |
| | | //生成开门任务 OpenTheDoor |
| | | if (!jarWrkMastExecuteGenerateExecute(basJar,basJarMast,new int[]{basJar.getEnterSteNo(),basJar.getEnterRgvId(),1,1})){ |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(basJarMast)); |
| | | //门作业 无 |
| | | //自动、空闲、右门关闭、 Other左门关闭 |
| | | if (jarProtocol.isAutoing() && !jarProtocol.isRightDoor() && jarProtocol.jarErr==0 |
| | | && jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0 |
| | | && !jarOtherProtocol.isLeftDoor() && jarOtherProtocol.leftDoorOpen==0 && jarOtherProtocol.leftDoorClose==0){ |
| | | if (jarProtocol.statusType == JarStatusType.IDLE && !jarProtocol.isLeftDoor() && basJarMast.getStatus()==0){ |
| | | //生成开门任务 OpenTheDoor |
| | | if (!jarWrkMastExecuteGenerateExecute(basJar,basJarMast,new int[]{basJar.getEnterSteNo(),basJar.getEnterRgvId(),1,1})){ |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(basJarMast)); |
| | | } |
| | | return true; |
| | | } else if (jarProtocol.statusType == JarStatusType.MOVING && jarProtocol.isLeftDoor()){ |
| | | //生成入硫化罐任务 |
| | | if (!jarWrkMastExecuteGenerateExecute(basJar,basJarMast,new int[]{basJar.getEnterSteNo(),basJar.getEnterRgvId(),5,1})){ |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(basJarMast)); |
| | | } |
| | | return true; |
| | | } else if (jarProtocol.statusType == JarStatusType.IDLE && jarProtocol.isLeftDoor()){ |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》硫化罐空闲但是门未关===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(basJarMast)); |
| | | } |
| | | } |
| | | return true; |
| | | } else if (jarProtocol.statusType == JarStatusType.MOVING && jarProtocol.isLeftDoor()){ |
| | | //生成入硫化罐任务 |
| | | if (!jarWrkMastExecuteGenerateExecute(basJar,basJarMast,new int[]{basJar.getEnterSteNo(),basJar.getEnterRgvId(),5,1})){ |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(basJarMast)); |
| | | } |
| | | return true; |
| | | } else if (jarProtocol.statusType == JarStatusType.IDLE && jarProtocol.isLeftDoor()){ |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》硫化罐空闲但是门未关===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(basJarMast)); |
| | | return false; |
| | | } else { |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》RGV不满足条件,等待===》异常数据:BasJar:"+ JSON.toJSONString(staProtocolRGV)+";BasJarMast:"+JSON.toJSONString(basJarMast)); |
| | | return false; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | } catch (Exception e){ |
| | | log.error("{}号硫化罐JarWrkMastExecute任务创建异常,异常原因={}",jarSlave.getId(),e.getMessage()); |
| | | } |