Przeglądaj źródła

3333

一拖四味魔方
fyf 1 rok temu
rodzic
commit
0fd572bbad
3 zmienionych plików z 22 dodań i 18 usunięć
  1. +5
    -1
      app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
  2. +2
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/SilosNewActivity.java
  3. +15
    -17
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/Silos_item_fragment.java

+ 5
- 1
app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java Wyświetl plik

@@ -241,7 +241,7 @@ public class ExecuteTheRecipe {
ExecuteTheRecipe.WritePLC("手动控制"+i,false,null);
}
}
});
}).start();

ThreadManager.Get().StartLong("PLC设备数据监听", true, new IThread() {
@Override
@@ -410,6 +410,10 @@ public class ExecuteTheRecipe {
//MessageLog.ShowUserMessage(UserLogEnum.订单处理日志, message + "准备下发【" + silos.num + "】号料仓PLC控制命令,需求量:=" + recipe.value);
int _val = (int)Math.round((Double.parseDouble(recipe.value) * 10));
WritePLC("需求值" + silos.num, (short) _val, null);

//減去料仓数量
int otherG=silos.silosmargin-(_val/10);
QueryDB.UpdateYL(silos.id,otherG>=0?otherG:0);
}
}
MessageLog.ShowInfo(RecipesNames + "下发成功!");


+ 2
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/SilosNewActivity.java Wyświetl plik

@@ -102,6 +102,7 @@ public class SilosNewActivity extends BaseActivity {
@Override
public void clickListenerNew(View v, int k, Object data) {
if (k == 0) {
DataBus.getInstance().RefreshSilos();
MessageManager.getInstance().sendMessage(MessageName.RefreshSilos,"RefreshSilos");
add_yijian.setVisibility(View.GONE);
} else if (k == 1) {
@@ -131,6 +132,7 @@ public class SilosNewActivity extends BaseActivity {
@Override
public void clickListenerNew(View v, int k, Object data) {
if (k == 0) {
DataBus.getInstance().RefreshSilos();
MessageManager.getInstance().sendMessage(MessageName.RefreshSilos,"RefreshSilos");
add_silos.setVisibility(View.GONE);
} else if (k == 1) {


+ 15
- 17
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/Silos_item_fragment.java Wyświetl plik

@@ -78,23 +78,21 @@ public class Silos_item_fragment extends BaseFragment {
*/
public void InitViewData()
{
// new Thread(new Runnable() {
// @Override
// public void run() {
// if(activity!=null)
// {
// activity.runOnUiThread(new Runnable() {
// @Override
// public void run() {
//
// }
// });
// }
// }
// });

DataBus.getInstance().RefreshSilos();
InitView();
new Thread(new Runnable() {
@Override
public void run() {
if(activity!=null)
{
activity.runOnUiThread(new Runnable() {
@Override
public void run() {

InitView();
}
});
}
}
}).start();
}
/**
* 初始化界面


Ładowanie…
Anuluj
Zapisz