mrDarker
2025-09-04 f5d3efdcec2d59e4adf6a3ae534082023e2df345
SourceCode/Bond/Servo/CAligner.cpp
@@ -48,6 +48,34 @@
      m_slot[0].setName("Slot 1");
   }
   void CAligner::initSteps()
   {
      CEquipment::initSteps();
      {
         // Panel Data Report
         CEqReadStep* pStep = new CEqReadStep(0x617f, 386 * 2,
            [&](void* pFrom, int code, const char* pszData, size_t size) -> int {
               if (code == ROK && pszData != nullptr && size > 0) {
                  decodePanelDataReport((CStep*)pFrom, pszData, size);
               }
               return -1;
            });
         pStep->setName(STEP_EQ_PANEL_DATA_REPORT);
         pStep->setProp("Port", (void*)1);
         pStep->setWriteSignalDev(0x15e);
         if (addStep(STEP_ID_PANEL_DATA_REPORT, pStep) != 0) {
            delete pStep;
         }
      }
   }
   void CAligner::onReceiveLBData(const char* pszData, size_t size)
   {
      __super::onReceiveLBData(pszData, size);
      CHECK_READ_STEP_SIGNAL(STEP_ID_PANEL_DATA_REPORT, pszData, size);
   }
   void CAligner::onTimer(UINT nTimerid)
   {
      CEquipment::onTimer(nTimerid);
@@ -66,35 +94,5 @@
   int CAligner::recvIntent(CPin* pPin, CIntent* pIntent)
   {
      return __super::recvIntent(pPin, pIntent);
   }
   BOOL CAligner::glassWillArrive(CGlass* pGlass)
   {
      BOOL bRet = __super::glassWillArrive(pGlass);
      if (!bRet) {
         return FALSE;
      }
      return m_glassList.empty();
   }
   BOOL CAligner::onPreStoredJob(int port, CJobDataB* pJobDataB)
   {
      CJobDataS* pJobDataS = getJobDataS(pJobDataB->getCassetteSequenceNo(), pJobDataB->getJobSequenceNo());
      if (pJobDataS == nullptr) {
         LOGE("<CAligner-%s>onPreFetchedOutJob,找不到对应的JobDataS(CassetteSequenceNo:%d, JobSequenceNo:%d), 注意排查风险!", m_strName.c_str(),
            pJobDataB->getCassetteSequenceNo(), pJobDataB->getJobSequenceNo());
         return FALSE;
      }
      // 只能一片一片的对位
      Lock();
      if (!m_glassList.empty()) {
         Unlock();
         LOGE("<CEquipment-%s>onPreFetchedOutJob,当前机器或单元存在玻璃片,不能进料,请注意风险!", m_strName.c_str());
         return FALSE;
      }
      return TRUE;
   }
}