| | |
| | | #include "CHMPropertyDlg.h" |
| | | #include "CEquipmentPage1.h" |
| | | #include "CEquipmentPage2.h" |
| | | #include "CEquipmentPage3.h" |
| | | #include "CPagePortProperty.h" |
| | | #include "CPageCassetteCtrlCmd.h" |
| | | #include "CJobDataB.h" |
| | | #include "CRobotCmdContainerDlg.h" |
| | | #include "CRobotCmdTestDlg.h" |
| | | |
| | | |
| | | // CPageGraph2 对话框 |
| | |
| | | m_pEqsGraphWnd = nullptr; |
| | | m_crBkgnd = PAGE_GRPAH2_BACKGROUND_COLOR; |
| | | m_hbrBkgnd = nullptr; |
| | | m_pObserver = nullptr; |
| | | } |
| | | |
| | | CPageGraph2::~CPageGraph2() |
| | |
| | | // CPageGraph2 消息处理程序 |
| | | |
| | | |
| | | void CPageGraph2::InitRxWindows() |
| | | { |
| | | /* code */ |
| | | // 订阅数据 |
| | | IRxWindows* pRxWindows = RX_GetRxWindows(); |
| | | pRxWindows->enableLog(5); |
| | | if (m_pObserver == NULL) { |
| | | m_pObserver = pRxWindows->allocObserver([&](IAny* pAny) -> void { |
| | | // onNext |
| | | pAny->addRef(); |
| | | int code = pAny->getCode(); |
| | | if (RX_CODE_EQ_DATA_CHANGED == code) { |
| | | // 通知设备状态 |
| | | SERVO::CEquipment* pEquipment = nullptr; |
| | | if (pAny->getPtrValue("ptr", (void*&)pEquipment)) { |
| | | if (pEquipment != nullptr) { |
| | | m_pEqsGraphWnd->ShowItemIndicator((DWORD_PTR)pEquipment, !pEquipment->isGlassListEmpty()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | pAny->release(); |
| | | }, [&]() -> void { |
| | | // onComplete |
| | | }, [&](IThrowable* pThrowable) -> void { |
| | | // onErrorm |
| | | pThrowable->printf(); |
| | | }); |
| | | |
| | | theApp.m_model.getObservable()->observeOn(pRxWindows->mainThread()) |
| | | ->subscribe(m_pObserver); |
| | | } |
| | | } |
| | | |
| | | BOOL CPageGraph2::OnInitDialog() |
| | | { |
| | | CDialogEx::OnInitDialog(); |
| | | InitRxWindows(); |
| | | SetTimer(1, 2000, nullptr); |
| | | |
| | | |
| | |
| | | pPage2->setEquipment(pEquipment); |
| | | pPage2->Create(IDD_PAGE_EQUIPMENT2); |
| | | dlg.addPage(pPage2, "Glass"); |
| | | |
| | | if (pEquipment->getID() == EQ_ID_EFEM) { |
| | | CEquipmentPage3* pPage3 = new CEquipmentPage3(); |
| | | pPage3->setEquipment(pEquipment); |
| | | pPage3->Create(IDD_PAGE_EQUIPMENT3); |
| | | dlg.addPage(pPage3, "Dispatching Mode"); |
| | | } |
| | | |
| | | if (pEquipment->getID() == EQ_ID_LOADPORT1 |
| | | || pEquipment->getID() == EQ_ID_LOADPORT2) { |
| | |
| | | // 测试 |
| | | else if (nCmd == ID_EQSGRAPHITEM_TEST1) { |
| | | SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData; |
| | | pEquipment->outputGlass(0); |
| | | if (pEquipment->getID() == EQ_ID_LOADPORT1) { |
| | | ((SERVO::CLoadPort*)pEquipment)->testGenerateGlassList(SERVO::MaterialsType::G1, 10, |
| | | "P20250320G1X", 1); |
| | | } |
| | | else if (pEquipment->getID() == EQ_ID_LOADPORT2) { |
| | | ((SERVO::CLoadPort*)pEquipment)->testGenerateGlassList(SERVO::MaterialsType::G2, 10, |
| | | "P20250320G2X", 1); |
| | | } |
| | | SERVO::CGlass* pGlass = pEquipment->getFrontGlass(); |
| | | if (pGlass != nullptr) { |
| | | SERVO::CJobDataB* pJobDataB = pGlass->getJobDataB(); |
| | | SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS(); |
| | | if (pJobDataB != nullptr && pJobDataS != nullptr) { |
| | | pEquipment->fetchedOutJob(pJobDataB); |
| | | pEquipment->onSentOutJob(0, pJobDataS); |
| | | } |
| | | } |
| | | } |
| | | else if (nCmd == ID_EQSGRAPHITEM_TEST2) { |
| | | SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData; |
| | | pEquipment->outputGlass(1); |
| | | SERVO::CArm* pArm = (SERVO::CArm*)pEquipment->getArm(); |
| | | if (pArm != nullptr) { |
| | | SERVO::CGlass* pGlass = pArm->getFrontGlass(); |
| | | if (pGlass != nullptr) { |
| | | SERVO::CJobDataB* pJobDataB = pGlass->getJobDataB(); |
| | | SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS(); |
| | | if (pJobDataB != nullptr && pJobDataS != nullptr) { |
| | | pEquipment->onReceivedJob(0, pJobDataS); |
| | | Sleep(600); |
| | | pEquipment->onStoredJob(0, pJobDataB); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else if (nCmd == ID_EQSGRAPHITEM_TEST3) { |
| | | SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData; |
| | | if (pEquipment != nullptr) { |
| | | SERVO::CGlass* pGlass = pEquipment->getFrontGlass(); |
| | | if (pGlass != nullptr) { |
| | | SERVO::CProcessData pd; |
| | | pd.setGlassId(pGlass->getID().c_str()); |
| | | pEquipment->onProcessData(&pd); |
| | | } |
| | | } |
| | | } |
| | | else if (nCmd == ID_EQSGRAPHITEM_TEST4) { |
| | | SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData; |
| | | |
| | | /* 测试 RobotCMD */ |
| | | if (pEquipment->getID() == EQ_ID_EFEM) { |
| | | SERVO::CEFEM* pEFEM = (SERVO::CEFEM*)pEquipment; |
| | | |
| | | //SERVO::ROBOT_CMD_PARAM cmds[4]; |
| | | //cmds[0].sequenceNo = 1; |
| | | //cmds[0].rcmd = (short)SERVO::RCMD::Move; |
| | | //cmds[0].armNo = 1; |
| | | //cmds[0].getPosition = 1; |
| | | //cmds[0].putPosition = 2; |
| | | //cmds[0].getSlotNo = 3; |
| | | //cmds[0].putSlotNo = 4; |
| | | //cmds[0].subCmd = 5; |
| | | //cmds[1].sequenceNo = 2; |
| | | //cmds[1].rcmd = (short)SERVO::RCMD::Transfer; |
| | | //cmds[1].armNo = 2; |
| | | //cmds[1].getPosition = 6; |
| | | //cmds[1].putPosition = 7; |
| | | //cmds[1].getSlotNo = 8; |
| | | //cmds[1].putSlotNo = 9; |
| | | //cmds[1].subCmd = 10; |
| | | //pEFEM->robotCmds(cmds, 2); |
| | | |
| | | //CRobotCmdContainerDlg dlg; |
| | | //if (dlg.DoModal() == IDOK) { |
| | | // std::vector<SERVO::ROBOT_CMD_PARAM>& cmds = dlg.GetResultCmds(); |
| | | // if (!cmds.empty()) { |
| | | // pEFEM->robotCmds(cmds.data(), (int)cmds.size()); |
| | | // } |
| | | //} |
| | | |
| | | CRobotCmdTestDlg dlg; |
| | | dlg.SetEFEM(pEFEM); |
| | | dlg.DoModal(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // 测试下发Cim Message |
| | | /* |
| | |
| | | } |
| | | } |
| | | */ |
| | | |
| | | |
| | | // 测试清除Cim Message |
| | | |
| | | /* |
| | | if (pEquipment->getID() == EQ_ID_Bonder1 |
| | | || pEquipment->getID() == EQ_ID_Bonder2) { |
| | | static int msgId = 0; msgId++; |
| | |
| | | pEquipment->clearCimMessage(msgId, 2); |
| | | } |
| | | } |
| | | |
| | | */ |
| | | |
| | | // 测试设置时间 |
| | | /* |
| | |
| | | } |
| | | */ |
| | | |
| | | /* |
| | | |
| | | if (pEquipment->getID() == EQ_ID_Bonder1 |
| | | || pEquipment->getID() == EQ_ID_Bonder2) { |
| | | static int ii = 0; ii++; |
| | | pEquipment->setEqMode((ii % 5) + 1); |
| | | } |
| | | */ |
| | | |
| | | |
| | | /* |
| | | SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData; |
| | | SERVO::CGlass* pGlass = pEquipment->getFrontGlass(); |
| | | if (pGlass != nullptr) { |
| | | std::string strDescription; |
| | |
| | | } |
| | | } |
| | | */ |
| | | |
| | | |
| | | // 请求主配方列表 |
| | | if (pEquipment != nullptr) { |
| | | pEquipment->masterRecipeListRequest(0); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | if (m_hbrBkgnd != nullptr) { |
| | | ::DeleteObject(m_hbrBkgnd); |
| | | } |
| | | |
| | | if (m_pObserver != nullptr) { |
| | | m_pObserver->unsubscribe(); |
| | | m_pObserver = NULL; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | for (auto outPin : outPins) { |
| | | m_pEqsGraphWnd->AddPin(pItem, OUTPIN, outPin->getName().c_str(), (DWORD_PTR)outPin); |
| | | } |
| | | |
| | | m_pEqsGraphWnd->ShowItemIndicator((DWORD_PTR)pEquipment, !pEquipment->isGlassListEmpty()); |
| | | } |
| | | |
| | | void CPageGraph2::OnTimer(UINT_PTR nIDEvent) |
| | |
| | | std::list<SERVO::CEquipment*>& eqs = theApp.m_model.m_master.getEquipmentList(); |
| | | for (auto item : eqs) { |
| | | EQITEM* pEqItem = m_pEqsGraphWnd->GetItem((DWORD_PTR)item); |
| | | if (nullptr == pEqItem) { |
| | | continue; |
| | | } |
| | | |
| | | strValue.Format(_T("%d"), pEqItem->rect.left); |
| | | WritePrivateProfileString(item->getName().c_str(), _T("Left"), |