| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #include "stdafx.h" |
| | | #include "CEqVcrEventStep.h" |
| | | #include "Log.h" |
| | | |
| | | |
| | | namespace SERVO { |
| | | CEqVcrEventStep::CEqVcrEventStep() : CReadStep() |
| | | { |
| | | m_nVcrEventReportDev = 0; |
| | | } |
| | | |
| | | CEqVcrEventStep::~CEqVcrEventStep() |
| | | { |
| | | |
| | | } |
| | | |
| | | void CEqVcrEventStep::setVcrEventReportDev(int nDev) |
| | | { |
| | | m_nVcrEventReportDev = nDev; |
| | | } |
| | | |
| | | void CEqVcrEventStep::getAttributeVector(CAttributeVector& attrubutes) |
| | | { |
| | | CReadStep::getAttributeVector(attrubutes); |
| | | |
| | | std::string strTemp; |
| | | attrubutes.addAttribute(new CAttribute("Dev", |
| | | ("W" + CToolUnits::toHexString(m_nVcrEventReportDev, strTemp)).c_str(), "")); |
| | | attrubutes.addAttribute(new CAttribute("GlassId", |
| | | m_vcrEventReport.getGlassId().c_str(), "")); |
| | | attrubutes.addAttribute(new CAttribute("CassetteSequenceNo", |
| | | std::to_string(m_vcrEventReport.getCassetteSequenceNo()).c_str(), "")); |
| | | attrubutes.addAttribute(new CAttribute("JobSequenceNo", |
| | | std::to_string(m_vcrEventReport.getJobSequenceNo()).c_str(), "")); |
| | | attrubutes.addAttribute(new CAttribute("UnitNo", |
| | | std::to_string(m_vcrEventReport.getUnitNo()).c_str(), "")); |
| | | attrubutes.addAttribute(new CAttribute("VCR No", |
| | | std::to_string(m_vcrEventReport.getVcrNo()).c_str(), "")); |
| | | attrubutes.addAttribute(new CAttribute("VCR Result", |
| | | m_vcrEventReport.getVcrResultDescription(strTemp).c_str(), "")); |
| | | } |
| | | |
| | | int CEqVcrEventStep::onReadData() |
| | | { |
| | | CReadStep::onReadData(); |
| | | |
| | | |
| | | char szBuffer[64]; |
| | | int nRet = m_pCclink->ReadData2(m_station, DeviceType::W, m_nVcrEventReportDev, |
| | | 30, szBuffer); |
| | | if (0 != nRet) { |
| | | return -1; |
| | | } |
| | | |
| | | m_vcrEventReport.unserialize(szBuffer, 60); |
| | | LOGI("<CEqVcrEventStep-%s>Read VCR Event Report\n", m_strName.c_str()); |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | int CEqVcrEventStep::onComplete() |
| | | { |
| | | CReadStep::onComplete(); |
| | | LOGI("<CEqVcrEventStep> onComplete."); |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | int CEqVcrEventStep::onTimeout() |
| | | { |
| | | CReadStep::onTimeout(); |
| | | LOGI("<CEqVcrEventStep> onTimeout."); |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | CVcrEventReport* CEqVcrEventStep::getVcrEventReport() |
| | | { |
| | | return &m_vcrEventReport; |
| | | } |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #pragma once |
| | | #include "CReadStep.h" |
| | | #include "CVcrEventReport.h" |
| | | |
| | | |
| | | namespace SERVO { |
| | | class CEqVcrEventStep : public CReadStep |
| | | { |
| | | public: |
| | | CEqVcrEventStep(); |
| | | ~CEqVcrEventStep(); |
| | | |
| | | public: |
| | | virtual void getAttributeVector(CAttributeVector& attrubutes); |
| | | virtual int onReadData(); |
| | | virtual int onComplete(); |
| | | virtual int onTimeout(); |
| | | void setVcrEventReportDev(int nDev); |
| | | CVcrEventReport* getVcrEventReport(); |
| | | |
| | | private: |
| | | int m_nVcrEventReportDev; |
| | | CVcrEventReport m_vcrEventReport; |
| | | }; |
| | | } |
| | | |
| | |
| | | |
| | | CEquipment::CEquipment() : m_nID(0), m_strName(""), m_strDescription(""), m_station(0, 255) |
| | | { |
| | | m_listener = { nullptr, nullptr, nullptr, nullptr }; |
| | | m_listener = { nullptr, nullptr, nullptr, nullptr, nullptr }; |
| | | m_alive = { FALSE, 0, FALSE }; |
| | | m_bCimState = FALSE; |
| | | m_bUpstreamInline = FALSE; |
| | |
| | | m_listener.onCimStateChanged = listener.onCimStateChanged; |
| | | m_listener.onAlarm = listener.onAlarm; |
| | | m_listener.onDataChanged = listener.onDataChanged; |
| | | m_listener.onVcrEventReport = listener.onVcrEventReport; |
| | | } |
| | | |
| | | void CEquipment::setCcLink(CCCLinkIEControl* pCcLink) |
| | |
| | | // CIM Message Confirm |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_CIM_MSG_CONFIRM_REPORT, pszData, size); |
| | | |
| | | // VCR1 Event report |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_VCR1_EVENT_REPORT, pszData, size); |
| | | |
| | | // EQ Job Event |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_RECIVE_JOB_UPS1, pszData, size); |
| | | CHECK_READ_STEP_SIGNAL(STEP_ID_RECIVE_JOB_UPS2, pszData, size); |
| | |
| | | msgId = (value & 0xffff0000 >> 16); |
| | | 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(); |
| | | ASSERT(pVcrEventReport); |
| | | if (m_listener.onVcrEventReport != nullptr) { |
| | | m_listener.onVcrEventReport(this, pVcrEventReport); |
| | | } |
| | | |
| | | return 1; |
| | | } |
| | | } |
| | | |
| | |
| | | return pStep->getName().compare(STEP_EQ_CIM_MESSAGE_CONFIRM) == 0; |
| | | } |
| | | |
| | | bool CEquipment::isVcrEventStep(SERVO::CStep* pStep) |
| | | { |
| | | return pStep->getName().compare(STEP_EQ_VCR1_EVENT_REPORT) == 0; |
| | | } |
| | | |
| | | int CEquipment::setEqMode(short mode) |
| | | { |
| | | SERVO::CEqModeChangeStep* pStep = (SERVO::CEqModeChangeStep*)getStepWithName(STEP_EQ_MODE_CHANGE); |
| | |
| | | #include "CEqCassetteTransferStateStep.h" |
| | | #include "CEqCassetteCtrlCmdStep.h" |
| | | #include "CEqJobEventStep.h" |
| | | #include "CEqVcrEventStep.h" |
| | | #include <vector> |
| | | #include <map> |
| | | #include <list> |
| | |
| | | typedef std::function<void(void* pEiuipment, BOOL bAlive)> ONALIVE; |
| | | typedef std::function<void(void* pEiuipment, int code)> ONDATACHANGED; |
| | | typedef std::function<void(void* pEiuipment, int state, int alarmId, int unitId, int level)> ONALARM; |
| | | typedef std::function<void(void* pEiuipment, void* pReport)> ONVCREVENTREPORT; |
| | | typedef struct _EquipmentListener |
| | | { |
| | | ONALIVE onAlive; |
| | | ONALIVE onCimStateChanged; |
| | | ONALARM onAlarm; |
| | | ONDATACHANGED onDataChanged; |
| | | ONVCREVENTREPORT onVcrEventReport; |
| | | } EquipmentListener; |
| | | |
| | | // Memory Block ç»æä½å®ä¹ |
| | |
| | | CGlass* getFrontGlass(); |
| | | BOOL removeClass(CGlass* pGlass); |
| | | bool isAlarmStep(SERVO::CStep* pStep); |
| | | bool isVcrEventStep(SERVO::CStep* pStep); |
| | | bool isCassetteTransferStateStep(SERVO::CStep* pStep); |
| | | bool isCimMessageConfirmStep(SERVO::CStep* pStep); |
| | | int setEqMode(short mode); |
| | |
| | | |
| | | CMaster::CMaster() |
| | | { |
| | | m_listener = {nullptr, nullptr, nullptr}; |
| | | m_listener = {nullptr, nullptr, nullptr, nullptr}; |
| | | m_bDataModify = FALSE; |
| | | m_hEventReadBitsThreadExit[0] = ::CreateEvent(NULL, TRUE, FALSE, NULL); |
| | | m_hEventReadBitsThreadExit[1] = ::CreateEvent(NULL, TRUE, FALSE, NULL); |
| | |
| | | m_listener.onEqAlive = listener.onEqAlive; |
| | | m_listener.onEqCimStateChanged = listener.onEqCimStateChanged; |
| | | m_listener.onEqAlarm = listener.onEqAlarm; |
| | | m_listener.onEqVcrEventReport = listener.onEqVcrEventReport; |
| | | } |
| | | |
| | | int CMaster::init() |
| | |
| | | CEquipment* p = (CEquipment*)pEquipment; |
| | | if (m_listener.onEqAlarm != nullptr) { |
| | | m_listener.onEqAlarm(this, p, state, alarmId, unitId, level); |
| | | } |
| | | }; |
| | | listener.onVcrEventReport = [&](void* pEquipment, void* pReport) -> void { |
| | | CEquipment* p = (CEquipment*)pEquipment; |
| | | CVcrEventReport* p2 = (CVcrEventReport*)pReport; |
| | | if (m_listener.onEqVcrEventReport != nullptr) { |
| | | m_listener.onEqVcrEventReport(this, p, p2); |
| | | } |
| | | }; |
| | | listener.onDataChanged = [&](void* pEquipment, int code) -> void { |
| | |
| | | } |
| | | } |
| | | { |
| | | // VCR1 Event Report |
| | | CEqVcrEventStep* pStep = new CEqVcrEventStep(); |
| | | pStep->setName(STEP_EQ_VCR1_EVENT_REPORT); |
| | | pStep->setWriteSignalDev(0x4a); |
| | | pStep->setVcrEventReportDev(0x5fef); |
| | | if (pEquipment->addStep(STEP_ID_VCR1_EVENT_REPORT, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | { |
| | | CEqCimMessageClearStep* pStep = new CEqCimMessageClearStep(); |
| | | pStep->setName(STEP_CIM_MESSAGE_CLEAR); |
| | | pStep->setWriteSignalDev(0x72); |
| | |
| | | typedef std::function<void(void* pMaster, CEquipment* pEiuipment, BOOL bAlive)> ONEQALIVE; |
| | | typedef std::function<void(CStep* pStep, int code, void* pData)> ONEQSTEPEVENT; |
| | | typedef std::function<void(void* pMaster, CEquipment* pEquipment, int state, int alarmId, int unitId, int level)> ONEQALARM; |
| | | typedef std::function<void(void* pMaster, CEquipment* pEquipment, CVcrEventReport* pReport)> ONEQVCREVENTREPORT; |
| | | typedef struct _MasterListener |
| | | { |
| | | ONEQALIVE onEqAlive; |
| | | ONEQALIVE onEqCimStateChanged; |
| | | ONEQALARM onEqAlarm; |
| | | ONEQVCREVENTREPORT onEqVcrEventReport; |
| | | } MasterListener; |
| | | |
| | | class CMaster |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #include "stdafx.h" |
| | | #include "CVcrEventReport.h" |
| | | #include "ToolUnits.h" |
| | | |
| | | |
| | | namespace SERVO { |
| | | CVcrEventReport::CVcrEventReport() |
| | | { |
| | | |
| | | } |
| | | |
| | | CVcrEventReport::~CVcrEventReport() |
| | | { |
| | | |
| | | } |
| | | |
| | | std::string& CVcrEventReport::getGlassId() |
| | | { |
| | | return m_strGlassId; |
| | | } |
| | | |
| | | short CVcrEventReport::getCassetteSequenceNo() |
| | | { |
| | | return m_nCassetteSequenceNo; |
| | | } |
| | | |
| | | short CVcrEventReport::getJobSequenceNo() |
| | | { |
| | | return m_nJobSequenceNo; |
| | | } |
| | | |
| | | short CVcrEventReport::getUnitNo() |
| | | { |
| | | return m_nUnitNo; |
| | | } |
| | | |
| | | short CVcrEventReport::getVcrNo() |
| | | { |
| | | return m_nVcrNo; |
| | | } |
| | | |
| | | short CVcrEventReport::getVcrResult() |
| | | { |
| | | return m_nVcrResult; |
| | | } |
| | | |
| | | int CVcrEventReport::serialize(char* pszBuffer, int nBufferSize) |
| | | { |
| | | if (nBufferSize < 640) return -1; |
| | | |
| | | int index = 0; |
| | | int strLen = min(20, m_strGlassId.size()); |
| | | memcpy(&pszBuffer[index], m_strGlassId.c_str(), strLen); |
| | | index += 20; |
| | | |
| | | memcpy(&pszBuffer[index], &m_nCassetteSequenceNo, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nJobSequenceNo, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nUnitNo, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nVcrNo, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&pszBuffer[index], &m_nVcrResult, sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | return 15 * 2; |
| | | } |
| | | |
| | | int CVcrEventReport::unserialize(char* pszBuffer, int nBufferSize) |
| | | { |
| | | if (nBufferSize < 640) return -1; |
| | | |
| | | int index = 0; |
| | | CToolUnits::convertString(&pszBuffer[index], 20, m_strGlassId); |
| | | index += 20; |
| | | |
| | | memcpy(&m_nCassetteSequenceNo, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nJobSequenceNo, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nUnitNo, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nVcrNo, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | memcpy(&m_nVcrResult, &pszBuffer[index], sizeof(short)); |
| | | index += sizeof(short); |
| | | |
| | | return 15 * 2; |
| | | } |
| | | |
| | | std::string& CVcrEventReport::getVcrResultDescription(std::string& strDescription) |
| | | { |
| | | static char* pszDescription[4] = { |
| | | "VCR Reading OK & Match With Job Data Glass ID", |
| | | "VCR Reading OK & Miss Match With Job Data Glass ID", |
| | | "VCR Reading Fail & Key In & Match With Job Data Glass ID", |
| | | "VCR Reading Fail & Key In & Miss Match With Job Data Glass ID" |
| | | }; |
| | | |
| | | if (1 <= m_nVcrResult && m_nVcrResult <= 4) { |
| | | strDescription = pszDescription[m_nVcrResult - 1]; |
| | | } |
| | | else { |
| | | strDescription = ""; |
| | | } |
| | | |
| | | return strDescription; |
| | | } |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #pragma once |
| | | #include <string> |
| | | |
| | | |
| | | namespace SERVO { |
| | | class CVcrEventReport |
| | | { |
| | | public: |
| | | CVcrEventReport(); |
| | | ~CVcrEventReport(); |
| | | |
| | | public: |
| | | std::string& getGlassId(); |
| | | short getCassetteSequenceNo(); |
| | | short getJobSequenceNo(); |
| | | short getUnitNo(); |
| | | short getVcrNo(); |
| | | short getVcrResult(); |
| | | std::string& getVcrResultDescription(std::string& strDescription); |
| | | int serialize(char* pszBuffer, int nBufferSize); |
| | | int unserialize(char* pszBuffer, int nBufferSize); |
| | | |
| | | private: |
| | | std::string m_strGlassId; // Read Data |
| | | short m_nCassetteSequenceNo; |
| | | short m_nJobSequenceNo; |
| | | short m_nUnitNo; |
| | | short m_nVcrNo; |
| | | short m_nVcrResult; |
| | | }; |
| | | } |
| | | |
| | |
| | | #define STEP_EQ_RECEIVED_JOB_UPS2 _T("EQJEReceivedJobUps2") |
| | | #define STEP_EQ_SENT_OUT_JOB_DOWNS1 _T("EQJESentOutJobDowns1") |
| | | #define STEP_EQ_SENT_OUT_JOB_DOWNS2 _T("EQJESentOutJobDowns2") |
| | | #define STEP_EQ_VCR1_EVENT_REPORT _T("EQVcr1EventReport") |
| | | |
| | | |
| | | /* Step ID */ |
| | |
| | | #define STEP_ID_EQALARM5 0x566 |
| | | #define STEP_ID_PROCESS_DATA_REPORT 0x567 |
| | | #define STEP_ID_CIM_MSG_CONFIRM_REPORT 0x569 |
| | | #define STEP_ID_VCR1_EVENT_REPORT 0x56A |
| | | #define STEP_ID_RECIVE_JOB_UPS1 0x580 |
| | | #define STEP_ID_RECIVE_JOB_UPS2 0x581 |
| | | #define STEP_ID_SENT_OUT_JOB_DOWNS1 0x590 |
| | |
| | | pEquipment->getBaseAlarmId() + alarmId, |
| | | strAlarmText.c_str()); |
| | | }; |
| | | masterListener.onEqVcrEventReport = [&](void* pMaster, SERVO::CEquipment* pEquipment, SERVO::CVcrEventReport* pReport) { |
| | | LOGE("<CModel>onEqVcrEventReport."); |
| | | }; |
| | | m_master.setListener(masterListener); |
| | | |
| | | |
| | |
| | | <ClInclude Include="CEquipmentPage1.h" /> |
| | | <ClInclude Include="CEquipmentPage2.h" /> |
| | | <ClInclude Include="CEqVCREnableStep.h" /> |
| | | <ClInclude Include="CEqVcrEventStep.h" /> |
| | | <ClInclude Include="CFliper.h" /> |
| | | <ClInclude Include="CGlass.h" /> |
| | | <ClInclude Include="CHMPropertyDlg.h" /> |
| | |
| | | <ClInclude Include="CSample.h" /> |
| | | <ClInclude Include="CStep.h" /> |
| | | <ClInclude Include="CVacuumBake.h" /> |
| | | <ClInclude Include="CVcrEventReport.h" /> |
| | | <ClInclude Include="CWriteStep.h" /> |
| | | <ClInclude Include="DevicePropertyDlg.h" /> |
| | | <ClInclude Include="CEFEM.h" /> |
| | |
| | | <ClCompile Include="CEquipmentPage1.cpp" /> |
| | | <ClCompile Include="CEquipmentPage2.cpp" /> |
| | | <ClCompile Include="CEqVCREnableStep.cpp" /> |
| | | <ClCompile Include="CEqVcrEventStep.cpp" /> |
| | | <ClCompile Include="CFliper.cpp" /> |
| | | <ClCompile Include="CGlass.cpp" /> |
| | | <ClCompile Include="CHMPropertyDlg.cpp" /> |
| | |
| | | <ClCompile Include="CSample.cpp" /> |
| | | <ClCompile Include="CStep.cpp" /> |
| | | <ClCompile Include="CVacuumBake.cpp" /> |
| | | <ClCompile Include="CVcrEventReport.cpp" /> |
| | | <ClCompile Include="CWriteStep.cpp" /> |
| | | <ClCompile Include="DevicePropertyDlg.cpp" /> |
| | | <ClCompile Include="CEFEM.cpp" /> |
| | |
| | | <ClCompile Include="CJobDataB.cpp" /> |
| | | <ClCompile Include="CJobDataC.cpp" /> |
| | | <ClCompile Include="CJobDataS.cpp" /> |
| | | <ClCompile Include="CVcrEventReport.cpp" /> |
| | | <ClCompile Include="CEqVcrEventStep.cpp" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ClInclude Include="AlarmManager.h" /> |
| | |
| | | <ClInclude Include="CJobDataB.h" /> |
| | | <ClInclude Include="CJobDataC.h" /> |
| | | <ClInclude Include="CJobDataS.h" /> |
| | | <ClInclude Include="CVcrEventReport.h" /> |
| | | <ClInclude Include="CEqVcrEventStep.h" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ResourceCompile Include="Servo.rc" /> |