CanadaMes-ui/src/views/home/index.vue
@@ -728,6 +728,12 @@ </el-table-column> </el-table> </el-dialog> <el-dialog :visible.sync="dialogFormCountDown" :title="$t('Glass information corresponding to aluminum frame')" top="5vh"> <div style="font-size: 500px;text-align: center;"> {{ this.CountDowns }} </div> </el-dialog> </el-container> </template> <script> @@ -760,6 +766,7 @@ dialogFormVisible5: false, dialogFormVisible6: false, dialogFormVisible7: false, dialogFormCountDown:false, form: { orderId: "", glassId: "", @@ -820,7 +827,7 @@ OutingQueue: true, OrderInfo: true, CageDetails: true, CountDowns:0 }; }, created() { @@ -839,7 +846,7 @@ //console.log("您的浏览器支持WebSocket"); let socketUrl = "ws://" + this.$t('ip') + ":8888" + "/springboot-vue3/api/talk/" + viewname; if (socket != null) { socket.close(); socket.close();this.car1 socket = null; } // 开启一个websocket服务 @@ -853,6 +860,7 @@ //console.log("收到数据====" + msg.data); let obj = JSON.parse(msg.data); if (obj.params != null) { this.car1 = 145 + 8.15 * Math.abs(obj.params[0][0] - this.carlist[0]['start']) / Math.abs(this.carlist[0]['end'] - this.carlist[0]['start']) * 100; this.car2 = 210 + 8.15 * Math.abs(obj.params[0][1] - this.carlist[1]['start']) / Math.abs(this.carlist[1]['end'] - this.carlist[1]['start']) * 100; // this.car1 = 210 + 11.25 * (obj.params[0][1]-this.carlist[1]['start'])/(this.carlist[1]['end']-this.carlist[1]['start'])*100; @@ -866,8 +874,13 @@ this.tasklist1 = obj.tasklist1[0]; this.tasklist2 = obj.tasklist2[0]; this.alarm = obj.alarmmg[0]; //铝框id提示 if(this.alarm.length>0){ this.dialogFormVisible2=true; } //复位倒计时 if (obj.countdown[0]== true&&this.CountDowns==0) { this.CountDown(); } //是否允许出片 this.isAllowQueue = obj.isAllowQueue[0]; @@ -1651,7 +1664,7 @@ }, //判断玻璃是否超出范围 Sizerange(Glass, position) { if (this.ManuallyInfeedGlass == true) { if (this.ManuallyInfeedGlass == false) { if ((Glass.glassheight < 380 || Glass.glasswidth < 390 || Glass.glassheight > 1810 || Glass.glasswidth > 2760) || (Glass.glassheight < 390 || Glass.glasswidth < 380 || Glass.glassheight > 2760 || Glass.glasswidth > 1810)) { this.$alert(this.$t('The glass size is not within the range'), this.$t('confirm'), { confirmButtonText: this.$t('Yes'), @@ -1676,7 +1689,8 @@ } else { this.disabled = false; } if (position == 3 && this.isConfirmState == true) { console.log(position,this.isConfirm); if (position == 3 && this.isConfirm == true) { this.InsertQueueGlass(1); } } @@ -1693,6 +1707,25 @@ this.$message.success(this.$t('Operation successful')); } }); }, CountDown(){ //50秒倒数计时 let count = 50; let timer = setInterval( () => { if (count > 0) { this.countDown = count; count--; this.CountDowns=count; } else { clearInterval(timer); this.countDown = 0; } }, 1000 ); } } } springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
@@ -69,13 +69,11 @@ // 获取DO2数据 StringBuilder queueid2 = spianService.queGlassid("DB103.58", 14); int questate = spianMapper.Selectquecount(queueid1.toString());// 判断扫码位是否有玻璃已确认 // queueid1.toString().isEmpty() north_glass_buffer1 glass1 = spianMapper.selectGlass(queueid1.toString());// D01的玻璃信息 north_glass_buffer1 glass2 = spianMapper.selectGlass(queueid2.toString());// D02玻璃信息 // 当扫码位玻璃id为空时 宽度为0 if (queueid1 != null && questate == 0) { // 写入D01的数据到上片队列表 if (glass1 == null) { // 当没有值时传空 springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -1,6 +1,8 @@ package com.example.springboot.component; import cn.hutool.json.JSONObject; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; @@ -71,26 +73,25 @@ // 查询报警信息 List<alarmmg> alarmmg = homeMapper.SelectAlarmmgInfo(); jsonObject.append("alarmmg", alarmmg); // // 读去Plc进片车与出片车位置W // List<String> addressList = new ArrayList<String>(); // addressList.add("DB106.12"); // addressList.add("DB106.0"); // List<Short> paramlist = S7control.getinstance().ReadWord(addressList); // if (paramlist != null) { // jsonObject.append("params", paramlist); // } // // 获取进片车状态 // List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8", // 1);// 获取进片车状态 // boolean exist1 = datas1ListState.contains((short) 0); // jsonObject.append("zhuangtai", exist1); // // 获取进片玻璃信息 // List<Short> inglassInfo = S7control.getinstance().ReadWord("DB106.24", 1); // if (inglassInfo != null) { // if (inglassInfo.size() > 0) // jsonObject.append("loadglassheight", inglassInfo.get(0) * 70); // } // 读去Plc进片车与出片车位置W List<String> addressList = new ArrayList<String>(); addressList.add("DB106.12"); addressList.add("DB106.0"); List<Short> paramlist = S7control.getinstance().ReadWord(addressList); if (paramlist != null) { jsonObject.append("params", paramlist); } // 获取进片车状态 List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8", 1);// 获取进片车状态 boolean exist1 = datas1ListState.contains((short) 0); jsonObject.append("zhuangtai", exist1); // 获取进片玻璃信息 List<Short> inglassInfo = S7control.getinstance().ReadWord("DB106.24", 1); if (inglassInfo != null) { if (inglassInfo.size() > 0) jsonObject.append("loadglassheight", inglassInfo.get(0) * 70); } // 伍 获取进是否有待确认的玻璃id String queid = spianMapper.Selectqueueid(); int state = spianMapper.Selectqueuestate(); @@ -115,20 +116,25 @@ // 获取当前出片队列状态 jsonObject.append("isAllowQueue", Plchome.isAllowQueue); // // 获取铝框idDB106.DBW64 // String frameno=spianService.queGlassid("DB106.24",14).toString(); // if(frameno!=Plchome.FrameNo){ // Plchome.FrameNo=frameno; // } // try { // north_Glass_Buffer1Service.AddOutSliceS(Plchome.FrameNo); // } catch (SQLException e) { // // TODO Auto-generated catch block // e.printStackTrace(); // } // 获取铝框idDB106.DBW64 String frameno=spianService.queGlassid("DB103.270",14).toString(); if(frameno!=Plchome.FrameNo&&frameno!=""){ Plchome.FrameNo=frameno; } try { north_Glass_Buffer1Service.AddOutSliceS(Plchome.FrameNo); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } // 是否需要人工确认上片玻璃 jsonObject.append("isConfirm", isConfirm); //复位倒计时 // 地址104.9.6 List<Boolean> countdown = S7control.getinstance().ReadBits("104.9.6", 71); jsonObject.append("countdown", countdown); // 铝框线交互 // //铝框id请求字 springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
@@ -17,7 +17,7 @@ // System.out.println("启动完成"); //new PlcHold().start(); new PlcHold().start(); // // new Plchome().start(); springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
@@ -144,11 +144,11 @@ StorageCage glass = homeMapper.SelectGlassInfo(glassid); if (types == 0) { homeMapper.UpdateCageTask1(glassid); S7control.getinstance().WriteWord("DB105.14", (short) 0); // S7control.getinstance().WriteWord("DB105.16", (short) 0); } else { spianMapper.UpdataOutCage1(glass.getGlassWidth(), glass.getCage(), glass.getCell()); homeMapper.UpdateCageTask2(glassid); S7control.getinstance().WriteWord("DB105.12", (short) 0); // S7control.getinstance().WriteWord("DB105.18", (short) 0); } map.put("message3", "200"); return Result.success(map);