From 4897210a25e7c98ddacb1fa4ecee3e8bdd1ae98e Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期四, 12 六月 2025 14:18:16 +0800
Subject: [PATCH] 1.手臂选择匹配问题,
---
SourceCode/Bond/Servo/CMaster.cpp | 187 ++++++++++++++++++++++++++++------------------
1 files changed, 114 insertions(+), 73 deletions(-)
diff --git a/SourceCode/Bond/Servo/CMaster.cpp b/SourceCode/Bond/Servo/CMaster.cpp
index 0a3b906..4eca70d 100644
--- a/SourceCode/Bond/Servo/CMaster.cpp
+++ b/SourceCode/Bond/Servo/CMaster.cpp
@@ -293,7 +293,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);
@@ -306,7 +306,7 @@
ASSERT(pLoadPort3);
ASSERT(pLoadPort4);
ASSERT(pFliper);
- ASSERT(pVacuumBack);
+ ASSERT(pVacuumBake);
ASSERT(pAligner);
ASSERT(pBonder1);
ASSERT(pBonder2);
@@ -375,6 +375,37 @@
}
+ // Measurement -> LoadPort
+ CLoadPort* pEqLoadPort[] = { pLoadPort1, pLoadPort2, pLoadPort3, pLoadPort4 };
+ CEquipment* pEqTar[] = { pVacuumBake, pFliper };
+ if (primaryType == MaterialsType::G2) {
+ pEqTar[0] = pFliper;
+ pEqTar[1] = pVacuumBake;
+ }
+ for (int s = 0; s < 4; s++) {
+ if (pEqLoadPort[s]->isEnable()
+ && pEqLoadPort[s]->getPortType() == PortType::Unloading
+ && pEqLoadPort[s]->getPortMode() == PortMode::ReadyToUnload) {
+ m_pActiveRobotTask = createTransferTask(pMeasurement, pEqLoadPort[s], primaryType, secondaryType);
+ if (m_pActiveRobotTask != nullptr) {
+ goto PORT_PUT;
+ }
+ }
+ }
+
+ PORT_PUT:
+ 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;
+ }
+
+
// BakeCooling ->Measurement
m_pActiveRobotTask = createTransferTask_bakecooling_to_measurement(pBakeCooling, pMeasurement);
if (m_pActiveRobotTask != nullptr) {
@@ -429,8 +460,9 @@
continue;
}
- // Aligner -> Bonder
- m_pActiveRobotTask = createTransferTask(pAligner, pBonder1, primaryType, secondaryType);
+ // Fliper(G2) -> Bonder
+ // VacuumBake(G1) -> Bonder
+ m_pActiveRobotTask = createTransferTask(pFliper, pBonder1, primaryType, secondaryType, 2);
if (m_pActiveRobotTask != nullptr) {
m_pActiveRobotTask->run();
std::string strDescription = m_pActiveRobotTask->getDescription();
@@ -442,7 +474,57 @@
continue;
}
- m_pActiveRobotTask = createTransferTask(pAligner, pBonder2, primaryType, secondaryType);
+ m_pActiveRobotTask = createTransferTask(pFliper, pBonder2, primaryType, secondaryType, 2);
+ 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);
+ 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);
+ 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, 2);
+ 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);
if (m_pActiveRobotTask != nullptr) {
m_pActiveRobotTask->run();
std::string strDescription = m_pActiveRobotTask->getDescription();
@@ -455,50 +537,14 @@
}
- // Fliper(G2) -> Aligner
- // VacuumBake(G1) -> Aligner
- m_pActiveRobotTask = createTransferTask(pFliper, pAligner, primaryType, secondaryType);
- 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);
- 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)
- CLoadPort* pEqSrc[] = { pLoadPort1, pLoadPort2, pLoadPort3, pLoadPort4 };
- CEquipment* pEqTar[] = { pVacuumBack, pFliper };
- if (primaryType == MaterialsType::G2) {
- pEqTar[0] = pFliper;
- pEqTar[1] = pVacuumBack;
- }
+ // LoadPort -> Aligner
for (int s = 0; s < 4; s++) {
- for (int t = 0; t < 2; t++) {
- if (pEqSrc[s]->isEnable()
- && pEqSrc[s]->getPortType() == PortType::Loading
- && pEqSrc[s]->getPortMode() == PortMode::ReadyToLoad) {
- m_pActiveRobotTask = createTransferTask(pEqSrc[s], pEqTar[t], primaryType, secondaryType);
- 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);
+ if (m_pActiveRobotTask != nullptr) {
+ goto PORT_GET;
}
}
}
@@ -514,11 +560,6 @@
LOGI("创建新任务<%s>...", strDescription.c_str());
continue;
}
-
-
- // Measurement -> LoadPort
-
-
unlock();
@@ -960,42 +1001,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"));
@@ -1108,7 +1147,8 @@
static int taskSeqNo = 0;
CRobotTask* CMaster::createTransferTask(CEquipment* pSrcEq, CEquipment* pTarEq,
- MaterialsType primaryType/* = MaterialsType::G1*/, MaterialsType secondaryType/* = MaterialsType::G2*/)
+ MaterialsType primaryType/* = MaterialsType::G1*/, MaterialsType secondaryType/* = MaterialsType::G2*/,
+ int armNo/* = 1*/)
{
CRobotTask* pTask = nullptr;
CSlot* pSrcSlot, * pTarSlot;
@@ -1124,7 +1164,7 @@
pTask = new CRobotTask();
pTask->setContext(pSrcSlot->getContext());
pTask->setEFEM((CEFEM*)getEquipment(EQ_ID_EFEM));
- pTask->setRobotTransferParam(++taskSeqNo, 1, pSrcSlot->getPosition(),
+ pTask->setRobotTransferParam(++taskSeqNo, armNo, pSrcSlot->getPosition(),
pTarSlot->getPosition(), pSrcSlot->getNo(), pTarSlot->getNo());
}
@@ -1187,6 +1227,7 @@
if (pSrcSlot != nullptr && nullptr != pTarSlot) {
pTask = new CRobotTask();
pTask->setContext(pSrcSlot->getContext());
+ pTask->setEFEM((CEFEM*)getEquipment(EQ_ID_EFEM));
pTask->setRobotTransferParam(++taskSeqNo, 1, pSrcSlot->getPosition(),
pTarSlot->getPosition(), pSrcSlot->getNo(), pTarSlot->getNo());
}
--
Gitblit v1.9.3