From bfe14e41fa5b07771d78af4511ba18d706bc23cc Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期一, 28 七月 2025 17:07:52 +0800
Subject: [PATCH] 1.Spooling Config功能EAP模拟测试;

---
 SourceCode/Bond/EAPSimulator/CHsmsActive.cpp           |   21 ++++++++++
 SourceCode/Bond/EAPSimulator/Resource.h                |    2 +
 SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.cpp       |   27 +++++++++++++
 SourceCode/Bond/EAPSimulator/CHsmsActive.h             |    4 ++
 SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.h         |    1 
 SourceCode/Bond/Servo/HsmsPassive.cpp                  |   49 ++++++------------------
 SourceCode/Bond/EAPSimulator/EAPSimulator.rc           |    0 
 Document/Panel Bonder八零联合 SecsTest CheckList_v3.0.xlsx |    0 
 8 files changed, 68 insertions(+), 36 deletions(-)

diff --git "a/Document/Panel Bonder\345\205\253\351\233\266\350\201\224\345\220\210 SecsTest CheckList_v3.0.xlsx" "b/Document/Panel Bonder\345\205\253\351\233\266\350\201\224\345\220\210 SecsTest CheckList_v3.0.xlsx"
index 33de0ae..6b16c1a 100644
--- "a/Document/Panel Bonder\345\205\253\351\233\266\350\201\224\345\220\210 SecsTest CheckList_v3.0.xlsx"
+++ "b/Document/Panel Bonder\345\205\253\351\233\266\350\201\224\345\220\210 SecsTest CheckList_v3.0.xlsx"
Binary files differ
diff --git a/SourceCode/Bond/EAPSimulator/CHsmsActive.cpp b/SourceCode/Bond/EAPSimulator/CHsmsActive.cpp
index 8098ce0..6d74a5c 100644
--- a/SourceCode/Bond/EAPSimulator/CHsmsActive.cpp
+++ b/SourceCode/Bond/EAPSimulator/CHsmsActive.cpp
@@ -245,6 +245,27 @@
 	return 0;
 }
 
