From 9a0dd8244282d90b08b16d2c239683bbac62fab2 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期二, 16 一月 2024 15:02:21 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes

---
 springboot-vue3/src/main/java/com/example/springboot/entity/device/PlcParameterInfo.java |  117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 117 insertions(+), 0 deletions(-)

diff --git a/springboot-vue3/src/main/java/com/example/springboot/entity/device/PlcParameterInfo.java b/springboot-vue3/src/main/java/com/example/springboot/entity/device/PlcParameterInfo.java
new file mode 100644
index 0000000..1faf7c9
--- /dev/null
+++ b/springboot-vue3/src/main/java/com/example/springboot/entity/device/PlcParameterInfo.java
@@ -0,0 +1,117 @@
+package com.example.springboot.entity.device;
+public  class PlcParameterInfo {
+      public PlcParameterInfo(String startAddress) {
+        this.startAddress = startAddress;
+      } 
+        private String startAddress;
+        // 鍙傛暟鏍囪瘑
+        private String codeId;
+
+        // 鍙傛暟鍚嶇О
+        private String name;
+
+        // 璇诲彇 鍙傛暟鍊�
+        private String value;
+
+        // // 鍐欏叆 鍙傛暟鍊�
+        // private String writeValue;
+
+        // 鍙傛暟鍗曚綅
+        private String unit;
+
+        // 鍙傛暟鍊艰浆鎹㈢郴鏁�
+        private int ratio;
+
+        // 鍙傛暟鍦板潃
+        private int addressIndex;
+
+        // 鍙傛暟鍦板潃浣嶉暱搴�
+        private int addressLength;
+
+        public String getCodeId() {
+            return this.codeId;
+        }
+
+        public void setCodeId(String codeId) {
+            this.codeId = codeId;
+        }
+
+        public String getName() {
+            return this.name;
+        }
+
+        public void setName(String name) {
+            this.name = name;
+        }
+
+        public String getValue() {
+            return this.value;
+        }
+
+        public void setValue(String value) {
+            this.value = value;
+        }
+
+        // public String getWriteValue() {
+        //     return this.writeValue;
+        // }
+
+        // public void setWriteValue(String writeValue) {
+        //     this.writeValue = writeValue;
+        // }
+
+        public String getUnit() {
+            return this.unit;
+        }
+
+        public void setUnit(String unit) {
+            this.unit = unit;
+        }
+
+        public int getAddressIndex() {
+            return this.addressIndex;
+        }
+
+        public void setAddressIndex(int addressindex) {
+            this.addressIndex = addressindex;
+        }
+
+        public int getAddressLength() {
+            return this.addressLength;
+        }
+
+        public void setAddressLength(int addresslength) {
+            this.addressLength = addresslength;
+        }
+
+        public int getRatio() {
+            return this.ratio;
+        }
+
+        public void setRatio(int ratio) {
+            this.ratio = ratio;
+        }
+
+           /**
+     * 鑾峰彇鍦板潃
+     * 
+     * @param index 绱㈠紩鍦板潃
+     */
+    public String getAddress(int index) {
+        String[] stringdatas = this.startAddress.trim().split("\\.");
+        if (stringdatas.length < 2 )
+            return null;
+        int dbwindex = 0;
+        int bitindex = 0;
+         if (stringdatas.length == 2) {
+            dbwindex = Integer.parseInt(stringdatas[1]);
+        } else
+            return null; 
+        return stringdatas[0]+"."+dbwindex+bitindex;
+    }
+
+    public int getPlcAddress() {
+
+        return addressIndex;
+    }
+}
\ No newline at end of file

--
Gitblit v1.8.0