From 375342c11638685d6b7fecc2a979825c56d770f9 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期一, 14 七月 2025 17:57:15 +0800
Subject: [PATCH] 1.CCollectionEvent,CLoadPort, CVariable类实现; 2.从.txt或csv中加载CVariable列表; 3.添加菜单,准备添加相关查看或编辑 CVariable列表的界面;
---
SourceCode/Bond/Servo/HsmsPassive.h | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/SourceCode/Bond/Servo/HsmsPassive.h b/SourceCode/Bond/Servo/HsmsPassive.h
index 38ba909..f5e8383 100644
--- a/SourceCode/Bond/Servo/HsmsPassive.h
+++ b/SourceCode/Bond/Servo/HsmsPassive.h
@@ -5,6 +5,7 @@
#include <functional>
#include <vector>
#include <map>
+#include "CCollectionEvent.h"
#define EQCONSTANT_VALUE_MAX 64
@@ -61,6 +62,8 @@
typedef std::function<void(void* pFrom, std::vector<EQConstant>&)> SECSEQCONSTANTREQUEST;
typedef std::function<void(void* pFrom, const char*, std::vector<CommandParameter>&)> SECSCommand;
typedef std::function<void(void* pFrom, SYSTEMTIME& time)> DATETIMESYNC;
+typedef std::function<void(void* pFrom, bool bEnable, std::vector<unsigned int>& ids)> EDEVENTREPORT;
+typedef std::function<void(void* pFrom, bool bEnable, unsigned int id)> EDALARMREPORT;
typedef struct _SECSListener
{
SECSEQOFFLINE onEQOffLine;
@@ -69,6 +72,8 @@
SECSEQCONSTANTREQUEST onEQConstantSend;
SECSCommand onCommand;
DATETIMESYNC onDatetimeSync;
+ EDEVENTREPORT onEnableDisableEventReport;
+ EDALARMREPORT onEnableDisableAlarmReport;
} SECSListener;
@@ -106,6 +111,10 @@
// 取消/删除所有 define report
void deleteAllReport();
+ // 从文件中加载CVariable列表
+ int loadVarialbleList(const char* pszFilepath);
+
+
void setListener(SECSListener listener);
unsigned OnCimWork();
void OnTimer(UINT nTimerid);
@@ -142,6 +151,7 @@
inline void Lock() { EnterCriticalSection(&m_criticalSection); }
inline void Unlock() { LeaveCriticalSection(&m_criticalSection); }
int onRecvMsg(IMessage* pMessage);
+ void clearAllVariabel();
private:
CModel* m_pModel;
@@ -175,5 +185,8 @@
// VID to Report
std::map<unsigned int, VALUE> m_mapValue;
+
+ // CVariable vector
+ std::vector<SERVO::CVariable*> m_variabels;
};
--
Gitblit v1.9.3