From 2be286ac19bf2bb00e27f556e8b2cc292a58bd09 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期四, 08 一月 2026 18:48:59 +0800
Subject: [PATCH] 1.EAP状态继续实现,已在左侧加入相关按钮
---
SourceCode/Bond/Servo/PageRecipe.cpp | 64 +++++++++++++++++++++++++------
1 files changed, 51 insertions(+), 13 deletions(-)
diff --git a/SourceCode/Bond/Servo/PageRecipe.cpp b/SourceCode/Bond/Servo/PageRecipe.cpp
index 864ea5a..3965041 100644
--- a/SourceCode/Bond/Servo/PageRecipe.cpp
+++ b/SourceCode/Bond/Servo/PageRecipe.cpp
@@ -8,6 +8,7 @@
#include "MsgDlg.h"
#include "InputDialog.h"
#include "RecipeDeviceBindDlg.h"
+#include "DeviceRecipeParamDlg.h"
// CPageRecipe 瀵硅瘽妗�
@@ -38,7 +39,7 @@
}
m_listPPID.InsertColumn(0, _T(""), LVCFMT_RIGHT, 0); // 闅愯棌鍒�
- m_listPPID.InsertColumn(1, _T("No."), LVCFMT_LEFT, width[1]);
+ m_listPPID.InsertColumn(1, _T("No."), LVCFMT_CENTER, width[1]);
m_listPPID.InsertColumn(2, _T("PPID"), LVCFMT_LEFT, width[2]);
m_listPPID.InsertColumn(3, _T("鐪熺┖鐑樼儰"), LVCFMT_LEFT, width[6]);
m_listPPID.InsertColumn(4, _T("Bonder1"), LVCFMT_LEFT, width[4]);
@@ -66,9 +67,9 @@
m_listPPID.InsertColumn(0, _T(""), LVCFMT_RIGHT, width[0]);
m_listPPID.InsertColumn(1, _T("No."), LVCFMT_CENTER, width[1]);
- m_listPPID.InsertColumn(2, _T("Recipe ID"), LVCFMT_CENTER, width[2]);
- m_listPPID.InsertColumn(3, _T("Recipe 鍚嶇О"), LVCFMT_CENTER, width[3]);
- m_listPPID.InsertColumn(4, _T("Recipe 鍙傛暟"), LVCFMT_CENTER, width[4]);
+ m_listPPID.InsertColumn(2, _T("Recipe ID"), LVCFMT_LEFT, width[2]);
+ m_listPPID.InsertColumn(3, _T("Recipe 鍚嶇О"), LVCFMT_LEFT, width[3]);
+ m_listPPID.InsertColumn(4, _T("Recipe 鍙傛暟"), LVCFMT_LEFT, width[4]);
}
void CPageRecipe::UpdateRecipeByPPID(const CString& strPPID)
@@ -158,7 +159,7 @@
str.Format(_T("%d"), recipe.vecDeviceList.at(j).nRecipeID);
}
else {
- str.Format(_T("%s"), CA2T(strRecipeName.c_str()));
+ str.Format(_T("%s"), strRecipeName.c_str());
}
m_listPPID.SetItemText(i, j + 3, str);
@@ -385,13 +386,12 @@
void CPageRecipe::OnBnClickedButtonNew()
{
- // TODO: 鍦ㄦ娣诲姞鎺т欢閫氱煡澶勭悊绋嬪簭浠g爜
- //CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_EQUIPMENT);
- //int nSel = pComboBox->GetCurSel();
- //SERVO::CEquipment* pEq = (SERVO::CEquipment*)pComboBox->GetItemDataPtr(nSel);
- //if (pEq == nullptr) {
- // return;
- //}
+ int rc = UX_CanExecute(L"recipe");
+ if (rc != 1) {
+ AfxMessageBox("鎿嶄綔鏉冮檺涓嶈冻锛岃鑱旂郴绠$悊浜哄憳锛�");
+ return;
+ }
+ UX_RecordAction(L"recipe");
CRecipeDeviceBindDlg dlg(this);
if (dlg.DoModal() == IDOK) {
@@ -451,6 +451,13 @@
void CPageRecipe::OnBnClickedButtonModify()
{
+ int rc = UX_CanExecute(L"recipe");
+ if (rc != 1) {
+ AfxMessageBox("鎿嶄綔鏉冮檺涓嶈冻锛岃鑱旂郴绠$悊浜哄憳锛�");
+ return;
+ }
+ UX_RecordAction(L"recipe");
+
// TODO: 鍦ㄦ娣诲姞鎺т欢閫氱煡澶勭悊绋嬪簭浠g爜
CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_EQUIPMENT);
if (pComboBox == nullptr || !::IsWindow(pComboBox->m_hWnd)) {
@@ -491,6 +498,13 @@
void CPageRecipe::OnBnClickedButtonDelete()
{
+ int rc = UX_CanExecute(L"recipe");
+ if (rc != 1) {
+ AfxMessageBox("鎿嶄綔鏉冮檺涓嶈冻锛岃鑱旂郴绠$悊浜哄憳锛�");
+ return;
+ }
+ UX_RecordAction(L"recipe");
+
// TODO: 鍦ㄦ娣诲姞鎺т欢閫氱煡澶勭悊绋嬪簭浠g爜
POSITION pos = m_listPPID.GetFirstSelectedItemPosition();
if (!pos) {
@@ -517,6 +531,13 @@
void CPageRecipe::OnBnClickedButtonDeleteAll()
{
+ int rc = UX_CanExecute(L"recipe");
+ if (rc != 1) {
+ AfxMessageBox("鎿嶄綔鏉冮檺涓嶈冻锛岃鑱旂郴绠$悊浜哄憳锛�");
+ return;
+ }
+ UX_RecordAction(L"recipe");
+
// TODO: 鍦ㄦ娣诲姞鎺т欢閫氱煡澶勭悊绋嬪簭浠g爜
if (IDYES != AfxMessageBox(_T("纭畾瑕佸垹闄ゅ叏閮ㄩ厤鏂硅褰曞悧锛�"), MB_YESNO | MB_ICONWARNING)) {
return;
@@ -588,17 +609,25 @@
return;
}
- CString strText = m_listPPID.GetItemText(nItem, 2);
+ CString strRecipeID = m_listPPID.GetItemText(nItem, 2);
+ CString strRecipeName = m_listPPID.GetItemText(nItem, 3);
CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_EQUIPMENT);
int nEqSel = pComboBox->GetCurSel();
if (nEqSel == CB_ERR) {
return;
}
+ int nRecipeID = _ttoi(strRecipeID);
SERVO::CEquipment* pEq = (SERVO::CEquipment*)pComboBox->GetItemDataPtr(nEqSel);
if (pEq == nullptr) {
return;
}
+
+ CDeviceRecipeParamDlg dlg(this);
+ dlg.setDeviceRecipeID(nRecipeID);
+ dlg.setDeviceRecipeName(strRecipeName);
+ dlg.setEquipment(pEq);
+ dlg.DoModal();
}
void CPageRecipe::OnCbnSelchangeComboEquipment()
@@ -769,4 +798,13 @@
}
}
return result;
+}
+
+BOOL CPageRecipe::PreTranslateMessage(MSG* pMsg)
+{
+ if (pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE) {
+ return TRUE;
+ }
+
+ return CDialogEx::PreTranslateMessage(pMsg);
}
\ No newline at end of file
--
Gitblit v1.9.3