From 769ff0cab8654aa951d9bb9f5a0d431249b60837 Mon Sep 17 00:00:00 2001 From: fyf Date: Fri, 5 May 2023 11:23:07 +0800 Subject: [PATCH] ces3223223111 --- .../java/com/example/bpa/app/BusinessServer.java | 16 ++++++++++++---- .../main/java/com/example/bpa/app/ICSApp.java | 4 ---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/example/bpa/app/BusinessServer.java b/app/src/main/java/com/example/bpa/app/BusinessServer.java index 51a44a2..37b5720 100644 --- a/app/src/main/java/com/example/bpa/app/BusinessServer.java +++ b/app/src/main/java/com/example/bpa/app/BusinessServer.java @@ -28,9 +28,10 @@ public class BusinessServer { private BusinessServer() { } + /** + * 商品制作队列 + */ ConcurrentLinkedQueue Commoditys = new ConcurrentLinkedQueue(); - - /** * 添加配方 * @@ -40,8 +41,12 @@ public class BusinessServer { Commoditys.offer(info); } + /** + * 订单制作线程 + */ public void Start() { - DeviceData.Get().TestInit(); + //DeviceData.Get().TestInit(); + ThreadManager.Get().StartLong("配方执行业务流程", true, new IThread() { @Override public void Run() throws InterruptedException { @@ -60,6 +65,7 @@ public class BusinessServer { for (LinkedHashMap.Entry> entry : rgrs.entrySet()) { for (int m = 0; m < entry.getValue().size(); m++) { int materialType = entry.getValue().get(m).materialType; + //1.正常物料 if (materialType == 1) { //获取料仓信息 List bss = QueryDB.GetSolisByMaterialID(entry.getValue().get(m).materialID); @@ -70,7 +76,9 @@ public class BusinessServer { DeviceData.Get().setDemandValue((short) entry.getValue().get(m).value, bss.get(x).num, null); } } - } else if (materialType == 2) { + } + //2.果糖 + else if (materialType == 2) { BPA_SUGAR bs = QueryDB.GetsugarId(entry.getValue().get(m).materialID); ModbusTcpServer.get().WriteBool(bs.plcvar, true); } diff --git a/app/src/main/java/com/example/bpa/app/ICSApp.java b/app/src/main/java/com/example/bpa/app/ICSApp.java index ef49dcf..bd079df 100644 --- a/app/src/main/java/com/example/bpa/app/ICSApp.java +++ b/app/src/main/java/com/example/bpa/app/ICSApp.java @@ -30,20 +30,16 @@ public class ICSApp extends Application { @Override public void onCreate() { super.onCreate(); - - MessageLog.MsgNotify = new IMessageLogNotify() { @Override public void ErrorMsg(String msg) { Log.e("Error", msg); } - @Override public void InfoMsg(String msg, String datetime) { Log.i("Info", msg); } - @Override public void WarnMsg(String msg) { Log.w("Warn", msg);