Merge branch 'liuyang' into clh
| | |
| | | // JOB Data Request |
| | | CEqReadStep* pStep = new CEqReadStep(0x0, 0, |
| | | [&](void* pFrom, int code, const char* pszData, size_t size) -> int { |
| | | if (code == ROK && pszData != nullptr && size > 0) { |
| | | if (code == ROK /* && pszData != nullptr && size > 0*/) { |
| | | // 由于EFEM没有发送参数到master, 我们只需要返回数据 |
| | | // Cassette Sequence No和Job Sequence No根据上一次调试缓存而来 |
| | | // decodeJobDataRequest((CStep*)pFrom, pszData, size); |
| | |
| | | if (m_pActiveContext != nullptr) { |
| | | CJobDataS* pJobDataS = ((CGlass*)m_pActiveContext)->getJobDataS(); |
| | | if (pJobDataS != nullptr) { |
| | | pJobDataS->serialize(szBuffer, 1024); |
| | | pJobDataS->serialize(szBuffer, 1024); |
| | | ack = (short)JobDataRequestAck::OK; |
| | | } |
| | |
| | | |
| | | 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); |
| | | // 转发到子单元设备 |
| | | CEquipment* pEqs[] = { m_pPort[0], m_pPort[1], m_pPort[2], m_pPort[3], m_pArmTray[0], m_pArmTray[1], |
| | | m_pAligner, m_pFliper }; |
| | | if (1 <= port && port <= 8) { |
| | | pEqs[port - 1]->onFetchedOutJob(port, pJobDataB); |
| | | } |
| | | |
| | | return -1; |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | 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); |
| | | // 转发到子单元设备 |
| | | CEquipment* pEqs[] = { m_pPort[0], m_pPort[1], m_pPort[2], m_pPort[3], m_pArmTray[0], m_pArmTray[1], |
| | | m_pAligner, m_pFliper }; |
| | | if (1 <= port && port <= 8) { |
| | | pEqs[port - 1]->onStoredJob(port, pJobDataB); |
| | | } |
| | | |
| | | return -1; |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | int CEFEM::getIndexerOperationModeBaseValue() |
| | |
| | | } |
| | | } |
| | | |
| | | /* |
| | | |
| | | { |
| | | // Fetched Out Job Report #1~15 |
| | | char szBuffer[256]; |
| | |
| | | delete pStep; |
| | | } |
| | | } |
| | | */ |
| | | } |
| | | |
| | | void CLoadPort::onTimer(UINT nTimerid) |
| | |
| | | js.setCassetteSequenceNo(getNextCassetteSequenceNo()); |
| | | js.setJobSequenceNo(m_slot[i].getNo()); |
| | | sprintf_s(szBuffer, 64, "%05d%05d", js.getCassetteSequenceNo(), js.getJobSequenceNo()); |
| | | js.setGlass1Id(szBuffer); |
| | | //js.setGlass1Id(szBuffer); |
| | | js.setJobType(1); |
| | | js.setMaterialsType((int)type); |
| | | |
| | |
| | | } |
| | | |
| | | if (m_pActiveRobotTask != nullptr) { |
| | | if (m_pActiveRobotTask->isPicked()) { |
| | | m_pActiveRobotTask->place(); |
| | | } |
| | | unlock(); |
| | | // 检测到当前有正在下午的任务,确保当前任务完成或中止后继续 |
| | | // LOGI("检测到当前有正在下午的任务,确保当前任务完成或中止后继续..."); |
| | |
| | | ) { |
| | | LOGI("取片完成."); |
| | | m_pActiveRobotTask->fetchOut(); |
| | | m_pActiveRobotTask->place(); |
| | | m_pActiveRobotTask->picked(); |
| | | } |
| | | |
| | | else if (m_pActiveRobotTask != nullptr |
| | |
| | | transformPosAndSlot(toPos, toSlot, tarPos, tarSlot); |
| | | |
| | | m_robotCmdParam[ACTION_PICK] = {}; |
| | | m_robotCmdParam[ACTION_PICK].sequenceNo = static_cast<short>(seq+2); |
| | | m_robotCmdParam[ACTION_PICK].sequenceNo = static_cast<short>(seq+1); |
| | | m_robotCmdParam[ACTION_PICK].rcmd = static_cast<short>(SERVO::RCMD::Get); |
| | | m_robotCmdParam[ACTION_PICK].armNo = static_cast<short>(armNo); |
| | | m_robotCmdParam[ACTION_PICK].getPosition = static_cast<short>(srcPos); |
| | |
| | | m_robotCmdParam[ACTION_PLACE].putSlotNo = static_cast<short>(tarSlot); |
| | | |
| | | m_robotCmdParam[ACTION_RESTORE] = {}; |
| | | m_robotCmdParam[ACTION_RESTORE].sequenceNo = static_cast<short>(seq + 1); |
| | | m_robotCmdParam[ACTION_RESTORE].sequenceNo = static_cast<short>(seq + 3); |
| | | m_robotCmdParam[ACTION_RESTORE].rcmd = static_cast<short>(SERVO::RCMD::Put); |
| | | m_robotCmdParam[ACTION_RESTORE].armNo = static_cast<short>(armNo); |
| | | m_robotCmdParam[ACTION_RESTORE].putPosition = static_cast<short>(srcPos); |
| | | m_robotCmdParam[ACTION_RESTORE].putSlotNo = static_cast<short>(srcSlot); |
| | | |
| | | return seq + 1; |
| | | return seq + 3; |
| | | } |
| | | |
| | | ROBOT_CMD_PARAM& CRobotTask::getRobotCmdParam(int index) |
| | |
| | | return m_state == ROBOT_TASK_STATE::Picking; |
| | | } |
| | | |
| | | bool CRobotTask::isPicked() |
| | | { |
| | | return m_state == ROBOT_TASK_STATE::Picked; |
| | | } |
| | | |
| | | bool CRobotTask::isPlacing() |
| | | { |
| | | return m_state == ROBOT_TASK_STATE::Placing; |
| | |
| | | ASSERT(m_pEFEM); |
| | | m_state = ROBOT_TASK_STATE::Picking; |
| | | |
| | | m_pEFEM->robotSendGet(m_robotCmdParam->sequenceNo, |
| | | m_robotCmdParam[ACTION_PICK].armNo, |
| | | m_robotCmdParam[ACTION_PICK].getPosition, |
| | | m_robotCmdParam[ACTION_PICK].getSlotNo, |
| | | m_pEFEM->robotCmd(m_robotCmdParam[ACTION_PICK], |
| | | [&](int code) -> int { |
| | | if (code == WOK) { |
| | | LOGI(_T("RobotTask/get已下发到EFEM")); |
| | |
| | | }); |
| | | } |
| | | |
| | | void CRobotTask::picked() |
| | | { |
| | | m_state = ROBOT_TASK_STATE::Picked; |
| | | } |
| | | |
| | | void CRobotTask::place() |
| | | { |
| | | ASSERT(m_pEFEM); |
| | | m_state = ROBOT_TASK_STATE::Placing; |
| | | |
| | | m_pEFEM->robotSendMoveToPut(m_robotCmdParam->sequenceNo, |
| | | m_robotCmdParam[ACTION_PLACE].armNo, |
| | | m_robotCmdParam[ACTION_PLACE].putPosition, |
| | | m_robotCmdParam[ACTION_PLACE].putSlotNo, |
| | | m_pEFEM->robotCmd(m_robotCmdParam[ACTION_PLACE], |
| | | [&](int code) -> int { |
| | | if (code == WOK) { |
| | | LOGI(_T("RobotTask/put已下发到EFEM")); |
| | |
| | | ASSERT(m_pEFEM); |
| | | m_state = ROBOT_TASK_STATE::Restoring; |
| | | |
| | | m_pEFEM->robotSendMoveToPut(m_robotCmdParam->sequenceNo, |
| | | m_robotCmdParam[ACTION_RESTORE].armNo, |
| | | m_robotCmdParam[ACTION_RESTORE].putPosition, |
| | | m_robotCmdParam[ACTION_RESTORE].putSlotNo, |
| | | m_pEFEM->robotCmd(m_robotCmdParam[ACTION_RESTORE], |
| | | [&](int code) -> int { |
| | | if (code == WOK) { |
| | | LOGI(_T("RobotTask/restore-put已下发到EFEM")); |
| | |
| | | int getArmNo(); |
| | | ROBOT_TASK_STATE getState(); |
| | | bool isPicking(); |
| | | bool isPicked(); |
| | | bool isPlacing(); |
| | | bool isRestoring(); |
| | | void run(); |
| | | void pick(); |
| | | void picked(); |
| | | void place(); |
| | | void restore(); |
| | | void restored(); |
| | |
| | | Ready = 0, |
| | | Running, |
| | | Picking, |
| | | Picked, |
| | | Placing, |
| | | Restoring, |
| | | Error, |