LAPTOP-SNT8I5JK\Boounion
2025-03-14 83922105a8e09cd8c1fbb5833e370518513121f7
1.Equipment在面板中显示机器信息(Alive, Name, CIM State, Upstream, Downstream等)
已修改8个文件
73 ■■■■■ 文件已修改
SourceCode/Bond/Servo/CEFEM.cpp 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEFEM.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEquipment.cpp 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEquipment.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPanelEquipment.cpp 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPanelEquipment.h 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.rc 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/ServoDlg.cpp 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEFEM.cpp
@@ -37,4 +37,9 @@
    {
        CEquipment::serialize(ar);
    }
    void CEFEM::getAttributeVector(CAttributeVector& attrubutes)
    {
        __super::getAttributeVector(attrubutes);
    }
}
SourceCode/Bond/Servo/CEFEM.h
@@ -15,6 +15,7 @@
        virtual void term();
        virtual void onTimer(UINT nTimerid);
        virtual void serialize(CArchive& ar);
        virtual void getAttributeVector(CAttributeVector& attrubutes);
    };
}
SourceCode/Bond/Servo/CEquipment.cpp
@@ -137,6 +137,39 @@
        return m_station;
    }
    void CEquipment::getAttributeVector(CAttributeVector& attrubutes)
    {
        attrubutes.clear();
        attrubutes.addAttribute(new CAttribute("Network",
            std::to_string(m_station.nNetNo).c_str(), ""));
        attrubutes.addAttribute(new CAttribute("Station",
            std::to_string(m_station.nStNo).c_str(), ""));
        attrubutes.addAttribute(new CAttribute("ID",
            std::to_string(m_nID).c_str(), ""));
        attrubutes.addAttribute(new CAttribute("Name",
            m_strName.c_str(), ""));
        attrubutes.addAttribute(new CAttribute("Description",
            m_strDescription.c_str(), ""));
        attrubutes.addAttribute(new CAttribute("Alive",
            this->isAlive() ? _T("TRUE") : _T("FALSE"), ""));
        attrubutes.addAttribute(new CAttribute("CIM State",
            m_bCimState ? _T("ON") : _T("OFF"), ""));
        attrubutes.addAttribute(new CAttribute("Upstream",
            m_bUpstreamInline ? _T("Inline") : _T("Offline"), ""));
        attrubutes.addAttribute(new CAttribute("Downstream",
            m_bDownstreamInline ? _T("Inline") : _T("Offline"), ""));
        attrubutes.addAttribute(new CAttribute("Local Alarm",
            m_bLocalAlarm ? _T("TRUE") : _T("FALSE"), ""));
        attrubutes.addAttribute(new CAttribute("Auto Recipe Change",
            m_bAutoRecipeChange ? _T("TRUE") : _T("FALSE"), ""));
        char szTemp[256];
        for (int i = 0; i < VCR_MAX; i++) {
            sprintf_s(szTemp, 256, "VCR-%d", i + 1);
            attrubutes.addAttribute(new CAttribute(szTemp,
                m_bVCREnable[i] ? _T("Enable") : _T("Disable"), ""));
        }
    }
    void CEquipment::setReadBitBlock(unsigned int start, unsigned int end)
    {
        m_blockReadBit.type = (unsigned int)DeviceType::B;
SourceCode/Bond/Servo/CEquipment.h
@@ -61,6 +61,7 @@
        std::string& getDescription();
        void setStation(int network, int station);
        const StationIdentifier& getStation();
        virtual void getAttributeVector(CAttributeVector& attrubutes);
        void setReadBitBlock(unsigned int start, unsigned int end);
        MemoryBlock& getReadBitBlock();
        void setWriteBitBlock(unsigned int start, unsigned int end);
SourceCode/Bond/Servo/CPanelEquipment.cpp
@@ -29,6 +29,7 @@
void CPanelEquipment::DoDataExchange(CDataExchange* pDX)
{
    CDialogEx::DoDataExchange(pDX);
    DDX_Control(pDX, IDC_MFCPROPERTYGRID1, m_gridCtrl);
}
@@ -56,6 +57,32 @@
    if (::IsWindow(m_hWnd)) {
        SetDlgItemText(IDC_LABEL_TITLE, m_pEquipment->getName().c_str());
    }
}
void CPanelEquipment::loadDataFromEquipment(SERVO::CEquipment* pEquipment)
{
    m_pEquipment = pEquipment;
    ASSERT(m_pEquipment);
    // 先清空所有
    m_gridCtrl.RemoveAll();
    // 加载数据
    SetDlgItemText(IDC_LABEL_TITLE, pEquipment->getName().c_str());
    SERVO::CAttributeVector attrubutes;
    pEquipment->getAttributeVector(attrubutes);
    unsigned int nSize = attrubutes.size();
    for (unsigned int i = 0; i < nSize; i++) {
        SERVO::CAttribute* pAttribute = attrubutes.getAttribute(i);
        CMFCPropertyGridProperty* pProperty = new CMFCPropertyGridProperty(
            pAttribute->getName().c_str(),
            pAttribute->getValue().c_str(),
            pAttribute->getDescription().c_str());
        pProperty->AllowEdit(FALSE);
        m_gridCtrl.AddProperty(pProperty);
    }
}
@@ -145,6 +172,8 @@
    pItem->MoveWindow(5, y, x2 - 5, rcItem.Height());
    y += rcItem.Height();
    y += 8;
    GetDlgItem(IDC_MFCPROPERTYGRID1)->MoveWindow(5, y, rcClient.Width() - 13, rcClient.Height() - 3 - y);
}
#define EQUIPMENT_PANEL_MIN_WIDTH        88
SourceCode/Bond/Servo/CPanelEquipment.h
@@ -14,11 +14,13 @@
    virtual ~CPanelEquipment();
    int getPanelWidth();
    void SetEquipment(SERVO::CEquipment* pEquipment);
    void loadDataFromEquipment(SERVO::CEquipment* pEquipment);
private:
    COLORREF m_crBkgnd;
    HBRUSH m_hbrBkgnd;
    int m_nPanelWidth;
    CMFCPropertyGridCtrl m_gridCtrl;
    CBlButton m_btnClose;
    SERVO::CEquipment* m_pEquipment;
SourceCode/Bond/Servo/Servo.rc
Binary files differ
SourceCode/Bond/Servo/ServoDlg.cpp
@@ -179,7 +179,7 @@
                    ASSERT(pEquipment);
                    ASSERT(m_pPanelEquipment);
                    ASSERT(m_pPanelAttributes);
                    m_pPanelEquipment->SetEquipment(pEquipment);
                    m_pPanelEquipment->loadDataFromEquipment(pEquipment);
                    m_pPanelAttributes->ShowWindow(SW_HIDE);
                    if (!m_pPanelEquipment->IsWindowVisible()) {
                        m_pPanelEquipment->ShowWindow(SW_SHOW);