From 9b2d1e962bf802f75c44c1f5372fc4cf029e3f4e Mon Sep 17 00:00:00 2001
From: darker <mr.darker@163.com>
Date: 星期二, 11 二月 2025 11:11:13 +0800
Subject: [PATCH] 1. 添加SECS运行设置管理类

---
 SourceCode/Bond/Servo/Model.cpp |   28 +++++++++++++++++++++++-----
 1 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/SourceCode/Bond/Servo/Model.cpp b/SourceCode/Bond/Servo/Model.cpp
index 8bb0368..8d621b0 100644
--- a/SourceCode/Bond/Servo/Model.cpp
+++ b/SourceCode/Bond/Servo/Model.cpp
@@ -58,13 +58,31 @@
 
 
 	SECSListener listener;
-	listener.onEQConstantRequest = [&](void* pFrom, const std::vector<unsigned int>& ecids,
-		std::vector<unsigned int>& ecvs) -> void {
-		// 在此填充常量值,目前仅是加1后返回
-		for (auto item : ecids) {
-			ecvs.push_back(item + 1);
+	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);

--
Gitblit v1.9.3