| | |
| | | CEqStatusStep::CEqStatusStep() : CReadStep() |
| | | { |
| | | m_nStatusDev = 0; |
| | | m_nUnitId = 0; |
| | | for (int i = 0; i < STATUS_MAX; i++) { |
| | | m_nStatus[i] = 0; |
| | | m_nReasonCode[i] = 0; |
| | |
| | | |
| | | return -1; |
| | | } |
| | | |
| | | int CEqStatusStep::getReasonCode(unsigned int uint) const |
| | | { |
| | | if (uint < STATUS_MAX) { |
| | | return m_nReasonCode[uint]; |
| | | } |
| | | |
| | | return -1; |
| | | } |
| | | |
| | | unsigned int CEqStatusStep::getUnitId() const |
| | | { |
| | | return m_nUnitId; |
| | | } |
| | | int CEqStatusStep::onReadData() |
| | | { |
| | | CReadStep::onReadData(); |
| | |
| | | return -1; |
| | | } |
| | | |
| | | unsigned int unitId = (unsigned int)CToolUnits::toInt16(&szBuffer[0]); |
| | | const unsigned int unitId = (unsigned int)CToolUnits::toInt16(&szBuffer[0]); |
| | | if (unitId >= STATUS_MAX) { |
| | | return -2; |
| | | } |
| | | m_nUnitId = unitId; |
| | | |
| | | if (unitId == 0) { |
| | | m_nStatus[unitId] = CToolUnits::toInt16(&szBuffer[2 + unitId * 4]); |
| | |
| | | virtual int onComplete(); |
| | | virtual int onTimeout(); |
| | | void setStatusDev(int nDev); |
| | | unsigned int getUnitId() const; |
| | | int getStatus(unsigned int uint); |
| | | int getReasonCode(unsigned int uint) const; |
| | | std::string& getStatusDescription(unsigned int unid, std::string& strDescription); |
| | | |
| | | private: |
| | | int m_nStatusDev; |
| | | unsigned int m_nUnitId; |
| | | int m_nStatus[STATUS_MAX]; |
| | | int m_nReasonCode[STATUS_MAX]; |
| | | }; |
| | |
| | | |
| | | return 1; |
| | | } |
| | | else if (pStep->getName().compare(STEP_STATUS) == 0) { |
| | | SERVO::CEqStatusStep* pEqStatusStep = (SERVO::CEqStatusStep*)pStep; |
| | | if (m_listener.onEqStatusChanged != nullptr) { |
| | | const unsigned int unitId = pEqStatusStep->getUnitId(); |
| | | const int status = pEqStatusStep->getStatus(unitId); |
| | | const int reason = pEqStatusStep->getReasonCode(unitId); |
| | | m_listener.onEqStatusChanged(this, (int)unitId, status, reason); |
| | | } |
| | | return 1; |
| | | } |
| | | else if (isCimMessageConfirmStep(pStep)) { |
| | | SERVO::CEqReadIntStep* pEqReadIntStep = (SERVO::CEqReadIntStep*)pStep; |
| | | int value = pEqReadIntStep->getValue(); |
| | |
| | | { |
| | | LOGI("<CEquipment-%s>onSentOutJob.", m_strName.c_str()); |
| | | |
| | | if (m_listener.onSentOutJob != nullptr) { |
| | | m_listener.onSentOutJob(this, port, pJobDataS); |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | |
| | |
| | | typedef std::function<void(void* pEiuipment, short status, __int64 data)> ONPORTSTATUSCHANGED; |
| | | typedef std::function<void(void* pEiuipment, const std::vector<CParam>& params)> ONPROCESSDATAREPORT; |
| | | typedef std::function<void(void* pEiuipment, int port, CJobDataS* pJobDataS)> ONRECEIVEDJOB; |
| | | typedef std::function<void(void* pEiuipment, int port, CJobDataS* pJobDataS)> ONSENTOUTJOB; |
| | | typedef std::function<void(void* pEiuipment, int unitId, int status, int reason)> ONEQSTATUSCHANGED; |
| | | |
| | | typedef struct _EquipmentListener |
| | | { |
| | |
| | | ONVCREVENTREPORT onPanelDataReport; |
| | | ONPROCESSDATAREPORT onProcessDataReport; |
| | | ONRECEIVEDJOB onReceivedJob; |
| | | ONSENTOUTJOB onSentOutJob; |
| | | ONEQSTATUSCHANGED onEqStatusChanged; |
| | | } EquipmentListener; |
| | | |
| | | |
| | |
| | | m_listener.onJobReceived(this, (CEquipment*)pEquipment, port, pJobDataS); |
| | | } |
| | | }; |
| | | listener.onSentOutJob = [&](void* pEquipment, int port, CJobDataS* pJobDataS) { |
| | | if (m_listener.onJobSentOut != nullptr) { |
| | | m_listener.onJobSentOut(this, (CEquipment*)pEquipment, port, pJobDataS); |
| | | } |
| | | }; |
| | | listener.onEqStatusChanged = [&](void* pEquipment, int unitId, int status, int reason) { |
| | | if (m_listener.onEqStatusChanged != nullptr) { |
| | | m_listener.onEqStatusChanged(this, (CEquipment*)pEquipment, unitId, status, reason); |
| | | } |
| | | }; |
| | | pEquipment->setListener(listener); |
| | | pEquipment->setCcLink(&m_cclink); |
| | | m_listEquipment.push_back(pEquipment); |
| | |
| | | typedef std::function<void(void* pMaster, CEquipment* pEquipment, const std::vector<CParam>& params)> ONPROCESSDATAREPORTEX; |
| | | typedef std::function<void(void* pMaster, CEquipment* pEquipment, const std::vector<CParam>& params)> ONSVDATAREPORT; |
| | | typedef std::function<void(void* pMaster, CEquipment* pEquipment, int port, CJobDataS* pJobDataS)> ONJOBRECEIVED; |
| | | typedef std::function<void(void* pMaster, CEquipment* pEquipment, int port, CJobDataS* pJobDataS)> ONJOBSENTOUT; |
| | | typedef std::function<void(void* pMaster, CEquipment* pEquipment, int unitId, int status, int reason)> ONEQSTATUSCHANGED; |
| | | typedef std::function<void(void* pMaster, int round)> ONCTROUNDEND; |
| | | typedef std::function<void(void* pMaster, void* pj)> ONPJSTART; |
| | | typedef std::function<void(void* pMaster)> ONCONTROLJOBCHANGED; |
| | |
| | | ONSVDATAREPORT onSVDataReport; |
| | | ONPROCESSDATAREPORTEX onProcessDataReport; |
| | | ONJOBRECEIVED onJobReceived; |
| | | ONJOBSENTOUT onJobSentOut; |
| | | ONEQSTATUSCHANGED onEqStatusChanged; |
| | | ONCTROUNDEND onCTRoundEnd; |
| | | ONPJSTART onCjStart; |
| | | ONPJSTART onCjEnd; |
| | |
| | | (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.setVariableValue(recipeVid, recipe.c_str()); |
| | | } |
| | | 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) { |
| | |
| | | |
| | | // SubEqp events (per equipment, ignore slot distinction except payload) |
| | | static std::map<int, SERVO::PROCESS_STATE> s_prevSubEqpState; |
| | | const auto prevEqState = s_prevSubEqpState[eqId]; |
| | | if (prevEqState != state) { |
| | | // state change |
| | | m_hsmsPassive.requestEventReportSend("SubEqpStateChange"); |
| | | } |
| | | if (state == SERVO::PROCESS_STATE::Processing) { |
| | | m_hsmsPassive.requestEventReportSend_SubEqpStart(); |
| | | } |
| | |
| | | } |
| | | }); |
| | | }; |
| | | masterListener.onEqStatusChanged = [&](void* pMaster, SERVO::CEquipment* pEquipment, int unitId, int status, int reason) { |
| | | (void)pMaster; |
| | | if (pEquipment == nullptr) return; |
| | | m_hsmsPassive.withVariableLock([&] { |
| | | m_hsmsPassive.setVariableValue("SubEqpName", pEquipment->getName().c_str()); |
| | | m_hsmsPassive.setVariableValue("SubEqpSlot", unitId); |
| | | m_hsmsPassive.setVariableValue("EquipmentStatus", (__int64)status); |
| | | m_hsmsPassive.requestEventReportSend("SubEqpStateChange"); |
| | | }); |
| | | }; |
| | | masterListener.onSVDataReport = [&](void* pMaster, SERVO::CEquipment* pEquipment, const std::vector<CParam>& params) { |
| | | (void)pMaster; |
| | | const int eqId = pEquipment ? pEquipment->getID() : 0; |
| | |
| | | 10061,CheckSlotMap,,(10061) |
| | | 10062,SlotMapVerificationOK,,(10062) |
| | | 10063,SlotMapVerificationNG,,(10062) |
| | | 10064,SlotMapMismatch,,(10062) |
| | | 10064,SlotMapMismatch,Slot map mismatch between scan and download,(10062) |
| | | 10071,GlassIDReadWaitingForHost,,(10071) |
| | | 10072,GlassIDReadVerificationOK,,(10072) |
| | | 10073,GlassIDReadVerificationNG,,(10072) |
| | |
| | | 50008,Port_Unload_Ready,,(50008) |
| | | 50009,Port_Load_Ready,,(50009) |
| | | 50010,Port_Blocked,,(50010) |
| | | 50011,OCR_PanelID_Read_OK,,(50012) |
| | | 50015,OCR_PanelID_Read_NG,,(50012) |
| | | 50016,OCR_PanelID_Read_Mismatch,,(50012) |
| | | 50017,OCR_PanelID_Read_NG_Mismatch,,(50012) |
| | | 50011,OCR_PanelID_Read_OK,OCR read OK and match,(50012) |
| | | 50015,OCR_PanelID_Read_NG,OCR read fail (key-in match),(50012) |
| | | 50016,OCR_PanelID_Read_Mismatch,OCR read OK but mismatch,(50012) |
| | | 50017,OCR_PanelID_Read_NG_Mismatch,OCR read fail and key-in mismatch,(50012) |
| | | 50012,Port_Ready_To_Release,,(50013) |
| | | 50020,PortStateChange,,(50020) |
| | | 50021,GlassReceivedJob,Glass received into equipment slot,(50021) |
| | | 50022,GlassSentOutJob,Glass sent out from equipment slot,(50022) |
| | | 60000,BonderSVData,,(60000) |
| | | 61000,BonderProcessData,,(61000) |
| | | 62000,VacuumBakeSVData,,(62000) |
| | |
| | | RPTID,(VID1,VID2,...) |
| | | RPTID,(VID1,VID2,...) |
| | | # Notes: |
| | | # - RPTIDs 60000-67000, 700, 10017, 20000 include SubEqpName(5018) and SubEqpSlot(5019). |
| | | # - RPTIDs 50008/50009/50010/50013/50014/50020 use PortId(5022). |
| | | # - OCR events (CEID 50011/50015/50016/50017) use RPTID 50012 with VCRPanelID(5014). |
| | | |
| | | 33,(5017) |
| | | 300,(1,300) |
| | | 301,(1,300) |
| | |
| | | 50013,(5022) |
| | | 50014,(5022) |
| | | 50020,(500,5022,5021) |
| | | 50021,(5018,5019,5023) |
| | | 50022,(5018,5019,5023) |
| | | 60000,(500,5018,5019,6000,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018) |
| | | 61000,(500,5018,5019,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121) |
| | | 62000,(500,5018,5019,6200,6201,6202,6203,6204,6205,6206,6207,6208,6209,6210,6211,6212,6213,6214,6215,6216,6217) |
| | |
| | | 67000,(500,5018,5019,6700,6701,6702,6703) |
| | | 10015,(5018,5019) |
| | | 10016,(5018,5019) |
| | | 10017,(500,5018,5019) |
| | | 10017,(500,5018,5019,5024) |
| | | 12000,(500,5018,5019) |
| | | 12001,(500,5018,5019) |
| | | 12002,(500,5018,5019) |
| | |
| | | 5009,CJEndID,A20,CJ end ID |
| | | 5014,VCRPanelID,A20,Panel ID from reader |
| | | 5017,ProcessDataReportText,A50,EV_PROCESS_DATA_REPORT payload (placeholder) |
| | | 5018,SubEqpName,A20,Sub equipment name for SubEqp events |
| | | 5019,SubEqpSlot,U1,Slot number for SubEqp events |
| | | 5018,SubEqpName,A20,Sub equipment name (SubEqp/Unit/Process/SV/ProcessData events) |
| | | 5019,SubEqpSlot,U1,Slot number for SubEqp/Unit; 0 when not applicable |
| | | 5021,PortState,U1,Port transfer/state code for PortStateChange |
| | | 5022,PortId,U1,Port ID for Port events |
| | | 5022,PortId,U1,Unified port ID for all Port events |
| | | 5023,MaterialId,A50,Material/Glass ID for Received/SentOut events |
| | | 5024,EquipmentStatus,U1,Equipment status (SubEqpStateChange): 1=PM;2=Down(BM);3=Pause;4=Idle;5=Run;6=Job Change;7=ETC |
| | | |