From ffd3de44be70cfa45f2ad74b71daa55192296298 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期四, 12 六月 2025 14:07:17 +0800
Subject: [PATCH] 1.调整物流传输顺序,将Aligner往前调到Fliper前面

---
 SourceCode/Bond/Servo/CMaster.cpp |  143 +++++++++++++++++++++++++++--------------------
 1 files changed, 81 insertions(+), 62 deletions(-)

diff --git a/SourceCode/Bond/Servo/CMaster.cpp b/SourceCode/Bond/Servo/CMaster.cpp
index 2b509e8..37fefe6 100644
--- a/SourceCode/Bond/Servo/CMaster.cpp
+++ b/SourceCode/Bond/Servo/CMaster.cpp
@@ -294,7 +294,7 @@
 		CLoadPort* pLoadPort3 = (CLoadPort*)getEquipment(EQ_ID_LOADPORT3);
 		CLoadPort* pLoadPort4 = (CLoadPort*)getEquipment(EQ_ID_LOADPORT4);
 		CFliper* pFliper = (CFliper*)getEquipment(EQ_ID_FLIPER);
-		CVacuumBake* pVacuumBack = (CVacuumBake*)getEquipment(EQ_ID_VACUUMBAKE);
+		CVacuumBake* pVacuumBake = (CVacuumBake*)getEquipment(EQ_ID_VACUUMBAKE);
 		CAligner* pAligner = (CAligner*)getEquipment(EQ_ID_ALIGNER);
 		CBonder* pBonder1 = (CBonder*)getEquipment(EQ_ID_Bonder1);
 		CBonder* pBonder2 = (CBonder*)getEquipment(EQ_ID_Bonder2);
@@ -307,7 +307,7 @@
 		ASSERT(pLoadPort3);
 		ASSERT(pLoadPort4);
 		ASSERT(pFliper);
-		ASSERT(pVacuumBack);
+		ASSERT(pVacuumBake);
 		ASSERT(pAligner);
 		ASSERT(pBonder1);
 		ASSERT(pBonder2);
@@ -378,10 +378,10 @@
 
 				// Measurement -> LoadPort
 				CLoadPort* pEqLoadPort[] = { pLoadPort1, pLoadPort2, pLoadPort3, pLoadPort4 };
