From c1c38d89b4d1b6576b7be0115a73a35b695ad375 Mon Sep 17 00:00:00 2001
From: dubin <bindu_bean@163.com>
Date: 星期三, 10 十二月 2025 16:20:22 +0800
Subject: [PATCH] 初始化
---
src/main/java/com/zy/core/thread/ScaleThread.java | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/ScaleThread.java b/src/main/java/com/zy/core/thread/ScaleThread.java
index 2c9a212..b8e0dd2 100644
--- a/src/main/java/com/zy/core/thread/ScaleThread.java
+++ b/src/main/java/com/zy/core/thread/ScaleThread.java
@@ -6,6 +6,7 @@
import com.core.common.SpringUtils;
import com.zy.asrs.entity.BasDevp;
import com.zy.asrs.service.BasDevpService;
+import com.zy.asrs.service.DeviceErrorService;
import com.zy.core.Slave;
import com.zy.core.ThreadHandler;
import com.zy.core.cache.OutputQueue;
@@ -48,7 +49,8 @@
byte[] read = read(8, 100);
if (null != read) {
String s = new String(read);
- if (!Cools.isEmpty(s) && s.startsWith("=")) {
+ s=s.substring(1);
+ if (!Cools.isEmpty(s) && s.startsWith("+")) {
scale = Double.parseDouble(s.substring(1));
//灏嗙О閲嶉噸閲忓啓鍏ヨ澶囧熀纭�鏁版嵁涓殑gross_wt瀛楁
@@ -83,6 +85,7 @@
@Override
public boolean connect() {
+
try {
close(); //1.涓诲姩閲婃斁杩炴帴 //2.鏌愪簺鏈嶅姟鍣ㄥ鎸囧畾ip鏈夐摼璺暟闄愬埗
socket = new Socket();
--
Gitblit v1.9.1