From 5a8bbd2426aeacdbbb2fdb1a7f7a1adce0cac7f9 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期五, 01 八月 2025 16:23:29 +0800
Subject: [PATCH] 1. 新增以下功能函数并集成:    - InitStorage():初始化存储区域    - StartStorage():开始数据存储    - StopStorage():停止存储并自动提取、分析数据    - AnalyzeStoredData():分析指定端口数据,返回偏移量

---
 SourceCode/Bond/Servo/CGlass.cpp |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/SourceCode/Bond/Servo/CGlass.cpp b/SourceCode/Bond/Servo/CGlass.cpp
index a88255a..6c1b30f 100644
--- a/SourceCode/Bond/Servo/CGlass.cpp
+++ b/SourceCode/Bond/Servo/CGlass.cpp
@@ -8,6 +8,9 @@
 		m_pPath = nullptr;
 		m_type = MaterialsType::G1;
 		m_pBuddy = nullptr;
+		m_nOriginPort = 0;
+		m_nOriginSlot = 0;
+		m_bScheduledForProcessing = FALSE;
 	}
 
 	CGlass::~CGlass()
@@ -66,6 +69,28 @@
 		return m_strID;
 	}
 
+	void CGlass::setOriginPort(int port, int slot)
+	{
+		m_nOriginPort = port;
+		m_nOriginSlot = slot;
+	}
+
+	void CGlass::getOrginPort(int& port, int& slot)
+	{
+		port = m_nOriginPort;
+		slot = m_nOriginSlot;
+	}
+
+	BOOL CGlass::isScheduledForProcessing()
+	{
+		return m_bScheduledForProcessing;
+	}
+	
+	void CGlass::setScheduledForProcessing(BOOL bProcessing)
+	{
+		m_bScheduledForProcessing = bProcessing;
+	}
+
 	CPath* CGlass::getPath()
 	{
 		return m_pPath;
@@ -103,6 +128,9 @@
 			Lock();
 			ar << (int)m_type;
 			WriteString(ar, m_strID);
+			ar << m_nOriginPort;
+			ar << m_nOriginSlot;
+			ar << m_bScheduledForProcessing;
 			ar << (ULONGLONG)m_pPath;
 			if (m_pPath != nullptr) {
 				m_pPath->serialize(ar);
@@ -123,6 +151,9 @@
 			ar >> type;
 			m_type = (MaterialsType)type;
 			ReadString(ar, m_strID);
+			ar >> m_nOriginPort;
+			ar >> m_nOriginSlot;
+			ar >> m_bScheduledForProcessing;
 			ar >> ullPath;
 			if (ullPath != 0) {
 				m_pPath = new CPath();
@@ -182,12 +213,13 @@
 		return m_strBuddyId;
 	}
 
-	void CGlass::processEnd(unsigned int nEqId, unsigned int nUnit)
+	int CGlass::processEnd(unsigned int nEqId, unsigned int nUnit)
 	{
 		CPath* pPath = getPathWithEq(nEqId, nUnit);
-		if (pPath != nullptr) {
-			pPath->processEnd();
-		}
+		if (pPath == nullptr) return -1;
+
+		pPath->processEnd();
+		return 0;
 	}
 
 	BOOL CGlass::isProcessed(unsigned int nEqId, unsigned int nUnit)
@@ -197,4 +229,21 @@
 
 		return pPath->isProcessEnd();
 	}
+
+	int CGlass::setInspResult(unsigned int nEqId, unsigned int nUnit, InspResult result)
+	{
+		CPath* pPath = getPathWithEq(nEqId, nUnit);
+		if (pPath == nullptr) return -1;
+			
+		pPath->setInspResult(result);
+		return 0;
+	}
+
+	InspResult CGlass::getInspResult(unsigned int nEqId, unsigned int nUnit)
+	{
+		CPath* pPath = getPathWithEq(nEqId, nUnit);
+		if (pPath == nullptr) return InspResult::NotInspected;
+
+		return pPath->getInspResult();
+	}
 }

--
Gitblit v1.9.3