-				CEquipment* pEqTar[] = { pVacuumBack, pFliper };
+				CEquipment* pEqTar[] = { pVacuumBake, pFliper };
 				if (primaryType == MaterialsType::G2) {
 					pEqTar[0] = pFliper;
-					pEqTar[1] = pVacuumBack;
+					pEqTar[1] = pVacuumBake;
 				}
 				for (int s = 0; s < 4; s++) {
 					if (pEqLoadPort[s]->isEnable()
@@ -461,8 +461,9 @@
 					continue;
 				}
 
-				// Aligner -> Bonder
-				m_pActiveRobotTask = createTransferTask(pAligner, pBonder1, primaryType, secondaryType, armNo);
+				// Fliper(G2) -> Bonder
+				// VacuumBake(G1) -> Bonder
+				m_pActiveRobotTask = createTransferTask(pFliper, pBonder1, primaryType, secondaryType, armNo);
 				if (m_pActiveRobotTask != nullptr) {
 					m_pActiveRobotTask->run();
 					std::string strDescription = m_pActiveRobotTask->getDescription();
@@ -474,7 +475,57 @@
 					continue;
 				}
 
-				m_pActiveRobotTask = createTransferTask(pAligner, pBonder2, primaryType, secondaryType, armNo);
+				m_pActiveRobotTask = createTransferTask(pFliper, pBonder2, primaryType, secondaryType, armNo);
+				if (m_pActiveRobotTask != nullptr) {
+					m_pActiveRobotTask->run();
+					std::string strDescription = m_pActiveRobotTask->getDescription();
+					unlock();
+					if (m_listener.onRobotTaskEvent != nullptr) {
+						m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE);
+					}
+					LOGI("创建新任务<%s>...", strDescription.c_str());
+					continue;
+				}
+
+				m_pActiveRobotTask = createTransferTask(pVacuumBake, pBonder1, primaryType, secondaryType, armNo);
+				if (m_pActiveRobotTask != nullptr) {
+					m_pActiveRobotTask->run();
+					std::string strDescription = m_pActiveRobotTask->getDescription();
+					unlock();
+					if (m_listener.onRobotTaskEvent != nullptr) {
+						m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE);
+					}
+					LOGI("创建新任务<%s>...", strDescription.c_str());
+					continue;
+				}
+
+				m_pActiveRobotTask = createTransferTask(pVacuumBake, pBonder2, primaryType, secondaryType, armNo);
+				if (m_pActiveRobotTask != nullptr) {
+					m_pActiveRobotTask->run();
+					std::string strDescription = m_pActiveRobotTask->getDescription();
+					unlock();
+					if (m_listener.onRobotTaskEvent != nullptr) {
+						m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE);
+					}
+					LOGI("创建新任务<%s>...", strDescription.c_str());
+					continue;
+				}
+
+				// Aligner -> Fliper(G2)
+				// Aligner -> VacuumBake(G1)
+				m_pActiveRobotTask = createTransferTask(pAligner, pFliper, primaryType, secondaryType, armNo);
+				if (m_pActiveRobotTask != nullptr) {
+					m_pActiveRobotTask->run();
+					std::string strDescription = m_pActiveRobotTask->getDescription();
+					unlock();
+					if (m_listener.onRobotTaskEvent != nullptr) {
+						m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE);
+					}
+					LOGI("创建新任务<%s>...", strDescription.c_str());
+					continue;
+				}
+
+				m_pActiveRobotTask = createTransferTask(pAligner, pVacuumBake, primaryType, secondaryType, armNo);
 				if (m_pActiveRobotTask != nullptr) {
 					m_pActiveRobotTask->run();
 					std::string strDescription = m_pActiveRobotTask->getDescription();
@@ -487,44 +538,14 @@
 				}
 
 
