From e431787780491220f026d83dccdf15e8ea078d1e Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期四, 19 六月 2025 11:04:03 +0800
Subject: [PATCH] 1.准备处理PanelDataRequest的响应; 2.删除掉Glass中的JobDataB

---
 SourceCode/Bond/Servo/CPageGraph2.cpp |    5 ++
 SourceCode/Bond/Servo/CReadStep.cpp   |    9 ++++
 SourceCode/Bond/Servo/CGlass.cpp      |   14 -------
 SourceCode/Bond/Servo/CEquipment.cpp  |   41 +++++++++++++++++---
 SourceCode/Bond/Servo/CGlass.h        |    3 -
 SourceCode/Bond/Servo/CReadStep.h     |    1 
 SourceCode/Bond/Servo/CEFEM.cpp       |   12 +++---
 SourceCode/Bond/Servo/CMaster.cpp     |    8 ++--
 SourceCode/Bond/Servo/CEquipment.h    |    3 +
 SourceCode/Bond/Servo/CLoadPort.cpp   |    6 ---
 SourceCode/Bond/Servo/Common.h        |    2 
 11 files changed, 62 insertions(+), 42 deletions(-)

diff --git a/SourceCode/Bond/Servo/CEFEM.cpp b/SourceCode/Bond/Servo/CEFEM.cpp
index d6a357d..7d54c05 100644
--- a/SourceCode/Bond/Servo/CEFEM.cpp
+++ b/SourceCode/Bond/Servo/CEFEM.cpp
@@ -611,7 +611,7 @@
 			CEqReadStep* pStep = new CEqReadStep(0x6301, 108 * 2,
 				[&](void* pFrom, int code, const char* pszData, size_t size) -> int {
 					if (code == ROK && pszData != nullptr && size > 0) {
-						decodeFacDataReport((CStep*)pFrom, pszData, size);
+						decodePanelDataRequest((CStep*)pFrom, pszData, size);
 					}
 					return -1;
 				});
