From f56051fa3102feb35ea60650ebda80f49e62d025 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期二, 05 八月 2025 14:54:24 +0800
Subject: [PATCH] 1. SGMeasurement实现规划的地址 2. 优化读取位时输入的地址不是8的倍数的问题 3. 添加读写心跳的功能

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

diff --git a/SourceCode/Bond/Servo/HsmsPassive.h b/SourceCode/Bond/Servo/HsmsPassive.h
index 84644a5..64bccc0 100644
--- a/SourceCode/Bond/Servo/HsmsPassive.h
+++ b/SourceCode/Bond/Servo/HsmsPassive.h
@@ -22,6 +22,7 @@
 #define ER_PARAM_ERROR			-3
 #define ER_NO_EVENT				-4
 #define ER_UNLINK_EVENT_REPORT	-5
+#define ER_NO_PPID_LIST			-6
 
 
 /*
@@ -67,6 +68,7 @@
 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 std::function<std::vector<std::string> (void* pFrom)> QUERYPPIDLIST;
 typedef struct _SECSListener
 {
 	SECSEQOFFLINE				onEQOffLine;
@@ -77,6 +79,7 @@
 	DATETIMESYNC				onDatetimeSync;
 	EDEVENTREPORT				onEnableDisableEventReport;
 	EDALARMREPORT				onEnableDisableAlarmReport;
+	QUERYPPIDLIST				onQueryPPIDList;
 } SECSListener;
 
 
@@ -142,7 +145,11 @@
 	void OnTimer(UINT nTimerid);
 	void setActionTimeout(int nSecond);
 	int init(CModel* pModel, const char* pszName, unsigned int port);
+	int loadCacheFromFile(const char* pszFilepath);
+	int saveCache();
 	int term();
+	int serialize(char* pszBuffer, int nBufferSize);
+	int unserialize(const char* pszBuffer, int nBufferSize);
 
 public:
 	/* request开头的函数为主动发送数据的函数 */
@@ -167,6 +174,7 @@
 	int replyCommand(IMessage* pRecv);
 	int replyConfigureSpooling(IMessage* pRecv);
 	int replyEanbleDisableAlarmReport(IMessage* pRecv);
+	int replyPurgeSpooledData(IMessage* pRecv);
 	int replyQueryPPIDList(IMessage* pRecv);
 	int replyTerminalDisplay(IMessage* pRecv);
 
@@ -189,6 +197,7 @@
 	CRITICAL_SECTION m_criticalSection;
 	std::list<CHsmsAction*> m_listAction;
 	std::list<CHsmsAction*> m_listActionSent;
+	std::list<CHsmsAction*> m_listActionSpooling;
 
 private:
 	SECSListener m_listener;
@@ -196,6 +205,8 @@
 	HANDLE m_hCimWorkEvent;
 	HANDLE m_hCimWorkThreadHandle;
 	unsigned m_nCimWorkThrdaddr;
+	std::string m_strCacheFilepath;
+	CHsmsAction* m_pActiveAction;
 
 private:
 	// CVariable vector

--
Gitblit v1.9.3