| | |
| | | } |
| | | } |
| | | // 增加任务记录 |
| | | albaniaMapper.Inserttask(0, 0, 1001, cage.getId(), glassid, glasstype, flowcard, glassfilms.getMateid(), glassfilms.getTier()); |
| | | albaniaMapper.Inserttask(0, 0, 1001, cage.getId(), glassid, glasstype, flowcard, glassfilms.getMateid(), |
| | | glassfilms.getTier()); |
| | | albaniaMapper.UpdateQueueState(glassid); |
| | | return (200); |
| | | |
| | |
| | | } |
| | | } |
| | | // 本次配片完成发送启动命令 |
| | | // S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), (short) 1);// 出片任务启动 |
| | | // S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), |
| | | // (short) 1);// 出片任务启动 |
| | | while (true) { |
| | | String currentValue = plcmes.getPlcParameter("MESToPLC").getValue(); |
| | | // 检查 MESToPLC 的值是否为 0 |
| | |
| | | int glassend = 0; |
| | | double carwidth = -300; |
| | | double width = 0; |
| | | for (int i = 1; i <= 7; i++) { |
| | | |
| | | method = albaniaMapper.SelectMethod(line); |
| | | if (method == null) { |
| | | return (400); |
| | |
| | | |
| | | } |
| | | // 本次配片完成发送启动命令 |
| | | // S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(),(short) 1);// 出片任务启动 |
| | | // S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(),(short) |
| | | // 1);// 出片任务启动 |
| | | MestoPlc(); |
| | | return (200);// 结束 |
| | | } |
| | |
| | | } |
| | | |
| | | } else { |
| | | for (int i = 1; i <= 7; i++) { |
| | | // 直通模式时按顺序直出 |
| | | // glassmate = albaniaMapper.SelectOutGlass(1); |
| | | glassmate = albaniaMapper.SelectOutGlass2(1); |
| | | System.out.println("glassmate:"+glassmate); |
| | | // // 获取直通模式最后一块 |
| | | // glassend = albaniaMapper.SelectOutGlassend(1); |
| | | glassmate = albaniaMapper.SelectOutGlass2(); |
| | | |
| | | } |
| | | System.err.println("出片:" + glassmate); |
| | | if (glassmate == null && i > 1) { |
| | | // 本次配片完成发送启动命令 |
| | |
| | | if (glassmate == null) { |
| | | // 未领取任务 |
| | | System.out.println("未领取任务:" + i); |
| | | glassmate = albaniaMapper.SelectOutGlass2(1); |
| | | if(glassmate==null){ |
| | | System.out.println("glassmate空"); |
| | | return (400); |
| | | } |
| | | |
| | | } else { |
| | | glass = albaniaMapper.SelectCageGlass(glassmate.getGlasstype()); |
| | | System.out.println("glassmate:" + glassmate + "glass:" + glass); |
| | | System.out.println("出片glass:" + glass); |
| | | if (glass != null) { |
| | | // 发送任务之前判断车上的剩余宽度是否大于此玻璃 |
| | | width = width + glassmate.getWidth() + 300; |
| | |
| | | } |
| | | // 发送配片数据 |
| | | Mestast(glass.getGlassId(), glass.getId(), 2001, 0, "MESID" + i, i); |
| | | albaniaMapper.AddFinishNumber(glassmate.getFlowcard(), glassmate.getMateid(), glassmate.getTier()); |
| | | albaniaMapper.AddFinishNumber(glassmate.getFlowcard(), glassmate.getMateid(), |
| | | glassmate.getTier()); |
| | | storageCageService.UpdateStroageCageByCell(glass.getId(), -1);// 玻璃数量-1 |
| | | albaniaMapper.Inserttask(1, 0, glass.getId(), 2001, glassmate.getGlassid(), |
| | | glassmate.getGlasstype(), glass.getFlowcard(), glassmate.getMateid(), glassmate.getTier()); |
| | | // if (glassmate.getTier() == glassmate.getId() || glassmate.getTier() == |
| | | // glassend|| method.getMethod() == 1) {// 当配片数量等于成品小片总片数时 |
| | | // // 本次配片完成发送启动命令 |
| | | // S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), |
| | | // (short) 1);// 出片任务启动 |
| | | // System.out.println("任务类型:1,任务状态:0,起始:" + glass.getId() + ",目标" + "2001"); |
| | | // return (200);// 结束 |
| | | // } |
| | | |
| | | glassmate.getGlasstype(), glass.getFlowcard(), glassmate.getMateid(), |
| | | glassmate.getTier()); |
| | | } else { |
| | | return (400);// 结束 |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | return (200);// 结束 |
| | |
| | | S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLCTarget" + i).getAddress(), |
| | | (short) MESToPLCTarget1);// 目标位置 |
| | | if (MESToPLC != 0) { |
| | | // S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), (short) MESToPLC);// mes理片任务类型 |
| | | // S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), |
| | | // (short) MESToPLC);// mes理片任务类型 |
| | | MestoPlc(); |
| | | } |
| | | } |