From bf93ca11cb257a83d65d7c21fa3e9058f3a5759f Mon Sep 17 00:00:00 2001 From: liup <1454939542@qq.com> Date: Thu, 26 Sep 2024 13:15:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/ExecuteTheRecipe.java | 41 ++++++++----------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java b/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java index 9051a960..f4bd58eb 100644 --- a/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java +++ b/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java @@ -1330,32 +1330,27 @@ public class ExecuteTheRecipe { Thread.sleep(500); ModbusCenter.rackWritePlc("输送线启动",false,null); - ThreadManager.get().execute(new Runnable() { - @Override - public void run() { - try{ - if(ModbusCenter.getListingValue("输送线出料菜盆检测") instanceof Boolean){ - boolean isStart = (boolean) ModbusCenter.getListingValue("输送线出料菜盆检测"); - long a = System.currentTimeMillis(); - Thread.sleep(15000); - while (!isStart) { - Thread.sleep(1000); - if ((System.currentTimeMillis() - a) > 1000 * 20) { - break; - } - isStart = (boolean) ModbusCenter.getListingValue("输送线出料菜盆检测"); - if(isStart){ - break; - } - } + try{ + if(ModbusCenter.getListingValue("输送线出料菜盆检测") instanceof Boolean){ + boolean isStart = (boolean) ModbusCenter.getListingValue("输送线出料菜盆检测"); + long a = System.currentTimeMillis(); + Thread.sleep(15000); + while (!isStart) { + Thread.sleep(1000); + if ((System.currentTimeMillis() - a) > 1000 * 20) { + break; + } + isStart = (boolean) ModbusCenter.getListingValue("输送线出料菜盆检测"); + if(isStart){ + break; } - ModbusCenter.rackWritePlc("输送线停止",true,null); - Thread.sleep(500); - ModbusCenter.rackWritePlc("输送线停止",false,null); - }catch (Exception e){ } } - }); + ModbusCenter.rackWritePlc("输送线停止",true,null); + Thread.sleep(500); + ModbusCenter.rackWritePlc("输送线停止",false,null); + }catch (Exception e){ + } }catch (Exception e){ }