| | |
| | | return CAACK_5; |
| | | } |
| | | |
| | | const short scanMap = pLoadPort->getScanCassetteMap(); |
| | | const short downloadMap = pLoadPort->getDownloadCassetteMap(); |
| | | m_hsmsPassive.withVariableLock([&] { |
| | | m_hsmsPassive.setVariableValue("SlotMapScan", pLoadPort->getScanCassetteMap()); |
| | | m_hsmsPassive.setVariableValue("SlotMapDownload", pLoadPort->getDownloadCassetteMap()); |
| | | m_hsmsPassive.requestEventReportSend_SlotMapVerificationOK(); |
| | | m_hsmsPassive.setVariableValue("SlotMapScan", scanMap); |
| | | m_hsmsPassive.setVariableValue("SlotMapDownload", downloadMap); |
| | | if (scanMap != downloadMap) { |
| | | m_hsmsPassive.requestEventReportSend_SlotMapVerificationNG(); |
| | | m_hsmsPassive.requestEventReportSend("SlotMapMismatch"); |
| | | } |
| | | else { |
| | | m_hsmsPassive.requestEventReportSend_SlotMapVerificationOK(); |
| | | } |
| | | }); |
| | | |
| | | if (scanMap != downloadMap) { |
| | | strErrorTxt = "rejected - SlotMap mismatch"; |
| | | return CAACK_5; |
| | | } |
| | | |
| | | // Host 确认 SlotMap 后再开始加工/流程 |
| | | m_master.proceedWithCarrier(portIndex); |
| | |
| | | if (pReport != nullptr) { |
| | | m_hsmsPassive.withVariableLock([&] { |
| | | m_hsmsPassive.setVariableValue("VCRPanelID", pReport->getGlassId().c_str()); |
| | | int nRet = m_hsmsPassive.requestEventReportSend_OCR_PanelID_Read_OK(); |
| | | int nRet = m_hsmsPassive.requestEventReportSend_OCR_PanelID_Read(pReport->getVcrResult()); |
| | | if (nRet != ER_NOERROR) { |
| | | LOGE("<CModel>requestEventReportSend_OCR_PanelID_Read_OK failed, ret=%d", nRet); |
| | | LOGE("<CModel>requestEventReportSend_OCR_PanelID_Read failed, ret=%d", nRet); |
| | | } |
| | | }); |
| | | } |
| | |
| | | (void)pMaster; |
| | | (void)port; |
| | | if (pEquipment == nullptr || pJobDataS == nullptr) return; |
| | | { |
| | | const std::string& g1 = pJobDataS->getGlass1Id(); |
| | | const std::string& g2 = pJobDataS->getGlass2Id(); |
| | | std::string glassId; |
| | | if (!g1.empty() && !g2.empty()) { |
| | | glassId = g1 + "+" + g2; |
| | | } |
| | | else if (!g1.empty()) { |
| | | glassId = g1; |
| | | } |
| | | else { |
| | | glassId = g2; |
| | | } |
| | | const int slotNo = pJobDataS->getTargetSlotNo(); |
| | | m_hsmsPassive.withVariableLock([&] { |
| | | m_hsmsPassive.setVariableValue("SubEqpName", pEquipment->getName().c_str()); |
| | | m_hsmsPassive.setVariableValue("SubEqpSlot", slotNo); |
| | | m_hsmsPassive.setVariableValue("MaterialId", glassId.c_str()); |
| | | m_hsmsPassive.requestEventReportSend("GlassReceivedJob"); |
| | | }); |
| | | } |
| | | const int eqId = pEquipment->getID(); |
| | | const int recipeId = pJobDataS->getMasterRecipe(); |
| | | std::string recipe = RecipeManager::getInstance().getPPIDById(recipeId); |
| | |
| | | m_hsmsPassive.requestEventReportSend("RecipeChanged"); |
| | | }); |
| | | }; |
| | | masterListener.onJobSentOut = [&](void* pMaster, SERVO::CEquipment* pEquipment, int port, SERVO::CJobDataS* pJobDataS) { |
| | | (void)pMaster; |
| | | (void)port; |
| | | if (pEquipment == nullptr || pJobDataS == nullptr) return; |
| | | const std::string& g1 = pJobDataS->getGlass1Id(); |
| | | const std::string& g2 = pJobDataS->getGlass2Id(); |
| | | std::string glassId; |
| | | if (!g1.empty() && !g2.empty()) { |
| | | glassId = g1 + "+" + g2; |
| | | } |
| | | else if (!g1.empty()) { |
| | | glassId = g1; |
| | | } |
| | | else { |
| | | glassId = g2; |
| | | } |
| | | const int slotNo = pJobDataS->getSourceSlotNo(); |
| | | m_hsmsPassive.withVariableLock([&] { |
| | | m_hsmsPassive.setVariableValue("SubEqpName", pEquipment->getName().c_str()); |
| | | m_hsmsPassive.setVariableValue("SubEqpSlot", slotNo); |
| | | m_hsmsPassive.setVariableValue("MaterialId", glassId.c_str()); |
| | | m_hsmsPassive.requestEventReportSend("GlassSentOutJob"); |
| | | }); |
| | | }; |
| | | masterListener.onLoadPortStatusChanged = [&] (void* pMaster, SERVO::CEquipment* pEquipment, short status, __int64 data) { |
| | | LOGE("<CModel>onLoadPortStatusChanged. status = %d", status); |
| | | static std::map<int, short> s_prevPortStatus; |
| | |
| | | m_hsmsPassive.withVariableLock([&] { |
| | | m_hsmsPassive.setVariableValue(stateVid, (__int64)status); |
| | | m_hsmsPassive.setVariableValue(modeVid, (__int64)pLoadPort->getPortMode()); |
| | | m_hsmsPassive.setVariableValue("PortStateChangePortId", pLoadPort->getID()); |
| | | m_hsmsPassive.setVariableValue("PortId", pLoadPort->getID()); |
| | | m_hsmsPassive.setVariableValue("PortState", (__int64)status); |
| | | m_hsmsPassive.requestEventReportSend("PortStateChange"); |
| | | }); |
| | |
| | | SERVO::CLoadPort* pLoadPort = dynamic_cast<SERVO::CLoadPort*>(pEquipment); |
| | | m_hsmsPassive.withVariableLock([&] { |
| | | if (pLoadPort != nullptr) { |
| | | m_hsmsPassive.setVariableValue("BlockedPortId", pLoadPort->getID()); |
| | | m_hsmsPassive.setVariableValue("PortId", pLoadPort->getID()); |
| | | } |
| | | m_hsmsPassive.requestEventReportSend_Port_Blocked(); |
| | | }); |
| | |
| | | SERVO::CLoadPort* pLoadPort = dynamic_cast<SERVO::CLoadPort*>(pEquipment); |
| | | m_hsmsPassive.withVariableLock([&] { |
| | | if (pLoadPort != nullptr) { |
| | | m_hsmsPassive.setVariableValue("LoadReadyPortId", pLoadPort->getID()); |
| | | m_hsmsPassive.setVariableValue("PortId", pLoadPort->getID()); |
| | | } |
| | | m_hsmsPassive.requestEventReportSend_Port_Load_Ready(); |
| | | }); |
| | |
| | | SERVO::CLoadPort* pLoadPort = dynamic_cast<SERVO::CLoadPort*>(pEquipment); |
| | | m_hsmsPassive.withVariableLock([&] { |
| | | if (pLoadPort != nullptr) { |
| | | m_hsmsPassive.setVariableValue("UnloadReadyPortId", pLoadPort->getID()); |
| | | m_hsmsPassive.setVariableValue("PortId", pLoadPort->getID()); |
| | | if (prevStatus == PORT_INUSE) { |
| | | m_hsmsPassive.setVariableValue("ReadyToReleasePortId", pLoadPort->getID()); |
| | | m_hsmsPassive.setVariableValue("PortId", pLoadPort->getID()); |
| | | m_hsmsPassive.requestEventReportSend_Port_Ready_To_Release(); |
| | | } |
| | | } |
| | |
| | | SERVO::CLoadPort* pLoadPort = dynamic_cast<SERVO::CLoadPort*>(pEquipment); |
| | | m_hsmsPassive.withVariableLock([&] { |
| | | if (pLoadPort != nullptr) { |
| | | m_hsmsPassive.setVariableValue("LoadPortNotAssocPortId", pLoadPort->getID()); |
| | | m_hsmsPassive.setVariableValue("PortId", pLoadPort->getID()); |
| | | } |
| | | m_hsmsPassive.requestEventReportSend_LoadPortNotAssoc(); |
| | | }); |
| | |
| | | auto sendSv = [&](const auto& vidMap, const char* evName) { |
| | | const size_t count = (std::min)(params.size(), vidMap.size()); |
| | | m_hsmsPassive.withVariableLock([&] { |
| | | if (pEquipment != nullptr) { |
| | | m_hsmsPassive.setVariableValue("SubEqpName", pEquipment->getName().c_str()); |
| | | } |
| | | m_hsmsPassive.setVariableValue("SubEqpSlot", 0); |
| | | m_hsmsPassive.setVariableValue("Clock", CToolUnits::getCurrentTimeString().c_str()); |
| | | for (size_t idx = 0; idx < count; ++idx) { |
| | | const std::string val = formatParamValue(params[idx]); |
| | |
| | | auto sendProcess = [&](const auto& vidMap, const char* evName) { |
| | | const size_t count = (std::min)(params.size(), vidMap.size()); |
| | | m_hsmsPassive.withVariableLock([&] { |
| | | if (pEquipment != nullptr) { |
| | | m_hsmsPassive.setVariableValue("SubEqpName", pEquipment->getName().c_str()); |
| | | } |
| | | m_hsmsPassive.setVariableValue("SubEqpSlot", 0); |
| | | m_hsmsPassive.setVariableValue("Clock", CToolUnits::getCurrentTimeString().c_str()); |
| | | for (size_t idx = 0; idx < count; ++idx) { |
| | | const std::string val = formatParamValue(params[idx]); |