-				// Fliper(G2) -> Aligner
-				// VacuumBake(G1) -> Aligner
-				m_pActiveRobotTask = createTransferTask(pFliper, pAligner, primaryType, secondaryType, armNo);
-				if (m_pActiveRobotTask != nullptr) {
-					m_pActiveRobotTask->run();
-					std::string strDescription = m_pActiveRobotTask->getDescription();
-					unlock();
-					if (m_listener.onRobotTaskEvent != nullptr) {
-						m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE);
-					}
-					LOGI("创建新任务<%s>...", strDescription.c_str());
-					continue;
-				}
-
-				m_pActiveRobotTask = createTransferTask(pVacuumBack, pAligner, primaryType, secondaryType, armNo);
-				if (m_pActiveRobotTask != nullptr) {
-					m_pActiveRobotTask->run();
-					std::string strDescription = m_pActiveRobotTask->getDescription();
-					unlock();
-					if (m_listener.onRobotTaskEvent != nullptr) {
-						m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE);
-					}
-					LOGI("创建新任务<%s>...", strDescription.c_str());
-					continue;
-				}
-
-
-				// LoadPort -> Fliper(G2)
-				// LoadPort -> VacuumBake(G1)
+				// LoadPort -> Aligner
 				for (int s = 0; s < 4; s++) {
-					for (int t = 0; t < 2; t++) {
-						if (pEqLoadPort[s]->isEnable()
-							&& pEqLoadPort[s]->getPortType() == PortType::Loading
-							&& pEqLoadPort[s]->getPortMode() == PortMode::ReadyToLoad) {
-							m_pActiveRobotTask = createTransferTask(pEqLoadPort[s], pEqTar[t], primaryType, secondaryType, armNo);
-							if (m_pActiveRobotTask != nullptr) {
-								goto PORT_GET;
-							}
+					if (pEqLoadPort[s]->isEnable()
+						&& pEqLoadPort[s]->getPortType() == PortType::Loading
+						&& pEqLoadPort[s]->getPortMode() == PortMode::ReadyToLoad) {
+						m_pActiveRobotTask = createTransferTask(pEqLoadPort[s], pAligner, primaryType, secondaryType, armNo);
+						if (m_pActiveRobotTask != nullptr) {
+							goto PORT_GET;
 						}
 					}
 				}
@@ -981,42 +1002,40 @@
 		CBakeCooling* pBakeCooling = (CBakeCooling*)getEquipment(EQ_ID_BAKE_COOLING);
 		CMeasurement* pMeasurement = (CMeasurement*)getEquipment(EQ_ID_MEASUREMENT);
 
-		nRet = pLoadPort1->getPin("Out1")->connectPin(pFliper->getPin("In1"));
+		nRet = pLoadPort1->getPin("Out")->connectPin(pAligner->getPin("In1"));
 		if (nRet < 0) {
 			LOGE("连接LoadPort1-Fliper失败");
 		}
-		nRet = pLoadPort2->getPin("Out1")->connectPin(pFliper->getPin("In2"));
+		nRet = pLoadPort2->getPin("Out")->connectPin(pAligner->getPin("In2"));
 		if (nRet < 0) {
 			LOGE("连接LoadPort1-Fliper失败");
 		}
 
-		nRet = pLoadPort1->getPin("Out2")->connectPin(pVacuumBake->getPin("In1"));
+		nRet = pAligner->getPin("Out1")->connectPin(pFliper->getPin("In"));
 		if (nRet < 0) {
-			LOGE("连接LoadPort1-VacuumBake失败");
+			LOGE("连接Aligner-Fliper失败");
 		}
-		nRet = pLoadPort2->getPin("Out2")->connectPin(pVacuumBake->getPin("In2"));
+		nRet = pAligner->getPin("Out2")->connectPin(pVacuumBake->getPin("In"));
 		if (nRet < 0) {
-			LOGE("连接LoadPort1-VacuumBake失败");
+			LOGE("连接Aligner-VacuumBake失败");
 		}
 
-		nRet = pFliper->getPin("Out")->connectPin(pAligner->getPin("In1"));
+		nRet = pFliper->getPin("Out1")->connectPin(pBonder1->getPin("In1"));
 		if (nRet < 0) {
-			LOGE("连接Fliper-Aligner失败");
+			LOGE("连接Fliper-Bonder1失败");
+		}
+		nRet = pFliper->getPin("Out2")->connectPin(pBonder2->getPin("In1"));
+		if (nRet < 0) {
+			LOGE("连接Fliper-Bonder2失败");
 		}
 
-		nRet = pVacuumBake->getPin("Out")->connectPin(pAligner->getPin("In2"));
+		nRet = pVacuumBake->getPin("Out1")->connectPin(pBonder1->getPin("In2"));
 		if (nRet < 0) {
-			LOGE("连接VacuumBake-Aligner失败");
+			LOGE("连接VacuumBake-Bonder1失败");
 		}
-
-		nRet = pAligner->getPin("Out1")->connectPin(pBonder1->getPin("In"));
+		nRet = pVacuumBake->getPin("Out2")->connectPin(pBonder2->getPin("In2"));
 		if (nRet < 0) {
-			LOGE("连接Aligner-Bondere1失败");
-		}
-
-		nRet = pAligner->getPin("Out2")->connectPin(pBonder2->getPin("In"));
-		if (nRet < 0) {
-			LOGE("连接Aligner-Bondere2失败");
+			LOGE("连接VacuumBake-Bonder2失败");
 		}
 
 		nRet = pBonder1->getPin("Out")->connectPin(pBakeCooling->getPin("In1"));

--
Gitblit v1.9.3