chenluhua1980
2 天以前 351086486441b80cfe71550b43cbe1e4dc440f5d
SourceCode/Bond/Servo/CEquipment.cpp
@@ -927,6 +927,27 @@
      for (int i = 0; i < SLOT_MAX; i++) {
         CGlass* pGlass = (CGlass*)m_slot[i].getContext();
         if (pGlass != nullptr && compareJobData(pJobDataB, pGlass->getJobDataS())) {
            // 取片成功后,回填当前路径节点的离开时间(优先匹配尚未离开的节点)。
            CPath* pPath = pGlass->getPath();
            if (pPath != nullptr) {
               CPath* pScan = pPath->getHeadPath();
               CPath* pOpenNode = nullptr;
               const unsigned int slotNo = (unsigned int)m_slot[i].getNo();
               const unsigned int unitNo = getSlotUnit((int)slotNo);
               while (pScan != nullptr) {
                  if (pScan->getEqID() == m_nID
                     && pScan->getUnit() == unitNo
                     && pScan->getSlot() == slotNo
                     && pScan->getOutTime() == 0) {
                     pOpenNode = pScan;
                  }
                  pScan = pScan->getNext();
               }
               if (pOpenNode != nullptr) {
                  pOpenNode->setOutTime(CToolUnits::getTimestamp());
               }
            }
            pContext = pGlass;
            if (pGlass != nullptr) pGlass->addRef();
            m_slot[i].setContext(nullptr);
@@ -2135,18 +2156,6 @@
         return FALSE;
      }
      // 如果没有可用位置,报错
      Lock();
      CSlot* pSlot = getSlot(putSlot - 1);
      ASSERT(pSlot);
      if (pSlot->getContext() != nullptr) {
         Unlock();
         LOGE("<CEquipemnt-%s>onPreStoredJob,指定slot(port:%d)有料,请注意风险!", m_strName.c_str(), port);
         return FALSE;
      }
      Unlock();
      if (m_listener.onPreStoredJob != nullptr) {
         if (!m_listener.onPreStoredJob(this, port, pJobDataB, putSlot)) {
            return FALSE;
@@ -2157,6 +2166,21 @@
         }
      }
      // 如果没有可用位置,报错(需在 listener 回调后拿到 putSlot)
      if (putSlot <= 0) {
         LOGE("<CEquipemnt-%s>onPreStoredJob, putSlot无效(port:%d).", m_strName.c_str(), port);
         return FALSE;
      }
      Lock();
      CSlot* pSlot = getSlot(putSlot - 1);
      ASSERT(pSlot);
      if (pSlot->getContext() != nullptr) {
         Unlock();
         LOGE("<CEquipemnt-%s>onPreStoredJob,指定slot(port:%d)有料,请注意风险!", m_strName.c_str(), port);
         return FALSE;
      }
      Unlock();
      return TRUE;
   }