LAPTOP-SNT8I5JK\Boounion
2025-05-26 ec2b63378e47ac0aba4e0265b63a5cd26e373a32
1.添加了状态栏;
已添加3个文件
已修改7个文件
223 ■■■■■ 文件已修改
Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.6(1).xlsx 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CMyStatusbar.cpp 110 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/CMyStatusbar.h 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Common.h 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.rc 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.vcxproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.vcxproj.filters 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/ServoDlg.cpp 63 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/ServoDlg.h 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/resource.h 补丁 | 查看 | 原始文档 | blame | 历史
Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.6(1).xlsx
Binary files differ
SourceCode/Bond/Servo/CMyStatusbar.cpp
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,110 @@
// CMyStatusbar.cpp: å®žçŽ°æ–‡ä»¶
//
#include "stdafx.h"
#include "Servo.h"
#include "CMyStatusbar.h"
#include "afxdialogex.h"
// CMyStatusbar å¯¹è¯æ¡†
IMPLEMENT_DYNAMIC(CMyStatusbar, CDialogEx)
CMyStatusbar::CMyStatusbar(CWnd* pParent /*=nullptr*/)
    : CDialogEx(IDD_STATUSBAR, pParent)
{
    m_crBkgnd = STATUSBAR_BK_NORMAL;
}
CMyStatusbar::~CMyStatusbar()
{
}
void CMyStatusbar::DoDataExchange(CDataExchange* pDX)
{
    CDialogEx::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CMyStatusbar, CDialogEx)
    ON_WM_CTLCOLOR()
    ON_WM_DESTROY()
    ON_WM_SIZE()
END_MESSAGE_MAP()
// CMyStatusbar æ¶ˆæ¯å¤„理程序
void CMyStatusbar::setBkgnd(COLORREF color)
{
    if (m_brBkgnd.GetSafeHandle() != nullptr) {
        m_brBkgnd.DeleteObject();
    }
    m_brBkgnd.CreateSolidBrush(color);
    Invalidate();
    UpdateWindow();
}
void CMyStatusbar::setRunTimeText(const char* pszText)
{
    SetDlgItemText(IDC_LABEL_RUNTIME, pszText);
}
BOOL CMyStatusbar::OnInitDialog()
{
    CDialogEx::OnInitDialog();
    // TODO:  åœ¨æ­¤æ·»åŠ é¢å¤–çš„åˆå§‹åŒ–
    return TRUE;  // return TRUE unless you set the focus to a control
                  // å¼‚常: OCX å±žæ€§é¡µåº”返回 FALSE
}
HBRUSH CMyStatusbar::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
    HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor);
    // TODO:  åœ¨æ­¤æ›´æ”¹ DC çš„任何特性
    if (nCtlColor == CTLCOLOR_STATIC) {
        pDC->SetBkMode(TRANSPARENT);
        pDC->SetBkColor(m_crBkgnd);
        pDC->SetTextColor(RGB(255, 255, 255));
    }
    if (m_brBkgnd.GetSafeHandle() == nullptr) {
        m_brBkgnd.CreateSolidBrush(m_crBkgnd);
    }
    return (HBRUSH)m_brBkgnd;
}
void CMyStatusbar::OnDestroy()
{
    CDialogEx::OnDestroy();
    // TODO: åœ¨æ­¤å¤„添加消息处理程序代码
}
void CMyStatusbar::OnSize(UINT nType, int cx, int cy)
{
    CDialogEx::OnSize(nType, cx, cy);
    if (nullptr == GetDlgItem(IDC_LABEL_RUNTIME)) return;
    Resize();
}
void CMyStatusbar::Resize()
{
    CRect rcClient, rcItem;
    CWnd* pItem = nullptr;
    int x;
    GetClientRect(&rcClient);
    x = 120;
    pItem = GetDlgItem(IDC_LABEL_RUNTIME);
    pItem->GetClientRect(rcItem);
    pItem->MoveWindow(x, (rcClient.Height() - rcItem.Height()) / 2, rcItem.Width(), rcItem.Height());
}
SourceCode/Bond/Servo/CMyStatusbar.h
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,41 @@
#pragma once
// CMyStatusbar å¯¹è¯æ¡†
class CMyStatusbar : public CDialogEx
{
    DECLARE_DYNAMIC(CMyStatusbar)
public:
    CMyStatusbar(CWnd* pParent = nullptr);   // æ ‡å‡†æž„造函数
    virtual ~CMyStatusbar();
public:
    void setBkgnd(COLORREF color);
    void setRunTimeText(const char* pszText);
private:
    void Resize();
private:
    COLORREF m_crBkgnd;
    CBrush m_brBkgnd;
// å¯¹è¯æ¡†æ•°æ®
#ifdef AFX_DESIGN_TIME
    enum { IDD = IDD_STATUSBAR };
#endif
protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV æ”¯æŒ
    DECLARE_MESSAGE_MAP()
public:
    virtual BOOL OnInitDialog();
    afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
    afx_msg void OnDestroy();
    afx_msg void OnSize(UINT nType, int cx, int cy);
};
SourceCode/Bond/Servo/Common.h
@@ -38,6 +38,9 @@
#define CR_MSGBOX_TITLE                        RGB(200, 216, 246)
#define CR_MSGBOX_MESSAGE                    RGB(200, 216, 246)
#define TOP_TOOLBAR_BACKGROUND                RGB(240, 240, 240)    
#define STATUSBAR_BK_NORMAL                    RGB(195, 195, 195)
#define STATUSBAR_BK_RUNNING                RGB(34, 177, 76)
#define STATUSBAR_BK_ALARM                    RGB(255, 127, 39)
/* LOG BTN */
#define BTN_LOG_FRAME_NORMAL            RGB(88, 88, 88)
SourceCode/Bond/Servo/Servo.rc
Binary files differ
SourceCode/Bond/Servo/Servo.vcxproj
@@ -200,6 +200,7 @@
  <ItemGroup>
    <ClInclude Include="CEquipmentPage3.h" />
    <ClInclude Include="CGlassPool.h" />
    <ClInclude Include="CMyStatusbar.h" />
    <ClInclude Include="CRobotCmdContainerDlg.h" />
    <ClInclude Include="CRobotCmdTestDlg.h" />
    <ClInclude Include="CPagePortStatus.h" />
