From 0b32b5ca45370256da5bbfa8ca43014890258997 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期六, 10 五月 2025 15:58:45 +0800
Subject: [PATCH] 1.修复storeJob为storedJob

---
 Document/PortFlow.pdf                 |    0 
 SourceCode/Bond/Servo/CPageGraph2.cpp |    2 
 SourceCode/Bond/Servo/CEquipment.cpp  |   64 +++++++++++++++
 SourceCode/Bond/Servo/Servo.rc        |    0 
 SourceCode/Bond/Servo/CEFEM.cpp       |   56 +++++++++++++
 SourceCode/Bond/Servo/CEFEM.h         |    1 
 SourceCode/Bond/Servo/CEquipment.h    |    6 +
 SourceCode/Bond/Servo/CBonder.cpp     |   48 ++++++++++++
 SourceCode/Bond/Servo/Common.h        |   32 ++++++++
 9 files changed, 204 insertions(+), 5 deletions(-)

diff --git a/Document/PortFlow.pdf b/Document/PortFlow.pdf
new file mode 100644
index 0000000..f80585c
--- /dev/null
+++ b/Document/PortFlow.pdf
Binary files differ
diff --git a/SourceCode/Bond/Servo/CBonder.cpp b/SourceCode/Bond/Servo/CBonder.cpp
index 04747f5..0167d1c 100644
--- a/SourceCode/Bond/Servo/CBonder.cpp
+++ b/SourceCode/Bond/Servo/CBonder.cpp
@@ -271,6 +271,54 @@
 				delete pStep;
 			}
 		}
+
+		{
+			// Fetched Out Job Report #1~15
+			char szBuffer[256];
+			for (int i = 0; i < 15; i++) {
+				CEqReadStep* pStep = new CEqReadStep((m_nIndex == 0 ? 0x9c31 : 0xdc31) + 18 * i, 18 * 2,
+					[&](void* pFrom, int code, const char* pszData, size_t size) -> int {
+						if (code == ROK && pszData != nullptr && size > 0) {
+							int port = (int)(__int64)((CEqReadStep*)pFrom)->getProp("Port");
+							if (port > 0) {
+								decodeFetchedOutJobReport(port, pszData, size);
+							}
+						}
+						return -1;
+					});
+				sprintf_s(szBuffer, "%s%d", STEP_EQ_FETCHED_OUT_JOBn, i + 1);
+				pStep->setName(szBuffer);
+				pStep->setProp("Port", (void*)(__int64)(i + 1));
+				pStep->setWriteSignalDev((m_nIndex == 0 ? 0x323 : 0x623) + i);
+				if (addStep(STEP_ID_FETCHED_OUT_JOB_REPORT1 + i, pStep) != 0) {
+					delete pStep;
+				}
+			}
+		}
+
+		{
+			// Stored Job Report #1~15
+			char szBuffer[256];
+			for (int i = 0; i < 15; i++) {
+				CEqReadStep* pStep = new CEqReadStep((m_nIndex == 0 ? 0x9b23 : 0xdb23) + 18 * i, 18 * 2,
+					[&](void* pFrom, int code, const char* pszData, size_t size) -> int {
+						if (code == ROK && pszData != nullptr && size > 0) {
+							int port = (int)(__int64)((CEqReadStep*)pFrom)->getProp("Port");
+							if (port > 0) {
+								decodeStoredJobReport(port, pszData, size);
+							}
+						}
+						return -1;
+					});
+				sprintf_s(szBuffer, "%s%d", STEP_EQ_STORED_JOBn, i + 1);
+				pStep->setName(szBuffer);
+				pStep->setProp("Port", (void*)(__int64)(i + 1));
+				pStep->setWriteSignalDev((m_nIndex == 0 ? 0x314 : 0x614) + i);
+				if (addStep(STEP_ID_STORE_JOB_REPORT1 + i, pStep) != 0) {
+					delete pStep;
+				}
+			}
+		}
 	}
 
 	void CBonder::onTimer(UINT nTimerid)
