| | |
| | | m_pPort[1] = nullptr; |
| | | m_pPort[2] = nullptr; |
| | | m_pPort[3] = nullptr; |
| | | m_pAligner = nullptr; |
| | | m_pFliper = nullptr; |
| | | } |
| | | |
| | | CEFEM::~CEFEM() |
| | |
| | | { |
| | | if (index < 4) { |
| | | m_pPort[index] = pPort; |
| | | } |
| | | } |
| | | |
| | | void CEFEM::setAligner(CAligner* pAligner) |
| | | { |
| | | m_pAligner = pAligner; |
| | | } |
| | | |
| | | void CEFEM::setFliper(CFliper* pFliper) |
| | | { |
| | | m_pFliper = pFliper; |
| | | } |
| | | |
| | | void CEFEM::setArmTray(unsigned int index, CArmTray* pArmTray) |
| | | { |
| | | if (index < 2) { |
| | | m_pArmTray[index] = pArmTray; |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | { |
| | | // 请求主配方列表的step |
| | | CEqWriteStep* pStep = new CEqWriteStep(); |
| | |
| | | STEP_ID_PORT4_CASSETTIE_UNLOAD_READY, 0x60b0); |
| | | ADD_EQ_CASSETTE_TRANSFER_STATE_STEP(STEP_EQ_P4_CASSETTE_BLOCKED, 0x103, |
| | | STEP_ID_PORT4_CASSETTIE_BLOCKED, 0x60b0); |
| | | |
| | | { |
| | | // Received Job Report Upstream#1~9 |
| | | char szBuffer[256]; |
| | | for (int i = 0; i < 9; i++) { |
| | | CEqReadStep* pStep = new CEqReadStep(0x4c90 + 320 * i, 320 * 2, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | int port = (int)(__int64)((CEqReadStep*)pFrom)->getProp("Port"); |
| | | if (port > 0) { |
| | | decodeFetchedOutJobReport((CStep*)pFrom, port, pszData, size); |
| | | } |
| | | } |
| | | return -1; |
| | | }); |
| | | sprintf_s(szBuffer, "%s%d", STEP_EQ_RECEIVED_JOBn, i + 1); |
| | | pStep->setName(szBuffer); |
| | | pStep->setProp("Upstream", (void*)(__int64)(i + 1)); |
| | | pStep->setWriteSignalDev(0x0 + i); |
| | | if (addStep(STEP_ID_FETCHED_OUT_JOB_REPORT1 + i, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | } |
| | | |
| | | { |
| | | // Fetched Out Job Report #1~15 |
| | | char szBuffer[256]; |
| | | for (int i = 0; i < 15; i++) { |
| | | CEqReadStep* pStep = new CEqReadStep(0x5c31 + 18 * i, 18 * 2, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | int port = (int)(__int64)((CEqReadStep*)pFrom)->getProp("Port"); |
| | | if (port > 0) { |
| | | decodeFetchedOutJobReport((CStep*)pFrom, port, pszData, size); |
| | | } |
| | | } |
| | | return -1; |
| | | }); |
| | | sprintf_s(szBuffer, "%s%d", STEP_EQ_FETCHED_OUT_JOBn, i+1); |
| | | pStep->setName(szBuffer); |
| | | pStep->setProp("Port", (void*)(__int64)(i + 1)); |
| | | pStep->setWriteSignalDev(0x023 + i); |
| | | if (addStep(STEP_ID_FETCHED_OUT_JOB_REPORT1 + i, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | } |
| | | |
| | | { |
| | | // Store Job Report #1~15 |
| | | char szBuffer[256]; |
| | | for (int i = 0; i < 15; i++) { |
| | | CEqReadStep* pStep = new CEqReadStep(0x5b23 + 18 * i, 18 * 2, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | int port = (int)(__int64)((CEqReadStep*)pFrom)->getProp("Port"); |
| | | if (port > 0) { |
| | | decodeStoredJobReport((CStep*)pFrom, port, pszData, size); |
| | | } |
| | | } |
| | | return -1; |
| | | }); |
| | | sprintf_s(szBuffer, "%s%d", STEP_EQ_STORED_JOBn, i + 1); |
| | | pStep->setName(szBuffer); |
| | | pStep->setProp("Port", (void*)(__int64)(i + 1)); |
| | | pStep->setWriteSignalDev(0x014 + i); |
| | | if (addStep(STEP_ID_STORE_JOB_REPORT1 + i, pStep) != 0) { |
| | | delete pStep; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | int CEFEM::onStepEvent(CStep* pStep, int code) |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | int CEFEM::onReceivedJob(int port, CJobDataS* pJobDataS) |
| | | { |
| | | m_pPort[0]->onReceivedJob(port, pJobDataS); |
| | | m_pPort[1]->onReceivedJob(port, pJobDataS); |
| | | m_pPort[2]->onReceivedJob(port, pJobDataS); |
| | | m_pPort[3]->onReceivedJob(port, pJobDataS); |
| | | m_pArmTray[0]->onReceivedJob(port, pJobDataS); |
| | | m_pArmTray[1]->onReceivedJob(port, pJobDataS); |
| | | m_pAligner->onReceivedJob(port, pJobDataS); |
| | | m_pFliper->onReceivedJob(port, pJobDataS); |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | int CEFEM::onSentOutJob(int port, CJobDataS* pJobDataS) |
| | | { |
| | | m_pPort[0]->onSentOutJob(port, pJobDataS); |
| | | m_pPort[1]->onSentOutJob(port, pJobDataS); |
| | | m_pPort[2]->onSentOutJob(port, pJobDataS); |
| | | m_pPort[3]->onSentOutJob(port, pJobDataS); |
| | | m_pArmTray[0]->onSentOutJob(port, pJobDataS); |
| | | m_pArmTray[1]->onSentOutJob(port, pJobDataS); |
| | | m_pAligner->onSentOutJob(port, pJobDataS); |
| | | m_pFliper->onSentOutJob(port, pJobDataS); |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | int CEFEM::onFetchedOutJob(int port, CJobDataB* pJobDataB) |
| | | { |
| | | if (port == 1) { |
| | | return m_pPort[0]->onFetchedOutJob(port, pJobDataB); |
| | | } |
| | | if (port == 2) { |
| | | return m_pPort[1]->onFetchedOutJob(port, pJobDataB); |
| | | } |
| | | if (port == 3) { |
| | | return m_pPort[2]->onFetchedOutJob(port, pJobDataB); |
| | | } |
| | | if (port == 4) { |
| | | return m_pPort[3]->onFetchedOutJob(port, pJobDataB); |
| | | } |
| | | if (port == 5) { |
| | | return m_pArmTray[0]->onFetchedOutJob(port, pJobDataB); |
| | | } |
| | | if (port == 6) { |
| | | return m_pArmTray[1]->onFetchedOutJob(port, pJobDataB); |
| | | } |
| | | if (port == 7) { |
| | | return m_pAligner->onFetchedOutJob(port, pJobDataB); |
| | | } |
| | | if (port == 8) { |
| | | return m_pFliper->onFetchedOutJob(port, pJobDataB); |
| | | } |
| | | |
| | | return -1; |
| | | } |
| | | |
| | | int CEFEM::onStoredJob(int port, CJobDataB* pJobDataB) |
| | | { |
| | | if (port == 1) { |
| | | return m_pPort[0]->onStoredJob(port, pJobDataB); |
| | | } |
| | | if (port == 2) { |
| | | return m_pPort[1]->onStoredJob(port, pJobDataB); |
| | | } |
| | | if (port == 3) { |
| | | return m_pPort[2]->onStoredJob(port, pJobDataB); |
| | | } |
| | | if (port == 4) { |
| | | return m_pPort[3]->onStoredJob(port, pJobDataB); |
| | | } |
| | | if (port == 5) { |
| | | return m_pArmTray[0]->onStoredJob(port, pJobDataB); |
| | | } |
| | | if (port == 6) { |
| | | return m_pArmTray[1]->onStoredJob(port, pJobDataB); |
| | | } |
| | | if (port == 7) { |
| | | return m_pAligner->onStoredJob(port, pJobDataB); |
| | | } |
| | | if (port == 8) { |
| | | return m_pFliper->onStoredJob(port, pJobDataB); |
| | | } |
| | | |
| | | return -1; |
| | | } |
| | | } |