From 3a6fca8a9ef505301907217ac9d98866fb5eeb3c Mon Sep 17 00:00:00 2001
From: huang <1532065656@qq.com>
Date: 星期二, 25 三月 2025 11:08:57 +0800
Subject: [PATCH] 修改看板表格加滚动,适应大屏
---
JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcParameter.java | 66 ++++++++++++++++++++++++++++-----
1 files changed, 56 insertions(+), 10 deletions(-)
diff --git a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcParameter.java b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcParameter.java
index e8b539f..7445a1c 100644
--- a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcParameter.java
+++ b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcParameter.java
@@ -13,6 +13,8 @@
import java.util.HashMap;
import java.util.Map;
+import static com.mes.tools.HexConversion.*;
+
/**
* Plc鍙傛暟
*/
@@ -28,7 +30,7 @@
/**
* 璧峰鍦板潃
*/
- private int addressIndex=0;
+ private int addressStart=0;
/**
* 闀垮害
*/
@@ -39,7 +41,11 @@
private String type="int";
/**
- * 瀹炴椂璇诲彇鐨勫��
+ * 瀹炴椂璇诲彇鐨刡yte鍊�
+ */
+ private byte[] readByte=null;
+ /**
+ * 瀹炴椂璇诲彇鐨刡yte鍊艰浆鎹㈡垚 瀵瑰簲绫诲瀷
*/
private Object readValue=null;
@@ -48,12 +54,17 @@
*/
private Object writeValue=null;
+ /**
+ * 闇�瑕佸啓鍏ョ殑鍊�
+ */
+ private byte[] writeByte=null;
+
PlcParameter(){
}
- PlcParameter(String codeId, int addressIndex, int addressLength, String type){
+ PlcParameter(String codeId, int addressStart, int addressLength, String type){
this.CodeId=codeId;
- this.addressIndex=addressIndex;
+ this.addressStart=addressStart;
this.addressLength=addressLength;
this.type=type;
}
@@ -66,12 +77,12 @@
CodeId = codeId;
}
- public int getAddressIndex() {
- return addressIndex;
+ public int getAddressStart() {
+ return addressStart;
}
- public void setAddressIndex(int addressIndex) {
- this.addressIndex = addressIndex;
+ public void setAddressStart(int addressIndex) {
+ this.addressStart = addressStart;
}
public int getAddressLength() {
@@ -91,18 +102,53 @@
}
public Object getReadValue() {
+
return readValue;
+ }
+ public String getValueString() {
+ return getValueInt()+"";
+ }
+ public int getValueInt() {
+ if(this.readByte==null||this.readByte.length<1){
+ //log.info("璇诲彇鍐呭涓簄ull: {} :{}",this.getCodeId(),this.readByte);
+ return 0;
+ }
+ return bytesToIntDesc(this.readByte,0);
}
public void setReadValue(Object readValue) {
this.readValue = readValue;
}
+ public byte[] getReadByte() {
+ return this.readByte;
+ }
+
+ public void setReadByte(byte[] readByte) {
+ this.readByte = readByte;
+ }
+
public Object getWriteValue() {
return writeValue;
}
- public void setWriteValue(Object writeValue) {
- this.writeValue = writeValue;
+ public byte [] setWriteValue(Object writeValue) {
+ //浼犲叆鍊兼牴鎹弬鏁扮被鍨嬭繘琛岃浆鎹㈡垚瀛楃涓蹭繚瀛樿繘鍐欏叆 瀛楄妭鍐呭苟涓旇繑鍥�
+ byte []sendByte=new byte[13+this.addressLength];
+ if ("int".equals(this.type)){
+ this.writeByte=intToBytesDesc(Integer.parseInt(writeValue.toString()),this.addressLength);
+ return this.writeByte;
+ }else if ("word".equals(this.type)){
+ this.writeByte=intToBytesDesc(Integer.parseInt(writeValue.toString()),this.addressLength);
+ return this.writeByte;
+ }else if("string".equals(this.type)){
+
+ }else{
+
+ }
+ return null;
+ }
+ public byte [] getWriteByte() {
+ return this.writeByte;
}
}
--
Gitblit v1.8.0