From 351086486441b80cfe71550b43cbe1e4dc440f5d Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期一, 09 二月 2026 13:58:30 +0800
Subject: [PATCH] 1.状态图右侧数据,Slot不刷新,修复刷新逻辑。

---
 SourceCode/Bond/Servo/CEquipment.cpp |   48 ++++++++++++++++++++++++++++++++++++------------
 1 files changed, 36 insertions(+), 12 deletions(-)

diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index 0668179..c0d4998 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -927,6 +927,27 @@
 		for (int i = 0; i < SLOT_MAX; i++) {
 			CGlass* pGlass = (CGlass*)m_slot[i].getContext();
 			if (pGlass != nullptr && compareJobData(pJobDataB, pGlass->getJobDataS())) {
+				// 鍙栫墖鎴愬姛鍚庯紝鍥炲~褰撳墠璺緞鑺傜偣鐨勭寮�鏃堕棿锛堜紭鍏堝尮閰嶅皻鏈寮�鐨勮妭鐐癸級銆�
+				CPath* pPath = pGlass->getPath();
+				if (pPath != nullptr) {
+					CPath* pScan = pPath->getHeadPath();
+					CPath* pOpenNode = nullptr;
+					const unsigned int slotNo = (unsigned int)m_slot[i].getNo();
+					const unsigned int unitNo = getSlotUnit((int)slotNo);
+					while (pScan != nullptr) {
+						if (pScan->getEqID() == m_nID
+							&& pScan->getUnit() == unitNo
+							&& pScan->getSlot() == slotNo
+							&& pScan->getOutTime() == 0) {
+							pOpenNode = pScan;
+						}
+						pScan = pScan->getNext();
+					}
+					if (pOpenNode != nullptr) {
+						pOpenNode->setOutTime(CToolUnits::getTimestamp());
+					}
+				}
+
 				pContext = pGlass;
 				if (pGlass != nullptr) pGlass->addRef();
 				m_slot[i].setContext(nullptr);
@@ -2135,18 +2156,6 @@
 			return FALSE;
 		}
 
-		// 濡傛灉娌℃湁鍙敤浣嶇疆锛屾姤閿�
-		Lock();
-		CSlot* pSlot = getSlot(putSlot - 1);
-		ASSERT(pSlot);
-		if (pSlot->getContext() != nullptr) {
-			Unlock();
-			LOGE("<CEquipemnt-%s>onPreStoredJob,鎸囧畾slot(port:%d)鏈夋枡锛岃娉ㄦ剰椋庨櫓锛�", m_strName.c_str(), port);
-			return FALSE;
-		}
-		Unlock();
-
-
 		if (m_listener.onPreStoredJob != nullptr) {
 			if (!m_listener.onPreStoredJob(this, port, pJobDataB, putSlot)) {
 				return FALSE;
@@ -2157,6 +2166,21 @@
 			}
 		}
 
+		// 濡傛灉娌℃湁鍙敤浣嶇疆锛屾姤閿欙紙闇�鍦� listener 鍥炶皟鍚庢嬁鍒� putSlot锛�
+		if (putSlot <= 0) {
+			LOGE("<CEquipemnt-%s>onPreStoredJob, putSlot鏃犳晥(port:%d).", m_strName.c_str(), port);
+			return FALSE;
+		}
+		Lock();
+		CSlot* pSlot = getSlot(putSlot - 1);
+		ASSERT(pSlot);
+		if (pSlot->getContext() != nullptr) {
+			Unlock();
+			LOGE("<CEquipemnt-%s>onPreStoredJob,鎸囧畾slot(port:%d)鏈夋枡锛岃娉ㄦ剰椋庨櫓锛�", m_strName.c_str(), port);
+			return FALSE;
+		}
+		Unlock();
+
 		return TRUE;
 	}
 

--
Gitblit v1.9.3