| | |
| | | #include "CHMPropertyDlg.h" |
| | | #include "CEquipmentPage1.h" |
| | | #include "CEquipmentPage2.h" |
| | | #include "CEquipmentPage3.h" |
| | | #include "CPageLinkSignal.h" |
| | | #include "CPagePortProperty.h" |
| | | #include "CPagePortStatus.h" |
| | | #include "CPageCassetteCtrlCmd.h" |
| | | #include "CJobDataB.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->hasGlass()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | 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); |
| | | |
| | | |
| | |
| | | ASSERT(pItem); |
| | | SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData; |
| | | |
| | | CHMPropertyDlg dlg(pEquipment->getName().c_str(), 600, 680); |
| | | CHMPropertyDlg dlg(pEquipment->getName().c_str(), 658, 788); |
| | | |
| | | CPageLinkSignal* pPage1 = new CPageLinkSignal(); |
| | | pPage1->setEquipment(pEquipment); |
| | | pPage1->Create(IDD_PAGE_LINK_SIGNAL); |
| | | dlg.addPage(pPage1, "Link Signal"); |
| | | |
| | | if (_strcmpi(pEquipment->getClassName(), "CLoadPort") == 0) { |
| | | CPagePortProperty* pPage1 = new CPagePortProperty(); |
| | | pPage1->setLoadPort((SERVO::CLoadPort*)pEquipment); |
| | | pPage1->Create(IDD_PAGE_PORT_PROPERTY); |
| | | dlg.addPage(pPage1, "属性"); |
| | | CPagePortProperty* pPageA = new CPagePortProperty(); |
| | | pPageA->setLoadPort((SERVO::CLoadPort*)pEquipment); |
| | | pPageA->Create(IDD_PAGE_PORT_PROPERTY); |
| | | dlg.addPage(pPageA, "属性"); |
| | | |
| | | CPagePortStatus* pPageB = new CPagePortStatus(); |
| | | pPageB->setLoadPort((SERVO::CLoadPort*)pEquipment); |
| | | pPageB->Create(IDD_PAGE_PORT_STATUS); |
| | | dlg.addPage(pPageB, "Status"); |
| | | } |
| | | |
| | | CEquipmentPage2* pPage2 = new CEquipmentPage2(); |
| | | pPage2->setEquipment(pEquipment); |
| | | pPage2->Create(IDD_PAGE_EQUIPMENT2); |
| | | dlg.addPage(pPage2, "Glass"); |
| | | dlg.addPage(pPage2, "Slots"); |
| | | |
| | | 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) { |
| | | || pEquipment->getID() == EQ_ID_LOADPORT2 |
| | | || pEquipment->getID() == EQ_ID_LOADPORT3 |
| | | || pEquipment->getID() == EQ_ID_LOADPORT4) { |
| | | CPageCassetteCtrlCmd* pPage = new CPageCassetteCtrlCmd(); |
| | | pPage->setEquipment(pEquipment); |
| | | pPage->Create(IDD_PAGE_CASSETTE_CTRL_CMD); |
| | |
| | | |
| | | // 测试 |
| | | else if (nCmd == ID_EQSGRAPHITEM_TEST1) { |
| | | BOOL bTestGenerate = FALSE; |
| | | SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData; |
| | | pEquipment->outputGlass(0); |
| | | if (pEquipment->getID() == EQ_ID_LOADPORT4 && !pEquipment->hasGlass()) { |
| | | ((SERVO::CLoadPort*)pEquipment)->testGenerateGlassList(SERVO::MaterialsType::G1); |
| | | bTestGenerate = TRUE; |
| | | } |
| | | /* |
| | | else if (pEquipment->getID() == EQ_ID_LOADPORT1 && !pEquipment->hasGlass()) { |
| | | ((SERVO::CLoadPort*)pEquipment)->testGenerateGlassList(SERVO::MaterialsType::G2); |
| | | bTestGenerate = TRUE; |
| | | } |
| | | */ |
| | | if (!bTestGenerate) { |
| | | SERVO::CRobotTask* pTask = theApp.m_model.getMaster().getActiveRobotTask(); |
| | | if (pTask != nullptr) { |
| | | SERVO::CGlass* pGlass = (SERVO::CGlass*)pTask->getContext(); |
| | | SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS(); |
| | | if (pJobDataS != nullptr) { |
| | | SERVO::CJobDataB jobDataB; |
| | | pEquipment->onFetchedOutJob(0, &pJobDataS->getJobDataB(jobDataB)); |
| | | 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->getAnyGlass(); |
| | | if (pGlass != nullptr) { |
| | | SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS(); |
| | | if (pJobDataS != nullptr) { |
| | | pEquipment->onReceivedJob(0, pJobDataS); |
| | | Sleep(600); |
| | | SERVO::CJobDataB jobDataB; |
| | | pEquipment->onStoredJob(0, &pJobDataS->getJobDataB(jobDataB)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else if (nCmd == ID_EQSGRAPHITEM_TEST3) { |
| | | SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData; |
| | | if (pEquipment != nullptr) { |
| | | SERVO::CGlass* pGlass = pEquipment->getAnyGlass(); |
| | | 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; |
| | | if (pEquipment != nullptr) { |
| | | pEquipment->setLinkSignalUpstream(0, SIGNAL_UPSTREAM_INLINE, TRUE); |
| | | pEquipment->setLinkSignalUpstream(0, SIGNAL_UPSTREAM_TROUBLE, FALSE); |
| | | pEquipment->setLinkSignalUpstream(0, SIGNAL_INTERLOCK, TRUE); |
| | | pEquipment->setLinkSignalUpstream(0, SIGNAL_SEND_ABLE, TRUE); |
| | | pEquipment->setLinkSignalUpstream(1, SIGNAL_UPSTREAM_INLINE, TRUE); |
| | | pEquipment->setLinkSignalUpstream(1, SIGNAL_UPSTREAM_TROUBLE, FALSE); |
| | | pEquipment->setLinkSignalUpstream(1, SIGNAL_INTERLOCK, TRUE); |
| | | pEquipment->setLinkSignalUpstream(1, SIGNAL_SEND_ABLE, TRUE); |
| | | } |
| | | |
| | | if (pEquipment != nullptr && (pEquipment->getID() == EQ_ID_Bonder1 |
| | | || pEquipment->getID() == EQ_ID_Bonder2)) { |
| | | SERVO::CGlass* pGlass = pEquipment->getAnyGlass(); |
| | | if (pGlass != nullptr) { |
| | | SERVO::CProcessData pd; |
| | | pd.setGlassId(pGlass->getID().c_str()); |
| | | pEquipment->onProcessData(&pd); |
| | | } |
| | | } |
| | | } |
| | | else if (nCmd == ID_EQSGRAPHITEM_TEST5) { |
| | | SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData; |
| | | if (pEquipment != nullptr) { |
| | | pEquipment->setLinkSignalUpstream(0, SIGNAL_UPSTREAM_INLINE, TRUE); |
| | | pEquipment->setLinkSignalUpstream(0, SIGNAL_UPSTREAM_TROUBLE, TRUE); |
| | | pEquipment->setLinkSignalUpstream(0, SIGNAL_INTERLOCK, TRUE); |
| | | pEquipment->setLinkSignalUpstream(0, SIGNAL_SEND_ABLE, FALSE); |
| | | pEquipment->setLinkSignalUpstream(1, SIGNAL_UPSTREAM_INLINE, TRUE); |
| | | pEquipment->setLinkSignalUpstream(1, SIGNAL_UPSTREAM_TROUBLE, TRUE); |
| | | pEquipment->setLinkSignalUpstream(1, SIGNAL_INTERLOCK, TRUE); |
| | | pEquipment->setLinkSignalUpstream(1, SIGNAL_SEND_ABLE, FALSE); |
| | | } |
| | | } |
| | | else if (nCmd == ID_EQSGRAPHITEM_TEST6) { |
| | | SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData; |
| | | |
| | | |
| | | // 测试下发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(); |
| | | SERVO::CGlass* pGlass = pEquipment->getAnyGlass(); |
| | | if (pGlass != nullptr) { |
| | | std::string strDescription; |
| | | SERVO::CPath* pPath = pGlass->getPath(); |
| | |
| | | } |
| | | } |
| | | */ |
| | | |
| | | |
| | | // 请求主配方列表 |
| | | if (pEquipment != nullptr) { |
| | | pEquipment->masterRecipeListRequest(0, nullptr); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | 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->hasGlass()); |
| | | } |
| | | |
| | | 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"), |