diff --git a/SourceCode/Bond/Servo/CEFEM.cpp b/SourceCode/Bond/Servo/CEFEM.cpp
index 3918188..bae19e5 100644
--- a/SourceCode/Bond/Servo/CEFEM.cpp
+++ b/SourceCode/Bond/Servo/CEFEM.cpp
@@ -300,7 +300,7 @@
 				CEqReadStep* pStep = new CEqReadStep(0x5c31 + 18 * i, 18 * 2,
 					[&](void* pFrom, int code, const char* pszData, size_t size) -> int {
 						if (code == ROK && pszData != nullptr && size > 0) {
-							int port = (int)((CEqReadStep*)pFrom)->getProp("Port");
+							int port = (int)(__int64)((CEqReadStep*)pFrom)->getProp("Port");
 							if (port > 0) {
 								decodeFetchedOutJobReport(port, pszData, size);
 							}
@@ -312,6 +312,30 @@
 				pStep->setProp("Port", (void*)(__int64)(i + 1));
 				pStep->setWriteSignalDev(0x023 + i);
 				if (addStep(STEP_ID_FETCHED_OUT_JOB_REPORT1 + i, pStep) != 0) {
+					delete pStep;
+				}
+			}
+		}
+
+		{
+			// Store Job Report #1~15
+			char szBuffer[256];
+			for (int i = 0; i < 15; i++) {
+				CEqReadStep* pStep = new CEqReadStep(0x5b23 + 18 * i, 18 * 2,
+					[&](void* pFrom, int code, const char* pszData, size_t size) -> int {
+						if (code == ROK && pszData != nullptr && size > 0) {
+							int port = (int)(__int64)((CEqReadStep*)pFrom)->getProp("Port");
+							if (port > 0) {
+								decodeStoredJobReport(port, pszData, size);
+							}
+						}
+						return -1;
+					});
+				sprintf_s(szBuffer, "%s%d", STEP_EQ_STORED_JOBn, i + 1);
+				pStep->setName(szBuffer);
+				pStep->setProp("Port", (void*)(__int64)(i + 1));
+				pStep->setWriteSignalDev(0x014 + i);
+				if (addStep(STEP_ID_STORE_JOB_REPORT1 + i, pStep) != 0) {
 					delete pStep;
 				}
 			}
@@ -407,4 +431,34 @@
 
 		return -1;
 	}
+
+	int CEFEM::onStore(int port, const char* pszGlassId)
+	{
+		if (port == 1) {
+			return m_pPort[0]->storedJob(pszGlassId);
+		}
+		if (port == 2) {
+			return m_pPort[1]->storedJob(pszGlassId);
+		}
+		if (port == 3) {
+			return m_pPort[2]->storedJob(pszGlassId);
+		}
+		if (port == 4) {
+			return m_pPort[3]->storedJob(pszGlassId);
+		}
+		if (port == 5) {
+			return m_pArmTray[0]->storedJob(pszGlassId);
+		}
+		if (port == 6) {
+			return m_pArmTray[1]->storedJob(pszGlassId);
+		}
+		if (port == 7) {
+			return m_pAligner->storedJob(pszGlassId);
+		}
+		if (port == 8) {
+			return m_pFliper->storedJob(pszGlassId);
+		}
+
+		return -1;
+	}
 }
diff --git a/SourceCode/Bond/Servo/CEFEM.h b/SourceCode/Bond/Servo/CEFEM.h
index 522456b..39b89d0 100644
--- a/SourceCode/Bond/Servo/CEFEM.h
+++ b/SourceCode/Bond/Servo/CEFEM.h
@@ -28,6 +28,7 @@
         virtual BOOL glassWillArrive(CGlass* pGlass);
         virtual void onReceiveLBData(const char* pszData, size_t size);
         virtual int onFetchedOut(int port, const char* pszGlassId);
+        virtual int onStore(int port, const char* pszGlassId);
 
     public:
         void setPort(unsigned int index, CLoadPort* pPort);
diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index fe9cfe6..b14e096 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -433,6 +433,40 @@
 		CHECK_READ_STEP_SIGNAL(STEP_ID_SENT_OUT_JOB_DOWNS1, pszData, size);
 		CHECK_READ_STEP_SIGNAL(STEP_ID_SENT_OUT_JOB_DOWNS2, pszData, size);
 
