From 50ec94dd7dd11e2a8b3305bf80ebd753e272f868 Mon Sep 17 00:00:00 2001 From: fyf <11621@LAPTOP-04QQU0AO> Date: Wed, 16 Aug 2023 16:33:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=B0=E5=9C=BA=E6=94=B9=E5=8A=A8=E5=A5=B6?= =?UTF-8?q?=E8=8C=B6=E5=90=A71?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/bpa/view/fragment/HomeFragment.java | 6 +++++- .../com/example/bpa/view/from/add_pf_activity.java | 1 + .../main/res/layout/from/layout/fragment_home.xml | 14 ++++++++++++++ app/src/main/res/layout/spinner_dropdown_item.xml | 2 +- 4 files changed, 21 insertions(+), 2 deletions(-) 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 b3b51b9..e6e0e6c 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 @@ -74,7 +74,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener, MyCl /** * 当前温度 */ - TextView wendu1, wendu2,pf_ms; + TextView wendu1, wendu2,pf_ms,plc_status; /** * 界面实例 */ @@ -106,6 +106,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener, MyCl wendu1 = view.findViewById(R.id.wendu1); wendu2 = view.findViewById(R.id.wendu2); pf_ms = view.findViewById(R.id.pf_ms); + plc_status = view.findViewById(R.id.plc_status); if( ConfigName.getInstance().IsUserDownOrder) { makesp.setVisibility(View.VISIBLE); @@ -309,6 +310,9 @@ public class HomeFragment extends Fragment implements View.OnClickListener, MyCl public void run() { wendu1.setText(String.valueOf(DeviceData.Get().getBWX_FructoseTemperature()) + "°C"); wendu2.setText(String.valueOf(DeviceData.Get().getJRX_FructoseTemperature()) + "°C"); + plc_status.setText(DataBus.getInstance().PlcIsConnect?"正常":"异常"); + plc_status.setTextColor(DataBus.getInstance().PlcIsConnect?getResources().getColor(R.color.foreground):getResources().getColor(R.color.warm_red)); + } }); Thread.sleep(100); diff --git a/app/src/main/java/com/example/bpa/view/from/add_pf_activity.java b/app/src/main/java/com/example/bpa/view/from/add_pf_activity.java index ae86b59..b2cad24 100644 --- a/app/src/main/java/com/example/bpa/view/from/add_pf_activity.java +++ b/app/src/main/java/com/example/bpa/view/from/add_pf_activity.java @@ -168,6 +168,7 @@ public class add_pf_activity extends AppCompatActivity implements View.OnClickLi adapter.setDropDownViewResource(R.layout.spinner_dropdown_item); wuliaolist_spinner.setAdapter(adapter); + List resSugars = QueryDB.GetSugarALL(); for (BPA_SUGAR sugar:resSugars){ sugar_map.put(sugar.sugarName,sugar.id); 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 557ad3b..8de90ad 100644 --- a/app/src/main/res/layout/from/layout/fragment_home.xml +++ b/app/src/main/res/layout/from/layout/fragment_home.xml @@ -174,6 +174,20 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true"> + +