| | |
| | | #include <functional> |
| | | #include <vector> |
| | | #include <map> |
| | | #include <set> |
| | | #include "CCollectionEvent.h" |
| | | |
| | | |
| | |
| | | #define ER_PARAM_ERROR -3 |
| | | #define ER_NO_EVENT -4 |
| | | #define ER_UNLINK_EVENT_REPORT -5 |
| | | #define ER_NO_PPID_LIST -6 |
| | | |
| | | |
| | | /* |
| | |
| | | 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; |
| | |
| | | DATETIMESYNC onDatetimeSync; |
| | | EDEVENTREPORT onEnableDisableEventReport; |
| | | EDALARMREPORT onEnableDisableAlarmReport; |
| | | QUERYPPIDLIST onQueryPPIDList; |
| | | } SECSListener; |
| | | |
| | | |
| | |
| | | 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开头的函数为主动发送数据的函数 */ |
| | |
| | | int replyLinkEventReport(IMessage* pRecv); |
| | | int replyEanbleDisableEventReport(IMessage* pRecv); |
| | | int replyCommand(IMessage* pRecv); |
| | | int replyConfigureSpooling(IMessage* pRecv); |
| | | int replyEanbleDisableAlarmReport(IMessage* pRecv); |
| | | int replyPurgeSpooledData(IMessage* pRecv); |
| | | int replyQueryPPIDList(IMessage* pRecv); |
| | | int replyTerminalDisplay(IMessage* pRecv); |
| | | |
| | |
| | | CRITICAL_SECTION m_criticalSection; |
| | | std::list<CHsmsAction*> m_listAction; |
| | | std::list<CHsmsAction*> m_listActionSent; |
| | | std::list<CHsmsAction*> m_listActionSpooling; |
| | | |
| | | private: |
| | | SECSListener m_listener; |
| | |
| | | HANDLE m_hCimWorkEvent; |
| | | HANDLE m_hCimWorkThreadHandle; |
| | | unsigned m_nCimWorkThrdaddr; |
| | | std::string m_strCacheFilepath; |
| | | CHsmsAction* m_pActiveAction; |
| | | |
| | | private: |
| | | // CVariable vector |
| | |
| | | |
| | | // CollectionEvent vector |
| | | std::vector<SERVO::CCollectionEvent*> m_collectionEvents; |
| | | |
| | | // Spooling Config |
| | | std::map<uint16_t, std::set<uint16_t>> m_spoolingConfig; |
| | | }; |
| | | |