chenluhua1980
2025-12-17 2aff4ac73e77d803ba3656057187956258713dbd
1.生产面板,菜单项等;
已修改4个文件
70 ■■■■■ 文件已修改
SourceCode/Bond/Servo/CPanelProduction.cpp 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.rc 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/ServoDlg.cpp 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/ServoDlg.h 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CPanelProduction.cpp
@@ -7,8 +7,6 @@
#include "afxdialogex.h"
#include "Common.h"
#include "VerticalLine.h"
#include <cstring>
#include <vector>
// CPanelProduction dialog
@@ -120,6 +118,8 @@
void CPanelProduction::OnBnClickedButtonClose()
{
    ShowWindow(SW_HIDE);
    GetParent()->SendMessage(ID_MSG_PANEL_RESIZE, m_nPanelWidth, 0);
    CWnd* pParent = GetParent();
    if (pParent != nullptr) {
        pParent->PostMessage(WM_COMMAND, ID_MENU_WND_TEST_PANEL, 0);
    }
}
SourceCode/Bond/Servo/Servo.rc
@@ -1566,6 +1566,7 @@
    BEGIN
        MENUITEM "日志窗口(&L)",                    ID_MENU_WND_LOG
        MENUITEM "警告窗口(A)",                     32781
        MENUITEM SEPARATOR
        MENUITEM "测试面板(T)",                     ID_MENU_WND_TEST_PANEL
        MENUITEM "生产面板(P)",                     ID_MENU_WND_PRO_PANEL
    END
SourceCode/Bond/Servo/ServoDlg.cpp
@@ -93,6 +93,7 @@
    m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
    m_crBkgnd = APPDLG_BACKGROUND_COLOR;
    m_hbrBkgnd = nullptr;
    m_nLeftPanelType = 2;
    m_pTerminalDisplayDlg = nullptr;
    m_pObserver = nullptr;
    m_pPanelMaster = nullptr;
@@ -142,6 +143,10 @@
    ON_UPDATE_COMMAND_UI(ID_MENU_TEST_MESSAGE_CLEAR, &CServoDlg::OnUpdateMenuTestMessageClear)
    ON_COMMAND(ID_MENU_TOOLS_CLIENT_LIST, &CServoDlg::OnMenuToolsClientList)
    ON_UPDATE_COMMAND_UI(ID_MENU_TOOLS_CLIENT_LIST, &CServoDlg::OnUpdateMenuToolsClientList)
    ON_COMMAND(ID_MENU_WND_TEST_PANEL, &CServoDlg::OnMenuWndTestPanel)
    ON_UPDATE_COMMAND_UI(ID_MENU_WND_TEST_PANEL, &CServoDlg::OnUpdateMenuWndTestPanel)
    ON_COMMAND(ID_MENU_WND_PRO_PANEL, &CServoDlg::OnMenuWndProPanel)
    ON_UPDATE_COMMAND_UI(ID_MENU_WND_PRO_PANEL, &CServoDlg::OnUpdateMenuWndProPanel)
    ON_COMMAND(ID_MENU_HELP_ABOUT, &CServoDlg::OnMenuHelpAbout)
    ON_WM_INITMENUPOPUP()
    ON_WM_TIMER()
@@ -435,7 +440,7 @@
    m_pPanelProduction = new CPanelProduction();
    m_pPanelProduction->setPanelWidth(nPanelWidth);
    m_pPanelProduction->Create(IDD_PANEL_PRODUCTION, this);
    m_pPanelProduction->ShowWindow(SW_SHOW);
    SetLeftPanelType(m_nLeftPanelType, false);
    m_pPanelEquipment = new CPanelEquipment();
    m_pPanelEquipment->Create(IDD_PANEL_EQUIPMENT, this);
    m_pPanelAttributes = new CPanelAttributes();
@@ -695,6 +700,28 @@
    pCmdUI->Enable(TRUE);
}
void CServoDlg::OnMenuWndTestPanel()
{
    SetLeftPanelType(1);
}
void CServoDlg::OnUpdateMenuWndTestPanel(CCmdUI* pCmdUI)
{
    pCmdUI->Enable(TRUE);
    pCmdUI->SetRadio(m_nLeftPanelType == 1);
}
void CServoDlg::OnMenuWndProPanel()
{
    SetLeftPanelType(2);
}
void CServoDlg::OnUpdateMenuWndProPanel(CCmdUI* pCmdUI)
{
    pCmdUI->Enable(TRUE);
    pCmdUI->SetRadio(m_nLeftPanelType == 2);
}
void CServoDlg::OnMenuHelpAbout()
{
    theApp.m_model.getMaster().test();
@@ -916,6 +943,32 @@
    m_pMyStatusbar->MoveWindow(0, y2, rcClient.Width(), STATUSBAR_HEIGHT);
}
void CServoDlg::SetLeftPanelType(int type, bool resize)
{
    if (type != 1 && type != 2) {
        type = 1;
    }
    m_nLeftPanelType = type;
    if (m_pPanelMaster != nullptr) {
        m_pPanelMaster->ShowWindow(SW_HIDE);
    }
    if (m_pPanelProduction != nullptr) {
        m_pPanelProduction->ShowWindow(SW_HIDE);
    }
    if (type == 1 && m_pPanelMaster != nullptr) {
        m_pPanelMaster->ShowWindow(SW_SHOW);
    }
    else if (type == 2 && m_pPanelProduction != nullptr) {
        m_pPanelProduction->ShowWindow(SW_SHOW);
    }
    if (resize && ::IsWindow(m_hWnd)) {
        Resize();
        DrawMenuBar();
    }
}
void CServoDlg::OnClose()
{
    // TODO: 在此添加消息处理程序代码和/或调用默认值
SourceCode/Bond/Servo/ServoDlg.h
@@ -35,6 +35,7 @@
private:
    void InitRxWindows();
    void Resize();
    void SetLeftPanelType(int type, bool resize = true);
    void ShowChildPage(int index);
    void UpdateLoginStatus();
    CString& GetRuntimeFormatText(CString& strText, const char* pszSuffix);
@@ -65,6 +66,7 @@
    HICON m_hIcon;
    COLORREF m_crBkgnd;
    HBRUSH m_hbrBkgnd;
    int m_nLeftPanelType; // 1: CPanelMaster, 2: CPanelProduction
    CTopToolbar* m_pTopToolbar;
    CPanelMaster* m_pPanelMaster;
    CPanelProduction* m_pPanelProduction;
@@ -102,6 +104,10 @@
    afx_msg void OnUpdateMenuTestMessageClear(CCmdUI* pCmdUI);
    afx_msg void OnMenuToolsClientList();
    afx_msg void OnUpdateMenuToolsClientList(CCmdUI* pCmdUI);
    afx_msg void OnMenuWndTestPanel();
    afx_msg void OnUpdateMenuWndTestPanel(CCmdUI* pCmdUI);
    afx_msg void OnMenuWndProPanel();
    afx_msg void OnUpdateMenuWndProPanel(CCmdUI* pCmdUI);
    afx_msg void OnMenuHelpAbout();
    afx_msg void OnTimer(UINT_PTR nIDEvent);
    afx_msg LRESULT OnPanelResize(WPARAM wParam, LPARAM lParam);