From db32ffbad65906185ba768a3dc7364337473b1b2 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期日, 27 七月 2025 20:48:14 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/thread/impl/TrafficControlImplThread.java |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/zy/core/thread/impl/TrafficControlImplThread.java b/src/main/java/com/zy/core/thread/impl/TrafficControlImplThread.java
index 9d92ed2..9a3a6de 100644
--- a/src/main/java/com/zy/core/thread/impl/TrafficControlImplThread.java
+++ b/src/main/java/com/zy/core/thread/impl/TrafficControlImplThread.java
@@ -36,6 +36,7 @@
     private HashMap<Integer, HashMap<String, List<Integer>>> levNodesMap = null;
 
 
+    private HashMap<Integer,Long> shuttleReportErrorMap = new HashMap<>();
     private HashMap<Integer,Long> pathIdleShuttleMap = new HashMap<>();
     private HashMap<Integer,Long> applyRecordsMap = new HashMap<>();
     private HashMap<String, List<NavigateNode>> taskNodesMap = new HashMap<>();
@@ -597,6 +598,7 @@
 
                     controlDataModel.setTotalNodeList(newTotalNodeList);
                     trafficControlDataList.set(i, controlDataModel);
+                    shuttleReportErrorMap.remove(shuttleNo);
                     return true;
                 }
             }
@@ -605,6 +607,25 @@
     }
 
     @Override
+    public boolean trafficReportError(Integer shuttleNo, Integer taskNo) {
+        ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttleNo);
+        if (shuttleThread == null) {
+            return false;
+        }
+
+        if(shuttleReportErrorMap.containsKey(shuttleNo)) {
+            Long errorTime = shuttleReportErrorMap.get(shuttleNo);
+            if((System.currentTimeMillis() - errorTime) > 1000 * 10) {
+                shuttleReportErrorMap.remove(shuttleNo);
+                shuttleThread.restartCalcPath();
+            }
+        }else {
+            shuttleReportErrorMap.put(shuttleNo, System.currentTimeMillis());
+        }
+        return true;
+    }
+
+    @Override
     public synchronized boolean cancelTrafficControl(Integer shuttleNo, Integer taskNo) {
         //妫�娴嬭溅瀛愭槸鍚﹀瓨鍦ㄧ鍒�
         for (int i = 0; i < trafficControlDataList.size(); i++) {

--
Gitblit v1.9.1