From 793e1ecb8d24c51a15d81eabd409361248e5663e Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期一, 25 十二月 2023 16:44:09 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |   63 ++++++++++++++++++++++++++-----
 1 files changed, 52 insertions(+), 11 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
index 176130d..6aa9b68 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -106,6 +106,57 @@
                 }
                 String barcode = barcodeThread.getBarcode();
 
+
+
+                // 鑾峰彇鍏ュ簱绔欎俊鎭�
+                SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
+                StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo());
+                if (staProtocol == null) {
+                    continue;
+                } else {
+                    staProtocol = staProtocol.clone();
+                }
+                // 灏哄妫�娴嬪紓甯�
+                boolean back = false;
+                String errMsg = "寮傚父锛�";
+                if (staProtocol.isFrontErr()) {
+                    errMsg = errMsg+"鍓嶈秴闄愶紱";
+                    back = true;
+                }
+                if (staProtocol.isBackErr()) {
+                    errMsg = errMsg+"鍚庤秴闄�";
+                    back = true;
+                }
+                if (staProtocol.isHighErr()) {
+                    errMsg = errMsg+"楂樿秴闄�";
+                    back = true;
+                }
+                if (staProtocol.isLeftErr()) {
+                    errMsg = errMsg+"宸﹁秴闄�";
+                    back = true;
+                }
+                if (staProtocol.isRightErr()) {
+                    errMsg = errMsg+"鍙宠秴闄�";
+                    back = true;
+                }
+                if (staProtocol.isWeightErr()) {
+                    errMsg = errMsg+"瓒呴噸";
+                    back = true;
+                }
+                if (staProtocol.isBarcodeErr()) {
+                    errMsg = errMsg+"鎵爜澶辫触";
+                    back = true;
+                }
+                // 閫�鍥�
+                if (back) {
+                    // led 寮傚父鏄剧ず
+                    LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed());
+                    if (ledThread != null) {
+                        MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errMsg));
+                    }
+                    continue;
+                }
+
                 if (!Cools.isEmpty(barcode)) {
                     log.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", inSta.getBarcode(), barcode);
                     if ("NG".endsWith(barcode) || "NoRead".equals(barcode)) {
@@ -120,16 +171,6 @@
 //                    }
                     continue;
                 }
-
-                // 鑾峰彇鍏ュ簱绔欎俊鎭�
-                SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
-                StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo());
-                if (staProtocol == null) {
-                    continue;
-                } else {
-                    staProtocol = staProtocol.clone();
-                }
-
                 // 鍒ゆ柇鏄惁婊¤冻鍏ュ簱鏉′欢
                 if (staProtocol.isAutoing()
                         && staProtocol.isLoading()
@@ -1419,7 +1460,7 @@
                 // 鑾峰彇鍙夎溅绔欑偣
                 StaProtocol staProtocol = devpThread.getStation().get(staNo);
                 if (staProtocol == null) { continue; }
-                if (staProtocol.getWorkNo() != 0) {
+                if (staProtocol.getWorkNo() != 0 || staProtocol.isErr()) {
                     reset = false;
                     break;
                 }

--
Gitblit v1.9.1