From b4a4a24a65fa3f90b4d39a311918943f73e18d5d Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期二, 07 五月 2024 22:07:35 +0800
Subject: [PATCH] 联调代码修改:写入确认字

---
 hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/PLCAutoMes.java |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 56 insertions(+), 0 deletions(-)

diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/PLCAutoMes.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/PLCAutoMes.java
new file mode 100644
index 0000000..4e8fe38
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/common/PLCAutoMes.java
@@ -0,0 +1,56 @@
+package com.mes.common;
+
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+
+import static com.mes.common.InitUtil.readAndUpdateWordValues;
+
+public class PLCAutoMes extends Thread {
+
+    private static final Logger log = LoggerFactory.getLogger(PLCAutoMes.class);
+    private static InitUtil initUtil;
+
+    // 鍗曚緥瀹炰緥
+    private static PLCAutoMes instance;
+    private static String PlcAlbania;
+
+
+
+    public static PlcParameterObject PlcMesObject;
+
+    // 绉佹湁鏋勯�犲嚱鏁�
+    public PLCAutoMes() throws IOException {
+        PlcAlbania="D:\\SQL\\PlcCacheGlass.json";
+//        PlcAlbania=PLCAutoMes.class.getResource("/JsonFile/PlcCacheGlass.json").getPath();
+        //log.info(PLCAutoMes.class.getResource("").getPath());
+        PlcMesObject = InitUtil.initword(PlcAlbania);
+        initUtil = new InitUtil();
+    }
+
+    // 鑾峰彇鍗曚緥瀹炰緥
+    public static synchronized PLCAutoMes getInstance() throws IOException {
+        if (instance == null) {
+            instance = new PLCAutoMes();
+        }
+        return instance;
+    }
+
+    @Override
+    public void run() {
+        while (this != null) {
+            try {
+                Thread.sleep(100);
+
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+
+            readAndUpdateWordValues(PlcMesObject);
+
+
+        }
+    }
+}

--
Gitblit v1.8.0