| | |
| | | // 当返回的格子号为空时,返回400笼子已满 |
| | | if (cage != null) { |
| | | albaniaMapper.AddCage(cage.getId(), glassid, width, height, 1, glasstype, 0, thickness, |
| | | glassfilms.getFilms(), glassfilms.getFlowcard(), glassfilms.getMateid()); |
| | | glassfilms.getFilms(), glassfilms.getFlowcard(), glassfilms.getMateid(),glassfilms.getTier()); |
| | | Mestast(glassid, 1001, cage.getId(), 1, "MESID1", 1); |
| | | System.out.println("任务发送玻璃id:" + glassid + "起始位置:" + 1001 + "格子号:" + cage.getId() + "启动:" + 1); |
| | | albaniaMapper.UpdateStorage(width, height, cage.getId()); |
| | |
| | | } |
| | | } |
| | | // 增加任务记录 |
| | | albaniaMapper.Inserttask(0, 0, 1001, cage.getId(), glassid, glasstype, flowcard, glassfilms.getMateid(), 0); |
| | | albaniaMapper.Inserttask(0, 0, 1001, cage.getId(), glassid, glasstype, flowcard, glassfilms.getMateid(), glassfilms.getTier()); |
| | | albaniaMapper.UpdateQueueState(glassid); |
| | | return (200); |
| | | |
| | |
| | | carwidth = carwidth + glass.getWidth() + 300; |
| | | if (carwidth >= 4300&&type!=glassmate.get(i).getTaskType()) { |
| | | S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), (short) 1);// 出片任务启动 |
| | | MestoPlc(); |
| | | return (200); |
| | | } else { |
| | | //增加一条任务记录 |
| | |
| | | } |
| | | // 本次配片完成发送启动命令 |
| | | // S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), (short) 1);// 出片任务启动 |
| | | while (true) { |
| | | String currentValue = plcmes.getPlcParameter("MESToPLC").getValue(); |
| | | // 检查 MESToPLC 的值是否为 0 |
| | | if (currentValue.equals("1")) { |
| | | System.out.println("发送启动字现在为1,停止循环写入"); |
| | | break; // 退出循环 |
| | | } |
| | | // 如果不为 1,继续写入 |
| | | S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(),(short) 1);// 任务发送字 |
| | | System.out.println("继续写入 MESToPLC,当前值:" + currentValue); |
| | | try { |
| | | Thread.sleep(100); // 例如每秒检查一次 |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | MestoPlc(); |
| | | |
| | | } |