| | |
| | | void CLoadPort::initPins() |
| | | { |
| | | // 加入Pin初始化代码 |
| | | LOGI("<CLoadPort>initPins"); |
| | | LOGD("<CLoadPort>initPins"); |
| | | addPin(SERVO::PinType::INPUT, _T("In")); |
| | | addPin(SERVO::PinType::OUTPUT, _T("Out")); |
| | | } |
| | |
| | | { |
| | | CEquipment::onTimer(nTimerid); |
| | | |
| | | |
| | | // 从配置读出的enable,初始化时写给efem |
| | | static int i_enable[4] = { 0 }; |
| | | if ((++i_enable[m_nIndex]) == 20 + m_nIndex) { |
| | | eablePort(m_bEnable, [&](int code) -> int { |
| | | LOGI("<LoadPort-%d>eablePort:code=%d", m_nIndex, code); |
| | | return 0; |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | // 模拟测试 |
| | | /* |
| | | if (m_nIndex == 0) { |
| | | static int ii = 0; |
| | | ii++; |
| | | if (ii == 20) { |
| | | if (ii == 50) { |
| | | char szBuffer[64] = {0}; |
| | | CStep* pStep = getStepWithName(STEP_EQ_PORT1_INUSE); |
| | | CStep* pStep = getStepWithName(STEP_EQ_PORT1_BLOCKED); |
| | | CPortStatusReport portStatusReport; |
| | | portStatusReport.setPortStatus(PORT_UNLOAD_READY); |
| | | portStatusReport.setPortStatus(PORT_BLOCKED); |
| | | portStatusReport.setJobExistenceSlot(0xf); |
| | | portStatusReport.setCassetteId("CID1001"); |
| | | int nRet = portStatusReport.serialize(szBuffer, 64); |
| | | decodePortStatusReport(pStep, szBuffer, 64); |
| | | } |
| | | } |
| | | if (m_nIndex == 1) { |
| | | static int ii = 0; |
| | | ii++; |
| | | if (ii == 55) { |
| | | char szBuffer[64] = { 0 }; |
| | | CStep* pStep = getStepWithName(STEP_EQ_PORT2_BLOCKED); |
| | | CPortStatusReport portStatusReport; |
| | | portStatusReport.setPortStatus(PORT_BLOCKED); |
| | | portStatusReport.setJobExistenceSlot(0xff ); |
| | | portStatusReport.setCassetteId("CID1004"); |
| | | int nRet = portStatusReport.serialize(szBuffer, 64); |
| | | decodePortStatusReport(pStep, szBuffer, 64); |
| | | } |
| | |
| | | m_portStatusReport.serialize(ar); |
| | | } |
| | | else { |
| | | int temp; |
| | | ar >> m_nIndex; |
| | | m_portStatusReport.serialize(ar); |
| | | } |
| | |
| | | return (m_nIndex + 1) * 1000 + m_nNextCassetteSequenceNo; |
| | | } |
| | | |
| | | int CLoadPort::getPortCassetteSnSeed() |
| | | { |
| | | return m_nNextCassetteSequenceNo; |
| | | } |
| | | |
| | | void CLoadPort::setPortCassetteSnSeed(int seed) |
| | | { |
| | | m_nNextCassetteSequenceNo = seed; |
| | | if (m_nNextCassetteSequenceNo >= 1000) { |
| | | m_nNextCassetteSequenceNo = 0; |
| | | } |
| | | } |
| | | |
| | | void CLoadPort::setIndex(unsigned int index) |
| | | { |
| | | m_nIndex = index; |
| | | |
| | | std::string id = "Port" + std::to_string(index + 1); |
| | | m_portStatusReport.setCassetteId(id.c_str()); |
| | | } |
| | | |
| | | unsigned int CLoadPort::getIndex() |
| | |
| | | else { |
| | | // 抛出到应用层做选择要加工的片子 |
| | | generateGlassList(getScanCassetteMap()); |
| | | if (m_listener.onPortStatusChanged != nullptr) { |
| | | m_listener.onPortStatusChanged(this, portStatusReport.getPortStatus(), |
| | | getScanCassetteMap()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (m_listener.onPortStatusChanged != nullptr) { |
| | | m_listener.onPortStatusChanged(this, portStatusReport.getPortStatus(), |
| | | getScanCassetteMap()); |
| | | } |
| | | |
| | | |
| | | // 缓存Attribute,用于调试时显示信息 |
| | |
| | | LOGI("<CLoadPort-%d>设置Port type成功.", m_nIndex); |
| | | } |
| | | else { |
| | | LOGI("<CLoadPort-%d>设置Port type失败,code:%d", m_nIndex, code); |
| | | LOGE("<CLoadPort-%d>设置Port type失败,code:%d", m_nIndex, code); |
| | | } |
| | | if (onWritedBlock != nullptr) { |
| | | return onWritedBlock(code); |
| | |
| | | LOGI("<CLoadPort-%d>%s Port成功.", m_nIndex, bEnable ? _T("启用") : _T("禁用")); |
| | | } |
| | | else { |
| | | LOGI("<CLoadPort-%d>%s Port失败,code:%d", m_nIndex, bEnable ? _T("启用") : _T("禁用"), code); |
| | | LOGE("<CLoadPort-%d>%s Port失败,code:%d", m_nIndex, bEnable ? _T("启用") : _T("禁用"), code); |
| | | } |
| | | if (onWritedBlock != nullptr) { |
| | | return onWritedBlock(code); |
| | |
| | | LOGI("<CLoadPort-%d>设置Port mode成功.", m_nIndex); |
| | | } |
| | | else { |
| | | LOGI("<CLoadPort-%d>设置Port mode失败,code:%d", m_nIndex, code); |
| | | LOGE("<CLoadPort-%d>设置Port mode失败,code:%d", m_nIndex, code); |
| | | } |
| | | if (onWritedBlock != nullptr) { |
| | | return onWritedBlock(code); |
| | |
| | | LOGI("<CLoadPort-%d>设置Cassette Type成功.", m_nIndex); |
| | | } |
| | | else { |
| | | LOGI("<CLoadPort-%d>设置Cassette Type失败,code:%d", m_nIndex, code); |
| | | LOGE("<CLoadPort-%d>设置Cassette Type失败,code:%d", m_nIndex, code); |
| | | } |
| | | if (onWritedBlock != nullptr) { |
| | | return onWritedBlock(code); |
| | |
| | | LOGI("<CLoadPort-%d>设置Transfer mode成功.", m_nIndex + 1); |
| | | } |
| | | else { |
| | | LOGI("<CLoadPort-%d>设置Transfer mode失败,code:%d", m_nIndex + 1, code); |
| | | LOGE("<CLoadPort-%d>设置Transfer mode失败,code:%d", m_nIndex + 1, code); |
| | | } |
| | | if (onWritedBlock != nullptr) { |
| | | return onWritedBlock(code); |
| | |
| | | LOGI("<CLoadPort-%d>%s Auto Change成功.", m_nIndex, bEnable ? _T("启用") : _T("禁用")); |
| | | } |
| | | else { |
| | | LOGI("<CLoadPort-%d>%s Auto Change失败,code:%d", m_nIndex, bEnable ? _T("启用") : _T("禁用"), code); |
| | | LOGE("<CLoadPort-%d>%s Auto Change失败,code:%d", m_nIndex, bEnable ? _T("启用") : _T("禁用"), code); |
| | | } |
| | | if (onWritedBlock != nullptr) { |
| | | return onWritedBlock(code); |
| | |
| | | |
| | | CGlass* pGlass = theApp.m_model.m_glassPool.allocaGlass(); |
| | | pGlass->setOriginPort(m_nIndex, i); |
| | | pGlass->addPath(m_nID, 0); |
| | | pGlass->addPath(m_nID, 0, i + 1); |
| | | pGlass->processEnd(m_nID, 0); |
| | | pGlass->setID(szBuffer); |
| | | pGlass->setType(type); |
| | |
| | | char szBuffer[64]; |
| | | for (int i = 0; i < SLOT_MAX; i++) { |
| | | if (!m_slot[i].isEnable()) continue; |
| | | if (!(map >> i) & 1) continue; |
| | | if (((map >> i) & 1) == 0) continue; |
| | | |
| | | CJobDataS js; |
| | | js.setCassetteSequenceNo(getNextCassetteSequenceNo()); |
| | |
| | | CGlass* pGlass = theApp.m_model.m_glassPool.allocaGlass(); |
| | | pGlass->setOriginPort(m_nIndex, i); |
| | | pGlass->setScheduledForProcessing(i % 2 == 1); |
| | | pGlass->addPath(m_nID, 0); |
| | | pGlass->addPath(m_nID, 0, i + 1); |
| | | pGlass->processEnd(m_nID, 0); |
| | | pGlass->setID(szBuffer); |
| | | pGlass->setType(m_cassetteType); |
| | |
| | | |
| | | CGlass* pGlass = theApp.m_model.m_glassPool.allocaGlass(); |
| | | pGlass->setOriginPort(m_nIndex, nSlotIndex); |
| | | pGlass->addPath(m_nID, 0); |
| | | pGlass->addPath(m_nID, 0, slot.nSlotID); |
| | | pGlass->processEnd(m_nID, 0); |
| | | pGlass->setID(szBuffer); |
| | | pGlass->setType(static_cast<SERVO::MaterialsType>(config.nMaterialType)); |