| | |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.mapper.*; |
| | |
| | | import com.zy.core.model.command.LedCommand; |
| | | import com.zy.core.model.command.RgvCommand; |
| | | import com.zy.core.model.cpmmandParam.CrnCommandParam; |
| | | import com.zy.core.model.protocol.CrnProtocol; |
| | | import com.zy.core.model.protocol.JarProtocol; |
| | | import com.zy.core.model.protocol.RgvProtocol; |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.model.protocol.*; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | import springfox.documentation.spring.web.json.Json; |
| | | |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | |
| | | private WrkMastSplitTwinService wrkMastSplitTwinService; |
| | | @Autowired |
| | | private BasJarMastService basJarMastService; |
| | | @Autowired |
| | | private WrkMastExecuteService wrkMastExecuteService; |
| | | @Autowired |
| | | private BasJarService basJarService; |
| | | @Autowired |
| | | private BasJarMapper basJarMapper; |
| | | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * Jar任务创建 |
| | | * Jar任务创建 //完成 |
| | | */ |
| | | public synchronized void jarGenerateWrkMastSta() { |
| | | public synchronized void jarMastGenerate() { |
| | | for (JarSlave jarSlave : slaveProperties.getJar()) { |
| | | try{ |
| | | Integer count = basJarMastService.getJarMastByJarIdCount(jarSlave.getId().longValue()); |
| | | if (count>=7){ |
| | | if (wrkMastExecuteService.getWrkMastByJarIdCount(jarSlave.getId())!=0){ |
| | | continue; |
| | | } |
| | | BasJarMast jarMastByJarIdMax = basJarMastService.getJarMastByJarIdMax(jarSlave.getId().longValue()); |
| | | if (!Cools.isEmpty(jarMastByJarIdMax) && jarMastByJarIdMax.getJarLocDigit()==7){ |
| | | for(JarSlave.StaStn staStn : jarSlave.getJarInSta()){ |
| | | // 获取硫化罐入库站信息 |
| | | 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()!=0){ |
| | | try{ |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getId(),2)!=0){ |
| | | break; |
| | | } |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),3)!=0){ |
| | | break; |
| | | } |
| | | if (basJarMastService.getJarMastByJarIdCount(jarSlave.getId())>=14){ |
| | | break; |
| | | } |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getId(),0,9)>=7){ |
| | | break; |
| | | } |
| | | if (!Objects.equals |
| | | ( |
| | | basJarMastService.selectJarMastOperation(jarSlave.getId(), 0, 4) |
| | | , |
| | | basJarMastService.selectJarMastOperation(jarSlave.getId(), 0, 9) |
| | | ) |
| | | ){ |
| | | break; |
| | | } |
| | | BasJarMast jarMastByJarIdMax = basJarMastService.getJarMastByJarIdMax(jarSlave.getId(),0,4); |
| | | int jarLocDigit = 0; |
| | | if (Cools.isEmpty(jarMastByJarIdMax)){ |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getId(),0,4)!=0){ |
| | | break; |
| | | } |
| | | jarLocDigit = 1; |
| | | } else if (jarMastByJarIdMax.getJarLocDigit()<7){ |
| | | jarLocDigit = jarMastByJarIdMax.getJarLocDigit()+1; |
| | | } else { |
| | | continue; |
| | | } |
| | | WrkMast wrkMast = wrkMastMapper.selectById(staProtocol.getWorkNo()); |
| | | if (Cools.isEmpty(wrkMast) || wrkMast.getWrkSts()!=2){ |
| | | continue; |
| | | } |
| | | BasJarMast basJarMast = basJarMastService.getJarMastByWrkNo(wrkMast.getWrkNo().longValue()); |
| | | if (!Cools.isEmpty(basJarMast)){ |
| | | continue; |
| | | } |
| | | WrkMastExecute wrkMastExecute = wrkMastExecuteService.getWrkMastByWrkNo(wrkMast.getWrkNo().longValue()); |
| | | if (!Cools.isEmpty(wrkMastExecute)){ |
| | | continue; |
| | | } |
| | | if (jarMastGenerateExecute(jarSlave,wrkMast,jarLocDigit,staStn.getStaNo())){ |
| | | return; |
| | | } |
| | | }catch (Exception e){ |
| | | log.error(jarSlave.getId()+"号小车复位线程报错!"+e); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } catch (Exception e){ |
| | | log.error("{}号硫化罐Jar任务创建异常,异常原因={}",jarSlave.getId(),e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Jar任务创建===》执行 //完成 |
| | | */ |
| | | public synchronized boolean jarMastGenerateExecute(JarSlave jarSlave,WrkMast wrkMast,Integer jarLocDigit,Integer staNo) { |
| | | try{ |
| | | // 获取硫化罐信息 |
| | | 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){ |
| | | // return false; |
| | | // } |
| | | |
| | | BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo()); |
| | | if (Cools.isEmpty(basJar)){ |
| | | log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | | |
| | | if (basJar.getJarMode()!=1 && basJar.getJarMode()!=0){ |
| | | 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.statusType == JarStatusType.MOVING){ |
| | | BasJarMast basJarMast = new BasJarMast(basJar, wrkMast, jarLocDigit); |
| | | basJarMast.setJarEnterStaNo(staNo);//入硫化罐站点 |
| | | basJarMastService.insert(basJarMast); |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | } catch (Exception e){ |
| | | log.error("{}号硫化罐生成BasJarMast初始任务失败,异常原因={},工作号={},硫化库位={}",jarSlave.getId(),e.getMessage(),wrkMast,jarLocDigit); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * Jar任务完成 //未完成 |
| | | */ |
| | | public synchronized boolean jarMastGenerateComplete(JarSlave jarSlave) { |
| | | try{ |
| | | // 获取堆垛机信息 |
| | | 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){ |
| | | return false; |
| | | } |
| | | |
| | | //自动、空闲、右门关闭、 |
| | | if (jarProtocol.isAutoing() && !jarProtocol.isRightDoor() && jarProtocol.jarErr==0 && !jarOtherProtocol.isLeftDoor() && jarOtherProtocol.jarErr==0){ |
| | | |
| | | } |
| | | } catch (Exception e){ |
| | | // log.error("堆垛机工位二完成等待确认异常,堆垛机号={},异常信息={},工位号={}",crn.getId(),e.getMessage(),2); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * JarWrkMastExecute任务创建 //完成 |
| | | */ |
| | | public synchronized void jarWrkMastExecuteGenerate(Integer sign) { |
| | | try{ |
| | | boolean[] signExecute = new boolean[]{false,false}; |
| | | switch (sign){ |
| | | case 1: |
| | | case 2: |
| | | case 3: |
| | | case 4: |
| | | signExecute = jarWrkMastExecuteGenerateJar(signExecute,sign);//硫化罐任务 |
| | | case 5: |
| | | signExecute = jarWrkMastExecuteGenerateBurial(signExecute, sign);//冷却槽取输送线 |
| | | default: |
| | | jarWrkMastExecuteGenerateSte(signExecute,sign);//小车移动 |
| | | } |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | public synchronized boolean[] jarWrkMastExecuteGenerateJar(boolean[] signExecute,Integer sign) { |
| | | for (JarSlave jarSlave : slaveProperties.getJar()) { |
| | | int i = jarSlave.getId()>2? 1:0; |
| | | try{ |
| | | if (wrkMastExecuteService.getWrkMastByJarIdCount(jarSlave.getId())!=0){ |
| | | continue; |
| | | } |
| | | jarGenerateWrkMastStaExecute(jarSlave); |
| | | }catch (Exception e){ |
| | | log.error(jarSlave.getId()+"号小车复位线程报错!"+e); |
| | | |
| | | // 获取硫化罐信息 |
| | | JarThread jarThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getId()); |
| | | JarProtocol jarProtocol = jarThread.getJarProtocol(); |
| | | if (jarProtocol == null) { |
| | | continue; |
| | | } |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | continue; |
| | | } |
| | | |
| | | JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId()); |
| | | JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol(); |
| | | if (jarOtherProtocol == null) { |
| | | continue; |
| | | } |
| | | // if (jarOtherProtocol.modeType != JarModeType.AUTO){ |
| | | // continue; |
| | | // } |
| | | |
| | | BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo()); |
| | | if (Cools.isEmpty(basJar)){ |
| | | log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo()); |
| | | continue; |
| | | } |
| | | //门作业 无 |
| | | //自动、空闲、右门关闭、 Other左门关闭 |
| | | if (jarProtocol.isAutoing() && jarProtocol.jarErr==0 |
| | | && jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0){ |
| | | switch (sign){ |
| | | case 0: |
| | | case 1: |
| | | if (jarWrkMastExecuteGenerate1(jarSlave,sign)){ |
| | | signExecute[i] = true; |
| | | break;//开门任务 生成入硫化罐任务 |
| | | } |
| | | case 2: |
| | | if (jarWrkMastExecuteGenerate2(jarSlave,sign)){ |
| | | signExecute[i] = true; |
| | | break;//关进料门 |
| | | } |
| | | case 3: |
| | | if (jarWrkMastExecuteGenerate3(jarSlave,sign)){ |
| | | signExecute[i] = true; |
| | | break;//开出料门 |
| | | } |
| | | case 4: |
| | | if (jarWrkMastExecuteGenerate4(jarSlave,sign)){ |
| | | signExecute[i] = true; |
| | | break;//出硫化罐 ===》 入冷却槽 |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e){ |
| | | log.error("{}号硫化罐JarWrkMastExecute任务创建异常,异常原因={}",jarSlave.getId(),e.getMessage()); |
| | | } |
| | | } |
| | | return signExecute; |
| | | } |
| | | |
| | | public synchronized boolean[] jarWrkMastExecuteGenerateBurial(boolean[] signExecute,Integer sign) { |
| | | for (JarSlave jarSlave : slaveProperties.getJar()) { |
| | | try{ |
| | | if (signExecute[jarSlave.getId()-5]){ |
| | | continue; |
| | | } |
| | | if (wrkMastExecuteService.getWrkMastByJarIdCount(jarSlave.getId())!=0){ |
| | | signExecute[jarSlave.getId()-5] = true; |
| | | continue; |
| | | } |
| | | |
| | | // 获取硫化罐信息 |
| | | JarThread jarThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getId()); |
| | | JarProtocol jarProtocol = jarThread.getJarProtocol(); |
| | | if (jarProtocol == null) { |
| | | signExecute[jarSlave.getId()-5] = true; |
| | | continue; |
| | | } |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | signExecute[jarSlave.getId()-5] = true; |
| | | continue; |
| | | } |
| | | |
| | | BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo()); |
| | | if (Cools.isEmpty(basJar)){ |
| | | log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo()); |
| | | continue; |
| | | } |
| | | //门作业 无 |
| | | //自动、空闲、右门关闭、 Other左门关闭 |
| | | if (jarProtocol.isAutoing() && jarProtocol.jarErr==0){ |
| | | switch (sign){ |
| | | case 5: |
| | | if (jarWrkMastExecuteGenerate5(jarSlave,sign)){ |
| | | signExecute[jarSlave.getId()-5] = true; |
| | | break;//出硫化罐 ===》 入冷却槽 |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e){ |
| | | log.error("{}号硫化罐JarWrkMastExecute任务创建异常,异常原因={}",jarSlave.getId(),e.getMessage()); |
| | | } |
| | | } |
| | | return signExecute; |
| | | } |
| | | |
| | | public synchronized boolean[] jarWrkMastExecuteGenerateSte(boolean[] signExecute,Integer sign) { |
| | | for (JarSlave jarSlave : slaveProperties.getJar()) { |
| | | try{ |
| | | if (signExecute[jarSlave.getId()-5]){ |
| | | continue; |
| | | } |
| | | if (wrkMastExecuteService.getWrkMastByJarIdCount(jarSlave.getId())!=0){ |
| | | continue; |
| | | } |
| | | |
| | | // 获取硫化罐信息 |
| | | JarThread jarThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getId()); |
| | | JarProtocol jarProtocol = jarThread.getJarProtocol(); |
| | | if (jarProtocol == null) { |
| | | continue; |
| | | } |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | continue; |
| | | } |
| | | |
| | | JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId()); |
| | | JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol(); |
| | | if (jarOtherProtocol == null) { |
| | | continue; |
| | | } |
| | | // if (jarOtherProtocol.modeType != JarModeType.AUTO){ |
| | | // continue; |
| | | // } |
| | | |
| | | BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo()); |
| | | if (Cools.isEmpty(basJar)){ |
| | | log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo()); |
| | | continue; |
| | | } |
| | | //门作业 无 |
| | | //自动、空闲、右门关闭、 Other左门关闭 |
| | | if (jarProtocol.isAutoing() && jarProtocol.jarErr==0 |
| | | && jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0){ |
| | | switch (sign){ |
| | | case 5: |
| | | if (jarWrkMastExecuteGenerate5(jarSlave,sign)){ |
| | | signExecute[jarSlave.getId()-5] = true; |
| | | break;//出硫化罐 ===》 入冷却槽 |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e){ |
| | | log.error("{}号硫化罐JarWrkMastExecute任务创建异常,异常原因={}",jarSlave.getId(),e.getMessage()); |
| | | } |
| | | } |
| | | return signExecute; |
| | | } |
| | | |
| | | /** |
| | | * Jar任务创建 执行 |
| | | * JarWrkMastExecute任务创建 //完成 |
| | | * 开门任务 |
| | | * 生成入硫化罐任务 |
| | | */ |
| | | public synchronized boolean jarGenerateWrkMastStaExecute(JarSlave jarSlave) { |
| | | public synchronized boolean jarWrkMastExecuteGenerate1(JarSlave jarSlave,Integer sign) { |
| | | try{ |
| | | // 获取堆垛机信息 |
| | | JarThread jarThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getId()); |
| | | JarProtocol jarProtocol = jarThread.getJarProtocol(); |
| | | if (jarProtocol == null) { |
| | | if (wrkMastExecuteService.getWrkMastByJarIdCount(jarSlave.getId())!=0){ |
| | | return false; |
| | | } |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{ |
| | | add(0); |
| | | add(2); |
| | | }}); |
| | | |
| | | //判断小车状态 |
| | | if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarInSte().get(0).getSteNo(),1)){ |
| | | 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){ |
| | | return false; |
| | | } |
| | | for (BasJarMast basJarMast : basJarMastList){ |
| | | JarSlave.StaStn staStn = null; |
| | | for (JarSlave.StaStn staStn1 : jarSlave.getJarInSta()){ |
| | | if (staStn1.getStaNo().equals(basJarMast.getEnterStaNo())){ |
| | | staStn = staStn1; |
| | | } |
| | | } |
| | | 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()){ |
| | | |
| | | //自动、空闲、右门关闭、 |
| | | if (jarProtocol.isAutoing() && !jarProtocol.isRightDoor() && jarProtocol.jarErr==0 && !jarOtherProtocol.isLeftDoor() && jarOtherProtocol.jarErr==0){ |
| | | //检测RGV状态 |
| | | StaProtocol staProtocolRGV = devpThread.getStation().get(staStn.getRgvNo()); |
| | | if (staProtocolRGV == null) { |
| | | continue; |
| | | } else { |
| | | staProtocolRGV = staProtocolRGV.clone(); |
| | | } |
| | | if (staProtocolRGV.rgvBoolean(1)){ |
| | | // 获取硫化罐信息 |
| | | 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; |
| | | } |
| | | |
| | | //门作业 无 |
| | | //自动、空闲、右门关闭、 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.isLeftDoor() && basJarMast.getStatus()==0){ |
| | | //生成开门任务 OpenTheDoor |
| | | if (!jarWrkMastExecuteGenerateExecute(basJar,basJarMast,basJar.getJarNo(),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.WAITING3 && jarProtocol.isLeftDoor()){ |
| | | //生成入硫化罐任务 |
| | | if (!jarWrkMastExecuteGenerateExecute(basJar,basJarMast,basJar.getJarNo(),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; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } catch (Exception e){ |
| | | // log.error("堆垛机工位二完成等待确认异常,堆垛机号={},异常信息={},工位号={}",crn.getId(),e.getMessage(),2); |
| | | log.error("{}号硫化罐JarWrkMastExecute任务创建异常,异常原因={}",jarSlave.getId(),e.getMessage()); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * Jar任务创建 执行 |
| | | * JarWrkMastExecute任务创建 //完成 |
| | | * 关进料门 |
| | | */ |
| | | public synchronized boolean jarGenerateWrkMastStaExecuteOne(JarSlave jarSlave) { |
| | | public synchronized boolean jarWrkMastExecuteGenerate2(JarSlave jarSlave,Integer sign) { |
| | | try{ |
| | | // 获取堆垛机信息 |
| | | JarThread jarThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getId()); |
| | | JarProtocol jarProtocol = jarThread.getJarProtocol(); |
| | | if (jarProtocol == null) { |
| | | if (wrkMastExecuteService.getWrkMastByJarIdCount(jarSlave.getId())!=0){ |
| | | return false; |
| | | } |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{ |
| | | add(4); |
| | | }}); |
| | | if (basJarMastList.size() != 7){ |
| | | return false; |
| | | } |
| | | |
| | | JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId()); |
| | | JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol(); |
| | | if (jarOtherProtocol == null) { |
| | | BasJarMast basJarMastSign = basJarMastList.get(0); |
| | | if (Cools.isEmpty(basJarMastSign)){ |
| | | return false; |
| | | } |
| | | if (jarOtherProtocol.modeType != JarModeType.AUTO){ |
| | | //判断小车状态 |
| | | if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarInSte().get(0).getSteNo(),1)){ |
| | | return false; |
| | | } |
| | | |
| | | //自动、空闲、右门关闭、 |
| | | if (jarProtocol.isAutoing() && !jarProtocol.isRightDoor() && jarProtocol.jarErr==0 && !jarOtherProtocol.isLeftDoor() && jarOtherProtocol.jarErr==0){ |
| | | JarSlave.RgvStn rgvStn = jarSlave.getJarInRgv().get(0); |
| | | |
| | | } |
| | | if (jarWrkMastExecuteGenerateRgvStatus(rgvStn.getRgvNo(),rgvStn.getDevpPlcId(),1)){ |
| | | // 获取硫化罐信息 |
| | | 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; |
| | | } |
| | | |
| | | } catch (Exception e){ |
| | | // log.error("堆垛机工位二完成等待确认异常,堆垛机号={},异常信息={},工位号={}",crn.getId(),e.getMessage(),2); |
| | | } |
| | | return false; |
| | | } |
| | | BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo()); |
| | | if (Cools.isEmpty(basJar)){ |
| | | log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | | if (basJar.getJarCount()!=7){ |
| | | log.error("{}号硫化罐查询设备库存数异常!!!库存待入数:{}",jarProtocol.getJarNo(),basJar.getJarCount()); |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * Jar任务创建 执行 |
| | | */ |
| | | public synchronized boolean jarGenerateWrkMastStaExecuteTwo(JarSlave jarSlave) { |
| | | try{ |
| | | // 获取堆垛机信息 |
| | | 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){ |
| | | return false; |
| | | } |
| | | |
| | | //自动、空闲、右门关闭、 |
| | | if (jarProtocol.isAutoing() && !jarProtocol.isRightDoor() && jarProtocol.jarErr==0 && !jarOtherProtocol.isLeftDoor() && jarOtherProtocol.jarErr==0){ |
| | | |
| | | } |
| | | |
| | | } catch (Exception e){ |
| | | // log.error("堆垛机工位二完成等待确认异常,堆垛机号={},异常信息={},工位号={}",crn.getId(),e.getMessage(),2); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * Jar任务执行 |
| | | */ |
| | | public synchronized void jarExecuteWrkMastSta() { |
| | | try{ |
| | | |
| | | }catch (Exception e){ |
| | | log.error("小车复位线程报错!"+e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Jar完成 |
| | | */ |
| | | public synchronized void jarCompleteWrkMastSta() { |
| | | try{ |
| | | |
| | | }catch (Exception e){ |
| | | log.error("小车复位线程报错!"+e); |
| | | } |
| | | } |
| | | |
| | | /* |
| | | * 小车取空板至工位任务 满取 |
| | | * */ |
| | | public synchronized boolean jarRgvTake1(Integer rgvId,WrkMastSta wrkMastSta){ |
| | | try{ |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | RgvCommand rgvCommand = new RgvCommand(); |
| | | rgvCommand.setRgvNo(rgvId); // RGV编号 |
| | | rgvCommand.setAckFinish2((short) 0); // 工位2任务完成确认位 |
| | | rgvCommand.setTaskNo2(wrkMastSta.getWrkNo().shortValue()); // 工位2工作号 |
| | | rgvCommand.setTaskMode2(RgvTaskModeType.FETCH_5); // 工位2任务模式: 满取 |
| | | rgvCommand.setSourceStaNo2(wrkMastSta.getStaStart().shortValue()); //工位2起点 |
| | | rgvCommand.setCommand((short) 2); //工位2任务确认 |
| | | if (!MessageQueue.offer(SlaveType.Rgv, rgvId, new Task(5, rgvCommand))) { |
| | | //step=2,工位1、2写任务; step=4,工位1写任务; step=5,工位2写任务 |
| | | log.error("RGV命令下发失败,RGV号={},任务数据={}", rgvId, JSON.toJSON(rgvCommand)); |
| | | //门作业 无 |
| | | if (jarProtocol.isAutoing() && jarProtocol.statusType == JarStatusType.WAITING3 && jarProtocol.jarErr==0 |
| | | && !jarProtocol.isRightDoor() && jarProtocol.isLeftDoor() |
| | | && jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0){ |
| | | //关进料门 |
| | | if (!jarWrkMastExecuteGenerateExecute(basJar,basJarMastSign,basJar.getJarNo(),new int[]{basJar.getEnterSteNo(),basJar.getEnterRgvId(),2,1})){ |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(basJarMastSign)); |
| | | } |
| | | return true; |
| | | } |
| | | return false; |
| | | } else { |
| | | return true; |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》RGV不满足条件,等待===》异常数据:BasJar:"+ JSON.toJSONString(rgvStn)+";BasJarMast:"+JSON.toJSONString(basJarMastSign)); |
| | | return false; |
| | | } |
| | | } catch (Exception e){ |
| | | return false; |
| | | log.error("{}号硫化罐JarWrkMastExecute任务创建异常,异常原因={}",jarSlave.getId(),e.getMessage()); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * JarWrkMastExecute任务创建 //完成 |
| | | * 开出料门 |
| | | */ |
| | | public synchronized boolean jarWrkMastExecuteGenerate3(JarSlave jarSlave,Integer sign) { |
| | | try{ |
| | | if (wrkMastExecuteService.getWrkMastByJarIdCount(jarSlave.getId())!=0){ |
| | | return false; |
| | | } |
| | | List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{ |
| | | add(6); |
| | | }}); |
| | | if (basJarMastList.size() != 7){ |
| | | return false; |
| | | } |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=0){ |
| | | return false; |
| | | } |
| | | |
| | | BasJarMast basJarMastSign = basJarMastList.get(0); |
| | | if (Cools.isEmpty(basJarMastSign)){ |
| | | return false; |
| | | } |
| | | //判断小车状态 |
| | | if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarInSte().get(0).getSteNo(),2)){ |
| | | return false; |
| | | } |
| | | |
| | | //判断RGV状态 |
| | | JarSlave.RgvStn rgvStn = jarSlave.getJarOutRgv().get(0); |
| | | |
| | | if (jarWrkMastExecuteGenerateRgvStatus(rgvStn.getRgvNo(),rgvStn.getDevpPlcId(),1)){ |
| | | // 获取硫化罐信息 |
| | | 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; |
| | | } |
| | | |
| | | BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo()); |
| | | if (Cools.isEmpty(basJar)){ |
| | | log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | | |
| | | //门作业 无 |
| | | if (jarProtocol.isAutoing() && jarProtocol.statusType == JarStatusType.WAITING2 && jarProtocol.jarErr==0 |
| | | && !jarProtocol.isLeftDoor() && !jarProtocol.isRightDoor() |
| | | && jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0){ |
| | | //开出料门 |
| | | if (!jarWrkMastExecuteGenerateExecute(basJar,basJarMastSign,basJar.getJarNo(),new int[]{basJar.getOutSteId(),basJar.getOutRgvId(),3,1})){ |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(basJarMastSign)); |
| | | } |
| | | return true; |
| | | } |
| | | return false; |
| | | } else { |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》RGV不满足条件,等待===》异常数据:BasJar:"+ JSON.toJSONString(rgvStn)+";BasJarMast:"+JSON.toJSONString(basJarMastSign)); |
| | | return false; |
| | | } |
| | | } catch (Exception e){ |
| | | log.error("{}号硫化罐JarWrkMastExecute任务创建异常,异常原因={}",jarSlave.getId(),e.getMessage()); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * JarWrkMastExecute任务创建 //完成 |
| | | * 出硫化罐 ===》 入冷却槽 |
| | | */ |
| | | public synchronized boolean jarWrkMastExecuteGenerate4(JarSlave jarSlave,Integer sign) { |
| | | try{ |
| | | if (wrkMastExecuteService.getWrkMastByJarIdCount(jarSlave.getId())!=0){ |
| | | return false; |
| | | } |
| | | List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{ |
| | | add(8); |
| | | }}); |
| | | if (basJarMastList.isEmpty()){ |
| | | return false; |
| | | } |
| | | |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),4)!=0){ |
| | | return false; |
| | | } |
| | | |
| | | BasJarMast jarMastByJarIdMin = basJarMastService.getJarMastByJarIdMax(jarSlave.getId(),8,8); |
| | | if (Cools.isEmpty(jarMastByJarIdMin)){ |
| | | return false; |
| | | } |
| | | //判断小车状态 |
| | | if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarOutSte().get(0).getSteNo(),2)){ |
| | | return false; |
| | | } |
| | | |
| | | //判断RGV状态 |
| | | JarSlave.RgvStn rgvStn = jarSlave.getJarOutRgv().get(0); |
| | | |
| | | if (jarWrkMastExecuteGenerateRgvStatus(rgvStn.getRgvNo(),rgvStn.getDevpPlcId(),1)){ |
| | | // 获取硫化罐信息 |
| | | 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; |
| | | } |
| | | |
| | | BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo()); |
| | | if (Cools.isEmpty(basJar)){ |
| | | log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | | |
| | | //门作业 无 |
| | | if (jarProtocol.isAutoing() && jarProtocol.statusType == JarStatusType.WAITING4 && jarProtocol.jarErr==0 |
| | | && !jarProtocol.isLeftDoor() && jarProtocol.isRightDoor() |
| | | && jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0){ |
| | | //关进料门 |
| | | if (!jarWrkMastExecuteGenerateExecute(basJar,jarMastByJarIdMin,basJar.getJarNo(),new int[]{basJar.getOutSteId(),basJar.getOutRgvId(),3,1})){ |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(jarMastByJarIdMin)); |
| | | } |
| | | return true; |
| | | } |
| | | return false; |
| | | } else { |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》RGV不满足条件,等待===》异常数据:BasJar:"+ JSON.toJSONString(rgvStn)+";BasJarMast:"+JSON.toJSONString(jarMastByJarIdMin)); |
| | | return false; |
| | | } |
| | | } catch (Exception e){ |
| | | log.error("{}号硫化罐JarWrkMastExecute任务创建异常,异常原因={}",jarSlave.getId(),e.getMessage()); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * JarWrkMastExecute任务创建 //完成 |
| | | * 冷却完成上输送线 |
| | | */ |
| | | public synchronized boolean jarWrkMastExecuteGenerate5(JarSlave jarSlave,Integer sign) { |
| | | try{ |
| | | if (wrkMastExecuteService.getWrkMastByJarIdCount(jarSlave.getId())!=0){ |
| | | return false; |
| | | } |
| | | List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{ |
| | | add(14);//冷却完成 |
| | | }}); |
| | | if (basJarMastList.isEmpty()){ |
| | | return false; |
| | | } |
| | | |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),7)!=0){ |
| | | return false; |
| | | } |
| | | |
| | | BasJarMast jarMastByJarIdMin = basJarMastService.getJarMastByJarIdMin(jarSlave.getId(),14,14); |
| | | if (Cools.isEmpty(jarMastByJarIdMin)){ |
| | | return false; |
| | | } |
| | | |
| | | //判断小车状态 |
| | | if (!jarWrkMastExecuteGenerateSteStatus(jarSlave.getJarOutSte().get(0).getSteNo(),2)){ |
| | | return false; |
| | | } |
| | | |
| | | //判断RGV状态 |
| | | JarSlave.RgvStn rgvStn = jarSlave.getJarOutRgv().get(0); |
| | | |
| | | if (jarWrkMastExecuteGenerateRgvStatus(rgvStn.getRgvNo(),rgvStn.getDevpPlcId(),1)){ |
| | | // 获取硫化罐信息 |
| | | 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; |
| | | } |
| | | |
| | | BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo()); |
| | | if (Cools.isEmpty(basJar)){ |
| | | log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | | |
| | | //门作业 无 |
| | | if (jarProtocol.isAutoing() && jarProtocol.jarErr==0){ |
| | | //关进料门 |
| | | if (!jarWrkMastExecuteGenerateExecute(basJar,jarMastByJarIdMin,basJar.getBurial(),new int[]{basJar.getOutSteId(),basJar.getOutRgvId(),3,1})){ |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(jarMastByJarIdMin)); |
| | | } |
| | | return true; |
| | | } |
| | | return false; |
| | | } else { |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》RGV不满足条件,等待===》异常数据:BasJar:"+ JSON.toJSONString(rgvStn)+";BasJarMast:"+JSON.toJSONString(jarMastByJarIdMin)); |
| | | return false; |
| | | } |
| | | } catch (Exception e){ |
| | | log.error("{}号硫化罐JarWrkMastExecute任务创建异常,异常原因={}",jarSlave.getId(),e.getMessage()); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 判断STE小车状态 //完成 |
| | | */ |
| | | public synchronized boolean jarWrkMastExecuteGenerateSteStatus(Integer steNo,Integer type) { |
| | | try{ |
| | | //判断小车状态 |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | if (steThread == null) { |
| | | return false; |
| | | } |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { |
| | | return false; |
| | | } |
| | | if (steProtocol.getMode() == 0) { |
| | | log.error(steNo + "号小车离线,无法操作"); |
| | | return false; |
| | | } |
| | | if (!steProtocol.getStatusType().equals(SteStatusType.IDLE)) { |
| | | log.error(steNo + "号小车不是空闲,无法操作"); |
| | | return false; |
| | | } |
| | | switch (type){ |
| | | case 1: |
| | | if (!steProtocol.getLocaType().equals(SteLocaType.POINT20)) { |
| | | log.error(steNo + "号小车不在A面平移车,无法操作"); |
| | | return false; |
| | | } |
| | | break; |
| | | case 2: |
| | | if (!steProtocol.getLocaType().equals(SteLocaType.POINT23)) { |
| | | log.error(steNo + "号小车不在B面平移车,无法操作"); |
| | | return false; |
| | | } |
| | | break; |
| | | case 3: |
| | | if (!steProtocol.getLocaType().equals(SteLocaType.POINT26) && !steProtocol.getLocaType().equals(SteLocaType.POINT25)) { |
| | | log.error(steNo + "号小车不在水槽B端,无法操作"); |
| | | return false; |
| | | } |
| | | break; |
| | | default: return false; |
| | | } |
| | | return true; |
| | | } catch (Exception e){ |
| | | log.error("{}号小车状态判断状态异常,异常原因={}",steNo,e.getMessage()); |
| | | } |
| | | return false; |
| | | } |
| | | /** |
| | | * 判断RGV小车状态 //完成 |
| | | */ |
| | | public synchronized boolean jarWrkMastExecuteGenerateRgvStatus(Integer rgvNo,Integer rgvPlcId,Integer type) { |
| | | try{ |
| | | //检测RGV状态 |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, rgvPlcId); |
| | | StaProtocol staProtocolRGV = devpThread.getStation().get(rgvNo); |
| | | if (staProtocolRGV == null) { |
| | | return false; |
| | | } else { |
| | | staProtocolRGV = staProtocolRGV.clone(); |
| | | } |
| | | if (staProtocolRGV == null) { |
| | | return false; |
| | | } |
| | | return staProtocolRGV.rgvBoolean(type); |
| | | } catch (Exception e){ |
| | | log.error("{}号RGV状态判断状态异常,异常原因={}",rgvNo,e.getMessage()); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * JarWrkMastExecute任务创建===>执行 //完成 |
| | | */ |
| | | public synchronized boolean jarWrkMastExecuteGenerateExecute(BasJar basJar,BasJarMast basJarMast,Integer id,int[] digit) { |
| | | try { |
| | | WrkMastExecute wrkMastExecute = new WrkMastExecute(basJarMast); |
| | | wrkMastExecute.setJarId(id); |
| | | wrkMastExecute.setSteId(digit[0]);//穿梭板ID |
| | | wrkMastExecute.setRgvId(digit[1]);//RGV ID |
| | | wrkMastExecute.setIoType(digit[2]);//任务类型 0: 未知 1: 开进料门 2: 关进料门 3: 开出料门 4: 关出料门 5: 入硫化罐 6: 入冷却槽 7: 穿梭车进冷却槽 8: 穿梭车离开冷却槽 9: 出冷却槽 10:A=>B 11:B=>A |
| | | wrkMastExecute.setType(digit[3]);//设备 0: 未知 1: 硫化罐 2: 冷却槽 3: 硫化罐==>冷却槽 |
| | | return wrkMastExecuteService.insert(wrkMastExecute); |
| | | } catch (Exception e) { |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》异常原因:"+e.getMessage()); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * JarWrkMastExecute任务完成 //未完成 |
| | | */ |
| | | public synchronized void jarWrkMastExecuteGenerateComplete() { |
| | | try{ |
| | | |
| | | }catch (Exception e){ |
| | | log.error("小车复位线程报错!"+e); |
| | | } |
| | | } |
| | | |
| | | /* |
| | | * Rgv 移动 |
| | | * Rgv 动作 |
| | | * */ |
| | | public synchronized boolean jarRgvTake2(Integer rgvId,BasJarMast basJarMast){ |
| | | public synchronized boolean jarRgvTake(Integer rgvNo,WrkMastExecute wrkMastExecute,Integer type){ |
| | | return false; |
| | | } |
| | | |
| | | /* |
| | | * 小车取空板至工位任务 满取 |
| | | * Ste 动作 |
| | | * */ |
| | | public synchronized boolean jarRgvTake3(Integer rgvId,BasJarMast basJarMast){ |
| | | public synchronized boolean jarSteTake(Integer steNo,WrkMastExecute wrkMastExecute,Integer type){ |
| | | return false; |
| | | } |
| | | |
| | | /* |
| | | * 小车取空板至工位任务 满取 |
| | | * Jar 动作 |
| | | * */ |
| | | public synchronized boolean jarRgvTake4(Integer rgvId,BasJarMast basJarMast){ |
| | | public synchronized boolean jarDoorTake(Integer jarNo,WrkMastExecute wrkMastExecute,Integer type){ |
| | | return false; |
| | | } |
| | | /* |
| | | * 小车取空板至工位任务 满取 |
| | | * */ |
| | | public synchronized boolean jarRgvTake5(Integer rgvId,BasJarMast basJarMast){ |
| | | return false; |
| | | } |
| | | /* |
| | | * 小车取空板至工位任务 满取 |
| | | * */ |
| | | public synchronized boolean jarRgvTake6(Integer rgvId,BasJarMast basJarMast){ |
| | | return false; |
| | | } |
| | | /* |
| | | * 小车取空板至工位任务 满取 |
| | | * */ |
| | | public synchronized boolean jarRgvTake7(Integer rgvId,BasJarMast basJarMast){ |
| | | return false; |
| | | } |
| | | /* |
| | | * 穿梭板移动 |
| | | * */ |
| | | public synchronized boolean jarRgvTake8(Integer rgvId,BasJarMast basJarMast){ |
| | | return false; |
| | | } |
| | | |
| | | } |