LAPTOP-SNT8I5JK\Boounion
2025-03-14 acce0e17813055eae0f99eca392b3096cb0ea778
1.测试写入CIM State成功。
已修改8个文件
73 ■■■■■ 文件已修改
SourceCode/Bond/Servo/CEquipment.cpp 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEquipment.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPanelMaster.cpp 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPanelMaster.h 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.rc 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/ServoDlg.cpp 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/ServoDlg.h 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/resource.h 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CEquipment.cpp
@@ -72,6 +72,17 @@
        return iter->second;
    }
    CStep* CEquipment::getStepWithName(const char* pszName)
    {
        for (auto item : m_mapStep) {
            if (item.second->getName().compare(pszName) == 0) {
                return item.second;
            }
        }
        return nullptr;
    }
    int CEquipment::addStep(unsigned int addr, CStep* pStep)
    {
        auto iter = m_mapStep.find(addr);
SourceCode/Bond/Servo/CEquipment.h
@@ -69,6 +69,7 @@
        void getProperties(std::vector<std::pair<std::string, std::string>>& container);
        int addStep(unsigned int addr, CStep* pStep);
        CStep* getStep(unsigned int addr);
        CStep* getStepWithName(const char* pszName);
        std::map<unsigned int, CStep*>& getSteps();
        virtual void init();
        virtual void term();
SourceCode/Bond/Servo/CPanelMaster.cpp
@@ -211,3 +211,22 @@
    return nLevel;
}
SERVO::CEquipment* CPanelMaster::GetActiveEquipment()
{
    HTREEITEM hItem = m_treeCtrl.GetSelectedItem();
    if (hItem == nullptr) return nullptr;
    int nLevel = GetTreeItemLevel(hItem);
    if (nLevel == 2) {
        return (SERVO::CEquipment*)m_treeCtrl.GetItemData(hItem);
    }
    else if (nLevel == 3) {
        SERVO::CStep* pStep = (SERVO::CStep*)m_treeCtrl.GetItemData(hItem);
        if (pStep != nullptr) {
            return pStep->getEquipment();
        }
    }
    return nullptr;
}
SourceCode/Bond/Servo/CPanelMaster.h
@@ -14,7 +14,7 @@
    int getPanelWidth();
    void loadEquipmentList();
    void loadSteps(SERVO::CEquipment* pEquipment, HTREEITEM hItemEq);
    SERVO::CEquipment* GetActiveEquipment();
private:
    int GetTreeItemLevel(HTREEITEM hItem);
SourceCode/Bond/Servo/Servo.rc
Binary files differ
SourceCode/Bond/Servo/ServoDlg.cpp
@@ -128,6 +128,10 @@
    ON_UPDATE_COMMAND_UI(ID_MENU_WND_LOG, &CServoDlg::OnUpdateMenuWndLog)
    ON_COMMAND(ID_MENU_WND_ALARM, &CServoDlg::OnMenuWndAlarm)
    ON_UPDATE_COMMAND_UI(ID_MENU_WND_ALARM, &CServoDlg::OnUpdateMenuWndAlarm)
    ON_COMMAND(ID_MENU_TEST_MESSAGE_SET, &CServoDlg::OnMenuTestMessageSet)
    ON_UPDATE_COMMAND_UI(ID_MENU_TEST_MESSAGE_SET, &CServoDlg::OnUpdateMenuTestMessageSet)
    ON_COMMAND(ID_MENU_TEST_MESSAGE_CLEAR, &CServoDlg::OnMenuTestMessageClear)
    ON_UPDATE_COMMAND_UI(ID_MENU_TEST_MESSAGE_CLEAR, &CServoDlg::OnUpdateMenuTestMessageClear)
    ON_COMMAND(ID_MENU_HELP_ABOUT, &CServoDlg::OnMenuHelpAbout)
    ON_WM_INITMENUPOPUP()
    ON_WM_TIMER()
@@ -552,6 +556,38 @@
    pCmdUI->Enable(TRUE);
}
void CServoDlg::OnMenuTestMessageSet()
{
    SERVO::CEquipment* pEquipment = m_pPanelMaster->GetActiveEquipment();
    if (pEquipment != nullptr) {
        SERVO::CEqCimModeChangeStep* pStep = (SERVO::CEqCimModeChangeStep*)pEquipment->getStepWithName(STEP_CIM_MODE_CHANGE);
        if (pStep != nullptr) {
            static int i = 0;
            i++;
            if(i % 2 == 1)
                pStep->cimOn();
            else
                pStep->cimOff();
            AfxMessageBox(pStep->getName().c_str());
        }
    }
}
void CServoDlg::OnUpdateMenuTestMessageSet(CCmdUI* pCmdUI)
{
    pCmdUI->Enable(m_pPanelMaster->GetActiveEquipment() != nullptr);
}
void CServoDlg::OnMenuTestMessageClear()
{
    AfxMessageBox("OnMenuTestMessageClear");
}
void CServoDlg::OnUpdateMenuTestMessageClear(CCmdUI* pCmdUI)
{
    pCmdUI->Enable(TRUE);
}
void CServoDlg::OnMenuHelpAbout()
{
    CAboutDlg dlgAbout;
SourceCode/Bond/Servo/ServoDlg.h
@@ -101,6 +101,10 @@
    afx_msg void OnUpdateMenuWndAlarm(CCmdUI* pCmdUI);
    afx_msg void OnMenuFileExit();
    afx_msg void OnUpdateMenuFileExit(CCmdUI* pCmdUI);
    afx_msg void OnMenuTestMessageSet();
    afx_msg void OnUpdateMenuTestMessageSet(CCmdUI* pCmdUI);
    afx_msg void OnMenuTestMessageClear();
    afx_msg void OnUpdateMenuTestMessageClear(CCmdUI* pCmdUI);
    afx_msg void OnMenuHelpAbout();
    afx_msg void OnTimer(UINT_PTR nIDEvent);
    afx_msg BOOL OnEraseBkgnd(CDC* pDC);
SourceCode/Bond/Servo/resource.h
Binary files differ