From c743df7d475735b26395c6ed5c17b4be2d972be2 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期三, 28 五月 2025 16:21:12 +0800
Subject: [PATCH] 1.初步去掉GlassList, 替换为Slot,待测;

---
 SourceCode/Bond/Servo/CLoadPort.cpp |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/SourceCode/Bond/Servo/CLoadPort.cpp b/SourceCode/Bond/Servo/CLoadPort.cpp
index c98dede..6df5ce3 100644
--- a/SourceCode/Bond/Servo/CLoadPort.cpp
+++ b/SourceCode/Bond/Servo/CLoadPort.cpp
@@ -70,6 +70,18 @@
 		m_slot[2].enable();
 		m_slot[2].setNo(3);
 		m_slot[2].setName("Slot 3");
+		m_slot[3].setPosition(m_nID);
+		m_slot[3].enable();
+		m_slot[3].setNo(4);
+		m_slot[3].setName("Slot 4");
+		m_slot[4].setPosition(m_nID);
+		m_slot[4].enable();
+		m_slot[4].setNo(5);
+		m_slot[4].setName("Slot 5");
+		m_slot[5].setPosition(m_nID);
+		m_slot[5].enable();
+		m_slot[5].setNo(6);
+		m_slot[5].setName("Slot 6");
 	}
 
 	void CLoadPort::initSteps()
@@ -391,21 +403,6 @@
 	int CLoadPort::recvIntent(CPin* pPin, CIntent* pIntent)
 	{
 		return __super::recvIntent(pPin, pIntent);
-	}
-
-	int CLoadPort::outputGlass(int port)
-	{
-		return __super::outputGlass(port);
-	}
-
-	BOOL CLoadPort::glassWillArrive(CGlass* pGlass)
-	{
-		BOOL bRet = __super::glassWillArrive(pGlass);
-		if (!bRet) {
-			return FALSE;
-		}
-
-		return (m_glassList.size() < 8);
 	}
 
 	int CLoadPort::sendCassetteCtrlCmd(short cmd,
@@ -1061,11 +1058,11 @@
 	/*
 	 * 生成测试用的玻璃列表
 	 */
-	int CLoadPort::testGenerateGlassList(MaterialsType type, int count, const char* pszPrefix, int startSuffix)
+	int CLoadPort::testGenerateGlassList(MaterialsType type, const char* pszPrefix, int startSuffix)
 	{
 		// 如果非空就不生成了
 		Lock();
-		if (!m_glassList.empty()) {
+		if (hasGlass()) {
 			Unlock();
 			return -1;
 		}
@@ -1074,7 +1071,9 @@
 
 		char szBuffer[64];
 		int suffix = startSuffix;
-		for (int i = 0; i < count; i++) {
+		for (int i = 0; i < SLOT_MAX; i++) {
+			if (!m_slot[i].isEnable()) continue;
+
 			CJobDataB jb;
 			CJobDataS js;
 
@@ -1093,7 +1092,8 @@
 			pGlass->setJobDataB(&jb);
 			pGlass->setType(type);
 			pGlass->setJobDataS(&js);
-			addGlassToList(pGlass);
+			pGlass->addRef();
+			m_slot[i].setContext(pGlass);
 		}
 
 		return 0;

--
Gitblit v1.9.3