From 6b6297c6fc0aa5c059d35732c7ee22ebca93967f Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期三, 14 一月 2026 15:43:40 +0800
Subject: [PATCH] 1.修复以下问题: ProceedWithCarrier 直接发 CCC_PROCESS_START:CModel::onCarrierAction 在 CompareMapsBeforeProceeding 关闭时,收到 ProceedWithCarrier 就调用 master.proceedWithCarrier(仅发送 Cassette Process Start,不校验 PJ/CJ 是否存在、SlotMap 是否验通过)。若 Host 流程异常(未下 PJ/CJ)或本地尚未准备好,会把设备推进加工态但无作业可跑。

---
 SourceCode/Bond/Servo/CPageCollectionEvent.cpp |   82 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 81 insertions(+), 1 deletions(-)

diff --git a/SourceCode/Bond/Servo/CPageCollectionEvent.cpp b/SourceCode/Bond/Servo/CPageCollectionEvent.cpp
index d623697..46f4b71 100644
--- a/SourceCode/Bond/Servo/CPageCollectionEvent.cpp
+++ b/SourceCode/Bond/Servo/CPageCollectionEvent.cpp
@@ -5,6 +5,7 @@
 #include "Servo.h"
 #include "CPageCollectionEvent.h"
 #include "afxdialogex.h"
+#include "CEventEditDlg.h"
 
 
 // CPageCollectionEvent 瀵硅瘽妗�
@@ -149,5 +150,84 @@
 
 void CPageCollectionEvent::OnClickedBtn(const char* btnName)
 {
-	// 鏆傜暀锛氬悗缁疄鐜板鍒犳敼閫昏緫
+	ASSERT(btnName);
+	if (_strcmpi(btnName, "鏂板") == 0) {
+		int rc = UX_CanExecute(L"addEvents");
+		if (rc != 1) {
+			AfxMessageBox("鎿嶄綔鏉冮檺涓嶈冻锛岃鑱旂郴绠$悊浜哄憳锛�");
+			return;
+		}
+		unsigned int newId = theApp.m_model.m_hsmsPassive.getMaxCollectionEventId() + 1;
+		std::vector<unsigned int> rptIds;
+		CEventEditDlg dlg(_T("鏂板浜嬩欢"), (int)newId, _T(""), _T(""), rptIds, this);
+		if (dlg.DoModal() != IDOK) return;
+
+		int ret = theApp.m_model.m_hsmsPassive.addCollectionEvent(newId, CT2A(dlg.GetNameText()), CT2A(dlg.GetDescText()), dlg.GetSelectedRptIds());
+		if (ret == 0) {
+			UX_RecordAction(L"addEvents");
+			m_listCtrl.DeleteAllItems();
+			loadCollectionEvents();
+			if (CButton* pDel = GetBtnByName("鍒犻櫎")) pDel->EnableWindow(FALSE);
+			if (CButton* pEdit = GetBtnByName("缂栬緫")) pEdit->EnableWindow(FALSE);
+		}
+		else {
+			AfxMessageBox(_T("鏂板浜嬩欢澶辫触锛堝彲鑳絀D閲嶅鎴栧啓鍏ュけ璐ワ級"));
+		}
+	}
+	else if (_strcmpi(btnName, "鍒犻櫎") == 0) {
+		POSITION pos = m_listCtrl.GetFirstSelectedItemPosition();
+		if (pos == nullptr) return;
+		int nItem = m_listCtrl.GetNextSelectedItem(pos);
+		auto pEvent = reinterpret_cast<SERVO::CCollectionEvent*>(m_listCtrl.GetItemData(nItem));
+		if (pEvent == nullptr) return;
+
+		int rc = UX_CanExecute(L"delEvents");
+		if (rc != 1) {
+			AfxMessageBox("鎿嶄綔鏉冮檺涓嶈冻锛岃鑱旂郴绠$悊浜哄憳锛�");
+			return;
+		}
+
+		int ret = theApp.m_model.m_hsmsPassive.deleteCollectionEvent((unsigned short)pEvent->getEventId());
+		if (ret == 0) {
+			UX_RecordAction(L"delEvents");
+			m_listCtrl.DeleteAllItems();
+			loadCollectionEvents();
+			if (CButton* pDel = GetBtnByName("鍒犻櫎")) pDel->EnableWindow(FALSE);
+			if (CButton* pEdit = GetBtnByName("缂栬緫")) pEdit->EnableWindow(FALSE);
+		}
+		else {
+			AfxMessageBox(_T("鍒犻櫎浜嬩欢澶辫触"));
+		}
+	}
+	else if (_strcmpi(btnName, "缂栬緫") == 0) {
+		POSITION pos = m_listCtrl.GetFirstSelectedItemPosition();
+		if (pos == nullptr) return;
+		int nItem = m_listCtrl.GetNextSelectedItem(pos);
+		auto pEvent = reinterpret_cast<SERVO::CCollectionEvent*>(m_listCtrl.GetItemData(nItem));
+		if (pEvent == nullptr) return;
+
+		int rc = UX_CanExecute(L"editEvents");
+		if (rc != 1) {
+			AfxMessageBox("鎿嶄綔鏉冮檺涓嶈冻锛岃鑱旂郴绠$悊浜哄憳锛�");
+			return;
+		}
+
+		CString name = pEvent->getName().c_str();
+		CString desc = pEvent->getDescription().c_str();
+		auto rptIds = pEvent->getReportIds();
+		CEventEditDlg dlg(_T("缂栬緫浜嬩欢"), (int)pEvent->getEventId(), name, desc, rptIds, this);
+		if (dlg.DoModal() != IDOK) return;
+
+		int ret = theApp.m_model.m_hsmsPassive.updateCollectionEvent(pEvent->getEventId(), CT2A(dlg.GetNameText()), CT2A(dlg.GetDescText()), dlg.GetSelectedRptIds());
+		if (ret == 0) {
+			UX_RecordAction(L"editEvents");
+			m_listCtrl.DeleteAllItems();
+			loadCollectionEvents();
+			if (CButton* pDel = GetBtnByName("鍒犻櫎")) pDel->EnableWindow(FALSE);
+			if (CButton* pEdit = GetBtnByName("缂栬緫")) pEdit->EnableWindow(FALSE);
+		}
+		else {
+			AfxMessageBox(_T("缂栬緫浜嬩欢澶辫触锛堝彲鑳藉啓鍏ュけ璐ワ級"));
+		}
+	}
 }

--
Gitblit v1.9.3