From cfc2855d2fe063e26947bad7277a1091efbb3bbb Mon Sep 17 00:00:00 2001 From: wu <731351411@qq.com> Date: 星期四, 28 十一月 2024 02:16:21 +0800 Subject: [PATCH] 协议地址更新,手动页面更新 --- springboot-vue3/src/main/java/com/example/springboot/entity/device/PlcParameterInfo.java | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 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 index f0bc2e2..07db710 100644 --- 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 @@ -1,4 +1,7 @@ package com.example.springboot.entity.device; + +import com.example.springboot.component.S7control; + public class PlcParameterInfo { public PlcParameterInfo(String startAddress) { this.startAddress = startAddress; @@ -9,6 +12,9 @@ // 鍙傛暟鍚嶇О private String name; + + // 鑻辨枃鍚嶇О + private String usname; // 璇诲彇 鍙傛暟鍊� private String value; @@ -42,6 +48,14 @@ public void setName(String name) { this.name = name; + } + + public String getusName() { + return this.usname; + } + + public void setusName(String usname) { + this.usname = usname; } public String getValue() { @@ -112,8 +126,8 @@ } if (addressLength == 14 ) { int wordindex = index; - int newIndex = wordindex + 13; - return stringdatas[0] + "." + wordindex +"-" + newIndex; + //int newIndex = wordindex + 13; + return stringdatas[0] + "." + wordindex ; } return null; } @@ -122,6 +136,9 @@ return addressIndex; } + public String getValueString() { + return S7control.getinstance().readStrings(getAddress()); + } public String getAddress() { return getAddress(this.addressIndex); } -- Gitblit v1.8.0