From aa2fcac243cb5df5b46030a6f113adb7b3922a00 Mon Sep 17 00:00:00 2001 From: fyf Date: Sat, 7 Oct 2023 15:31:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/example/bpa/service/BusinessServer.java | 6 ++++++ .../java/com/example/bpa/service/DeviceData.java | 9 +++++++++ .../example/bpa/view/fragment/HomeFragment.java | 4 +++- .../main/res/layout/from/layout/fragment_home.xml | 15 +++++++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/example/bpa/service/BusinessServer.java b/app/src/main/java/com/example/bpa/service/BusinessServer.java index fa7de4a..1cc4c55 100644 --- a/app/src/main/java/com/example/bpa/service/BusinessServer.java +++ b/app/src/main/java/com/example/bpa/service/BusinessServer.java @@ -109,6 +109,12 @@ public class BusinessServer { //region 物料下发 int count = 0; for (LinkedHashMap.Entry> entry : rgrs.entrySet()) { + + //复位完成信号 + DeviceData.Get().setfuweiwanchengxinhao(false,null); + Thread.sleep(10); + MessageLog.ShowInfo("[" + good.name + "]完成信号置于false!"); + final Integer key = entry.getKey(); //当前一次性下发物料集合 List goodsRecipes = entry.getValue(); diff --git a/app/src/main/java/com/example/bpa/service/DeviceData.java b/app/src/main/java/com/example/bpa/service/DeviceData.java index 0991912..88d2f37 100644 --- a/app/src/main/java/com/example/bpa/service/DeviceData.java +++ b/app/src/main/java/com/example/bpa/service/DeviceData.java @@ -435,6 +435,15 @@ public class DeviceData { ModbusTcpServer.get().WriteBool("M0.2", value, callback); } + /** + * 复位配料完成信号 + * + * @param value true:自动模式,flase:手动模式 + */ + public void setfuweiwanchengxinhao(boolean value, IWriteCallBack callback) { + ModbusTcpServer.get().WriteBool("M0.3", value, callback); + } + /** * 手自动模式 */ diff --git a/app/src/main/java/com/example/bpa/view/fragment/HomeFragment.java b/app/src/main/java/com/example/bpa/view/fragment/HomeFragment.java index b3a5603..b37d40c 100644 --- a/app/src/main/java/com/example/bpa/view/fragment/HomeFragment.java +++ b/app/src/main/java/com/example/bpa/view/fragment/HomeFragment.java @@ -79,7 +79,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener, MyCl /** * 当前温度 */ - TextView wendu1,pf_ms,plc_status; + TextView wendu1,pf_ms,plc_status,dianzichen; /** * 界面实例 */ @@ -119,6 +119,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener, MyCl nohelp=view.findViewById(R.id.nohelp); image_zdkz=view.findViewById(R.id.image_zdkz); wendu1 = view.findViewById(R.id.wendu1); + dianzichen= view.findViewById(R.id.dianzichen); pf_ms = view.findViewById(R.id.pf_ms); plc_status = view.findViewById(R.id.plc_status); if( ConfigName.getInstance().IsUserDownOrder) @@ -374,6 +375,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener, MyCl public void run() { wendu1.setText(String.valueOf(DeviceData.Get().getBWX_FructoseTemperature()) + "°C"); plc_status.setText(DataBus.getInstance().PlcIsConnect?"正常":"异常"); + dianzichen.setText(String.valueOf(DeviceData.Get().getCallCurrentWeight(1) / 10.0) + " g"); // plc_status.setTextColor(DataBus.getInstance().PlcIsConnect?getResources().getColor(R.color.foreground):getResources().getColor(R.color.warm_red)); } }); diff --git a/app/src/main/res/layout/from/layout/fragment_home.xml b/app/src/main/res/layout/from/layout/fragment_home.xml index 062adf5..8cb0c4c 100644 --- a/app/src/main/res/layout/from/layout/fragment_home.xml +++ b/app/src/main/res/layout/from/layout/fragment_home.xml @@ -222,6 +222,21 @@ android:text="89.9°C" android:layout_margin="5dp"/> + + +