1.修改替换CEqVcrEventStep为(CEqReadStep)
| | |
| | | |
| | | { |
| | | // VCR1 Event Report |
| | | /* |
| | | CEqVcrEventStep* pStep = new CEqVcrEventStep(); |
| | | pStep->setName(STEP_EQ_VCR1_EVENT_REPORT); |
| | | pStep->setWriteSignalDev(0x4a); |
| | | pStep->setReturnDev(0x91e); |
| | | pStep->setVcrEventReportDev(0x5fef); |
| | | if (addStep(STEP_ID_VCR1_EVENT_REPORT, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | */ |
| | | |
| | | // VCR Event Report |
| | | // 机器上报扫码结果,扫码器预计安装在巡边检机器上 |
| | | CEqReadStep* pStep = new CEqReadStep(0x5fef, 15 * 2, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | decodeVCREventReport((CStep*)pFrom, pszData, size); |
| | | } |
| | | return -1; |
| | | }); |
| | | pStep->setName(STEP_EQ_VCR1_EVENT_REPORT); |
| | | pStep->setProp("Port", (void*)1); |
| | | pStep->setWriteSignalDev(0x4a); |
| | | if (addStep(STEP_ID_VCR1_EVENT_REPORT, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | |
| | | delete pStep; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | int CEFEM::onStepEvent(CStep* pStep, int code) |
| | |
| | | panelNo = (value & 0xffff); |
| | | LOGI("Cim Message Confirm(msgID = %d, panel no.=%d).", msgId, panelNo); |
| | | } |
| | | /* |
| | | else if (isVcrEventStep(pStep)) { |
| | | SERVO::CEqVcrEventStep* pEqVcrEventStep = (SERVO::CEqVcrEventStep*)pStep; |
| | | CVcrEventReport* pVcrEventReport = pEqVcrEventStep->getVcrEventReport(); |
| | |
| | | pEqVcrEventStep->setReturnCode(1); |
| | | return 1; |
| | | } |
| | | */ |
| | | } |
| | | |
| | | |
| | |
| | | return index; |
| | | } |
| | | |
| | | int CEquipment::decodeVCREventReport(CStep* pStep, const char* pszData, size_t size) |
| | | { |
| | | CVcrEventReport vcrEventReport; |
| | | vcrEventReport.unserialize(pszData, size); |
| | | LOGI("<CEquipment-%s>decodeVCREventReport<Result:%d, GlassId:%s>\n", m_strName.c_str(), |
| | | vcrEventReport.getVcrResult(), |
| | | vcrEventReport.getGlassId().c_str()); |
| | | |
| | | |
| | | // 缓存Attribute,用于调试时显示信息 |
| | | unsigned int weight = 201; |
| | | CAttributeVector attrubutes; |
| | | vcrEventReport.getAttributeVector(attrubutes, weight); |
| | | pStep->addAttributeVector(attrubutes); |
| | | |
| | | // 0426, 先固定返回1(OK) |
| | | ((CReadStep*)pStep)->setReturnCode((short)VCR_Reply_Code::OK); |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | int CEquipment::onPreStoredJob(int port, CJobDataB* pJobDataB) |
| | | { |
| | | LOGI("<CEquipment-%s>onPreStoredJob:port:%d|GlassId:%s", |
| | |
| | | Batch_put |
| | | }; |
| | | |
| | | enum VCR_Reply_Code { |
| | | OK = 1, |
| | | NG, |
| | | Job_Data_Request, |
| | | VCR_Mismatch |
| | | }; |
| | | |
| | | // Robot cmd param |
| | | #define ROBOT_CMD_PARAM_SIZE 16 /* 防止以后修改ROBOT_CMD_PARAM为不是4的整数倍 */ |
| | | typedef struct _ROBOT_CMD_PARAM { |
| | |
| | | int decodeSentOutJobReport(CStep* pStep, int port, const char* pszData, size_t size); |
| | | int decodeFetchedOutJobReport(CStep* pStep, int port, const char* pszData, size_t size); |
| | | int decodeStoredJobReport(CStep* pStep, int port, const char* pszData, size_t size); |
| | | int decodeVCREventReport(CStep* pStep, const char* pszData, size_t size); |
| | | int addJobDataB(CJobDataB* pJobDataB); |
| | | int removeJobDataB(int nCassetteSequenceNo, int nJobSequenceNo); |
| | | CJobDataB* getJobDataB(int nCassetteSequenceNo, int nJobSequenceNo); |
| | |
| | | return 15 * 2; |
| | | } |
| | | |
| | | int CVcrEventReport::unserialize(char* pszBuffer, int nBufferSize) |
| | | int CVcrEventReport::unserialize(const char* pszBuffer, int nBufferSize) |
| | | { |
| | | if (nBufferSize < 640) return -1; |
| | | |
| | |
| | | return 15 * 2; |
| | | } |
| | | |
| | | void CVcrEventReport::getAttributeVector(CAttributeVector& attrubutes, int beginWeight) |
| | | { |
| | | unsigned int weight = beginWeight; |
| | | std::string strTemp; |
| | | |
| | | attrubutes.addAttribute(new CAttribute("GlassId", |
| | | m_strGlassId.c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("CassetteSequenceNo", |
| | | std::to_string(m_nCassetteSequenceNo).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("JobSequenceNo", |
| | | std::to_string(m_nJobSequenceNo).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("UnitNo", |
| | | std::to_string(m_nUnitNo).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("VcrNo", |
| | | std::to_string(m_nVcrNo).c_str(), "", weight++)); |
| | | |
| | | attrubutes.addAttribute(new CAttribute("VcrResult", |
| | | std::to_string(m_nVcrResult).c_str(), "", weight++)); |
| | | } |
| | | |
| | | std::string& CVcrEventReport::getVcrResultDescription(std::string& strDescription) |
| | | { |
| | | static char* pszDescription[4] = { |
| | |
| | | #pragma once |
| | | #include <string> |
| | | #include "CAttributeVector.h" |
| | | |
| | | |
| | | namespace SERVO { |
| | |
| | | short getVcrResult(); |
| | | std::string& getVcrResultDescription(std::string& strDescription); |
| | | int serialize(char* pszBuffer, int nBufferSize); |
| | | int unserialize(char* pszBuffer, int nBufferSize); |
| | | int unserialize(const char* pszBuffer, int nBufferSize); |
| | | void getAttributeVector(CAttributeVector& attrubutes, int beginWeight); |
| | | |
| | | private: |
| | | std::string m_strGlassId; // Read Data |