Browse Source

推送

调味吧台第二版
fyf 1 year ago
parent
commit
aa2fcac243
4 changed files with 33 additions and 1 deletions
  1. +6
    -0
      app/src/main/java/com/example/bpa/service/BusinessServer.java
  2. +9
    -0
      app/src/main/java/com/example/bpa/service/DeviceData.java
  3. +3
    -1
      app/src/main/java/com/example/bpa/view/fragment/HomeFragment.java
  4. +15
    -0
      app/src/main/res/layout/from/layout/fragment_home.xml

+ 6
- 0
app/src/main/java/com/example/bpa/service/BusinessServer.java View File

@@ -109,6 +109,12 @@ public class BusinessServer {
//region 物料下发
int count = 0;
for (LinkedHashMap.Entry<Integer, List<ResGoodsRecipe>> entry : rgrs.entrySet()) {

//复位完成信号
DeviceData.Get().setfuweiwanchengxinhao(false,null);
Thread.sleep(10);
MessageLog.ShowInfo("[" + good.name + "]完成信号置于false!");

final Integer key = entry.getKey();
//当前一次性下发物料集合
List<ResGoodsRecipe> goodsRecipes = entry.getValue();


+ 9
- 0
app/src/main/java/com/example/bpa/service/DeviceData.java View File

@@ -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);
}

/**
* 手自动模式
*/


+ 3
- 1
app/src/main/java/com/example/bpa/view/fragment/HomeFragment.java View File

@@ -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));
}
});


+ 15
- 0
app/src/main/res/layout/from/layout/fragment_home.xml View File

@@ -222,6 +222,21 @@
android:text="89.9°C"
android:layout_margin="5dp"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:text="称:"
android:layout_margin="5dp"/>
<TextView
android:id="@+id/dianzichen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/lable_color"
android:textSize="@dimen/TitleSize"
android:text="11.9g"
android:layout_margin="5dp"/>

<TextView
android:id="@+id/pf_ms"
android:layout_width="match_parent"


Loading…
Cancel
Save