1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- #ifndef _EVENTMANAGER_H_
- #define _EVENTMANAGER_H_
- #define YK 0 // 遥控
- #define BACK 1 // 恢复正常
- #define UPALARM 2 // 上限告警
- #define LOWALARM 3 // 下限告警
- #define ALARM 4 // 告警
- #define UPPER_LIMIT_ID 1000 // 上限告警
- #define LOWER_LIMIT_ID 1001 // 下限告警
- #define MAX_EQUIP_DESC 255
- static char* EVENTTYPE[] =
- {
- "遥控",
- "恢复正常",
- "上限告警",
- "下限告警",
- "告警",
- };
- class USCADADLLEXPORT CAlarmEvent: public CObject
- {
- public:
- CAlarmEvent();
- SYSTEMTIME time;
- CString strContent;
- CString strUid;
- int nVarID;
- double dbParaValue;
- int nUpperLimit;
- int nLowerLimit;
- int nNormalState;
- int nAlarmState;
- int nStatus;//0:报警 1:恢复正常
- int nAlarmIndex;//报警索引
- int nDealStatus;//处理状态 0:未处理 1:处理过时 2:不处理 3:确认
- int nGet;//0:没有从列表取出 1:已经取出
- int nIsSound;//0:没播放语音 1:已经播放过
- int nColor;//1:颜色变红 2:颜色恢复正常
- };
- typedef CTypedPtrList<CObList, CAlarmEvent*> CEventList;
- class USCADADLLEXPORT CEventServer
- {
- public:
- CEventServer();
- ~CEventServer();
- void AddNewEvent(CAlarmEvent* event);
- CAlarmEvent* GetNewEvent( );
- CAlarmEvent* GetUnconfirmEvent();
- void DeleteOneEvent( CString strUid, int nVarID,int nStatus );
- void DeleteOneEvent( int iIndex );
- void ClearAllEvent();
- void Validate(bool valid);
- void GetOneEventInfo( int iIndex,CString &strUid, int &nVarID, int &nStatus,int &nAlarmIndex,int &nIsSound,int &nColor );
- void SetOneEventInfo( int iIndex,int nIsSound,int nColor );
- void AddAlarmEvent( CString strDevUid, int nVarID,int nStatus,CString strContent,double dbParaValue, int nUpperLimit,int nLowerLimit, int nNormalState,int nAlarmState,int nAlarmIndex );
- CAlarmEvent* GetUnconfirmEventForLoopPlaySound( CAlarmEvent *pEvent );
- public:
- CEventList eventList;
- bool m_bValid;
- private:
- CRITICAL_SECTION m_cs;
- };
- #endif
|