From 6356c6e148c854bb60ba1cd51fafdabfa932efff Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期一, 18 三月 2024 08:29:05 +0800
Subject: [PATCH] 逻辑更新

---
 springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java |   35 ++++++++++++++++++++++-------------
 1 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java
index a10c293..17fbf5a 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java
@@ -33,39 +33,38 @@
         // \\ TODO Auto-generated catch block
         e.printStackTrace();
       }
-
+      
       // if (S7control.getinstance().CheckConnected() == false) {
       spianService = WebSocketServer.applicationContext.getBean(SpianServiceNew.class);
       albaniaMapper = WebSocketServer.applicationContext.getBean(AlbaniaMapper.class);
-
+      spianService.selectAll(albaniaMapper.SelectGlass());
       //璇诲彇DB14鍖烘枃浠�
       PlcParameterObject plcmes=PLCAutoMes.PlcMesObject;
-    
-      //璇�103
+
       
       String ExportTOMES1=plcmes.getPlcParameter("ExportTOMES1").getValue();//鍑虹墖璇锋眰涓�绾�
       String ExportToMES2=plcmes.getPlcParameter("ExportToMES2").getValue();//鍑虹墖璇锋眰浜岀嚎
       String PLCToMES=plcmes.getPlcParameter("PLCToMES").getValue();//杩涚墖璇锋眰
       String B01State=plcmes.getPlcParameter("B01State").getValue();//杩愰�佽溅璇锋眰
       String TastState=plcmes.getPlcParameter("MESToPLCStatus1").getValue();//浠诲姟瀹屾垚
-      String TastType=plcmes.getPlcParameter("TastType").getValue();//浠诲姟绫诲瀷
+  
       
-      //璋冪敤鍑虹墖浠诲姟
-      if (ExportTOMES1.equals("1") == false&&PLCToMES.equals("0")==true) {
+      //涓�鍙风嚎璇锋眰
+      if (ExportTOMES1.equals("1") == true&&B01State.equals("0")==true) {
         //灏嗚繍杈撹溅鐘舵�佹敼涓哄繖纰�
-        S7control.getinstance().WriteWord(plcmes.getPlcParameter("B01report").getAddress(plcmes.getPlcParameter("B01report").getAddressIndex()), (short) 1);
+        S7control.getinstance().WriteWord(plcmes.getPlcParameter("B01report").getAddress(), (short) 1);
         spianService.selectout(1);
       }
-      //浜岀嚎璇锋眰鏃�
-      if (ExportToMES2.equals("1") == false&&PLCToMES.equals("0")==true) {
+      //浜岀嚎鍙疯姹傛椂
+      if (ExportToMES2.equals("1") == true&&B01State.equals("0")==true) {
         //灏嗚繍杈撹溅鐘舵�佹敼涓哄繖纰�
-        S7control.getinstance().WriteWord(plcmes.getPlcParameter("B01report").getAddress(plcmes.getPlcParameter("B01report").getAddressIndex()), (short) 1);
+        S7control.getinstance().WriteWord(plcmes.getPlcParameter("B01report").getAddress(), (short) 1);
         spianService.selectout(2);
       }
-      //璋冪敤杩涚墖浠诲姟
+      //杩涚墖璇锋眰鏃�
       if(PLCToMES.equals("1")==true&&B01State.equals("0")==true){
         //灏嗚繍杈撹溅鐘舵�佹敼涓哄繖纰�
-        S7control.getinstance().WriteWord(plcmes.getPlcParameter("B01report").getAddress(plcmes.getPlcParameter("B01report").getAddressIndex()), (short) 1);
+        S7control.getinstance().WriteWord(plcmes.getPlcParameter("B01report").getAddress(), (short) 1);
         
         spianService.selectAll(albaniaMapper.SelectGlass());
       }
@@ -73,7 +72,17 @@
 
       //浠诲姟瀹屾垚鏃�
       if(TastState.equals("1")==true){
+        
+        //瀹屾垚纭瀛�
+        for(int i=1;i<7;i++){
+          String Tastover=plcmes.getPlcParameter("IDStatus"+i).getValue();//渚濇鑾峰彇浠诲姟绫诲瀷
+          String Glassid=plcmes.getPlcParameter("MESID"+i).getValue();//渚濇鑾峰彇浠诲姟绫诲瀷
+          if(Tastover.equals("1")){
 
+            //璋冪敤瀹屾垚浠诲姟 Glassid
+            S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLCStatus"+i).getAddress(), (short) 1);//瀹屾垚纭瀛�
+          }
+        }
       }
 
   

--
Gitblit v1.8.0