@@ -624,17 +624,17 @@
 		}
 
 		{
-			// Panel Data Request xxx
-			CEqReadStep* pStep = new CEqReadStep(0x6301, 108 * 2,
+			// Panel Data Request
+			CEqReadStep* pStep = new CEqReadStep(0x617d, 2 * 2,
 				[&](void* pFrom, int code, const char* pszData, size_t size) -> int {
 					if (code == ROK && pszData != nullptr && size > 0) {
-						decodeFacDataReport((CStep*)pFrom, pszData, size);
+						decodePanelDataRequest((CStep*)pFrom, pszData, size);
 					}
 					return -1;
 				});
-			pStep->setName(STEP_EQ_FAC_DATA_REPORT);
+			pStep->setName(STEP_EFEM_PANEL_DATA_REQUEST);
 			pStep->setProp("Port", (void*)1);
-			pStep->setWriteSignalDev(0x04d);
+			pStep->setWriteSignalDev(0x15d);
 			if (addStep(STEP_ID_PANEL_DATA_REQUEST, pStep) != 0) {
 				delete pStep;
 			}
diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index 2038e25..1cbcb03 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -791,7 +791,7 @@
 		CGlass* pContext = nullptr;
 		for (int i = 0; i < SLOT_MAX; i++) {
 			CGlass* pGlass = (CGlass*)m_slot[i].getContext();
-			if (pGlass != nullptr && compareJobDataB(pJobDataB, pGlass->getJobDataB())) {
+			if (pGlass != nullptr && compareJobData(pJobDataB, pGlass->getJobDataS())) {
 				pContext = pGlass;
 				if (pGlass != nullptr) pGlass->addRef();
 				m_slot[i].setContext(nullptr);
@@ -1543,6 +1543,35 @@
 		return 0;
 	}
 
+	int CEquipment::decodePanelDataRequest(CStep* pStep, const char* pszData, size_t size)
+	{
+		int index = 0;
+		short cassetteSequenceNo, jobSequenceNo;
+		memcpy(&cassetteSequenceNo, &pszData[index], sizeof(short));
+		index += sizeof(short);
+		memcpy(&jobSequenceNo, &pszData[index], sizeof(short));
+		index += sizeof(short);
+
+
+		// efme, 获取数据后返回
+		// Cassette Sequence No		1W
+		// Job Sequence No			1W
+		// Job DataS				256W
+
+
+
+
+		// 缓存Attribute,用于调试时显示信息
+		unsigned int weight = 201;
+		pStep->addAttribute(new CAttribute("CassetteSequenceNo",
+			(std::to_string(cassetteSequenceNo)).c_str(), "", weight++));
+		pStep->addAttribute(new CAttribute("JobSequenceNo",
+			(std::to_string(jobSequenceNo)).c_str(), "", weight++));
+
+
+		return 0;
+	}
+
 	int CEquipment::onPreStoredJob(int port, CJobDataB* pJobDataB, short& putSlot)
 	{
 		LOGI("<CEquipment-%s>onPreStoredJob:port:%d|GlassId:%s",
@@ -1719,14 +1748,14 @@
 		return nullptr;
 	}
 
-	BOOL CEquipment::compareJobDataB(CJobDataB* pJobDataB1, CJobDataB* pJobDataB2)
+	BOOL CEquipment::compareJobData(CJobDataB* pJobDataB, CJobDataS* pJobDataS)
 	{
-		ASSERT(pJobDataB1);
-		ASSERT(pJobDataB2);
+		ASSERT(pJobDataB);
+		ASSERT(pJobDataS);
 
-		if (pJobDataB1->getCassetteSequenceNo() != pJobDataB2->getCassetteSequenceNo())
+		if (pJobDataB->getCassetteSequenceNo() != pJobDataS->getCassetteSequenceNo())
 			return FALSE;
-		if (pJobDataB1->getJobSequenceNo() != pJobDataB2->getJobSequenceNo())
+		if (pJobDataB->getJobSequenceNo() != pJobDataS->getJobSequenceNo())
 			return FALSE;
 
 		return TRUE;
diff --git a/SourceCode/Bond/Servo/CEquipment.h b/SourceCode/Bond/Servo/CEquipment.h
index 8108f02..25a40c9 100644
--- a/SourceCode/Bond/Servo/CEquipment.h
+++ b/SourceCode/Bond/Servo/CEquipment.h
@@ -223,13 +223,14 @@
 		int decodeVCREventReport(CStep* pStep, const char* pszData, size_t size);
 		int decodePanelDataReport(CStep* pStep, const char* pszData, size_t size);
 		int decodeFacDataReport(CStep* pStep, const char* pszData, size_t size);
+		int decodePanelDataRequest(CStep* pStep, const char* pszData, size_t size);
 		int addJobDataB(CJobDataB* pJobDataB);
 		int removeJobDataB(int nCassetteSequenceNo, int nJobSequenceNo);
 		CJobDataB* getJobDataB(int nCassetteSequenceNo, int nJobSequenceNo);
 		int addJobDataS(CJobDataS* pJobDataS);
 		int removeJobDataS(int nCassetteSequenceNo, int nJobSequenceNo);
 		CJobDataS* getJobDataS(int nCassetteSequenceNo, int nJobSequenceNo);
-		BOOL compareJobDataB(CJobDataB* pJobDataB1, CJobDataB* pJobDataB2);
+		BOOL compareJobData(CJobDataB* pJobDataB, CJobDataS* pJobDataS);
 		void setProcessState(PROCESS_STATE state);
 
 	protected:
diff --git a/SourceCode/Bond/Servo/CGlass.cpp b/SourceCode/Bond/Servo/CGlass.cpp
index dc47c5e..a9e88eb 100644
--- a/SourceCode/Bond/Servo/CGlass.cpp
+++ b/SourceCode/Bond/Servo/CGlass.cpp
@@ -108,8 +108,6 @@
 				m_pPath->serialize(ar);
 			}
 			char temp[JOBDATAS_SIZE] = { 0 };
-			m_jobDataB.serialize(temp, JOBDATAB_SIZE);
-			ar.Write(temp, JOBDATAB_SIZE);
 			m_jobDataS.serialize(temp, JOBDATAS_SIZE);
 			ar.Write(temp, JOBDATAS_SIZE);
 			ar << (ULONGLONG)m_pBuddy;
@@ -131,24 +129,12 @@
 				m_pPath->serialize(ar);
 			}
 			char temp[JOBDATAS_SIZE];
-			ar.Read(temp, JOBDATAB_SIZE);
-			m_jobDataB.unserialize(temp, JOBDATAB_SIZE);
 			ar.Read(temp, JOBDATAS_SIZE);
 			m_jobDataS.unserialize(temp, JOBDATAS_SIZE);
 			ar >> ullPath;	m_pBuddy = (CGlass*)ullPath;
 			ReadString(ar, m_strBuddyId);
 			Unlock();
 		}
-	}
-
-	void CGlass::setJobDataB(CJobDataB* pJobDataB)
-	{
-		m_jobDataB.copy(pJobDataB);
-	}
-
-	CJobDataB* CGlass::getJobDataB()
-	{
-		return &m_jobDataB;
 	}
 
 	void CGlass::setJobDataS(CJobDataS* pJobDataS)
diff --git a/SourceCode/Bond/Servo/CGlass.h b/SourceCode/Bond/Servo/CGlass.h
index 3374f84..86115ef 100644
--- a/SourceCode/Bond/Servo/CGlass.h
+++ b/SourceCode/Bond/Servo/CGlass.h
@@ -28,8 +28,6 @@
 		CPath* getPath();
 		void addPath(unsigned int nEqId, unsigned int nUnit);
 		void serialize(CArchive& ar);
-		void setJobDataB(CJobDataB* pJobDataB);
-		CJobDataB* getJobDataB();
 		void setJobDataS(CJobDataS* pJobDataS);
 		CJobDataS* getJobDataS();
 		BOOL setBuddy(CGlass* pGlass);
@@ -43,7 +41,6 @@
 		MaterialsType m_type;
 		std::string m_strID;
 		CPath* m_pPath;
-		CJobDataB m_jobDataB;
 		CJobDataS m_jobDataS;
 		CGlass* m_pBuddy;
 		std::string m_strBuddyId;
diff --git a/SourceCode/Bond/Servo/CLoadPort.cpp b/SourceCode/Bond/Servo/CLoadPort.cpp
index 81361bc..601a73c 100644
--- a/SourceCode/Bond/Servo/CLoadPort.cpp
+++ b/SourceCode/Bond/Servo/CLoadPort.cpp
@@ -1159,13 +1159,8 @@
 		for (int i = 0; i < 1; i++) {
 			if (!m_slot[i].isEnable()) continue;
 
-			CJobDataB jb;
 			CJobDataS js;
-
 			sprintf_s(szBuffer, "%s%d", pszPrefix, suffix++);
-			jb.setGlassId(szBuffer);
-			jb.setCassetteSequenceNo(nCassetteSequenceNo);
-			jb.setJobSequenceNo(++nJobSequenceNo);
 			js.setMaterialsType((int)type);
 			js.setCassetteSequenceNo(nCassetteSequenceNo);
 			js.setJobSequenceNo(nJobSequenceNo);
@@ -1180,7 +1175,6 @@
 			pGlass->addPath(m_nID, 0);
 			pGlass->processEnd(m_nID, 0);
 			pGlass->setID(szBuffer);
-			pGlass->setJobDataB(&jb);
 			pGlass->setType(type);
 			pGlass->setJobDataS(&js);
 			m_slot[i].setContext(pGlass);
diff --git a/SourceCode/Bond/Servo/CMaster.cpp b/SourceCode/Bond/Servo/CMaster.cpp
index bcc0ea2..6efd863 100644
--- a/SourceCode/Bond/Servo/CMaster.cpp
+++ b/SourceCode/Bond/Servo/CMaster.cpp
@@ -786,10 +786,10 @@
 				if (m_pActiveRobotTask->getSrcPosition() == p->getID()) {
 					CGlass* pGlass = p->getGlassFromSlot(m_pActiveRobotTask->getSrcSlot());
 					if (pGlass != nullptr) {
-						CJobDataB* pJobDataBSrc = pGlass->getJobDataB();
-						if (pJobDataBSrc != nullptr
-							&& pJobDataBSrc->getCassetteSequenceNo() == pJobDataB->getCassetteSequenceNo()
-							&& pJobDataBSrc->getJobSequenceNo() == pJobDataB->getJobSequenceNo()) {
+						CJobDataS* pJobDataS = pGlass->getJobDataS();
+						if (pJobDataS != nullptr
+							&& pJobDataS->getCassetteSequenceNo() == pJobDataB->getCassetteSequenceNo()
+							&& pJobDataS->getJobSequenceNo() == pJobDataB->getJobSequenceNo()) {
 							bOk = TRUE;
 							LOGI("<CMaster>onPreFethedOutJob, 已校验数据一致性.");
 						}
diff --git a/SourceCode/Bond/Servo/CPageGraph2.cpp b/SourceCode/Bond/Servo/CPageGraph2.cpp
index 08dae61..380852e 100644
--- a/SourceCode/Bond/Servo/CPageGraph2.cpp
+++ b/SourceCode/Bond/Servo/CPageGraph2.cpp
@@ -225,6 +225,7 @@
 			}
 			*/
 			if (!bTestGenerate) {
+				/*
 				SERVO::CRobotTask* pTask = theApp.m_model.getMaster().getActiveRobotTask();
 				if (pTask != nullptr) {
 					SERVO::CGlass* pGlass = (SERVO::CGlass*)pTask->getContext();
@@ -235,12 +236,14 @@
 						pEquipment->onSentOutJob(0, pJobDataS);
 					}
 				}
+				*/
 			}
 		}
 		else if (nCmd == ID_EQSGRAPHITEM_TEST2) {
 			SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
 			SERVO::CArm* pArm = (SERVO::CArm*)pEquipment->getArm();
 			if (pArm != nullptr) {
+				/*
 				SERVO::CGlass* pGlass = pArm->getAnyGlass();
 				if (pGlass != nullptr) {
 					SERVO::CJobDataB* pJobDataB = pGlass->getJobDataB();
@@ -250,7 +253,7 @@
 						Sleep(600);
 						pEquipment->onStoredJob(0, pJobDataB);
 					}
-				}
+				}*/
 			}
 		}
 		else if (nCmd == ID_EQSGRAPHITEM_TEST3) {
diff --git a/SourceCode/Bond/Servo/CReadStep.cpp b/SourceCode/Bond/Servo/CReadStep.cpp
index d3c7747..c6aa36f 100644
--- a/SourceCode/Bond/Servo/CReadStep.cpp
+++ b/SourceCode/Bond/Servo/CReadStep.cpp
@@ -218,4 +218,13 @@
 
 		return 0;
 	}
+
+	int CReadStep::setReturnData(const char* pszData, unsigned int size)
+	{
+		ASSERT(size < 1024);
+		memcpy(m_szReturnBuf, pszData, size);
+		m_nReturnDataSize = size;
+
+		return 0;
+	}
 }
diff --git a/SourceCode/Bond/Servo/CReadStep.h b/SourceCode/Bond/Servo/CReadStep.h
index c74568e..dcb3c56 100644
--- a/SourceCode/Bond/Servo/CReadStep.h
+++ b/SourceCode/Bond/Servo/CReadStep.h
@@ -23,6 +23,7 @@
 		inline void nextStep();
 		inline void resetStep();
 		virtual int setReturnCode(short code);
+		virtual int setReturnData(const char* pszData, unsigned int size);
 
 	protected:
 		HANDLE m_hWorkThreadHandle;
diff --git a/SourceCode/Bond/Servo/Common.h b/SourceCode/Bond/Servo/Common.h
index 6a12cae..913285f 100644
--- a/SourceCode/Bond/Servo/Common.h
+++ b/SourceCode/Bond/Servo/Common.h
@@ -246,7 +246,7 @@
 #define STEP_PORT4_CASSETTE_TYPE_CHANGE	_T("Port4CassetteTypeChange")
 #define STEP_EQ_PANEL_DATA_REPORT		_T("EQPanelDataReport")
 #define STEP_EQ_FAC_DATA_REPORT			_T("EQFacDataReport")
-
+#define STEP_EFEM_PANEL_DATA_REQUEST	_T("EFEMPanelDataRequest")
 
 /* Step ID */
 #define STEP_ID_CIMMODE_CHANGED_CMD_REPLY		0x550

--
Gitblit v1.9.3