@@ -309,6 +310,7 @@
  <ItemGroup>
    <ClCompile Include="CEquipmentPage3.cpp" />
    <ClCompile Include="CGlassPool.cpp" />
    <ClCompile Include="CMyStatusbar.cpp" />
    <ClCompile Include="CRobotCmdContainerDlg.cpp" />
    <ClCompile Include="CRobotCmdTestDlg.cpp" />
    <ClCompile Include="CPagePortStatus.cpp" />
SourceCode/Bond/Servo/Servo.vcxproj.filters
@@ -114,6 +114,7 @@
    <ClCompile Include="JobSlotGrid.cpp" />
    <ClCompile Include="TopToolbar.cpp" />
    <ClCompile Include="HorizontalLine.cpp" />
    <ClCompile Include="CMyStatusbar.cpp" />
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="AlarmManager.h" />
@@ -227,6 +228,7 @@
    <ClInclude Include="JobSlotGrid.h" />
    <ClInclude Include="TopToolbar.h" />
    <ClInclude Include="HorizontalLine.h" />
    <ClInclude Include="CMyStatusbar.h" />
  </ItemGroup>
  <ItemGroup>
    <ResourceCompile Include="Servo.rc" />
SourceCode/Bond/Servo/ServoDlg.cpp
@@ -25,6 +25,10 @@
/* åˆ›å»ºç»ˆç«¯çš„定时器 */
#define TIMER_ID_CREATE_TERMINAL        1
/* è¿è¡Œæ—¶é—´å®šæ—¶å™¨ */
#define TIMER_ID_UPDATE_RUMTIME            2
// ç”¨äºŽåº”用程序“关于”菜单项的 CAboutDlg å¯¹è¯æ¡†
@@ -79,6 +83,7 @@
    m_pPageLog = nullptr;
    m_pPageRecipe = nullptr;
    m_pTopToolbar = nullptr;
    m_pMyStatusbar = nullptr;
}
void CServoDlg::DoDataExchange(CDataExchange* pDX)
@@ -258,6 +263,13 @@
    m_pPanelAttributes = new CPanelAttributes();
    m_pPanelAttributes->Create(IDD_PANEL_ATTRIBUTES, this);
    
    // statusbar
    m_pMyStatusbar = new CMyStatusbar();
    m_pMyStatusbar->Create(IDD_STATUSBAR, this);
    m_pMyStatusbar->ShowWindow(SW_SHOW);
    // è°ƒæ•´åˆå§‹çª—口位置
    CRect rcWnd;
