From b092806a662b99310cdb050292de2721ba06acd9 Mon Sep 17 00:00:00 2001 From: wu <731351411@qq.com> Date: 星期二, 19 十一月 2024 14:43:18 +0800 Subject: [PATCH] 增加测量台直通模式,增加手动参数界面的JSON文件 --- springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java | 40 ++++++++++++++++++++++++++++------------ 1 files changed, 28 insertions(+), 12 deletions(-) diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java index 8756fe9..4b1844c 100644 --- a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java +++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java @@ -17,7 +17,7 @@ private StorageCageService storageCageService; int aaa; String huibao = ""; - + String qidong = ""; @Override public void run() { @@ -32,7 +32,8 @@ storageCageService = WebSocketServer.applicationContext.getBean(StorageCageService.class); spianService = WebSocketServer.applicationContext.getBean(SpianServiceNew.class); albaniaMapper = WebSocketServer.applicationContext.getBean(AlbaniaMapper.class); - spianService.selectout(1); + // spianService.selectout(1); + // spianService.mateOut(); // 璇诲彇DB14鍖烘枃浠� PlcParameterObject plcmes = PLCAutoMes.PlcMesObject; if (plcmes.getPlcParameter("PLCToMES").getValue() != null) { @@ -42,11 +43,16 @@ String IDStatus1 = plcmes.getPlcParameter("IDStatus1").getValue();// 1鍙蜂换鍔″畬鎴� String MESToPLCStatus1 = plcmes.getPlcParameter("MESToPLCStatus1").getValue();// 1鍙风‘璁ゅ瓧 String MESToPLC = plcmes.getPlcParameter("MESToPLC").getValue();// 鍙戦�佷换鍔″瓧 + int taskcont = albaniaMapper.SelectTaskcount(); // 姝e湪杩涜鐨勪换鍔℃暟閲� int outtask = albaniaMapper.SelectOutTaskCount(); // 绛夊緟琛ュ彂鐨勫嚭鐗囦换鍔℃暟閲� - if(outtask>0){ - spianService.mateOut(); + if (ExportTOMES1 != null && MESToPLC != null && taskcont == 0) { + //褰撳彲浠ュ彂浠诲姟骞朵笖鍑虹墖闃熷垪鏈変换鍔℃椂 + if (ExportTOMES1.equals("1") == true && MESToPLC.equals("0") == true && PLCToMES.equals("1") == true&&outtask>0 && MESToPLCStatus1.equals("0")) { + spianService.mateOut(); + } } + // String scan=plcmes.getPlcParameter("scan").getValue();//鍙戦�佹壂鐮佷俊鎭� // if(scan.equals("1")==true){ // spianService.scan(scan); @@ -57,15 +63,25 @@ System.out.println("姹囨姤璁板綍:" + IDStatus1 + "鏃堕棿" + currentTime); } huibao = IDStatus1; + if (!qidong.equals(MESToPLC)) { + System.out.println("鍚姩璁板綍:" + MESToPLC + "鏃堕棿" + currentTime); + } + qidong = MESToPLC; + + PLCToMES = plcmes.getPlcParameter("PLCToMES").getValue();// 杩愰�佽溅璇锋眰 + IDStatus1 = plcmes.getPlcParameter("IDStatus1").getValue();// 1鍙蜂换鍔″畬鎴� + MESToPLCStatus1 = plcmes.getPlcParameter("MESToPLCStatus1").getValue();// 1鍙风‘璁ゅ瓧 + MESToPLC = plcmes.getPlcParameter("MESToPLC").getValue();// 鍙戦�佷换鍔″瓧 + // 涓�鍙风嚎璇锋眰 if (ExportTOMES1 != null && MESToPLC != null && taskcont == 0) { if (ExportTOMES1.equals("1") == true && MESToPLC.equals("0") == true && PLCToMES.equals("1") == true - && MESToPLCStatus1.equals("0") == true) { - System.out - .println("鍑虹墖鐘舵��:MESToPLC:" + MESToPLC + "PLCToMES:" + PLCToMES + "MESToPLCStatus1:" + MESToPLCStatus1); + && MESToPLCStatus1.equals("0") == true&&outtask == 0) { + // System.out + // .println("鍑虹墖鐘舵��:MESToPLC:" + MESToPLC + "PLCToMES:" + PLCToMES + "MESToPLCStatus1:" + MESToPLCStatus1); spianService.selectout(1); try { - Thread.sleep(200); // 姣�100姣妫�鏌ヤ竴娆� + Thread.sleep(100); // 姣�100姣妫�鏌ヤ竴娆� } catch (InterruptedException e) { Thread.currentThread().interrupt(); // 澶勭悊绾跨▼涓柇 } @@ -78,15 +94,15 @@ MESToPLC = plcmes.getPlcParameter("MESToPLC").getValue();// 鍙戦�佷换鍔″瓧 // 杩愰�佽溅璇锋眰鍜屾祴閲忓畬鎴愯姹� GlassInfo glass = albaniaMapper.SelectGlass(); - if (PLCToMES != null && glass != null && MESToPLC != null && taskcont == 0) { - if (PLCToMES.equals("1") == true && MESToPLC.equals("0") == true && MESToPLCStatus1.equals("0") == true) { + if (PLCToMES != null && glass != null && MESToPLC != null) { + if (PLCToMES.equals("1") == true && MESToPLC.equals("0") == true && MESToPLCStatus1.equals("0") == true&&outtask == 0) { try { Thread.sleep(100); // 姣�100姣妫�鏌ヤ竴娆� } catch (InterruptedException e) { Thread.currentThread().interrupt(); // 澶勭悊绾跨▼涓柇 } - System.out - .println("杩涚墖鐘舵��:MESToPLC:" + MESToPLC + "PLCToMES:" + PLCToMES + "MESToPLCStatus1:" + MESToPLCStatus1); + // System.out + // .println("杩涚墖鐘舵��:MESToPLC:" + MESToPLC + "PLCToMES:" + PLCToMES + "MESToPLCStatus1:" + MESToPLCStatus1); spianService.selectAll(glass); } } -- Gitblit v1.8.0