| SourceCode/Bond/Servo/CMyStatusbar.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/CMyStatusbar.h | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/CRobotTaskDlg.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/CRobotTaskDlg.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 | 历史 |
SourceCode/Bond/Servo/CMyStatusbar.cpp
@@ -118,6 +118,22 @@ // TODO: 卿¤å¤æ·»å æ¶æ¯å¤çç¨åºä»£ç } BOOL CMyStatusbar::OnCommand(WPARAM wParam, LPARAM lParam) { CWnd* pItem; CRect rcItem; switch (LOWORD(wParam)) { case IDC_BUTTON_ROBOTTASK: pItem = GetDlgItem(IDC_BUTTON_ROBOTTASK); pItem->GetWindowRect(rcItem); GetParent()->SendMessage(ID_MSG_STATUSBAR_BTN_CLICKED, rcItem.left, LOWORD(wParam)); break; } return CDialogEx::OnCommand(wParam, lParam); } void CMyStatusbar::OnSize(UINT nType, int cx, int cy) { CDialogEx::OnSize(nType, cx, cy); @@ -149,4 +165,4 @@ pItem->GetClientRect(rcItem); pItem->MoveWindow(x, (rcClient.Height() - rcItem.Height()) / 2, rcItem.Width(), rcItem.Height()); x += rcItem.Width(); } } SourceCode/Bond/Servo/CMyStatusbar.h
@@ -3,6 +3,8 @@ #include "ColorTransfer.h" #define ID_MSG_STATUSBAR_BTN_CLICKED WM_USER + 20398 // CMyStatusbar å¯¹è¯æ¡ class CMyStatusbar : public CDialogEx @@ -43,4 +45,5 @@ afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); afx_msg void OnDestroy(); afx_msg void OnSize(UINT nType, int cx, int cy); virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam); }; SourceCode/Bond/Servo/CRobotTaskDlg.cpp
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,124 @@ // CRobotTaskDlg.cpp: å®ç°æä»¶ // #include "stdafx.h" #include "Servo.h" #include "CRobotTaskDlg.h" #include "afxdialogex.h" // CRobotTaskDlg å¯¹è¯æ¡ IMPLEMENT_DYNAMIC(CRobotTaskDlg, CDialogEx) CRobotTaskDlg::CRobotTaskDlg(CWnd* pParent /*=nullptr*/) : CDialogEx(IDD_DIALOG_ROBOT_TASK, pParent) { m_pRobotTask = nullptr; } CRobotTaskDlg::~CRobotTaskDlg() { } void CRobotTaskDlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CRobotTaskDlg, CDialogEx) ON_WM_CTLCOLOR() ON_WM_DESTROY() ON_WM_SIZE() ON_WM_ACTIVATE() END_MESSAGE_MAP() // CRobotTaskDlg æ¶æ¯å¤çç¨åº void CRobotTaskDlg::SetRobotTask(SERVO::CRobotTask* pRobotTask) { m_pRobotTask = pRobotTask; // åæ§ä»¶æ¯å¦æ¾ç¤º; GetDlgItem(IDC_LABEL_NO_TASK)->ShowWindow(m_pRobotTask == nullptr ? SW_SHOW : SW_HIDE); GetDlgItem(IDC_LABEL_GET_PUT)->ShowWindow(m_pRobotTask != nullptr ? SW_SHOW : SW_HIDE); if (m_pRobotTask != nullptr) { SERVO::CEquipment* pEq1, * pEq2; pEq1 = theApp.m_model.getMaster().getEquipment(m_pRobotTask->getSrcPosition()); pEq2 = theApp.m_model.getMaster().getEquipment(m_pRobotTask->getTarPosition()); CString strText; strText.Format(_T("%s --> %s"), pEq1->getName().c_str(), pEq2->getName().c_str()); SetDlgItemText(IDC_LABEL_GET_PUT, strText); } } BOOL CRobotTaskDlg::OnInitDialog() { CDialogEx::OnInitDialog(); // TODO: 卿¤æ·»å é¢å¤çåå§å return TRUE; // return TRUE unless you set the focus to a control // å¼å¸¸: OCX 屿§é¡µåºè¿å FALSE } HBRUSH CRobotTaskDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor); // TODO: 卿¤æ´æ¹ DC çä»»ä½ç¹æ§ // TODO: 妿é»è®¤ç䏿¯æéç»ç¬ï¼åè¿åå¦ä¸ä¸ªç»ç¬ return hbr; } void CRobotTaskDlg::OnDestroy() { CDialogEx::OnDestroy(); // TODO: 卿¤å¤æ·»å æ¶æ¯å¤çç¨åºä»£ç } void CRobotTaskDlg::OnSize(UINT nType, int cx, int cy) { CDialogEx::OnSize(nType, cx, cy); if (GetDlgItem(IDC_LABEL_NO_TASK) == nullptr) return; Resize(); } void CRobotTaskDlg::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) { CWnd::OnActivate(nState, pWndOther, bMinimized); if (nState == WA_INACTIVE) { ShowWindow(SW_HIDE); } } void CRobotTaskDlg::Resize() { CRect rcClient, rcItem; CWnd* pItem; GetClientRect(&rcClient); pItem = GetDlgItem(IDC_LABEL_NO_TASK); pItem->GetClientRect(&rcItem); pItem->MoveWindow((rcClient.Width() - rcItem.Width()) / 2, (rcClient.Height() - rcItem.Height()) / 2, rcItem.Width(), rcItem.Height()); pItem = GetDlgItem(IDC_LABEL_GET_PUT); pItem->GetClientRect(&rcItem); pItem->MoveWindow(12, 12, rcItem.Width(), rcItem.Height()); } SourceCode/Bond/Servo/CRobotTaskDlg.h
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,41 @@ #pragma once #include "CRobotTask.h" // CRobotTaskDlg å¯¹è¯æ¡ class CRobotTaskDlg : public CDialogEx { DECLARE_DYNAMIC(CRobotTaskDlg) public: CRobotTaskDlg(CWnd* pParent = nullptr); // æ åæé 彿° virtual ~CRobotTaskDlg(); public: void SetRobotTask(SERVO::CRobotTask* pRobotTask); private: void Resize(); private: SERVO::CRobotTask* m_pRobotTask; // å¯¹è¯æ¡æ°æ® #ifdef AFX_DESIGN_TIME enum { IDD = IDD_DIALOG_ROBOT_TASK }; #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); afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized); }; SourceCode/Bond/Servo/Servo.rcBinary files differ
SourceCode/Bond/Servo/Servo.vcxproj
@@ -205,6 +205,7 @@ <ClInclude Include="CRobotCmdTestDlg.h" /> <ClInclude Include="CPagePortStatus.h" /> <ClInclude Include="CPortStatusReport.h" /> <ClInclude Include="CRobotTaskDlg.h" /> <ClInclude Include="GridControl\CellRange.h" /> <ClInclude Include="GridControl\GridCell.h" /> <ClInclude Include="GridControl\GridCellBase.h" /> @@ -333,6 +334,7 @@ <ClCompile Include="CRobotCmdTestDlg.cpp" /> <ClCompile Include="CPagePortStatus.cpp" /> <ClCompile Include="CPortStatusReport.cpp" /> <ClCompile Include="CRobotTaskDlg.cpp" /> <ClCompile Include="GridControl\GridCell.cpp" /> <ClCompile Include="GridControl\GridCellBase.cpp" /> <ClCompile Include="GridControl\GridCellButton.cpp" /> SourceCode/Bond/Servo/Servo.vcxproj.filters
@@ -155,6 +155,7 @@ <ClCompile Include="CMyStatusbar.cpp" /> <ClCompile Include="CRobotTask.cpp" /> <ClCompile Include="CSlot.cpp" /> <ClCompile Include="CRobotTaskDlg.cpp" /> </ItemGroup> <ItemGroup> <ClInclude Include="AlarmManager.h" /> @@ -315,6 +316,7 @@ <ClInclude Include="CMyStatusbar.h" /> <ClInclude Include="CRobotTask.h" /> <ClInclude Include="CSlot.h" /> <ClInclude Include="CRobotTaskDlg.h" /> </ItemGroup> <ItemGroup> <ResourceCompile Include="Servo.rc" /> SourceCode/Bond/Servo/ServoDlg.cpp
@@ -84,6 +84,7 @@ m_pPageRecipe = nullptr; m_pTopToolbar = nullptr; m_pMyStatusbar = nullptr; m_pRobotTaskDlg = nullptr; } void CServoDlg::DoDataExchange(CDataExchange* pDX) @@ -119,6 +120,7 @@ ON_MESSAGE(ID_MSG_PANEL_RESIZE, OnPanelResize) ON_NOTIFY(BYHMTAB_SEL_CHANGED, IDC_TAB1, &CServoDlg::OnTabSelChanged) ON_MESSAGE(ID_MSG_TOOLBAR_BTN_CLICKED, &CServoDlg::OnToolbarBtnClicked) ON_MESSAGE(ID_MSG_STATUSBAR_BTN_CLICKED, &CServoDlg::OnStatusbarBtnClicked) END_MESSAGE_MAP() @@ -187,6 +189,9 @@ } else if (RX_CODE_EQ_ROBOT_TASK == code) { SERVO::CRobotTask* pTask = theApp.m_model.getMaster().getActiveRobotTask(); if (m_pRobotTaskDlg != nullptr) { m_pRobotTaskDlg->SetRobotTask(pTask); } if (pTask == nullptr) { m_pMyStatusbar->setCurTaskBtnText("æ "); } @@ -562,6 +567,12 @@ m_pMyStatusbar = nullptr; } if (m_pRobotTaskDlg != nullptr) { m_pRobotTaskDlg->DestroyWindow(); delete m_pRobotTaskDlg; m_pRobotTaskDlg = nullptr; } if (m_pTerminalDisplayDlg != nullptr) { m_pTerminalDisplayDlg->DestroyWindow(); delete m_pTerminalDisplayDlg; @@ -793,6 +804,27 @@ return 0; } LRESULT CServoDlg::OnStatusbarBtnClicked(WPARAM wParam, LPARAM lParam) { int id = (int)lParam; int x = (int)wParam; if (id == IDC_BUTTON_ROBOTTASK) { if (m_pRobotTaskDlg == nullptr) { m_pRobotTaskDlg = new CRobotTaskDlg(); m_pRobotTaskDlg->Create(IDD_DIALOG_ROBOT_TASK, this); } CRect rcBar; int h = 258; int w = 388; m_pRobotTaskDlg->SetRobotTask(theApp.m_model.getMaster().getActiveRobotTask()); m_pMyStatusbar->GetWindowRect(rcBar); m_pRobotTaskDlg->MoveWindow(x, rcBar.top - h, w, h); m_pRobotTaskDlg->ShowWindow(SW_SHOW); } return 0; } CString& CServoDlg::GetRuntimeFormatText(CString& strText, const char* pszSuffix) { ULONGLONG ullRunTime = (ULONGLONG)(theApp.m_model.getMaster().getRunTime() * 0.001); SourceCode/Bond/Servo/ServoDlg.h
@@ -15,6 +15,7 @@ #include "CPageGraph2.h" #include "TopToolbar.h" #include "CMyStatusbar.h" #include "CRobotTaskDlg.h" // CServoDlg å¯¹è¯æ¡ @@ -37,12 +38,12 @@ private: IObserver* m_pObserver; CTerminalDisplayDlg* m_pTerminalDisplayDlg; CRobotTaskDlg* m_pRobotTaskDlg; CPageGraph1* m_pPageGraph1; CPageGraph2* m_pPageGraph2; CPageRecipe* m_pPageRecipe; CPageAlarm* m_pPageAlarm; CPageLog* m_pPageLog; // å¯¹è¯æ¡æ°æ® #ifdef AFX_DESIGN_TIME @@ -95,4 +96,5 @@ afx_msg LRESULT OnPanelResize(WPARAM wParam, LPARAM lParam); afx_msg void OnTabSelChanged(NMHDR* nmhdr, LRESULT* result); LRESULT OnToolbarBtnClicked(WPARAM wParam, LPARAM lParam); LRESULT OnStatusbarBtnClicked(WPARAM wParam, LPARAM lParam); }; SourceCode/Bond/Servo/resource.hBinary files differ