LAPTOP-SNT8I5JK\Boounion
2025-03-21 d1fd8f9e1f5a012b301a6ce93c2ce7eb3c927e31
1.整理完善物流控制框架,各种虚函数处理。
已修改21个文件
367 ■■■■■ 文件已修改
SourceCode/Bond/Servo/CAligner.cpp 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CAligner.h 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CBakeCooling.cpp 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CBakeCooling.h 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CBonder.cpp 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEFEM.cpp 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEFEM.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEquipment.cpp 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEquipment.h 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CFliper.cpp 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CFliper.h 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CLoadPort.cpp 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CLoadPort.h 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CMeasurement.cpp 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CMeasurement.h 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPageGraph2.cpp 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CVacuumBake.cpp 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CVacuumBake.h 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.rc 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/ServoDlg.cpp 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/resource.h 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CAligner.cpp
@@ -48,4 +48,14 @@
    {
        CEquipment::serialize(ar);
    }
    void CAligner::getAttributeVector(CAttributeVector& attrubutes)
    {
        __super::getAttributeVector(attrubutes);
    }
    int CAligner::recvIntent(CPin* pPin, CIntent* pIntent)
    {
        return __super::recvIntent(pPin, pIntent);
    }
}
SourceCode/Bond/Servo/CAligner.h
@@ -17,6 +17,8 @@
        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);
    };
}
SourceCode/Bond/Servo/CBakeCooling.cpp
@@ -48,4 +48,14 @@
    {
        CEquipment::serialize(ar);
    }
    void CBakeCooling::getAttributeVector(CAttributeVector& attrubutes)
    {
        __super::getAttributeVector(attrubutes);
    }
    int CBakeCooling::recvIntent(CPin* pPin, CIntent* pIntent)
    {
        return __super::recvIntent(pPin, pIntent);
    }
}
SourceCode/Bond/Servo/CBakeCooling.h
@@ -17,6 +17,8 @@
        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);
    };
}
SourceCode/Bond/Servo/CBonder.cpp
@@ -51,87 +51,10 @@
    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);
    }
}
SourceCode/Bond/Servo/CEFEM.cpp
@@ -50,4 +50,9 @@
    {
        __super::getAttributeVector(attrubutes);
    }
    int CEFEM::recvIntent(CPin* pPin, CIntent* pIntent)
    {
        return __super::recvIntent(pPin, pIntent);
    }
}
SourceCode/Bond/Servo/CEFEM.h
@@ -18,6 +18,7 @@
        virtual void onTimer(UINT nTimerid);
        virtual void serialize(CArchive& ar);
        virtual void getAttributeVector(CAttributeVector& attrubutes);
        virtual int recvIntent(CPin* pPin, CIntent* pIntent);
    };
}
SourceCode/Bond/Servo/CEquipment.cpp
@@ -190,6 +190,21 @@
            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)
@@ -435,9 +450,113 @@
    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);
SourceCode/Bond/Servo/CEquipment.h
@@ -89,7 +89,9 @@
        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:
SourceCode/Bond/Servo/CFliper.cpp
@@ -47,4 +47,14 @@
    {
        CEquipment::serialize(ar);
    }
    void CFliper::getAttributeVector(CAttributeVector& attrubutes)
    {
        __super::getAttributeVector(attrubutes);
    }
    int CFliper::recvIntent(CPin* pPin, CIntent* pIntent)
    {
        return __super::recvIntent(pPin, pIntent);
    }
}
SourceCode/Bond/Servo/CFliper.h
@@ -17,6 +17,8 @@
        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);
    };
}
SourceCode/Bond/Servo/CLoadPort.cpp
@@ -52,28 +52,15 @@
    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;
@@ -87,23 +74,6 @@
            }
        }
        // 模拟取出第一张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);
    }
}
SourceCode/Bond/Servo/CLoadPort.h
@@ -18,9 +18,10 @@
        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);
    };
}
SourceCode/Bond/Servo/CMeasurement.cpp
@@ -44,4 +44,14 @@
    {
        CEquipment::serialize(ar);
    }
    void CMeasurement::getAttributeVector(CAttributeVector& attrubutes)
    {
        __super::getAttributeVector(attrubutes);
    }
    int CMeasurement::recvIntent(CPin* pPin, CIntent* pIntent)
    {
        return __super::recvIntent(pPin, pIntent);
    }
}
SourceCode/Bond/Servo/CMeasurement.h
@@ -17,6 +17,8 @@
        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);
    };
}
SourceCode/Bond/Servo/CPageGraph2.cpp
@@ -100,6 +100,54 @@
    };
    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;
    };
SourceCode/Bond/Servo/CVacuumBake.cpp
@@ -47,4 +47,14 @@
    {
        CEquipment::serialize(ar);
    }
    void CVacuumBake::getAttributeVector(CAttributeVector& attrubutes)
    {
        __super::getAttributeVector(attrubutes);
    }
    int CVacuumBake::recvIntent(CPin* pPin, CIntent* pIntent)
    {
        return __super::recvIntent(pPin, pIntent);
    }
}
SourceCode/Bond/Servo/CVacuumBake.h
@@ -17,6 +17,8 @@
        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);
    };
}
SourceCode/Bond/Servo/Servo.rc
Binary files differ
SourceCode/Bond/Servo/ServoDlg.cpp
@@ -465,17 +465,11 @@
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)
SourceCode/Bond/Servo/resource.h
Binary files differ