+int CHsmsActive::hsmsConfigureSpooling(std::map<unsigned int, std::set<unsigned int>>& spoolingConfig)
+{
+	IMessage* pMessage = nullptr;
+	int nRet = HSMS_Create1Message(pMessage, m_nSessionId, 2 | REPLY, 43, ++m_nSystemByte);
+	if (spoolingConfig.size() > 0) {
+		for (auto s : spoolingConfig) {
+			ISECS2Item* pItemStreamList = pMessage->getBody()->addItem();
+			pItemStreamList->addU1Item(s.first, "STRID");
+			ISECS2Item* pItemFcnList = pItemStreamList->addItem();
+			for (auto f : s.second) {
+				pItemFcnList->addU1Item(f, "FCNID");
+			}
+		}
+	}
+
+	m_pActive->sendMessage(pMessage);
+	HSMS_Destroy1Message(pMessage);
+
+	return 0;
+}
+
 int CHsmsActive::replyAck0(IMessage* pMessage)
 {
 	return 0;
diff --git a/SourceCode/Bond/EAPSimulator/CHsmsActive.h b/SourceCode/Bond/EAPSimulator/CHsmsActive.h
index a5925e6..e171c75 100644
--- a/SourceCode/Bond/EAPSimulator/CHsmsActive.h
+++ b/SourceCode/Bond/EAPSimulator/CHsmsActive.h
@@ -2,6 +2,7 @@
 #include <string>
 #include <vector>
 #include <map>
+#include <set>
 #include "CCollectionEvent.h"
 
 
@@ -53,6 +54,9 @@
 	// Line Event Report
 	int hsmsLinkEventReport(std::map<unsigned int, std::vector<unsigned int>>& mapEvent);
 
+	// Configure Spooling
+	int hsmsConfigureSpooling(std::map<unsigned int, std::set<unsigned int>>& spoolingConfig);
+
 	// 通过的reply函数
 	void replyAck(int s, int f, unsigned int systemBytes, BYTE ack, const char* pszAckName);
 
diff --git a/SourceCode/Bond/EAPSimulator/EAPSimulator.rc b/SourceCode/Bond/EAPSimulator/EAPSimulator.rc
index ade0d9e..e90e25a 100644
--- a/SourceCode/Bond/EAPSimulator/EAPSimulator.rc
+++ b/SourceCode/Bond/EAPSimulator/EAPSimulator.rc
Binary files differ
diff --git a/SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.cpp b/SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.cpp
index 756b7b2..430a1ae 100644
--- a/SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.cpp
+++ b/SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.cpp
@@ -84,6 +84,7 @@
 	ON_BN_CLICKED(IDC_BUTTON_ED_ALARM_REPORT, &CEAPSimulatorDlg::OnBnClickedButtonEdAlarmReport)
 	ON_BN_CLICKED(IDC_BUTTON_DEFINE_REPORT, &CEAPSimulatorDlg::OnBnClickedButtonDefineReport)
 	ON_BN_CLICKED(IDC_BUTTON_LINE_REPORT, &CEAPSimulatorDlg::OnBnClickedButtonLineReport)
+	ON_BN_CLICKED(IDC_BUTTON_CONFIGURE_SPOOLING, &CEAPSimulatorDlg::OnBnClickedButtonConfigureSpooling)
 END_MESSAGE_MAP()
 
 
@@ -267,6 +268,7 @@
 	GetDlgItem(IDC_BUTTON_ED_ALARM_REPORT)->EnableWindow(enabled);	
 	GetDlgItem(IDC_BUTTON_DEFINE_REPORT)->EnableWindow(enabled);
 	GetDlgItem(IDC_BUTTON_LINE_REPORT)->EnableWindow(enabled);	
+	GetDlgItem(IDC_BUTTON_CONFIGURE_SPOOLING)->EnableWindow(enabled);	
 }
 
 void CEAPSimulatorDlg::OnBnClickedButtonConnect()
@@ -328,3 +330,28 @@
 	CLinkReportDlg dlg;
 	dlg.DoModal();
 }
+
+void CEAPSimulatorDlg::OnBnClickedButtonConfigureSpooling()
+{
+	std::map<unsigned int, std::set<unsigned int>> spoolingConfig;
+
+	// test clear all
+	// theApp.m_model.m_pHsmsActive->hsmsConfigureSpooling(spoolingConfig);
+
+
+	// test add s2[1,3,5];
+	// spoolingConfig[2].insert(1);
+	// spoolingConfig[2].insert(3);
+	// spoolingConfig[2].insert(5);
+	// spoolingConfig[3].insert(2);
+	// spoolingConfig[3].insert(4);
+	// spoolingConfig[3].insert(6);
+	// theApp.m_model.m_pHsmsActive->hsmsConfigureSpooling(spoolingConfig);
+
+	// test clear S2
+	// spoolingConfig[2].clear();
+	// theApp.m_model.m_pHsmsActive->hsmsConfigureSpooling(spoolingConfig);
+
+	spoolingConfig[5].insert(66);
+	theApp.m_model.m_pHsmsActive->hsmsConfigureSpooling(spoolingConfig);
+}
diff --git a/SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.h b/SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.h
index 70228c3..dd2de49 100644
--- a/SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.h
+++ b/SourceCode/Bond/EAPSimulator/EAPSimulatorDlg.h
@@ -53,4 +53,5 @@
 	afx_msg void OnBnClickedButtonEdAlarmReport();
 	afx_msg void OnBnClickedButtonDefineReport();
 	afx_msg void OnBnClickedButtonLineReport();
+	afx_msg void OnBnClickedButtonConfigureSpooling();
 };
