| | |
| | | { |
| | | CEquipment::serialize(ar); |
| | | } |
| | | |
| | | void CAligner::getAttributeVector(CAttributeVector& attrubutes) |
| | | { |
| | | __super::getAttributeVector(attrubutes); |
| | | } |
| | | |
| | | int CAligner::recvIntent(CPin* pPin, CIntent* pIntent) |
| | | { |
| | | return __super::recvIntent(pPin, pIntent); |
| | | } |
| | | } |
| | |
| | | virtual void initPins(); |
| | | virtual void onTimer(UINT nTimerid); |
| | | virtual void serialize(CArchive& ar); |
| | | virtual void getAttributeVector(CAttributeVector& attrubutes); |
| | | virtual int recvIntent(CPin* pPin, CIntent* pIntent); |
| | | }; |
| | | } |
| | | |
| | |
| | | { |
| | | CEquipment::serialize(ar); |
| | | } |
| | | |
| | | void CBakeCooling::getAttributeVector(CAttributeVector& attrubutes) |
| | | { |
| | | __super::getAttributeVector(attrubutes); |
| | | } |
| | | |
| | | int CBakeCooling::recvIntent(CPin* pPin, CIntent* pIntent) |
| | | { |
| | | return __super::recvIntent(pPin, pIntent); |
| | | } |
| | | } |
| | |
| | | virtual void initPins(); |
| | | virtual void onTimer(UINT nTimerid); |
| | | virtual void serialize(CArchive& ar); |
| | | virtual void getAttributeVector(CAttributeVector& attrubutes); |
| | | virtual int recvIntent(CPin* pPin, CIntent* pIntent); |
| | | }; |
| | | } |
| | | |
| | |
| | | void CBonder::getAttributeVector(CAttributeVector& attrubutes) |
| | | { |
| | | __super::getAttributeVector(attrubutes); |
| | | |
| | | for (auto item : m_inputPins) { |
| | | attrubutes.addAttribute(new CAttribute(item->getName().c_str(), |
| | | std::to_string((int)item->getType()).c_str(), "")); |
| | | } |
| | | |
| | | for (auto item : m_outputPins) { |
| | | attrubutes.addAttribute(new CAttribute(item->getName().c_str(), |
| | | std::to_string((int)item->getType()).c_str(), "")); |
| | | } |
| | | |
| | | for (auto item : m_panelList) { |
| | | attrubutes.addAttribute(new CAttribute("Panel", |
| | | item->getID().c_str(), "")); |
| | | } |
| | | } |
| | | |
| | | int CBonder::recvIntent(CPin* pPin, CIntent* pIntent) |
| | | { |
| | | ASSERT(pPin); |
| | | |
| | | CPin* pFromPin = pPin->getConnectedPin(); |
| | | ASSERT(pFromPin); |
| | | |
| | | CEquipment* pFromEq = pFromPin->getEquipment(); |
| | | ASSERT(pFromEq); |
| | | |
| | | LOGI("<CBonder><%s-%s>收到来自<%s.%s>的Intent<%d,%s,0x%x>", |
| | | this->getName().c_str(), |
| | | pPin->getName().c_str(), |
| | | pFromEq->getName().c_str(), |
| | | pFromPin->getName().c_str(), |
| | | pIntent->getCode(), |
| | | pIntent->getMsg(), |
| | | pIntent->getContext()); |
| | | |
| | | |
| | | |
| | | // 以下解释处理数据 |
| | | int code = pIntent->getCode(); |
| | | |
| | | |
| | | // 测试 |
| | | if (code == FLOW_TEST) { |
| | | AfxMessageBox(pIntent->getMsg()); |
| | | return FLOW_ACCEPT; |
| | | } |
| | | |
| | | |
| | | // 信号 |
| | | if (code == FLOW_SIGNAL) { |
| | | return FLOW_ACCEPT; |
| | | } |
| | | |
| | | |
| | | // 数据 |
| | | if (code == FLOW_SIGNAL) { |
| | | return FLOW_ACCEPT; |
| | | } |
| | | |
| | | |
| | | // 物料 |
| | | if (code == FLOW_MOVE_MATERIAL) { |
| | | // 如果我这里是空的,可以接受 |
| | | Lock(); |
| | | if (m_panelList.size() < 15) { |
| | | CPanel* pPanel = (CPanel*)pIntent->getContext(); |
| | | ASSERT(pPanel); |
| | | pPanel->addRef(); |
| | | m_panelList.push_back(pPanel); |
| | | Unlock(); |
| | | return FLOW_ACCEPT; |
| | | } |
| | | else { |
| | | Unlock(); |
| | | return FLOW_REJECT; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | return FLOW_ACCEPT; |
| | | return __super::recvIntent(pPin, pIntent); |
| | | } |
| | | } |
| | |
| | | { |
| | | __super::getAttributeVector(attrubutes); |
| | | } |
| | | |
| | | int CEFEM::recvIntent(CPin* pPin, CIntent* pIntent) |
| | | { |
| | | return __super::recvIntent(pPin, pIntent); |
| | | } |
| | | } |
| | |
| | | virtual void onTimer(UINT nTimerid); |
| | | virtual void serialize(CArchive& ar); |
| | | virtual void getAttributeVector(CAttributeVector& attrubutes); |
| | | virtual int recvIntent(CPin* pPin, CIntent* pIntent); |
| | | }; |
| | | } |
| | | |
| | |
| | | attrubutes.addAttribute(new CAttribute(szTemp, |
| | | m_bVCREnable[i] ? _T("Enable") : _T("Disable"), "")); |
| | | } |
| | | |
| | | for (auto item : m_inputPins) { |
| | | attrubutes.addAttribute(new CAttribute(item->getName().c_str(), |
| | | std::to_string((int)item->getType()).c_str(), "")); |
| | | } |
| | | |
| | | for (auto item : m_outputPins) { |
| | | attrubutes.addAttribute(new CAttribute(item->getName().c_str(), |
| | | std::to_string((int)item->getType()).c_str(), "")); |
| | | } |
| | | |
| | | for (auto item : m_panelList) { |
| | | attrubutes.addAttribute(new CAttribute("Panel", |
| | | item->getID().c_str(), "")); |
| | | } |
| | | } |
| | | |
| | | void CEquipment::setReadBitBlock(unsigned int start, unsigned int end) |
| | |
| | | |
| | | int CEquipment::recvIntent(CPin* pPin, CIntent* pIntent) |
| | | { |
| | | ASSERT(pPin); |
| | | CPin* pFromPin = pPin->getConnectedPin(); |
| | | ASSERT(pFromPin); |
| | | CEquipment* pFromEq = pFromPin->getEquipment(); |
| | | ASSERT(pFromEq); |
| | | |
| | | LOGI("<CEquipment><%s-%s>收到来自<%s.%s>的Intent<%d,%s,0x%x>", |
| | | this->getName().c_str(), |
| | | pPin->getName().c_str(), |
| | | pFromEq->getName().c_str(), |
| | | pFromPin->getName().c_str(), |
| | | pIntent->getCode(), |
| | | pIntent->getMsg(), |
| | | pIntent->getContext()); |
| | | |
| | | |
| | | |
| | | // 以下解释处理数据 |
| | | int code = pIntent->getCode(); |
| | | |
| | | |
| | | // 测试 |
| | | if (code == FLOW_TEST) { |
| | | AfxMessageBox(pIntent->getMsg()); |
| | | return FLOW_ACCEPT; |
| | | } |
| | | |
| | | |
| | | // 信号 |
| | | if (code == FLOW_SIGNAL) { |
| | | return FLOW_ACCEPT; |
| | | } |
| | | |
| | | |
| | | // 数据 |
| | | if (code == FLOW_SIGNAL) { |
| | | return FLOW_ACCEPT; |
| | | } |
| | | |
| | | |
| | | // 物料 |
| | | if (code == FLOW_MOVE_MATERIAL) { |
| | | CPanel* pPanel = (CPanel*)pIntent->getContext(); |
| | | ASSERT(pPanel); |
| | | if (!glassWillArrive(pPanel)) { |
| | | return FLOW_REJECT; |
| | | } |
| | | return glassArrived(pPanel); |
| | | } |
| | | |
| | | |
| | | |
| | | return FLOW_ACCEPT; |
| | | } |
| | | |
| | | int CEquipment::outputGlass(int port) |
| | | { |
| | | CPin* pOutPin = nullptr; |
| | | if (port == 0) { |
| | | pOutPin = getPin("Out"); |
| | | if (pOutPin == nullptr) { |
| | | pOutPin = getPin("Out1"); |
| | | } |
| | | } |
| | | else if (port == 1) { |
| | | pOutPin = getPin("Out2"); |
| | | } |
| | | if (pOutPin == nullptr) { |
| | | return -1; |
| | | } |
| | | |
| | | |
| | | // 模拟取出第一张Panel,传送到下一环节 |
| | | Lock(); |
| | | CPanel* pContext = m_panelList.front(); |
| | | pContext->addRef(); |
| | | |
| | | CIntent intent(FLOW_MOVE_MATERIAL, "", pContext); |
| | | int nRet = pOutPin->sendIntent(&intent); |
| | | if (nRet == FLOW_REJECT) { |
| | | LOGE("<CEquipment>对方拒绝接收Intent."); |
| | | } |
| | | else if (nRet == FLOW_ACCEPT) { |
| | | m_panelList.pop_front(); |
| | | pContext->release(); // 添加到列队时addRef, 取出时release |
| | | } |
| | | |
| | | pContext->release(); |
| | | Unlock(); |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | BOOL CEquipment::glassWillArrive(CPanel* pPanel) |
| | | { |
| | | return TRUE; |
| | | } |
| | | |
| | | int CEquipment::glassArrived(CPanel* pPanel) |
| | | { |
| | | Lock(); |
| | | pPanel->addRef(); |
| | | m_panelList.push_back(pPanel); |
| | | Unlock(); |
| | | return FLOW_ACCEPT; |
| | | } |
| | | |
| | | void CEquipment::addPanelToList(CPanel* pPanel) |
| | | { |
| | | ASSERT(pPanel); |
| | |
| | | std::vector<CPin*>& CEquipment::getInputPins(); |
| | | std::vector<CPin*>& CEquipment::getOutputPins(); |
| | | virtual int recvIntent(CPin* pPin, CIntent* pIntent); |
| | | |
| | | virtual BOOL glassWillArrive(CPanel* pPanel); |
| | | virtual int outputGlass(int port); |
| | | virtual int glassArrived(CPanel* pPanel); |
| | | |
| | | // 以下为从CC-Link读取到的Bit标志位检测函数 |
| | | public: |
| | |
| | | { |
| | | CEquipment::serialize(ar); |
| | | } |
| | | |
| | | void CFliper::getAttributeVector(CAttributeVector& attrubutes) |
| | | { |
| | | __super::getAttributeVector(attrubutes); |
| | | } |
| | | |
| | | int CFliper::recvIntent(CPin* pPin, CIntent* pIntent) |
| | | { |
| | | return __super::recvIntent(pPin, pIntent); |
| | | } |
| | | } |
| | |
| | | virtual void initPins(); |
| | | virtual void onTimer(UINT nTimerid); |
| | | virtual void serialize(CArchive& ar); |
| | | virtual void getAttributeVector(CAttributeVector& attrubutes); |
| | | virtual int recvIntent(CPin* pPin, CIntent* pIntent); |
| | | }; |
| | | } |
| | | |
| | |
| | | void CLoadPort::getAttributeVector(CAttributeVector& attrubutes) |
| | | { |
| | | __super::getAttributeVector(attrubutes); |
| | | |
| | | for (auto item : m_inputPins) { |
| | | attrubutes.addAttribute(new CAttribute(item->getName().c_str(), |
| | | std::to_string((int)item->getType()).c_str(), "")); |
| | | } |
| | | |
| | | for (auto item : m_outputPins) { |
| | | attrubutes.addAttribute(new CAttribute(item->getName().c_str(), |
| | | std::to_string((int)item->getType()).c_str(), "")); |
| | | } |
| | | |
| | | for (auto item : m_panelList) { |
| | | attrubutes.addAttribute(new CAttribute("Panel", |
| | | item->getID().c_str(), "")); |
| | | } |
| | | } |
| | | |
| | | void CLoadPort::outputPanel() |
| | | int CLoadPort::recvIntent(CPin* pPin, CIntent* pIntent) |
| | | { |
| | | CPin* pOutPin = getPin("Out"); |
| | | return __super::recvIntent(pPin, pIntent); |
| | | } |
| | | |
| | | |
| | | int CLoadPort::outputGlass(int port) |
| | | { |
| | | // 如果列表中没有Panel,模拟生成10张 |
| | | if (m_panelList.empty()) { |
| | | static int ii = 0; |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | // 模拟取出第一张Panel,传送到下一环节 |
| | | Lock(); |
| | | CPanel* pContext = m_panelList.front(); |
| | | pContext->addRef(); |
| | | |
| | | CIntent intent(FLOW_MOVE_MATERIAL, "", pContext); |
| | | int nRet = pOutPin->sendIntent(&intent); |
| | | if (nRet == FLOW_REJECT) { |
| | | AfxMessageBox("对方拒绝接受"); |
| | | } |
| | | else if (nRet == FLOW_ACCEPT) { |
| | | m_panelList.pop_front(); |
| | | pContext->release(); // 添加到列队时addRef, 取出时release |
| | | } |
| | | |
| | | pContext->release(); |
| | | Unlock(); |
| | | return __super::outputGlass(port); |
| | | } |
| | | } |
| | |
| | | virtual void onTimer(UINT nTimerid); |
| | | virtual void serialize(CArchive& ar); |
| | | virtual void getAttributeVector(CAttributeVector& attrubutes); |
| | | virtual int recvIntent(CPin* pPin, CIntent* pIntent); |
| | | |
| | | public: |
| | | void outputPanel(); |
| | | virtual int outputGlass(int port); |
| | | }; |
| | | } |
| | | |
| | |
| | | { |
| | | CEquipment::serialize(ar); |
| | | } |
| | | |
| | | void CMeasurement::getAttributeVector(CAttributeVector& attrubutes) |
| | | { |
| | | __super::getAttributeVector(attrubutes); |
| | | } |
| | | |
| | | int CMeasurement::recvIntent(CPin* pPin, CIntent* pIntent) |
| | | { |
| | | return __super::recvIntent(pPin, pIntent); |
| | | } |
| | | } |
| | |
| | | virtual void initPins(); |
| | | virtual void onTimer(UINT nTimerid); |
| | | virtual void serialize(CArchive& ar); |
| | | virtual void getAttributeVector(CAttributeVector& attrubutes); |
| | | virtual int recvIntent(CPin* pPin, CIntent* pIntent); |
| | | }; |
| | | } |
| | | |
| | |
| | | }; |
| | | listener.onRclickEqItem = [&](EQITEM* pItem) -> bool { |
| | | ASSERT(pItem); |
| | | |
| | | CMenu menu, menuCommand; |
| | | CMenu* pPopupMenu; |
| | | menu.LoadMenu(IDR_MENU_EQSGRAPH_ITEM); |
| | | pPopupMenu = menu.GetSubMenu(0); |
| | | |
| | | |
| | | // 显示模式 |
| | | pPopupMenu->EnableMenuItem(ID_EQSGRAPHITEM_SMALL, MF_DISABLED | MF_GRAYED); |
| | | pPopupMenu->EnableMenuItem(ID_EQSGRAPHITEM_NORMAL, MF_DISABLED | MF_GRAYED); |
| | | pPopupMenu->EnableMenuItem(ID_EQSGRAPHITEM_LARGE, MF_DISABLED | MF_GRAYED); |
| | | if (pItem->nShowType == ITEM_SMALL) { |
| | | pPopupMenu->CheckMenuRadioItem(ID_EQSGRAPHITEM_SMALL, ID_EQSGRAPHITEM_LARGE, ID_EQSGRAPHITEM_SMALL, MF_CHECKED); |
| | | } |
| | | else if (pItem->nShowType == ITEM_LARGE) { |
| | | pPopupMenu->CheckMenuRadioItem(ID_EQSGRAPHITEM_SMALL, ID_EQSGRAPHITEM_LARGE, ID_EQSGRAPHITEM_LARGE, MF_CHECKED); |
| | | } |
| | | else { |
| | | pPopupMenu->CheckMenuRadioItem(ID_EQSGRAPHITEM_SMALL, ID_EQSGRAPHITEM_LARGE, ID_EQSGRAPHITEM_NORMAL, MF_CHECKED); |
| | | } |
| | | |
| | | |
| | | |
| | | POINT pt; |
| | | GetCursorPos(&pt); |
| | | int nCmd = pPopupMenu->TrackPopupMenu(TPM_RETURNCMD | TPM_LEFTALIGN | TPM_TOPALIGN, pt.x, pt.y, this, NULL); |
| | | if (nCmd == ID_EQSGRAPHITEM_SMALL) { |
| | | m_pEqsGraphWnd->SetItemType(pItem, ITEM_SMALL); |
| | | } |
| | | else if (nCmd == ID_EQSGRAPHITEM_NORMAL) { |
| | | m_pEqsGraphWnd->SetItemType(pItem, ITEM_NORMAL); |
| | | } |
| | | else if (nCmd == ID_EQSGRAPHITEM_LARGE) { |
| | | m_pEqsGraphWnd->SetItemType(pItem, ITEM_LARGE); |
| | | } |
| | | |
| | | |
| | | // 测试 |
| | | else if (nCmd == ID_EQSGRAPHITEM_TEST1) { |
| | | SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData; |
| | | pEquipment->outputGlass(0); |
| | | } |
| | | else if (nCmd == ID_EQSGRAPHITEM_TEST2) { |
| | | SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData; |
| | | pEquipment->outputGlass(1); |
| | | } |
| | | |
| | | |
| | | return true; |
| | | }; |
| | | |
| | |
| | | { |
| | | CEquipment::serialize(ar); |
| | | } |
| | | |
| | | void CVacuumBake::getAttributeVector(CAttributeVector& attrubutes) |
| | | { |
| | | __super::getAttributeVector(attrubutes); |
| | | } |
| | | |
| | | int CVacuumBake::recvIntent(CPin* pPin, CIntent* pIntent) |
| | | { |
| | | return __super::recvIntent(pPin, pIntent); |
| | | } |
| | | } |
| | |
| | | virtual void initPins(); |
| | | virtual void onTimer(UINT nTimerid); |
| | | virtual void serialize(CArchive& ar); |
| | | virtual void getAttributeVector(CAttributeVector& attrubutes); |
| | | virtual int recvIntent(CPin* pPin, CIntent* pIntent); |
| | | }; |
| | | } |
| | | |
| | |
| | | |
| | | void CServoDlg::OnMenuTestMessageClear() |
| | | { |
| | | /* |
| | | SERVO::CEquipment* pEquipment = m_pPanelMaster->GetActiveEquipment(); |
| | | if (pEquipment != nullptr) { |
| | | SERVO::CEqCimMessageClearStep* pStep = (SERVO::CEqCimMessageClearStep*)pEquipment->getStepWithName(STEP_CIM_MESSAGE_CLEAR); |
| | | pStep->clearCimMessage(2, 3); |
| | | } |
| | | */ |
| | | |
| | | SERVO::CLoadPort* pLoadPort1 = |
| | | (SERVO::CLoadPort*)theApp.m_model.m_master.getEquipment(EQ_ID_LOADPORT1); |
| | | pLoadPort1->outputPanel(); |
| | | } |
| | | |
| | | void CServoDlg::OnUpdateMenuTestMessageClear(CCmdUI* pCmdUI) |