+		// Store Job Report #1~15
+		CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT1, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT2, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT3, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT4, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT5, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT6, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT7, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT8, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT9, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT10, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT11, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT12, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT13, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT14, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT15, pszData, size);
+
+		// Fetched Out Job Report #1~15
+		CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT1, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT2, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT3, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT4, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT5, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT6, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT7, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT8, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT9, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT10, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT11, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT12, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT13, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT14, pszData, size);
+		CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT15, pszData, size);
+
 
 		// CEqCassetteTranserStateStep
 		CHECK_READ_STEP_SIGNAL(STEP_ID_PORT1_CASSETTIE_EMPTY, pszData, size);
@@ -823,7 +857,7 @@
 		return 0;
 	}
 
-	int CEquipment::storeJob(const char* pszGlassId)
+	int CEquipment::storedJob(const char* pszGlassId)
 	{
 		if (m_pArm == nullptr) {
 			return -1;
@@ -1052,4 +1086,32 @@
 	{
 		return fetchedOut(pszGlassId);
 	}
+
+	int CEquipment::decodeStoredJobReport(int port, const char* pszData, size_t size)
+	{
+		int index = 0;
+		short unitOrPort, unitOrPortNo, subUnitNo, subSlotNo;
+		CJobDataB jobDataB;
+		int nRet = jobDataB.unserialize(&pszData[index], size);
+		if (nRet < 0) return nRet;
+		index += nRet;
+
+		memcpy(&unitOrPort, &pszData[index], sizeof(short));
+		index += sizeof(short);
+		memcpy(&unitOrPortNo, &pszData[index], sizeof(short));
+		index += sizeof(short);
+		memcpy(&subUnitNo, &pszData[index], sizeof(short));
+		index += sizeof(short);
+		memcpy(&subSlotNo, &pszData[index], sizeof(short));
+		index += sizeof(short);
+
+		onStore(port, jobDataB.getGlassId().c_str());
+
+		return index;
+	}
+
+	int CEquipment::onStore(int port, const char* pszGlassId)
+	{
+		return storedJob(pszGlassId);
+	}
 }
\ No newline at end of file
diff --git a/SourceCode/Bond/Servo/CEquipment.h b/SourceCode/Bond/Servo/CEquipment.h
index e655f2c..2861c80 100644
--- a/SourceCode/Bond/Servo/CEquipment.h
+++ b/SourceCode/Bond/Servo/CEquipment.h
@@ -116,6 +116,8 @@
 		virtual BOOL glassWillArrive(CGlass* pGlass);
 		virtual int outputGlass(int port);
 		virtual int glassArrived(CGlass* pGlass);
+		virtual int onFetchedOut(int port, const char* pszGlassId);
+		virtual int onStore(int port, const char* pszGlassId);
 		void getGlassList(std::list<CGlass*>& list);
 		CGlass* getFrontGlass();
 		BOOL removeClass(CGlass* pGlass);
@@ -147,7 +149,7 @@
 
 	public:
 		int fetchedOut(const char* pszGlassId);
-		int storeJob(const char* pszGlassId);
+		int storedJob(const char* pszGlassId);
 		BOOL isGlassListEmpty();
 
 
@@ -170,7 +172,7 @@
 		short decodeRecipeListReport(const char* pszData, size_t size);
 		short decodeRecipeParameterReport(const char* pszData, size_t size);
 		int decodeFetchedOutJobReport(int port, const char* pszData, size_t size);
-		int onFetchedOut(int port, const char* pszGlassId);
+		int decodeStoredJobReport(int port, const char* pszData, size_t size);
 
 	protected:
 		EquipmentListener m_listener;
diff --git a/SourceCode/Bond/Servo/CPageGraph2.cpp b/SourceCode/Bond/Servo/CPageGraph2.cpp
index 16890d4..6ef9a57 100644
--- a/SourceCode/Bond/Servo/CPageGraph2.cpp
+++ b/SourceCode/Bond/Servo/CPageGraph2.cpp
@@ -197,7 +197,7 @@
 		}
 		else if (nCmd == ID_EQSGRAPHITEM_TEST2) {
 			SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
-			pEquipment->storeJob("P20250320A1A2");
+			pEquipment->storedJob("P20250320A1A2");
 		}
 		else if (nCmd == ID_EQSGRAPHITEM_TEST3) {
 			SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
diff --git a/SourceCode/Bond/Servo/Common.h b/SourceCode/Bond/Servo/Common.h
index 39f19d7..e6c3025 100644
--- a/SourceCode/Bond/Servo/Common.h
+++ b/SourceCode/Bond/Servo/Common.h
@@ -163,6 +163,23 @@
 #define STEP_EQ_FETCHED_OUT_JOB13		_T("EQFetchedOutJobReport13")
 #define STEP_EQ_FETCHED_OUT_JOB14		_T("EQFetchedOutJobReport14")
 #define STEP_EQ_FETCHED_OUT_JOB15		_T("EQFetchedOutJobReport15")
+#define STEP_EQ_STORED_JOBn				_T("EQStoredJobReport")
+#define STEP_EQ_STORED_JOB1				_T("EQStoredJobReport1")
+#define STEP_EQ_STORED_JOB2				_T("EQStoredJobReport2")
+#define STEP_EQ_STORED_JOB3				_T("EQStoredJobReport3")
+#define STEP_EQ_STORED_JOB4				_T("EQStoredJobReport4")
+#define STEP_EQ_STORED_JOB5				_T("EQStoredJobReport5")
+#define STEP_EQ_STORED_JOB6				_T("EQStoredJobReport6")
+#define STEP_EQ_STORED_JOB7				_T("EQStoredJobReport7")
+#define STEP_EQ_STORED_JOB8				_T("EQStoredJobReport8")
+#define STEP_EQ_STORED_JOB9				_T("EQStoredJobReport9")
+#define STEP_EQ_STORED_JOB10			_T("EQStoredJobReport10")
+#define STEP_EQ_STORED_JOB11			_T("EQStoredJobReport11")
+#define STEP_EQ_STORED_JOB12			_T("EQStoredJobReport12")
+#define STEP_EQ_STORED_JOB13			_T("EQStoredJobReport13")
+#define STEP_EQ_STORED_JOB14			_T("EQStoredJobReport14")
+#define STEP_EQ_STORED_JOB15			_T("EQStoredJobReport15")
+
 
 
 /* Step ID */
@@ -191,6 +208,21 @@
 #define STEP_ID_RECIVE_JOB_UPS2					0x581
 #define STEP_ID_SENT_OUT_JOB_DOWNS1				0x590
 #define STEP_ID_SENT_OUT_JOB_DOWNS2				0x591
+#define STEP_ID_STORE_JOB_REPORT1				0x5A0
+#define STEP_ID_STORE_JOB_REPORT2				0x5A1
+#define STEP_ID_STORE_JOB_REPORT3				0x5A2
+#define STEP_ID_STORE_JOB_REPORT4				0x5A3
+#define STEP_ID_STORE_JOB_REPORT5				0x5A4
+#define STEP_ID_STORE_JOB_REPORT6				0x5A5
+#define STEP_ID_STORE_JOB_REPORT7				0x5A6
+#define STEP_ID_STORE_JOB_REPORT8				0x5A7
+#define STEP_ID_STORE_JOB_REPORT9				0x5A8
+#define STEP_ID_STORE_JOB_REPORT10				0x5A9
+#define STEP_ID_STORE_JOB_REPORT11				0x5AA
+#define STEP_ID_STORE_JOB_REPORT12				0x5AB
+#define STEP_ID_STORE_JOB_REPORT13				0x5AC
+#define STEP_ID_STORE_JOB_REPORT14				0x5AD
+#define STEP_ID_STORE_JOB_REPORT15				0x5AE
 #define STEP_ID_FETCHED_OUT_JOB_REPORT1			0x5AF
 #define STEP_ID_FETCHED_OUT_JOB_REPORT2			0x5B0
 #define STEP_ID_FETCHED_OUT_JOB_REPORT3			0x5B1
diff --git a/SourceCode/Bond/Servo/Servo.rc b/SourceCode/Bond/Servo/Servo.rc
index 64064b0..0233b72 100644
--- a/SourceCode/Bond/Servo/Servo.rc
+++ b/SourceCode/Bond/Servo/Servo.rc
Binary files differ

--
Gitblit v1.9.3