From 802dca6731294c970e8adb81646ea7ecebf91fbd Mon Sep 17 00:00:00 2001
From: whyclj <1525436766@qq.com>
Date: 星期五, 22 十一月 2019 09:56:06 +0800
Subject: [PATCH] 编辑电池组信息时改变当前电池组线程状态,并且添加电池组充放电线程记录

---
 platforms/android/app/src/main/java/com/socket/CommSockClientThread.java |   26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/platforms/android/app/src/main/java/com/socket/CommSockClientThread.java b/platforms/android/app/src/main/java/com/socket/CommSockClientThread.java
index 6618c58..d8852a7 100644
--- a/platforms/android/app/src/main/java/com/socket/CommSockClientThread.java
+++ b/platforms/android/app/src/main/java/com/socket/CommSockClientThread.java
@@ -21,7 +21,9 @@
 import java.io.OutputStream;
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
 
 /**
  * 搴曞眰鍜屾眹闆嗗櫒閫氳绾跨▼
@@ -77,7 +79,13 @@
             public void handleMessage(Message msg)
             {
                 ServiceModel model = (ServiceModel) (msg.obj);
-                //Log.e(TAG, "handleMessage: " + model);
+//                int what = msg.what;
+//                List<BattDataThread> battData = FBS9600S_DeviceService.allBattDatt;
+//                if(model.battindex>0 && model.battindex<FBS9600S_DeviceService.MAXCONCENTRATORCOUNT){
+//                    if(!battData.get(model.battindex-1).isInstall){
+//                        return;
+//                    }
+//                }
                 try
                 {
                     if(null != model.mhandler)
@@ -108,7 +116,7 @@
                         Message toMain = handler.obtainMessage();
                         toMain.obj = remodel;
                         handler.sendMessage(toMain);
-                        sleep(200);
+                        sleep(5);
                     }
                 }
                 catch (InterruptedException e)
@@ -200,7 +208,7 @@
                             //	res = true;
                             break;
                         }
-                        if(rx_read_time_out > 40) {
+                        if(rx_read_time_out > 30) {
                             break;
                         }
                     }
@@ -209,11 +217,11 @@
 
                 bytebuffer_for_socket_RX.flip();
 
-                Date d2 = new Date();
-                long comm_tms = (d2.getTime() - d1.getTime());
-                if(comm_tms < 200) {
-                    Thread.sleep(200 - comm_tms);
-                }
+//                Date d2 = new Date();
+//                long comm_tms = (d2.getTime() - d1.getTime());
+//                if(comm_tms < 200) {
+//                    Thread.sleep(200 - comm_tms);
+//                }
 		        /*
 		        System.out.println(this.getName()
 		        					+ "  dev_id: " + m_StatAndParam.dev_id
@@ -228,7 +236,7 @@
                 bytebuffer_for_socket_RX.get(cipher_buf);
 
 
-                Log.e(TAG, "鎺ユ敹鏁版嵁: "+ ComFn.bytesToHexString(cipher_buf, cipher_buf.length));
+                //Log.e(TAG, "鎺ユ敹鏁版嵁: "+ ComFn.bytesToHexString(cipher_buf, cipher_buf.length));
                 if(true == getDataFromCommBuf(cipher_buf,remodel)) {
                     rx_errcount_for_live_of_thread = 0;
                     res_t = true;

--
Gitblit v1.9.1