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/Servo/Model.cpp |   37 +++++++++++++++++++++++++++++++------
 1 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/SourceCode/Bond/Servo/Model.cpp b/SourceCode/Bond/Servo/Model.cpp
index c2acb85..77ab4c7 100644
--- a/SourceCode/Bond/Servo/Model.cpp
+++ b/SourceCode/Bond/Servo/Model.cpp
@@ -108,11 +108,34 @@
 			LOGI("onEQConstantRequest: %d, %s", item.id, item.szValue);
 		}
 	};
-
+	listener.onDatetimeSync = [&](void* pFrom, SYSTEMTIME& time) -> void {
+		LOGI("onDatetimeSync: %d%02d%02d%02d%02d%02d", time.wYear,
+			time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond);
+		m_master.datetimeSync(time);
+	};
+	listener.onEnableDisableEventReport = [&](void* pFrom, bool bEnable, std::vector<unsigned int> ids) -> void {
+		LOGI("EanbleDisableEventReport bEnable:%s", bEnable ? _T("YES") : _T("NO"));
+		if (ids.empty()) {
+			m_master.enableEventReport(bEnable);
+		}
+	};
+	listener.onEnableDisableAlarmReport = [&](void* pFrom, bool bEnable, unsigned int id) -> void {
+		LOGI("onEnableDisableAlarmReport bEnable:%s, id:%d", bEnable ? _T("YES") : _T("NO"), id);
+		if (id == 0) {
+			m_master.enableAlarmReport(bEnable);
+		}
+	};
 	m_hsmsPassive.setListener(listener);
 	m_hsmsPassive.setEquipmentModelType((LPTSTR)(LPCTSTR)strModeType);
 	m_hsmsPassive.setSoftRev((LPTSTR)(LPCTSTR)strSoftRev);
+	CString strVarialbleFile;
+	strVarialbleFile.Format(_T("%s\\VariableList.txt"), (LPTSTR)(LPCTSTR)m_strWorkDir);
+	m_hsmsPassive.loadVarialbles((LPTSTR)(LPCTSTR)strVarialbleFile);
 	m_hsmsPassive.init(this, "APP", 7000);
+	strVarialbleFile.Format(_T("%s\\ReportList.txt"), (LPTSTR)(LPCTSTR)m_strWorkDir);
+	m_hsmsPassive.loadReports((LPTSTR)(LPCTSTR)strVarialbleFile);
+	strVarialbleFile.Format(_T("%s\\CollectionEventList.txt"), (LPTSTR)(LPCTSTR)m_strWorkDir);
+	m_hsmsPassive.loadCollectionEvents((LPTSTR)(LPCTSTR)strVarialbleFile);
 
 
 	SERVO::MasterListener masterListener;
@@ -121,13 +144,13 @@
 		notify(RX_CODE_MASTER_STATE_CHANGED);
 	};
 	masterListener.onEqAlive = [&](void* pMaster, SERVO::CEquipment* pEquipment, BOOL bAlive) -> void {
-		LOGI("<CModel>Equipment onAlive:%s(%s).\n", pEquipment->getName().c_str(),
+		LOGI("<CModel>Equipment onAlive:%s(%s).", pEquipment->getName().c_str(),
 			bAlive ? _T("ON") : _T("OFF"));
 		notifyPtr(RX_CODE_EQ_ALIVE, pEquipment);
 
 	};
 	masterListener.onEqCimStateChanged = [&](void* pMaster, SERVO::CEquipment* pEquipment, BOOL bOn) -> void {
-		LOGI("<CModel>Equipment Cim State:%s(%s).\n", pEquipment->getName().c_str(),
+		LOGI("<CModel>Equipment Cim State:%s(%s).", pEquipment->getName().c_str(),
 			bOn ? _T("ON") : _T("OFF"));
 		notifyPtr(RX_CODE_EQ_ALIVE, pEquipment);
 
@@ -172,9 +195,11 @@
 			notify(RX_CODE_ALARM_CLEAR);
 		}
 
-		m_hsmsPassive.requestAlarmReport(state,
-			pEquipment->getBaseAlarmId() + alarmId,
-			strAlarmText.c_str());
+		if (m_master.isAlarmReportEnable()) {
+			m_hsmsPassive.requestAlarmReport(state,
+				pEquipment->getBaseAlarmId() + alarmId,
+				strAlarmText.c_str());
+		}
 	};
 	masterListener.onEqVcrEventReport = [&](void* pMaster, SERVO::CEquipment* pEquipment, SERVO::CVcrEventReport* pReport) {
 		LOGE("<CModel>onEqVcrEventReport.");

--
Gitblit v1.9.3