From 9057d8571f11a552a326fa35fda9b5ec614f5c58 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期二, 23 四月 2024 09:33:09 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes

---
 springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java |   65 +++++++++++++++++++-------------
 1 files changed, 39 insertions(+), 26 deletions(-)

diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java b/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
index 922b962..f7eff5d 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -7,7 +7,9 @@
 import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import com.example.springboot.service.*;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -18,6 +20,7 @@
 import com.example.springboot.entity.StorageCage;
 import com.example.springboot.entity.alarmmg;
 import com.example.springboot.entity.north_glass_buffer1;
+import com.example.springboot.entity.device.PlcParameterObject;
 import com.example.springboot.mapper.HomeMapper;
 import com.example.springboot.mapper.SpianMapper;
 
@@ -34,7 +37,7 @@
     public static Boolean isAllowQueue = true;
     public static Boolean isAllowReordering = true;
     // 鍑虹墖闃熷垪璀﹀憡
-    public static Boolean isQueueWarning = false;
+    public static Boolean isQueueWarning = true;
     // 閾濇id
     public static String FrameNo = "";
     // 鏄惁闇�瑕佹墜鍔ㄧ‘璁ょ幓鐠�
@@ -60,8 +63,10 @@
             JSONObject jsonObject = new JSONObject();
             try {
                 Thread.sleep(1000);
+
+                String s1=S7controlalbia.getinstance().readStrings("DB14.38");
+                String s2=S7controlalbia.getinstance().readStrings("DB14.40");
                 // 娉ㄥ叆mapper
-                
                 homeMapper = WebSocketServer.applicationContext.getBean(HomeMapper.class);
                 spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
                 spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
@@ -123,7 +128,7 @@
 
                 // String E01id = new String( S7controlLK.getinstance().ReadByte("DB17.0",16));
                 // String J01id = new String( S7controlLK.getinstance().ReadByte("DB17.22",14));
-                
+
                 if (S7control.getinstance().CheckConnected() == true) {
 
                     // 閾濇绾夸氦浜�
@@ -189,7 +194,7 @@
                     GlassIdList.add(spianService.queGlassid("DB103.114", 14).toString());
                     jsonObject.append("GlassIdList", GlassIdList);
 
-                    // 璇诲幓Plc杩涚墖杞︿笌鍑虹墖杞︿綅缃甒
+                    // 鑾峰彇Plc杩涚墖杞︿笌鍑虹墖杞︿綅缃�
                     List<String> addressList = new ArrayList<String>();
                     addressList.add("DB106.12");
                     addressList.add("DB106.0");
@@ -197,21 +202,21 @@
                     if (paramlist != null) {
                         jsonObject.append("params", paramlist);
                     }
-                    // 鑾峰彇杩涚墖杞︾姸鎬�
-                    List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8",
-                            1);// 鑾峰彇杩涚墖杞︾姸鎬�
-                    if (datas1ListState != null) {
-                        boolean exist1 = datas1ListState.contains((short) 0);
-                        jsonObject.append("zhuangtai", exist1);
-                    }
+                    // // 鑾峰彇杩涚墖杞︾姸鎬�
+                    // List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8",
+                    // 1);// 鑾峰彇杩涚墖杞︾姸鎬�
+                    // if (datas1ListState != null) {
+                    // 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);
-                        }
-                    }
+                    // // 鑾峰彇杩涚墖鐜荤拑淇℃伅
+                    // List<Short> inglassInfo = S7control.getinstance().ReadWord("DB106.24", 1);
+                    // if (inglassInfo != null) {
+                    // if (inglassInfo.size() > 0) {
+                    // jsonObject.append("loadglassheight", inglassInfo.get(0) * 70);
+                    // }
+                    // }
                     // // 鑾峰彇閾濇idDB106.DBW64锛屾坊鍔犲埌鍑虹墖闃熷垪
                     // String frameno="X21763329601FB";
                     String frameno = spianService.queGlassid("DB103.270", 14).toString();
@@ -248,7 +253,7 @@
                         jsonObject.append("countdown", countdowns);
                     }
                     // jsonObject.append("countdown", true);
-                    // 澶嶄綅瀹屾垚淇″彿ss
+                    // 澶嶄綅瀹屾垚淇″彿
                     List<Boolean> resetss = S7control.getinstance().ReadBits("DB103.284", 1);
                     for (Boolean reset : resetss) {
                         jsonObject.append("reset", reset);
@@ -269,15 +274,23 @@
                     boolean D01ResponseState = D01respnse.contains((short) 1);
                     // jsonObject.append("D01RequestState", D01RequestState);
                     // 鑷姩杩涚墖
-                    if ((form3.getglassheight() < 380 || form3.getglasswidth() < 390 || form3.getglassheight() > 1810
-                            || form3.getglasswidth() > 2760)
-                            || (form3.getglassheight() < 390 || form3.getglasswidth() < 380
-                                    || form3.getglassheight() > 2760 || form3.getglasswidth() > 1810)) {
-
-                        if (isConfirm == true && D01RequestState == true && D01ResponseState == false) {
-                            storageCageService.InsertQueueGlassId((short) 1, form3);
+                    isConfirm = true;
+                    if (isConfirm == true && form3.getglassId() != null && form3.getglassId() != "") {
+                        if ((form3.getglassheight() < 380 || form3.getglasswidth() < 390
+                                || form3.getglassheight() > 1810
+                                || form3.getglasswidth() > 2760)
+                                || (form3.getglassheight() < 390 || form3.getglasswidth() < 380
+                                        || form3.getglassheight() > 2760 || form3.getglasswidth() > 1810)) {
+                            FeedState = true;
+                            jsonObject.append("FeedState", FeedState);
+                            FeedState = false;
+                        } else {
+                            if (D01RequestState == true && D01ResponseState != true) {
+                                storageCageService.InsertQueueGlassId((short) 1, form3);
+                            }
                         }
                     }
+
                 }
 
             } catch (InterruptedException e) {

--
Gitblit v1.8.0