| SourceCode/Bond/Servo/CCustomCheckBox.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/CCustomCheckBox.h | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/CLoadPort.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/PortConfigurationDlg.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/PortConfigurationDlg.h | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/Servo.rc | 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/Servo.vcxproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/Servo.vcxproj.filters | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SourceCode/Bond/Servo/resource.h | 补丁 | 查看 | 原始文档 | blame | 历史 |
SourceCode/Bond/Servo/CCustomCheckBox.cpp
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,56 @@ #include "stdafx.h" #include "CCustomCheckBox.h" CCustomCheckBox::CCustomCheckBox() : m_bgColor(RGB(255, 255, 255)), m_textColor(RGB(0, 0, 0)) { m_brush.CreateSolidBrush(m_bgColor); } CCustomCheckBox::~CCustomCheckBox() { } void CCustomCheckBox::SetBackgroundColor(COLORREF color) { m_bgColor = color; if (m_brush.GetSafeHandle()) m_brush.DeleteObject(); m_brush.CreateSolidBrush(m_bgColor); Invalidate(); } void CCustomCheckBox::SetTextColor(COLORREF color) { m_textColor = color; Invalidate(); } void CCustomCheckBox::SetNotifyHwnd(HWND hWnd) { m_hNotifyWnd = hWnd; } void CCustomCheckBox::OnClicked() { BOOL bChecked = (GetCheck() == BST_CHECKED); // ä½ å¯ä»¥å®ä¹èªå·±çèªå®ä¹æ¶æ¯ if (m_hNotifyWnd && ::IsWindow(m_hNotifyWnd)) { ::PostMessage(m_hNotifyWnd, WM_CHECKBOX_STATE_CHANGED, GetDlgCtrlID(), bChecked); } } BEGIN_MESSAGE_MAP(CCustomCheckBox, CButton) ON_WM_CTLCOLOR_REFLECT() ON_CONTROL_REFLECT(BN_CLICKED, &CCustomCheckBox::OnClicked) END_MESSAGE_MAP() HBRUSH CCustomCheckBox::CtlColor(CDC* pDC, UINT /*nCtlColor*/) { pDC->SetBkMode(TRANSPARENT); pDC->SetTextColor(m_textColor); return (HBRUSH)m_brush.GetSafeHandle(); } SourceCode/Bond/Servo/CCustomCheckBox.h
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,28 @@ #pragma once #define WM_CHECKBOX_STATE_CHANGED WM_USER + 1003 class CCustomCheckBox : public CButton { public: CCustomCheckBox(); virtual ~CCustomCheckBox(); public: void SetBackgroundColor(COLORREF color); void SetTextColor(COLORREF color); void SetNotifyHwnd(HWND hWnd); // è®¾ç½®æ¶æ¯æ¥æ¶çªå£ protected: afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor); afx_msg void OnClicked(); DECLARE_MESSAGE_MAP() private: COLORREF m_bgColor; COLORREF m_textColor; CBrush m_brush; HWND m_hNotifyWnd; }; SourceCode/Bond/Servo/CLoadPort.cpp
@@ -350,10 +350,11 @@ CEquipment::onTimer(nTimerid); // æ¨¡ææµè¯ /* if (m_nIndex == 0) { static int ii = 0; ii++; if (ii == 50) { if (ii == 20) { char szBuffer[64]; CStep* pStep = getStepWithName(STEP_EQ_PORT1_INUSE); CPortStatusReport portStatusReport; @@ -363,6 +364,7 @@ decodePortStatusReport(pStep, szBuffer, 64); } } */ } void CLoadPort::serialize(CArchive& ar) SourceCode/Bond/Servo/PortConfigurationDlg.cpp
@@ -12,6 +12,9 @@ #include "ServoCommo.h" #define CHECKBOX_ALL_ID 0x1234 // CPortConfigurationDlg å¯¹è¯æ¡ IMPLEMENT_DYNAMIC(CPortConfigurationDlg, CDialogEx) @@ -25,6 +28,8 @@ m_pPort[2] = dynamic_cast<SERVO::CLoadPort*>(theApp.m_model.m_master.getEquipment(EQ_ID_LOADPORT3)); m_pPort[3] = dynamic_cast<SERVO::CLoadPort*>(theApp.m_model.m_master.getEquipment(EQ_ID_LOADPORT4)); m_nCurSelPort = -1; m_pCheckBox = nullptr; m_bCheckedAll = FALSE; } CPortConfigurationDlg::~CPortConfigurationDlg() @@ -91,6 +96,7 @@ } } } m_pCheckBox->SetCheck(IsCheckedAll() ? BST_CHECKED : BST_UNCHECKED); } void CPortConfigurationDlg::InitGrid() @@ -123,7 +129,8 @@ m_wndGrid.SetColumnWidth(nColIdx, 50); m_wndGrid.SetItemText(0, nColIdx++, _T("Slot ID")); m_wndGrid.SetColumnWidth(nColIdx, 60); m_wndGrid.SetItemText(0, nColIdx++, _T("å¯ç¨")); m_wndGrid.SetItemText(0, nColIdx++, _T("Glass ID")); // 设置è¡ä¸ºæ ·å¼ m_wndGrid.SetFixedRowSelection(FALSE); @@ -146,6 +153,17 @@ for (int i = 0; i < nRows; ++i) { m_wndGrid.SetRowHeight(i, nEachRowHeight); } CRect rect; BOOL bOK = m_wndGrid.GetCellRect(0, 1, rect); m_pCheckBox = new CCustomCheckBox(); m_pCheckBox->Create(_T("éæ©ææ"), WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, // èªå¨å¾é CRect(0, 0, 150, 32), &m_wndGrid, CHECKBOX_ALL_ID); m_pCheckBox->SetFont(GetFont()); m_pCheckBox->MoveWindow(rect.left + 5, rect.top + 3, 150, rect.Height() - 6); m_pCheckBox->SetBackgroundColor(g_nGridFixCellColor); m_pCheckBox->SetNotifyHwnd(GetSafeHwnd()); } void CPortConfigurationDlg::DoDataExchange(CDataExchange* pDX) @@ -161,6 +179,10 @@ BEGIN_MESSAGE_MAP(CPortConfigurationDlg, CDialogEx) ON_CBN_SELCHANGE(IDC_COMBO_PORT, &CPortConfigurationDlg::OnSelchangeComboPort) ON_BN_CLICKED(IDC_BUTTON_APPLY, &CPortConfigurationDlg::OnBnClickedButtonApply) ON_MESSAGE(WM_CHECKBOX_STATE_CHANGED, &CPortConfigurationDlg::OnCheckAllClicked) ON_WM_DESTROY() ON_BN_CLICKED(IDC_BUTTON_PROCESS_START, &CPortConfigurationDlg::OnBnClickedButtonProcessStart) ON_BN_CLICKED(IDC_BUTTON_PROCESS_CANCEL, &CPortConfigurationDlg::OnBnClickedButtonProcessCancel) END_MESSAGE_MAP() @@ -203,7 +225,8 @@ LoadPortConfigToUI(m_pPort[0]); // é»è®¤å 载第ä¸ä¸ªç«¯å£çé ç½® // è®¾ç½®å¯¹è¯æ¡æ é¢ if (0 <= m_nCurSelPort && m_nCurSelPort <= 3) { BOOL bAutoPopup = 0 <= m_nCurSelPort && m_nCurSelPort <= 3; if (bAutoPopup) { CString strTitle; strTitle.Format(_T("%s Configuration"), ports[m_nCurSelPort]); SetWindowText(strTitle); @@ -211,6 +234,11 @@ else { SetWindowText(_T("Port Configuration")); } // Porcess Start / Process Cancel æé®ç¶æ GetDlgItem(IDC_BUTTON_PROCESS_START)->EnableWindow(FALSE); GetDlgItem(IDC_BUTTON_PROCESS_CANCEL)->EnableWindow(FALSE); return TRUE; // return TRUE unless you set the focus to a control @@ -284,7 +312,7 @@ } // è·å Grid è¡¨æ ¼ä¸ Slot ç¶æï¼ç¬¬1~8è¡ï¼ for (int i = 1; i <= 8; ++i) { for (int i = 1; i <= SLOT_MAX; ++i) { SERVO::CGlass* pGlass = (SERVO::CGlass*)m_wndGrid.GetItemData(i, 0); if (pGlass != nullptr) { CGridCellCheck* pCheck = dynamic_cast<CGridCellCheck*>(m_wndGrid.GetCell(i, 1)); @@ -300,6 +328,60 @@ } } GetDlgItem(IDC_BUTTON_PROCESS_START)->EnableWindow(TRUE); GetDlgItem(IDC_BUTTON_PROCESS_CANCEL)->EnableWindow(TRUE); } OnOK(); } void CPortConfigurationDlg::OnDestroy() { CDialogEx::OnDestroy(); if (m_pCheckBox != nullptr) { m_pCheckBox->DestroyWindow(); delete m_pCheckBox; m_pCheckBox = nullptr; } } LRESULT CPortConfigurationDlg::OnCheckAllClicked(WPARAM wParam, LPARAM lParam) { UINT ctrlID = (UINT)wParam; BOOL bChecked = (BOOL)lParam; for (int i = 1; i <= SLOT_MAX; ++i) { CGridCellCheck* pCheck = dynamic_cast<CGridCellCheck*>(m_wndGrid.GetCell(i, 1)); if (pCheck != nullptr) { pCheck->SetCheck(bChecked); } } return 0; } BOOL CPortConfigurationDlg::IsCheckedAll() { for (int i = 1; i <= SLOT_MAX; ++i) { CGridCellCheck* pCheck = dynamic_cast<CGridCellCheck*>(m_wndGrid.GetCell(i, 1)); if (pCheck != nullptr) { if (!pCheck->GetCheck()) return FALSE; } } return TRUE; } void CPortConfigurationDlg::OnBnClickedButtonProcessStart() { int selPort = (0 <= m_nCurSelPort && m_nCurSelPort <= 3) ? m_nCurSelPort : m_comboPort.GetCurSel(); if (selPort < 0 || selPort >= 4) return; m_pPort[selPort]->sendCassetteCtrlCmd(CCC_PROCESS_START, nullptr, 0, 0, 0, nullptr, nullptr); } void CPortConfigurationDlg::OnBnClickedButtonProcessCancel() { int selPort = (0 <= m_nCurSelPort && m_nCurSelPort <= 3) ? m_nCurSelPort : m_comboPort.GetCurSel(); if (selPort < 0 || selPort >= 4) return; m_pPort[selPort]->sendCassetteCtrlCmd(CCC_PROCESS_CANCEL, nullptr, 0, 0, 0, nullptr, nullptr); } SourceCode/Bond/Servo/PortConfigurationDlg.h
@@ -2,6 +2,8 @@ #include "afxdialogex.h" #include "GridCtrl.h" #include "CLoadPort.h" #include "CCustomCheckBox.h" // CPortConfigurationDlg å¯¹è¯æ¡ @@ -15,6 +17,7 @@ public: void setCurSelPort(int sel); BOOL IsCheckedAll(); // å¯¹è¯æ¡æ°æ® #ifdef AFX_DESIGN_TIME @@ -26,6 +29,7 @@ virtual BOOL OnInitDialog(); afx_msg void OnSelchangeComboPort(); afx_msg void OnBnClickedButtonApply(); afx_msg LRESULT OnCheckAllClicked(WPARAM wParam, LPARAM lParam); DECLARE_MESSAGE_MAP() private: @@ -41,4 +45,12 @@ CComboBox m_comboPort; CComboBox m_comboRecipe; CComboBox m_comboMaterialsType; CCustomCheckBox* m_pCheckBox; BOOL m_bCheckedAll; public: afx_msg void OnDestroy(); afx_msg void OnBnClickedButtonProcessStart(); afx_msg void OnBnClickedButtonProcessCancel(); }; SourceCode/Bond/Servo/Servo.rcBinary files differ
SourceCode/Bond/Servo/Servo.vcxproj
@@ -200,6 +200,7 @@ </ItemGroup> <ItemGroup> <ClInclude Include="CBaseDlg.h" /> <ClInclude Include="CCustomCheckBox.h" /> <ClInclude Include="CEquipmentPage3.h" /> <ClInclude Include="CGlassPool.h" /> <ClInclude Include="ChangePasswordDlg.h" /> @@ -342,6 +343,7 @@ </ItemGroup> <ItemGroup> <ClCompile Include="CBaseDlg.cpp" /> <ClCompile Include="CCustomCheckBox.cpp" /> <ClCompile Include="CEquipmentPage3.cpp" /> <ClCompile Include="CGlassPool.cpp" /> <ClCompile Include="ChangePasswordDlg.cpp" /> SourceCode/Bond/Servo/Servo.vcxproj.filters
@@ -169,6 +169,7 @@ <ClCompile Include="InputDialog.cpp" /> <ClCompile Include="RecipeManager.cpp" /> <ClCompile Include="RecipeDeviceBindDlg.cpp" /> <ClCompile Include="CCustomCheckBox.cpp" /> </ItemGroup> <ItemGroup> <ClInclude Include="AlarmManager.h" /> @@ -343,6 +344,7 @@ <ClInclude Include="InputDialog.h" /> <ClInclude Include="RecipeManager.h" /> <ClInclude Include="RecipeDeviceBindDlg.h" /> <ClInclude Include="CCustomCheckBox.h" /> </ItemGroup> <ItemGroup> <ResourceCompile Include="Servo.rc" /> SourceCode/Bond/Servo/resource.hBinary files differ