springboot-vue3/src/main/java/com/example/springboot/AuthorityApplication.java
@@ -14,6 +14,8 @@ public static void main(String[] args) { // SpringApplication.run(AuthorityApplication.class, args); // 111 //System.out.println("null"); SpringApplication springApplication = new SpringApplication(AuthorityApplication.class); ConfigurableApplicationContext configurableApplicationContext = springApplication.run(args); WebSocketServer.setApplicationContext(configurableApplicationContext); springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
@@ -21,7 +21,6 @@ private SpianMapper spianMapper; private SpianService spianService; @Override public void run() { @@ -47,59 +46,57 @@ e.printStackTrace(); } //spianService.selectout("11"); //判断进片请求 List<Short> datas1List=S7control.getinstance().ReadWord("DB106.24", 1); List<Short> datas1ListState=S7control.getinstance().ReadWord("DB106.8", 1); if(datas1List!=null &&datas1ListState!=null){ //获取prc进片请求数据 boolean exist = datas1List.contains((short)1); //获取进片车状态 boolean exist1 = datas1ListState.contains((short)0); String glassid=""; //进片请求为1时 if(exist=true){ //当进片车空闲时 if(exist1=true){ //获取进片id List<Short> datas1ListID=S7control.getinstance().ReadWord("DB106.26", 13); if (datas1ListID != null) { //获取玻璃id for(Short list1:datas1ListID){ glassid=glassid.concat(list1.toString()); spianService.selectAll((short)list1); } spianService.selectAll(Short.parseShort(glassid)); } } //System.out.println(exist); } } //spianService.selectAll((short) 111); List<Short> outlist=S7control.getinstance().ReadWord("DB106.20", 1); //出片车状态 List<Short> outlist2=S7control.getinstance().ReadWord("DB106.20", 1); //出片任务完成 //List<Short> outlist2 = S7control.getinstance().ReadWord("DB106.20", 1); // 出片任务完成 List<Short>ceshi1=new ArrayList<Short>();//出片车状态 List<Short>ceshi2=new ArrayList<Short>();//出片任务完成 ceshi1.add((short)0); ceshi2.add((short)1); if(outlist!=null && outlist2!=null){ if (outlist != null) { //判断按订单出片 boolean outstate = outlist.contains((short)0); boolean outstate2 = outlist2.contains((short)1); if(outstate=true){ //出片车状态空闲时 if(outstate2=true){ //出片车任务完成时 String orderid=spianMapper.SelectOrderout(); if(orderid!=null){ spianService.selectout(orderid); } } } } // 查询数据库 // 推送到前端 springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java
@@ -10,7 +10,7 @@ public void run() { while (this != null) { try { Thread.sleep(1000); Thread.sleep(500); } catch (InterruptedException e) { e.printStackTrace(); } springboot-vue3/src/main/java/com/example/springboot/component/Plcaction.java
@@ -11,7 +11,7 @@ public void run() { while (this != null) { try { Thread.sleep(1000); Thread.sleep(500); } catch (InterruptedException e) { e.printStackTrace(); } springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java
@@ -15,7 +15,7 @@ public void run() { while (this != null) { try { Thread.sleep(10000); Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } springboot-vue3/src/main/java/com/example/springboot/component/Plcsign.java
@@ -11,7 +11,7 @@ public void run() { while (this != null) { try { Thread.sleep(10000); Thread.sleep(500); } catch (InterruptedException e) { e.printStackTrace(); } springboot-vue3/src/main/java/com/example/springboot/component/Plcstate.java
@@ -11,7 +11,7 @@ public void run() { while (this != null) { try { Thread.sleep(10000); Thread.sleep(500); } catch (InterruptedException e) { e.printStackTrace(); } springboot-vue3/src/main/java/com/example/springboot/component/S7control.java
@@ -206,7 +206,8 @@ } else return null; for (int i = 0; i < count; i++) { addresslist.add(address); for (int i = 0; i < count-1; i++) { int bitcurrent = bitindex + addedbit; if (bitcurrent > 7) { @@ -214,7 +215,9 @@ bitindex = 0; } else bitindex = bitcurrent; addresslist.add(stringdatas[0] + "." + dbwindex + "." + bitindex); String endstr=stringdatas.length==3?"." + bitindex:""; addresslist.add(stringdatas[0] + "." + dbwindex + endstr); } return addresslist; }