| | |
| | | // Bonder1和Bonder2需要的G2就过不来了 |
| | | // 最基本的实现,可以G2和G2轮流搬送,但最好根据Bonder的需求来决定 |
| | | MaterialsType primaryType, secondaryType; |
| | | int armNo = 1; // 默认使用手臂2 |
| | | |
| | | |
| | | // 各种机器 |
| | | CEFEM* pEFEM = (CEFEM*)getEquipment(EQ_ID_EFEM); |
| | | CLoadPort* pLoadPort1 = (CLoadPort*)getEquipment(EQ_ID_LOADPORT1); |
| | | CLoadPort* pLoadPort2 = (CLoadPort*)getEquipment(EQ_ID_LOADPORT2); |
| | | 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); |
| | |
| | | ASSERT(pEFEM); |
| | | ASSERT(pLoadPort1); |
| | | ASSERT(pLoadPort2); |
| | | ASSERT(pLoadPort3); |
| | | ASSERT(pLoadPort4); |
| | | ASSERT(pFliper); |
| | | ASSERT(pVacuumBack); |
| | | ASSERT(pVacuumBake); |
| | | ASSERT(pAligner); |
| | | ASSERT(pBonder1); |
| | | ASSERT(pBonder2); |
| | |
| | | } |
| | | |
| | | |
| | | // 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, armNo); |
| | | 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) { |
| | |
| | | continue; |
| | | } |
| | | |
| | | // Aligner -> Bonder |
| | | m_pActiveRobotTask = createTransferTask(pAligner, pBonder1, primaryType, secondaryType); |
| | | // 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(); |
| | |
| | | continue; |
| | | } |
| | | |
| | | m_pActiveRobotTask = createTransferTask(pAligner, pBonder2, primaryType, secondaryType); |
| | | 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(); |
| | |
| | | } |
| | | |
| | | |
| | | // Fliper(G2) -> Aligner |
| | | // VacuumBake(G1) -> Aligner |
| | | m_pActiveRobotTask = createTransferTask(pFliper, pAligner, primaryType, secondaryType); |
| | | // LoadPort -> Aligner |
| | | for (int s = 0; s < 4; s++) { |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | | |
| | | PORT_GET: |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | m_pActiveRobotTask->run(); |
| | | std::string strDescription = m_pActiveRobotTask->getDescription(); |
| | |
| | | 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) |
| | | CEquipment* pEqTar1 = pVacuumBack; |
| | | CEquipment* pEqTar2 = pFliper; |
| | | if (primaryType == MaterialsType::G2) { |
| | | pEqTar1 = pFliper; |
| | | pEqTar2 = pVacuumBack; |
| | | } |
| | | m_pActiveRobotTask = createTransferTask(pLoadPort1, pEqTar1, 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(pLoadPort2, pEqTar1, 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 -> VacuumBake(G1) |
| | | m_pActiveRobotTask = createTransferTask(pLoadPort1, pEqTar2, 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(pLoadPort2, pEqTar2, 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; |
| | | } |
| | | |
| | | |
| | | // Measurement -> LoadPort |
| | | |
| | | |
| | | |
| | | unlock(); |
| | | |
| | |
| | | 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")); |
| | |
| | | |
| | | 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; |
| | |
| | | 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()); |
| | | } |
| | | |
| | |
| | | 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()); |
| | | } |