From 9e62d4c6dfcebf8510580d9141a8141f6b158818 Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期二, 26 十二月 2023 09:34:41 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes

---
 CanadaMes-ui/src/views/home/index.vue                                                            |   34 ++++++++---------
 springboot-vue3/src/main/java/com/example/springboot/component/S7control.java                    |   10 ++++
 springboot-vue3/src/main/java/com/example/springboot/component/PLCAutomaticParameterSetting.java |   56 ++++++++++++++--------------
 3 files changed, 53 insertions(+), 47 deletions(-)

diff --git a/CanadaMes-ui/src/views/home/index.vue b/CanadaMes-ui/src/views/home/index.vue
index 9ab796e..14397ef 100644
--- a/CanadaMes-ui/src/views/home/index.vue
+++ b/CanadaMes-ui/src/views/home/index.vue
@@ -46,9 +46,6 @@
     background-color: blue;
 }
 
-.black {
-    background-color: black;
-}
 
 .yellow {
     background-color: yellow;
@@ -155,7 +152,7 @@
 .box {
     width: 90%;
     margin-left: 5%;
-    color: black;
+    color: red;
     font-size: 12px;
     overflow: hidden;
     height: 20px;
@@ -899,6 +896,7 @@
                     this.cagelist4 = obj.cagelist4[0];
                     this.tasklist1 = obj.tasklist1[0];
                     this.tasklist2 = obj.tasklist2[0];
+                    this.alarm = obj.alarmmg[0];
                     // if (obj.alarmmg[0].length > 0) {
                     //     if (this.alarm.length > 0) {
                     //         if (this.alarm[this.alarm.length - 1].id != obj.alarmmg[0][obj.alarmmg[0].length - 1].id) {
@@ -910,22 +908,22 @@
                     //         this.dialogFormVisible2 = true;
                     //     }
                     // }
-                    //鏄惁鎬ュ仠
-                    if (obj.emergencystop != null) {
-                        this.EmergencyStop = obj.emergencystop[0];
-                    }
+                    // //鏄惁鎬ュ仠
+                    // if (obj.emergencystop != null) {
+                    //     this.EmergencyStop = obj.emergencystop[0];
+                    // }
 
-                    //澶嶄綅鍊掕鏃�
-                    if (obj.countdown != null) {
-                        if ((obj.countdown[0] == true && this.CountDowns == 0) || this.EmergencyStop == true) {
-                            this.CountDown();
-                        }
-                    }
+                    // //澶嶄綅鍊掕鏃�
+                    // if (obj.countdown != null) {
+                    //     if ((obj.countdown[0] == true && this.CountDowns == 0) || this.EmergencyStop == true) {
+                    //         this.CountDown();
+                    //     }
+                    // }
 
-                    //澶嶄綅瀹屾垚淇″彿
-                    if (obj.reset != null) {
-                        this.reset = obj.reset[0];
-                    }
+                    // //澶嶄綅瀹屾垚淇″彿
+                    // if (obj.reset != null) {
+                    //     this.reset = obj.reset[0];
+                    // }
 
                     //鏄惁鏈夎繘鐗囪姹�
                     if (obj.D01RequestState != null) {
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PLCAutomaticParameterSetting.java b/springboot-vue3/src/main/java/com/example/springboot/component/PLCAutomaticParameterSetting.java
index 76ba5f6..3532c83 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/PLCAutomaticParameterSetting.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PLCAutomaticParameterSetting.java
@@ -34,36 +34,36 @@
 
       // System.out.println(stt);
 
-//      List<Short> arraylist = S7control.getinstance().ReadWord("DB100.120", 8);
-//      List<Short> dache1 = S7control.getinstance().ReadWord("DB100.18", 1);
-//      List<Short> xiaoche1 = S7control.getinstance().ReadWord("DB100.22", 1);
-//      List<Short> fanzhuan1 = S7control.getinstance().ReadWord("DB100.14", 1);
-//
-//      List<String> addresses = Arrays.asList(config.getProperty("Auto.addresses").split(","));
-//
-//      List<Short> arraylist2 = S7control.getinstance().readWords(addresses);
-//      //System.out.println("lastMessage锛�" + arraylist2);
-//
-////缈昏浆
-//      List<Short> fanzhuan2 = S7control.getinstance().ReadWord("DB100.8", 1);
-//      List<Short> xiaoche2 = S7control.getinstance().ReadWord("DB100.12", 1);
+      List<Short> arraylist = S7control.getinstance().ReadWord("DB100.120", 8);
+      List<Short> dache1 = S7control.getinstance().ReadWord("DB100.18", 1);
+      List<Short> xiaoche1 = S7control.getinstance().ReadWord("DB100.22", 1);
+      List<Short> fanzhuan1 = S7control.getinstance().ReadWord("DB100.14", 1);
+
+      List<String> addresses = Arrays.asList(config.getProperty("Auto.addresses").split(","));
+
+      List<Short> arraylist2 = S7control.getinstance().readWords(addresses);
+      //System.out.println("lastMessage锛�" + arraylist2);
+
+//缈昏浆
+      List<Short> fanzhuan2 = S7control.getinstance().ReadWord("DB100.8", 1);
+      List<Short> xiaoche2 = S7control.getinstance().ReadWord("DB100.12", 1);
 
 
-       Short[] values1 = { 1, 2, 3, 4, 5, 6, 7, 8 };
-       List<Short> arraylist = new ArrayList<>(Arrays.asList(values1));
-       Short[] fanzhuan = { 4 };
-       List<Short> fanzhuan1 = new ArrayList<>(Arrays.asList(fanzhuan));
-       Short[] dache = { 5 };
-       List<Short> dache1 = new ArrayList<>(Arrays.asList(dache));
-       Short[] xiaoche = { 6 };
-       List<Short> xiaoche1 = new ArrayList<>(Arrays.asList(xiaoche));
-
-       Short[] values2 = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
-       List<Short> arraylist2 = new ArrayList<>(Arrays.asList(values2));
-       Short[] fanzhuan22 = { 4 };
-       List<Short> fanzhuan2 = new ArrayList<>(Arrays.asList(fanzhuan22));
-       Short[] xiaoche22 = {5};
-       List<Short> xiaoche2 = new ArrayList<>(Arrays.asList(xiaoche22));
+//       Short[] values1 = { 1, 2, 3, 4, 5, 6, 7, 8 };
+//       List<Short> arraylist = new ArrayList<>(Arrays.asList(values1));
+//       Short[] fanzhuan = { 4 };
+//       List<Short> fanzhuan1 = new ArrayList<>(Arrays.asList(fanzhuan));
+//       Short[] dache = { 5 };
+//       List<Short> dache1 = new ArrayList<>(Arrays.asList(dache));
+//       Short[] xiaoche = { 6 };
+//       List<Short> xiaoche1 = new ArrayList<>(Arrays.asList(xiaoche));
+//
+//       Short[] values2 = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
+//       List<Short> arraylist2 = new ArrayList<>(Arrays.asList(values2));
+//       Short[] fanzhuan22 = { 4 };
+//       List<Short> fanzhuan2 = new ArrayList<>(Arrays.asList(fanzhuan22));
+//       Short[] xiaoche22 = {5};
+//       List<Short> xiaoche2 = new ArrayList<>(Arrays.asList(xiaoche22));
 
       JSONObject jsonObject = new JSONObject();
       // new short[]{1,1, 1, 1, 1, 1, 2, 33, 2,3, 4, 5}
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/S7control.java b/springboot-vue3/src/main/java/com/example/springboot/component/S7control.java
index 95ebb15..75fcb53 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/S7control.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/S7control.java
@@ -37,13 +37,21 @@
         }
         return instance;
     }
-
+    
     /**
      * 鍏抽棴瑗块棬瀛恠7閫氳杩炴帴
      */
     public void CloseS7client() {
         if (s7PLC == null)
             s7PLC.close();
+            s7PLC.checkConnected();
+    }
+
+    /**
+     * s7閫氳杩炴帴鐘舵��
+     */
+    public boolean CheckConnected() {
+        return s7PLC.checkConnected();
     }
 
     /**

--
Gitblit v1.8.0