From 31aa10eaae103c30e02d7dc6c71ff4e50de361b3 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期一, 12 五月 2025 15:28:32 +0800
Subject: [PATCH] 1. 修改报警的显示模式(包括日志,需要后期修复) 2. 添加Release模式编译

---
 SourceCode/Bond/Servo/CGlass.cpp |   50 ++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/SourceCode/Bond/Servo/CGlass.cpp b/SourceCode/Bond/Servo/CGlass.cpp
index e9847f9..a21bd7b 100644
--- a/SourceCode/Bond/Servo/CGlass.cpp
+++ b/SourceCode/Bond/Servo/CGlass.cpp
@@ -5,12 +5,18 @@
 namespace SERVO {
 	CGlass::CGlass()
 	{
-
+		m_pPath = nullptr;
 	}
 
 	CGlass::~CGlass()
 	{
-
+		CPath* pPath = m_pPath;
+		while (pPath != nullptr) {
+			CPath* pTemp = pPath->getNext();
+			delete pPath;
+			pPath = pTemp;
+		}
+		m_pPath = nullptr;
 	}
 
 	std::string& CGlass::getClassName()
@@ -39,18 +45,58 @@
 		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;
+	}
+
+	void CGlass::addPath(unsigned int nSiteId)
+	{
+		CPath* pPath = new CPath(nSiteId);
+		if (m_pPath == nullptr) {
+			m_pPath = pPath;
+		}
+		else {
+			m_pPath->addPath(pPath);
+		}
+	}
+
 	void CGlass::serialize(CArchive& ar)
 	{
 		if (ar.IsStoring())
 		{
 			Lock();
 			WriteString(ar, m_strID);
+			ar << (ULONGLONG)m_pPath;
+			if (m_pPath != nullptr) {
+				m_pPath->serialize(ar);
+			}
 			Unlock();
 		}
 		else
 		{
 			Lock();
 			ReadString(ar, m_strID);
+			ULONGLONG ullPath;
+			ar >> ullPath;
+			if (ullPath != 0) {
+				m_pPath = new CPath();
+				m_pPath->serialize(ar);
+			}
+
 			Unlock();
 		}
 	}

--
Gitblit v1.9.3