From cfa0f3595c53e3567bb12cb194a37617a7b8a662 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期一, 24 三月 2025 17:39:35 +0800
Subject: [PATCH] 1.缓存文件的备份。

---
 SourceCode/Bond/Servo/CEquipment.cpp |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index 393191b..0633bf2 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -7,7 +7,7 @@
 
 	CEquipment::CEquipment() : m_nID(0), m_strName(""), m_strDescription(""), m_station(0, 255)
 	{
-		m_listener = { nullptr, nullptr };
+		m_listener = { nullptr, nullptr, nullptr };
 		m_alive = {FALSE, 0, FALSE};
 		m_bCimState = FALSE;
 		m_bUpstreamInline = FALSE;
@@ -49,6 +49,7 @@
 	{
 		m_listener.onAlive = listener.onAlive;
 		m_listener.onCimStateChanged = listener.onCimStateChanged;
+		m_listener.onDataChanged = listener.onDataChanged;
 	}
 
 	void CEquipment::setCcLink(CCCLinkIEControl* pCcLink)
@@ -563,6 +564,9 @@
 		else if (nRet == FLOW_ACCEPT) {
 			m_glassList.pop_front();
 			pContext->release();		// 添加到列队时addRef, 取出时release
+			if (m_listener.onDataChanged != nullptr) {
+				m_listener.onDataChanged(this, 0);
+			}
 		}
 
 		pContext->release();
@@ -582,6 +586,11 @@
 		pGlass->addRef();
 		m_glassList.push_back(pGlass);
 		Unlock();
+
+		if (m_listener.onDataChanged != nullptr) {
+			m_listener.onDataChanged(this, 0);
+		}
+
 		return FLOW_ACCEPT;
 	}
 
@@ -593,5 +602,9 @@
 		pGlass->addRef();
 		m_glassList.push_back(pGlass);
 		Unlock();
+
+		if (m_listener.onDataChanged != nullptr) {
+			m_listener.onDataChanged(this, 0);
+		}
 	}
 }

--
Gitblit v1.9.3