From 0de0a72329a77fbf20bc299c542e435a6d47256b Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期六, 21 六月 2025 17:12:01 +0800
Subject: [PATCH] Merge branch 'liuyang' into clh

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

diff --git a/SourceCode/Bond/Servo/CLoadPort.cpp b/SourceCode/Bond/Servo/CLoadPort.cpp
index 0ba62ba..d2366f1 100644
--- a/SourceCode/Bond/Servo/CLoadPort.cpp
+++ b/SourceCode/Bond/Servo/CLoadPort.cpp
@@ -300,7 +300,7 @@
 			pStep->setName(pszName[m_nIndex]);
 			pStep->setWriteSignalDev(0x128 + m_nIndex);
 			pStep->setDataDev(dev[m_nIndex]);
-			if (addStep(STEP_ID_PROT1_TYPE_AUTO_CHANGE_REPLY + m_nIndex, pStep) != 0) {
+			if (addStep(STEP_ID_PROT1_CASSETTE_TYPE_CHANGE_REPLY + m_nIndex, pStep) != 0) {
 				delete pStep;
 			}
 		}
@@ -1140,4 +1140,44 @@
 		return 0;
 	}
 
+	int CLoadPort::testGenerateGlassListFromConfig(const SERVO::PortConfig& config)
+	{
+		char szBuffer[64];
+		for (const auto& slot : config.vecSlot) {
+			if (!slot.isEnabled) continue;
+
+			int nSlotIndex = slot.nSlotID - 1;
+			if (nSlotIndex < 0 || nSlotIndex >= SLOT_MAX) {
+				continue;
+			}
+
+			m_slot[nSlotIndex].enable();
+
+			if (!m_slot[nSlotIndex].isEnable()) continue;
+
+			CJobDataS js;
+			js.setCassetteSequenceNo(getNextCassetteSequenceNo());
+			js.setJobSequenceNo(m_slot[nSlotIndex].getNo());
+
+			sprintf_s(szBuffer, 64, "%05d%05d", js.getCassetteSequenceNo(), js.getJobSequenceNo());
+			js.setJobType(1);
+			js.setMaterialsType(config.nMaterialType);
+
+			js.setLotId(config.strLotID.c_str());
+			js.setProductId(config.strProductID.c_str());
+			js.setOperationId(config.strOperationID.c_str());
+			js.setGlass1Id(szBuffer);
+
+			CGlass* pGlass = theApp.m_model.m_glassPool.allocaGlass();
+			pGlass->addPath(m_nID, 0);
+			pGlass->processEnd(m_nID, 0);
+			pGlass->setID(szBuffer);
+			pGlass->setType(static_cast<SERVO::MaterialsType>(config.nMaterialType));
+			pGlass->setJobDataS(&js);
+
+			m_slot[nSlotIndex].setContext(pGlass);
+		}
+
+		return 0;
+	}
 }

--
Gitblit v1.9.3