diff --git a/SourceCode/Bond/EAPSimulator/Resource.h b/SourceCode/Bond/EAPSimulator/Resource.h
index 8cda42b..fda0a5c 100644
--- a/SourceCode/Bond/EAPSimulator/Resource.h
+++ b/SourceCode/Bond/EAPSimulator/Resource.h
@@ -29,6 +29,8 @@
 #define IDC_BUTTON_DEFINE_REPORT        1010
 #define IDC_BUTTON_LINE_REPORT          1011
 #define IDC_RADIO_ENABLE                1012
+#define IDC_BUTTON_LINE_REPORT2         1012
+#define IDC_BUTTON_CONFIGURE_SPOOLING   1012
 #define IDC_RADIO_DISABLE               1013
 #define IDC_EDIT_CEID                   1014
 #define IDC_LIST1                       1015
diff --git a/SourceCode/Bond/Servo/HsmsPassive.cpp b/SourceCode/Bond/Servo/HsmsPassive.cpp
index 55c616a..22840c2 100644
--- a/SourceCode/Bond/Servo/HsmsPassive.cpp
+++ b/SourceCode/Bond/Servo/HsmsPassive.cpp
@@ -1089,50 +1089,27 @@
 	for (int i = 0; i < pBody->getSubItemSize(); i++) {
 		ISECS2Item* pStreamItem = pBody->getSubItem(i);
 		ASSERT(pStreamItem);
-		unsigned char STRID;
+		unsigned char STRID, FCNID;
 		pStreamItem->getSubItemU1(0, STRID);
-		ISECS2Item* pFcnItem = pStreamItem->getSubItem(1);
-		for (int j = 0; j < pFcnItem->getSubItemSize(); j++) {
-
+		ISECS2Item* pFcnItemList = pStreamItem->getSubItem(1);
+		if (pFcnItemList->getSubItemSize() == 0) {
+			m_spoolingConfig[STRID].clear();
 		}
-	}
-
-
-
-
-	BOOL bCheckData = FALSE;
-	const char* pszCmdName;
-	std::vector<CommandParameter> params;
-	{
-		ISECS2Item* pItemParams, * pItemParam;
-		ISECS2Item* pItem = pRecv->getBody();
-		if (pItem->getSubItemSize() < 2) goto MYREPLY;
-		if (!pItem->getSubItemString(0, pszCmdName)) goto MYREPLY;
-		pItemParams = pItem->getSubItem(1);
-		if (pItemParams == nullptr || pItemParams->getType() != SITYPE::L) goto MYREPLY;
-		for (int i = 0; i < pItemParams->getSubItemSize(); i++) {
-			const char* pszParamName, * pszParamValue;
-			pItemParam = pItemParams->getSubItem(i);
-			if (pItemParam != nullptr
-				&& pItemParam->getSubItemString(0, pszParamName)
-				&& pItemParam->getSubItemString(1, pszParamValue)) {
-				CommandParameter cp;
-				strcpy_s(cp.szName, COMMAND_NAME_MAX, pszParamName);
-				strcpy_s(cp.szValue, COMMAND_VALUE_MAX, pszParamValue);
-				params.push_back(cp);
+		else {
+			for (int j = 0; j < pFcnItemList->getSubItemSize(); j++) {
+				pFcnItemList->getSubItemU1(j, FCNID);
+				m_spoolingConfig[STRID].insert(FCNID);
 			}
 		}
-		bCheckData = TRUE;
 	}
 
-
-	// 鍥炶皟鍒板簲鐢ㄥ眰
-	if (bCheckData) {
-		if (m_listener.onCommand != nullptr) {
-			m_listener.onCommand(this, pszCmdName, params);
+	// 鎵撳嵃楠岃瘉缁撴灉
+	for (auto s : m_spoolingConfig) {
+		LOGI("====> stream:%d", s.first);
+		for (auto f : s.second) {
+			LOGI("function:%d", f);
 		}
 	}
-
 MYREPLY:
 	replyAck(2, 42, pRecv->getHeader()->systemBytes, BYTE(0), "ERACK");
 	return 0;

--
Gitblit v1.9.3