| Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.6(1).xlsx | 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/CMyStatusbar.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/CMyStatusbar.h | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/Common.h | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/Servo.rc | 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/Servo.vcxproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/Servo.vcxproj.filters | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/ServoDlg.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/ServoDlg.h | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/resource.h | 补丁 | 查看 | 原始文档 | blame | 历史 |
Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.6(1).xlsxBinary 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.rcBinary 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) @@ -257,6 +262,13 @@ m_pPanelEquipment->Create(IDD_PANEL_EQUIPMENT, this); 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); // è°æ´åå§çªå£ä½ç½® @@ -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.hBinary files differ