From e20ca95947bf2c7314c8b6bff085050134d88c53 Mon Sep 17 00:00:00 2001 From: liup Date: Sat, 11 May 2024 11:27:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bonait/bnframework/business/ConfigData.java | 1 + .../bnframework/business/ExecuteTheRecipe.java | 8 +++++++- .../home/activity/BottomNavigationMainActivity.java | 4 ++++ app/src/main/res/layout/fragment_make_good.xml | 7 ++++--- .../res/layout/item/layout/dialog_add_silos_ck.xml | 4 ++-- .../res/layout/item/layout/loadinggood_item.xml | 13 ++++++------- app/src/main/res/layout/item/layout/newmakegood.xml | 1 + 7 files changed, 25 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/com/bonait/bnframework/business/ConfigData.java b/app/src/main/java/com/bonait/bnframework/business/ConfigData.java index edbc7a47..a4fa2c2b 100644 --- a/app/src/main/java/com/bonait/bnframework/business/ConfigData.java +++ b/app/src/main/java/com/bonait/bnframework/business/ConfigData.java @@ -997,6 +997,7 @@ public class ConfigData { } + //endregion } diff --git a/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java b/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java index 61c274ef..104bee13 100644 --- a/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java +++ b/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java @@ -296,7 +296,7 @@ public class ExecuteTheRecipe { } catch (Exception ex) { ToastUtils.error("PLC设备数据监听异常:" + ex.getMessage()); } - Thread.sleep(1); + Thread.sleep(50); } @Override @@ -510,6 +510,12 @@ public class ExecuteTheRecipe { } }); } + + public static void releaseListening(){ + ThreadManager.Get().Stop("PLC设备数据监听"); + ThreadManager.Get().Stop("PLC设备数据监听-信号检测"); + ThreadManager.Get().Stop("商品制作线程"); + } //endregion //region PLC基础控制类 diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigationMainActivity.java b/app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigationMainActivity.java index 14f5855e..a6db02ee 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigationMainActivity.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigationMainActivity.java @@ -20,6 +20,7 @@ import android.widget.RelativeLayout; import com.bonait.bnframework.R; import com.bonait.bnframework.business.ConfigData; +import com.bonait.bnframework.business.ExecuteTheRecipe; import com.bonait.bnframework.business.OrderServer; import com.bonait.bnframework.common.base.BaseActivity; import com.bonait.bnframework.common.constant.ConfigName; @@ -140,6 +141,9 @@ public class BottomNavigationMainActivity extends BaseActivity{ ConfigData.getInstance().ColsePLC(); MediaPlayerHelper.getInstance().Release(); MQTT.get().ConnMqttBroken(false);//释放mqtt + ThreadManager.Get().Stop("PLC断线重连线程"); + ThreadManager.Get().Stop("心跳服务"); + ExecuteTheRecipe.releaseListening(); super.onDestroy(); Glide.get(this).clearMemory(); diff --git a/app/src/main/res/layout/fragment_make_good.xml b/app/src/main/res/layout/fragment_make_good.xml index dd1115fd..5aa8614a 100644 --- a/app/src/main/res/layout/fragment_make_good.xml +++ b/app/src/main/res/layout/fragment_make_good.xml @@ -18,7 +18,7 @@ android:layout_weight="1" android:orientation="horizontal"> + android:layout_height="100dp">