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"> + +