From 1f5df45b8e213de70e91a7ca54d6e2219cd967ca Mon Sep 17 00:00:00 2001
From: darker <mr.darker@163.com>
Date: 星期二, 18 二月 2025 11:07:25 +0800
Subject: [PATCH] 1. 添加获取plc心跳修改状态

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

diff --git a/SourceCode/Bond/Servo/Model.cpp b/SourceCode/Bond/Servo/Model.cpp
index 8d621b0..f7d8571 100644
--- a/SourceCode/Bond/Servo/Model.cpp
+++ b/SourceCode/Bond/Servo/Model.cpp
@@ -89,6 +89,14 @@
 	m_hsmsPassive.init(this, "APP", 7000);
 
 
+	SERVO::MasterListener masterListener;
+	masterListener.onEqAlive = [&](void* pMaster, SERVO::CEquipment* pEquipment, BOOL bAlive) -> void {
+		LOGI("<CModel>Equipment onAlive:%d.\n", pEquipment->getName().c_str(),
+			bAlive ? _T("ON") : _T("OFF"));
+		notifyPtr(RX_CODE_EQ_ALIVE, pEquipment);
+	};
+	m_master.setListener(masterListener);
+
 	return 0;
 }
 
@@ -96,6 +104,8 @@
 {
 	m_hsmsPassive.term();
 	CLog::GetLog()->SetOnLogCallback(nullptr);
+	m_master.term();
+
 	return 0;
 }
 

--
Gitblit v1.9.3