| | |
| | | m_bLinkSignalToUpstream[i][SIGNAL_INTERLOCK] = isBitOn(pszData, size, index + 2); |
| | | m_bLinkSignalToUpstream[i][SIGNAL_SEND_ABLE] = isBitOn(pszData, size, index + 3); |
| | | index += 0x40; |
| | | |
| | | if (m_bLinkSignalToUpstream[i][SIGNAL_SEND_ABLE]) { |
| | | onSendAble(i+1); |
| | | } |
| | | } |
| | | if(m_bLinkSignalToUpstream[0][SIGNAL_SEND_ABLE]) { |
| | | onSendAble(); |
| | | } |
| | | |
| | | |
| | | index += 0x40 * 2; |
| | | for (int i = 0; i < 8; i++) { |
| | |
| | | m_bLinkSignalToDownstream[i][SIGNAL_INTERLOCK] = isBitOn(pszData, size, index + 2); |
| | | m_bLinkSignalToDownstream[i][SIGNAL_RECEIVE_ABLE] = isBitOn(pszData, size, index + 3); |
| | | index += 0x40; |
| | | |
| | | if (m_bLinkSignalToDownstream[0][SIGNAL_RECEIVE_ABLE]) { |
| | | onReceiveAble(i + 1); |
| | | } |
| | | } |
| | | if (m_bLinkSignalToDownstream[0][SIGNAL_RECEIVE_ABLE]) { |
| | | onReceiveAble(); |
| | | } |
| | | |
| | | |
| | | // 其它信号及响应 |
| | | index = 0x540; |
| | |
| | | |
| | | // 找到指定的glass id, |
| | | Lock(); |
| | | CGlass* pGlass = (CGlass*)m_slot[port - 1].getContext(); |
| | | if (pGlass == nullptr && !compareJobData(pJobDataB, pGlass->getJobDataS())) { |
| | | CGlass* pContext = nullptr; |
| | | for (int i = 0; i < SLOT_MAX; i++) { |
| | | CGlass* pGlass = (CGlass*)m_slot[i].getContext(); |
| | | if (pGlass != nullptr && compareJobData(pJobDataB, pGlass->getJobDataS())) { |
| | | pContext = pGlass; |
| | | if (pGlass != nullptr) pGlass->addRef(); |
| | | m_slot[i].setContext(nullptr); |
| | | break; |
| | | } |
| | | } |
| | | if (pContext == nullptr) { |
| | | Unlock(); |
| | | return -3; |
| | | } |
| | | |
| | | if (pGlass != nullptr) pGlass->addRef(); |
| | | m_slot[port - 1].setContext(nullptr); |
| | | |
| | | ((CArm*)m_pArm)->tempStore(pGlass); |
| | | pGlass->release(); |
| | | ((CArm*)m_pArm)->tempStore(pContext); |
| | | pContext->release(); |
| | | Unlock(); |
| | | |
| | | |
| | |
| | | return 0; |
| | | } |
| | | |
| | | int CEquipment::storedJob(int port, CJobDataB* pJobDataB) |
| | | int CEquipment::storedJob(int port, CJobDataB* pJobDataB, short putSlot) |
| | | { |
| | | if (m_pArm == nullptr) { |
| | | return -1; |
| | |
| | | |
| | | ASSERT(pGlass); |
| | | Lock(); |
| | | pGlass->addPath(m_nID, port); |
| | | m_slot[port - 1].setContext(pGlass); |
| | | pGlass->addPath(m_nID, getSlotUnit(putSlot)); |
| | | m_slot[putSlot - 1].setContext(pGlass); |
| | | pGlass->release(); // tempFetchOut需要调用一次release |
| | | Unlock(); |
| | | |
| | |
| | | if (m_listener.onDataChanged != nullptr) { |
| | | m_listener.onDataChanged(this, EDCC_STORED_JOB); |
| | | } |
| | | |
| | | |
| | | return 0; |
| | | } |
| | | |
| | |
| | | |
| | | CGlass* CEquipment::getGlassWithCassette(int cassetteSequenceNo, int jobSequenceNo) |
| | | { |
| | | CSlot* pSlot = nullptr; |
| | | for (int i = 0; i < SLOT_MAX; i++) { |
| | | if (!m_slot[i].isEnable()) continue; |
| | | CGlass* pGlass = (CGlass*)m_slot[i].getContext(); |
| | |
| | | if (!m_slot[i].isEnable()) continue; |
| | | if (m_slot[i].isLock()) continue; |
| | | CGlass* pGlass = (CGlass*)m_slot[i].getContext(); |
| | | if (!isSlotProcessed(i+1)) continue; |
| | | if (!isSlotProcessed(i)) continue; |
| | | if (pGlass == nullptr) continue; |
| | | int lsPath = m_slot[i].getLinkSignalPath(); |
| | | if(!m_bLinkSignalToUpstream[lsPath][SIGNAL_UPSTREAM_INLINE] |
| | |
| | | if (m_processState != PROCESS_STATE::Complete) { |
| | | setProcessState(PROCESS_STATE::Complete); |
| | | } |
| | | CGlass* pGlass = getGlassFromSlot(port); |
| | | |
| | | CGlass* pGlass = getGlassFromSlot(slotNo); |
| | | if (pGlass == nullptr) { |
| | | LOGE("<CEquipment-%s>decodeJobProcessEndReport, 找不到对应glass", getName().c_str()); |
| | | } |
| | | else { |
| | | pGlass->processEnd(m_nID, port); |
| | | if (m_processState != PROCESS_STATE::Complete) { |
| | | setProcessState(PROCESS_STATE::Complete); |
| | | CJobDataS* pJs = pGlass->getJobDataS(); |
| | | if (pJs->getCassetteSequenceNo() == cassetteNo |
| | | && pJs->getJobSequenceNo() == jobSequenceNo) { |
| | | pGlass->processEnd(m_nID, getSlotUnit(slotNo)); |
| | | if (m_processState != PROCESS_STATE::Complete) { |
| | | setProcessState(PROCESS_STATE::Complete); |
| | | } |
| | | } |
| | | else { |
| | | LOGE("<CEquipment-%s>decodeJobProcessEndReport, jobSequenceNo或jobSequenceNo不匹配", |
| | | getName().c_str()); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | // 如果没有可用位置,报错 |
| | | Lock(); |
| | | CSlot* pSlot = getSlot(port - 1); |
| | | CSlot* pSlot = getSlot(putSlot - 1); |
| | | ASSERT(pSlot); |
| | | if (pSlot->getContext() != nullptr) { |
| | | Unlock(); |
| | |
| | | |
| | | short putSlot = 0; |
| | | BOOL bCheck = onPreStoredJob(port, pJobDataB, putSlot); |
| | | if (bCheck && port == putSlot) { |
| | | return storedJob(port, pJobDataB); |
| | | if (bCheck) { |
| | | return storedJob(port, pJobDataB, putSlot); |
| | | } |
| | | |
| | | // 数据异常,处理或显示 |
| | | LOGI("<CEquipment-%s>onStoredJob Error.ort:%d|GlassId:%s", |
| | | LOGI("<CEquipment-%s>onStoredJob Error.port:%d|GlassId:%s", |
| | | m_strName.c_str(), port, pJobDataB->getGlassId().c_str()); |
| | | return -1; |
| | | } |
| | |
| | | * 当从CC-Link检测到设备Send Able为On时调用此函数 |
| | | * 可能会多次重复调用(根据扫描频率), 注意防呆 |
| | | */ |
| | | int CEquipment::onSendAble() |
| | | int CEquipment::onSendAble(int port) |
| | | { |
| | | LOGI("<CEquipment-%s>onSendAble.", m_strName.c_str()); |
| | | if (m_processState != PROCESS_STATE::Complete) { |
| | | setProcessState(PROCESS_STATE::Complete); |
| | | } |
| | | LOGI("<CEquipment-%s>onSendAble.port:%d", m_strName.c_str(), port); |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | int CEquipment::onReceiveAble() |
| | | int CEquipment::onReceiveAble(int port) |
| | | { |
| | | LOGI("<CEquipment-%s>onReceiveAble.", m_strName.c_str()); |
| | | LOGI("<CEquipment-%s>onReceiveAble.port:%d", m_strName.c_str(), port); |
| | | |
| | | return 0; |
| | | } |