From 2fc5bbfe88adefb0d2f8ba55d800fe074264a539 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期五, 14 二月 2025 14:16:27 +0800
Subject: [PATCH] Merge branch 'liuyang' into clh

---
 SourceCode/Bond/Servo/Model.cpp |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/Servo/Model.cpp b/SourceCode/Bond/Servo/Model.cpp
index 548e170..8d621b0 100644
--- a/SourceCode/Bond/Servo/Model.cpp
+++ b/SourceCode/Bond/Servo/Model.cpp
@@ -32,6 +32,11 @@
 	m_configuration.setFilepath((LPTSTR)(LPCTSTR)strIniFile);
 	m_configuration.getUnitId(strUnitId);
 
+	// 机器型号和软件版本号应从配置中读取,当前先固定值
+	CString strModeType = _T("Bond2860");
+	CString strSoftRev = _T("1.0.2");
+
+
 
 	// Log
 	CString strLogDir;
@@ -52,6 +57,35 @@
 	});
 
 
+	SECSListener listener;
+	listener.onEQOffLine = [&](void* pFrom) -> void {
+		LOGI("远程请求OffLine");
+	};
+	listener.onEQOnLine = [&](void* pFrom) -> void {
+		LOGI("远程请求OnLine");
+	};
+	listener.onCommand = [&](void* pFrom, const char* pszName, std::vector<CommandParameter>& params) -> void {
+		LOGI("onCommand:%s", pszName);
+		for (auto& item : params) {
+			LOGI("param:%s,%s", item.szName, item.szValue);
+		}
+	};
+	listener.onEQConstantRequest = [&](void* pFrom, std::vector<EQConstant>& eqcs) -> void {
+		// 在此填充常量值,目前仅是加1后返回
+		for (auto& item : eqcs) {
+			sprintf_s(item.szValue, 256, "Test%d", item.id+1);
+		}
+	};
+	listener.onEQConstantSend = [&](void* pFrom, std::vector<EQConstant>& eqcs) -> void {
+		// 在此保存和设置机器常量值
+		for (auto& item : eqcs) {
+			LOGI("onEQConstantRequest: %d, %s", item.id, item.szValue);
+		}
+	};
+
+	m_hsmsPassive.setListener(listener);
+	m_hsmsPassive.setEquipmentModelType((LPTSTR)(LPCTSTR)strModeType);
+	m_hsmsPassive.setSoftRev((LPTSTR)(LPCTSTR)strSoftRev);
 	m_hsmsPassive.init(this, "APP", 7000);
 
 

--
Gitblit v1.9.3