From 436f0ab66f5eded4367e61edb46edcab57b5787b Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期四, 05 六月 2025 14:07:53 +0800
Subject: [PATCH] 1.Path增加Unit,因为BakeCooling比较特殊,它分为烧烤笔冷却,相当于两单元

---
 SourceCode/Bond/Servo/CGlass.cpp |   29 ++++++++---------------------
 1 files changed, 8 insertions(+), 21 deletions(-)

diff --git a/SourceCode/Bond/Servo/CGlass.cpp b/SourceCode/Bond/Servo/CGlass.cpp
index 029f39f..e975351 100644
--- a/SourceCode/Bond/Servo/CGlass.cpp
+++ b/SourceCode/Bond/Servo/CGlass.cpp
@@ -66,29 +66,16 @@
 		return m_strID;
 	}
 
-	CPath* CGlass::getPathWithSiteID(unsigned int nSiteId)
-	{
-		CPath* pPath = m_pPath;
-		while (pPath != nullptr) {
-			if (nSiteId == pPath->getSiteID()) {
-				return pPath;
-			}
-			pPath = pPath->getNext();
-		}
-
-		return nullptr;
-	}
-
 	CPath* CGlass::getPath()
 	{
 		return m_pPath;
 	}
 
-	CPath* CGlass::getPathWithSiteId(unsigned int nSiteId)
+	CPath* CGlass::getPathWithEq(unsigned int nEqId, unsigned int nUnit)
 	{
 		CPath* pTemp = m_pPath;
 		while (pTemp != nullptr) {
-			if (pTemp->getSiteID() == nSiteId) {
+			if (pTemp->getEqID() == nEqId && pTemp->getUnit() == nUnit) {
 				return pTemp;
 			}
 
@@ -98,9 +85,9 @@
 		return nullptr;
 	}
 
-	void CGlass::addPath(unsigned int nSiteId)
+	void CGlass::addPath(unsigned int nEqId, unsigned int nUnit)
 	{
-		CPath* pPath = new CPath(nSiteId);
+		CPath* pPath = new CPath(nEqId, nUnit);
 		if (m_pPath == nullptr) {
 			m_pPath = pPath;
 		}
@@ -197,17 +184,17 @@
 		return m_strBuddyId;
 	}
 
-	void CGlass::processEnd(unsigned int nSiteId)
+	void CGlass::processEnd(unsigned int nEqId, unsigned int nUnit)
 	{
-		CPath* pPath = getPathWithSiteID(nSiteId);
+		CPath* pPath = getPathWithEq(nEqId, nUnit);
 		if (pPath != nullptr) {
 			pPath->processEnd();
 		}
 	}
 
-	BOOL CGlass::isProcessed(unsigned int nSiteId)
+	BOOL CGlass::isProcessed(unsigned int nEqId, unsigned int nUnit)
 	{
-		CPath* pPath = getPathWithSiteID(nSiteId);
+		CPath* pPath = getPathWithEq(nEqId, nUnit);
 		if (pPath == nullptr) return FALSE;
 
 		return pPath->isProcessEnd();

--
Gitblit v1.9.3