From f354ac6647f9d763c0119717c202e684b261d8ae Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期六, 29 三月 2025 17:26:42 +0800
Subject: [PATCH] 1.修改逻辑,CStep不在设置和调用Listener,而是直接调用成员变量m_pEquipment的虚函数onStepEvent来传递数据。

---
 SourceCode/Bond/Servo/CEquipment.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/Servo/CEquipment.h b/SourceCode/Bond/Servo/CEquipment.h
index f95070a..407b505 100644
--- a/SourceCode/Bond/Servo/CEquipment.h
+++ b/SourceCode/Bond/Servo/CEquipment.h
@@ -29,10 +29,12 @@
 
 	typedef std::function<void(void* pEiuipment, BOOL bAlive)> ONALIVE;
 	typedef std::function<void(void* pEiuipment, int code)> ONDATACHANGED;
+	typedef std::function<void(void* pEiuipment, int state, int alarmId, int unitId, int level)> ONALARM;
 	typedef struct _EquipmentListener
 	{
 		ONALIVE				onAlive;
 		ONALIVE				onCimStateChanged;
+		ONALARM				onAlarm;
 		ONDATACHANGED		onDataChanged;
 	} EquipmentListener;
 
@@ -89,6 +91,7 @@
 		virtual void onTimer(UINT nTimerid);
 		virtual void serialize(CArchive& ar);
 		virtual void onReceiveLBData(const char* pszData, size_t size);
+		virtual int onStepEvent(CStep* pStep, int code);
 		virtual CPin* addPin(PinType type, char* pszName);
 		CPin* getPin(char* pszName);
 		std::vector<CPin*>& CEquipment::getInputPins();
@@ -100,6 +103,7 @@
 		void getGlassList(std::list<CGlass*>& list);
 		CGlass* getFrontGlass();
 		BOOL removeClass(CGlass* pGlass);
+		bool isAlarmStep(SERVO::CStep* pStep);
 
 	// 以下为从CC-Link读取到的Bit标志位检测函数
 	public:

--
Gitblit v1.9.3