| | |
| | | private StorageCageService storageCageService; |
| | | int aaa; |
| | | String huibao = ""; |
| | | |
| | | String qidong = ""; |
| | | @Override |
| | | public void run() { |
| | | |
| | |
| | | storageCageService = WebSocketServer.applicationContext.getBean(StorageCageService.class); |
| | | spianService = WebSocketServer.applicationContext.getBean(SpianServiceNew.class); |
| | | albaniaMapper = WebSocketServer.applicationContext.getBean(AlbaniaMapper.class); |
| | | spianService.selectout(1); |
| | | // spianService.selectout(1); |
| | | // spianService.mateOut(); |
| | | // 读取DB14区文件 |
| | | PlcParameterObject plcmes = PLCAutoMes.PlcMesObject; |
| | | if (plcmes.getPlcParameter("PLCToMES").getValue() != null) { |
| | |
| | | String IDStatus1 = plcmes.getPlcParameter("IDStatus1").getValue();// 1号任务完成 |
| | | String MESToPLCStatus1 = plcmes.getPlcParameter("MESToPLCStatus1").getValue();// 1号确认字 |
| | | String MESToPLC = plcmes.getPlcParameter("MESToPLC").getValue();// 发送任务字 |
| | | |
| | | int taskcont = albaniaMapper.SelectTaskcount(); // 正在进行的任务数量 |
| | | int outtask = albaniaMapper.SelectOutTaskCount(); // 等待补发的出片任务数量 |
| | | if(outtask>0){ |
| | | spianService.mateOut(); |
| | | if (ExportTOMES1 != null && MESToPLC != null && taskcont == 0) { |
| | | //当可以发任务并且出片队列有任务时 |
| | | if (ExportTOMES1.equals("1") == true && MESToPLC.equals("0") == true && PLCToMES.equals("1") == true&&outtask>0 && MESToPLCStatus1.equals("0")) { |
| | | spianService.mateOut(); |
| | | } |
| | | } |
| | | |
| | | // String scan=plcmes.getPlcParameter("scan").getValue();//发送扫码信息 |
| | | // if(scan.equals("1")==true){ |
| | | // spianService.scan(scan); |
| | |
| | | System.out.println("汇报记录:" + IDStatus1 + "时间" + currentTime); |
| | | } |
| | | huibao = IDStatus1; |
| | | if (!qidong.equals(MESToPLC)) { |
| | | System.out.println("启动记录:" + MESToPLC + "时间" + currentTime); |
| | | } |
| | | qidong = MESToPLC; |
| | | |
| | | PLCToMES = plcmes.getPlcParameter("PLCToMES").getValue();// 运送车请求 |
| | | IDStatus1 = plcmes.getPlcParameter("IDStatus1").getValue();// 1号任务完成 |
| | | MESToPLCStatus1 = plcmes.getPlcParameter("MESToPLCStatus1").getValue();// 1号确认字 |
| | | MESToPLC = plcmes.getPlcParameter("MESToPLC").getValue();// 发送任务字 |
| | | |
| | | // 一号线请求 |
| | | if (ExportTOMES1 != null && MESToPLC != null && taskcont == 0) { |
| | | if (ExportTOMES1.equals("1") == true && MESToPLC.equals("0") == true && PLCToMES.equals("1") == true |
| | | && MESToPLCStatus1.equals("0") == true) { |
| | | System.out |
| | | .println("出片状态:MESToPLC:" + MESToPLC + "PLCToMES:" + PLCToMES + "MESToPLCStatus1:" + MESToPLCStatus1); |
| | | && MESToPLCStatus1.equals("0") == true&&outtask == 0) { |
| | | // System.out |
| | | // .println("出片状态:MESToPLC:" + MESToPLC + "PLCToMES:" + PLCToMES + "MESToPLCStatus1:" + MESToPLCStatus1); |
| | | spianService.selectout(1); |
| | | try { |
| | | Thread.sleep(200); // 每100毫秒检查一次 |
| | | Thread.sleep(100); // 每100毫秒检查一次 |
| | | } catch (InterruptedException e) { |
| | | Thread.currentThread().interrupt(); // 处理线程中断 |
| | | } |
| | |
| | | MESToPLC = plcmes.getPlcParameter("MESToPLC").getValue();// 发送任务字 |
| | | // 运送车请求和测量完成请求 |
| | | GlassInfo glass = albaniaMapper.SelectGlass(); |
| | | if (PLCToMES != null && glass != null && MESToPLC != null && taskcont == 0) { |
| | | if (PLCToMES.equals("1") == true && MESToPLC.equals("0") == true && MESToPLCStatus1.equals("0") == true) { |
| | | if (PLCToMES != null && glass != null && MESToPLC != null) { |
| | | if (PLCToMES.equals("1") == true && MESToPLC.equals("0") == true && MESToPLCStatus1.equals("0") == true&&outtask == 0) { |
| | | try { |
| | | Thread.sleep(100); // 每100毫秒检查一次 |
| | | } catch (InterruptedException e) { |
| | | Thread.currentThread().interrupt(); // 处理线程中断 |
| | | } |
| | | System.out |
| | | .println("进片状态:MESToPLC:" + MESToPLC + "PLCToMES:" + PLCToMES + "MESToPLCStatus1:" + MESToPLCStatus1); |
| | | // System.out |
| | | // .println("进片状态:MESToPLC:" + MESToPLC + "PLCToMES:" + PLCToMES + "MESToPLCStatus1:" + MESToPLCStatus1); |
| | | spianService.selectAll(glass); |
| | | } |
| | | } |