@@ -512,6 +524,12 @@
        m_pTopToolbar = nullptr;
    }
    if (m_pMyStatusbar != nullptr) {
        m_pMyStatusbar->DestroyWindow();
        delete m_pMyStatusbar;
        m_pMyStatusbar = nullptr;
    }
    if (m_pTerminalDisplayDlg != nullptr) {
        m_pTerminalDisplayDlg->DestroyWindow();
        delete m_pTerminalDisplayDlg;
@@ -592,34 +610,39 @@
}
#define TOOLBAR_HEIGHT        78
#define STATUSBAR_HEIGHT    38
void CServoDlg::Resize()
{
    CRect rcClient, rcItem;
    CWnd* pItem = nullptr;
    int x, y;
    int x, y, y2;
    GetClientRect(&rcClient);
    x = 0;
    y = 0;
    y2 = rcClient.bottom - STATUSBAR_HEIGHT;
    m_pTopToolbar->MoveWindow(0, 0, rcClient.Width(), TOOLBAR_HEIGHT);
    y += TOOLBAR_HEIGHT;
    int nPanelWidth = 0;
    if (m_pPanelMaster != nullptr) {
        nPanelWidth = m_pPanelMaster->getPanelWidth();
        m_pPanelMaster->MoveWindow(x, y, nPanelWidth, rcClient.Height());
        m_pPanelMaster->MoveWindow(x, y, nPanelWidth, y2 - y);
        x += nPanelWidth;
    }
    if (m_pPanelEquipment != nullptr && m_pPanelEquipment->IsWindowVisible()) {
        nPanelWidth = m_pPanelEquipment->getPanelWidth();
        m_pPanelEquipment->MoveWindow(x, y, nPanelWidth, rcClient.Height());
        m_pPanelEquipment->MoveWindow(x, y, nPanelWidth, y2 - y);
        x += nPanelWidth;
    }
    if (m_pPanelAttributes != nullptr && m_pPanelAttributes->IsWindowVisible()) {
        nPanelWidth = m_pPanelAttributes->getPanelWidth();
        m_pPanelAttributes->MoveWindow(x, y, nPanelWidth, rcClient.Height());
        m_pPanelAttributes->MoveWindow(x, y, nPanelWidth, y2 - y);
        x += nPanelWidth;
    }
@@ -630,11 +653,14 @@
    y += rcItem.Height();
    m_pPageGraph1->MoveWindow(x, y, rcClient.Width() - x, rcClient.Height() - y);
    m_pPageGraph2->MoveWindow(x, y, rcClient.Width() - x, rcClient.Height() - y);
    m_pPageRecipe->MoveWindow(x, y, rcClient.Width() - x, rcClient.Height() - y);
    m_pPageAlarm->MoveWindow(x, y, rcClient.Width() - x, rcClient.Height() - y);
    m_pPageLog->MoveWindow(x, y, rcClient.Width() - x, rcClient.Height() - y);
    m_pPageGraph1->MoveWindow(x, y, rcClient.Width() - x, y2 - y);
    m_pPageGraph2->MoveWindow(x, y, rcClient.Width() - x, y2 - y);
    m_pPageRecipe->MoveWindow(x, y, rcClient.Width() - x, y2 - y);
    m_pPageAlarm->MoveWindow(x, y, rcClient.Width() - x, y2 - y);
    m_pPageLog->MoveWindow(x, y, rcClient.Width() - x, y2 - y);
    m_pMyStatusbar->MoveWindow(0, y2, rcClient.Width(), STATUSBAR_HEIGHT);
}
void CServoDlg::OnClose()
@@ -673,6 +699,21 @@
        m_pTerminalDisplayDlg->Create(IDD_DIALOG_TERMINAL_DISPLAY, this);
    }
    if (TIMER_ID_UPDATE_RUMTIME == nIDEvent) {
        static int index = 0; index++;
        if (index >= 4) index = 0;
        static char* status[] = {"|", "/", "--", "\\"};
        CTime time = CTime::GetCurrentTime();
        CString strText;
        strText.Format(_T("已运行:%d-%02d-%02d %02d:%02d:%02d   %s"),
            time.GetYear(), time.GetMonth(), time.GetDay(),
            time.GetHour(), time.GetMinute(), time.GetSecond(),
            status[index]);
        m_pMyStatusbar->setRunTimeText((LPTSTR)(LPCTSTR)strText);
    }
    CDialogEx::OnTimer(nIDEvent);
}
@@ -709,12 +750,16 @@
        theApp.m_model.getMaster().start();
        m_pTopToolbar->GetBtn(IDC_BUTTON_RUN)->EnableWindow(FALSE);
        m_pTopToolbar->GetBtn(IDC_BUTTON_STOP)->EnableWindow(TRUE);
        m_pMyStatusbar->setBkgnd(STATUSBAR_BK_RUNNING);
        SetTimer(TIMER_ID_UPDATE_RUMTIME, 1000, nullptr);
    }
    else if (id == IDC_BUTTON_STOP) {
        theApp.m_model.getMaster().stop();
        m_pTopToolbar->GetBtn(IDC_BUTTON_RUN)->EnableWindow(TRUE);
        m_pTopToolbar->GetBtn(IDC_BUTTON_STOP)->EnableWindow(FALSE);
        m_pMyStatusbar->setBkgnd(STATUSBAR_BK_ALARM);
        KillTimer(TIMER_ID_UPDATE_RUMTIME);
    }
    else if (id == IDC_BUTTON_ROBOT) {
        SERVO::CEFEM* pEFEM = (SERVO::CEFEM*)theApp.m_model.getMaster().getEquipment(EQ_ID_EFEM);
SourceCode/Bond/Servo/ServoDlg.h
@@ -14,6 +14,7 @@
#include "CPageGraph1.h"
#include "CPageGraph2.h"
#include "TopToolbar.h"
#include "CMyStatusbar.h"
// CServoDlg å¯¹è¯æ¡†
@@ -61,6 +62,7 @@
    CPanelMaster* m_pPanelMaster;
    CPanelEquipment* m_pPanelEquipment;
    CPanelAttributes* m_pPanelAttributes;
    CMyStatusbar* m_pMyStatusbar;
    // ç”Ÿæˆçš„æ¶ˆæ¯æ˜ å°„函数
    virtual BOOL OnInitDialog();
SourceCode/Bond/Servo/resource.h
Binary files differ