| | |
| | | //如果有同类型时直接增加 |
| | | if(cage!=null){ |
| | | //发送plc任务 |
| | | Mestast(glassid, 40, cage.getId(), 1,"MESID1",1); |
| | | Mestast(glassid, 1001, cage.getId(), 1,"MESID1",1); |
| | | //任务发送字 |
| | | |
| | | }else{ |
| | |
| | | if(cage!=null){ |
| | | albaniaMapper.AddCage(cage.getId(), glassid, cage.getGlassWidth(), cage.getGlassHeight(), cage.getGlassWidthMm(), cage.getGlassHeightMm(), 1, cage.getGlasstype(), 0); |
| | | Mestast(glassid,1001,cage.getId(),1,"MESID1",1); |
| | | albaniaMapper.UpdateStorage(cage.getGlassWidth(),cage.getGlassHeight(),cage.getId()); |
| | | //发送plc任务 |
| | | |
| | | }else{ |
| | |
| | | glass= albaniaMapper.SelectCageGlass(glassmate.getGlasstype()); |
| | | if(glass!=null){ |
| | | //发送任务之前判断车上的剩余宽度是否大于此玻璃 |
| | | width+=glassmate.getWidth()+50; |
| | | width=width+glassmate.getWidth()+50; |
| | | //大于车上空余宽度时提前发送出片启动 |
| | | if(width>5000){ |
| | | //本次配片完成发送启动命令 |
| | |
| | | } |
| | | |
| | | //发送配片数据 |
| | | Mestast(glass.getGlassId(), glass.getId(),7, 0,"MESID"+i,i); |
| | | Mestast(glass.getGlassId(), glass.getId(),line, 0,"MESID"+i,i); |
| | | albaniaMapper.AddFinishNumber(glassmate.getFlowcard(), glassmate.getMateid(), glassmate.getTier()); |
| | | albaniaMapper.Inserttask(1, 0, glass.getId(), 2002, glassmate.getGlassid(), glassmate.getGlasstype(),glass.getFlowcard(),glassmate.getMateid(),glassmate.getTier()); |
| | | if(glassmate.getTier()==glassmate.getId()){//当配片数量等于成品小片总片数时 |
| | |
| | | System.out.println("outmesidbytes:" + bytes.length); |
| | | System.out.println(plcmes.getPlcParameter(address).getAddress()); |
| | | System.out.println(); |
| | | |
| | | //S7control.getinstance().WriteByte(plcmes.getPlcParameter(address).getAddress(),bytes); |
| | | //S7control.getinstance().WriteByte(address, bytes);// 派发出片id |
| | | |
| | | } |
| | | |