From 0417fafe757f09bfb166b1dd1d9f096e966a30d8 Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期六, 11 五月 2024 09:38:43 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes

---
 springboot-vue3/src/main/java/com/example/springboot/component/PLCAutomaticParameterSettingReview2.java |   48 +++++++++++++++++++++++++++++++++---------------
 1 files changed, 33 insertions(+), 15 deletions(-)

diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PLCAutomaticParameterSettingReview2.java b/springboot-vue3/src/main/java/com/example/springboot/component/PLCAutomaticParameterSettingReview2.java
index a6d3f93..bf6f648 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/PLCAutomaticParameterSettingReview2.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PLCAutomaticParameterSettingReview2.java
@@ -1,6 +1,7 @@
 package com.example.springboot.component;
 
-import com.example.springboot.entity.device.PlcBitObject;
+
+
 import com.example.springboot.entity.device.PlcParameterObject;
 
 import java.io.IOException;
@@ -8,16 +9,21 @@
 import java.util.Arrays;
 import java.util.List;
 
+
 import static com.example.springboot.component.InitUtil.readAndUpdateBitValues;
 import static com.example.springboot.component.InitUtil.readAndUpdateWordValues;
 
 public class PLCAutomaticParameterSettingReview2 extends Thread {
 
+
+    private static PlcParameterObject plcParameterObject;
     // 鐢ㄤ簬瀛樺偍搴旂敤绋嬪簭鐨勯厤缃俊鎭�
     private Configuration config;
     private static InitUtil initUtil;
     // 鍒涘缓涓�涓嚜瀹氫箟鐨� S7 鎺у埗鍣ㄦ秷鎭鐞嗗櫒瀵硅薄
     MessageHandler customS7Control = new MessageHandler();
+
+//    public static  PlcParameterObject plcStateObject;
 
     // 鍗曚緥瀹炰緥
     private static PLCAutomaticParameterSettingReview2 instance;
@@ -25,7 +31,7 @@
     // 绉佹湁鏋勯�犲嚱鏁�
     public PLCAutomaticParameterSettingReview2() throws IOException {
         config = new Configuration("config.properties");
-        initUtil = new InitUtil();
+       // initUtil = new InitUtil();
     }
 
     // 鑾峰彇鍗曚緥瀹炰緥
@@ -36,16 +42,7 @@
         return instance;
     }
 
-    String jsonFilePath = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcParameter.json").getPath();
-    String jsonFilePath2 = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcSign.json").getPath();
-    String jsonFilePath4 = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcState.json").getPath();
-    //System.out.println(jsonFilePath4);
-    // 璋冪敤initword鏂规硶
-    PlcParameterObject plcParameterObject = initUtil.initword(jsonFilePath);
-    PlcParameterObject plcStateObject = initUtil.initword(jsonFilePath4);
 
-    // 璋冪敤initbit鏂规硶
-    PlcBitObject plcBitObject = initUtil.initbit(jsonFilePath2);
 
     @Override
     public void run() {
@@ -58,6 +55,17 @@
             }
 
 
+          //  String jsonFilePath = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcParameter.json").getPath();
+           //  String jsonFilePath2 = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcSign.json").getPath();
+             //String jsonFilePath4 = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcState.json").getPath();
+            //System.out.println(jsonFilePath4);
+            // 璋冪敤initword鏂规硶
+            // plcParameterObject = initUtil.initword(jsonFilePath);
+         //    plcStateObject = initUtil.initword(jsonFilePath4);
+
+            // 璋冪敤initbit鏂规硶
+         //   PlcBitObject plcBitObject = initUtil.initbit(jsonFilePath2);
+
           //  int index3 = plcParameterObject.getPlcParameter("A01A02conveyorVelocity(Max)").getAddressIndex();
            // System.out.println(index3);
            // System.out.println(plcParameterObject.getPlcParameter("A01A02conveyorVelocity(Max)").getAddress(index3));
@@ -67,15 +75,25 @@
 //            readAndUpdateWordValues(plcParameterObject);
 //            readAndUpdateWordValues(plcStateObject);
 
-                 List<String> addresses = new ArrayList<>();
-      addresses.add("conveyorVelocity(AutoFAST)");
-      addresses.add("A02ID");
+//                 List<String> addresses = new ArrayList<>();
+//      addresses.add("conveyorVelocity(AutoFAST)");
+//      addresses.add("A02ID");
+//            addresses.add("conveyorVelocity(Manual)");
+            List<String> addresses = new ArrayList<>();
+            addresses.add("conveyorVelocity(AutoFAST)");
+            addresses.add("A02ID");
             addresses.add("conveyorVelocity(Manual)");
 
 
-            List<String> address =  plcParameterObject.getAddressListByCodeId(addresses);
+
+
+
+            List<String> address =  PLCAutomaticParameterSettingReview2.plcParameterObject.getAddressListByCodeId(addresses);
             System.out.println(address);
 
+           // List<String> address =  plcParameterObject.getAddressListByCodeId(addresses);
+         // System.out.println(address);
+
            // int index = plcParameterObject.getPlcParameter("A01turnAngle1").getAddressIndex();
            // List<Short> arraylist = S7control.getinstance().ReadWord(plcParameterObject.getPlcParameter("A01turnAngle1").getAddress(index), 8);
 

--
Gitblit v1.8.0