| | |
| | | void CLoadPort::initPins() |
| | | { |
| | | // 加入Pin初始化代码 |
| | | LOGI("<CLoadPort>initPins"); |
| | | LOGD("<CLoadPort>initPins"); |
| | | addPin(SERVO::PinType::INPUT, _T("In")); |
| | | addPin(SERVO::PinType::OUTPUT, _T("Out")); |
| | | } |
| | |
| | | |
| | | // 从配置读出的enable,初始化时写给efem |
| | | static int i_enable[4] = { 0 }; |
| | | if ((++i_enable[m_nIndex]) == 10 + m_nIndex) { |
| | | 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; |
| | |
| | | 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() |
| | |
| | | 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); |
| | |
| | | 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)); |