HM-SPMS/product/src/gui/plugin/AlarmWidget/CAiAlarmDataCollect.h

85 lines
2.1 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef CAIALARMDATACOLLECT_H
#define CAIALARMDATACOLLECT_H
#include <QObject>
#include <QMutex>
#include <QThread>
#include <QMap>
#include <QTimer>
#include "IntelliAlmMsg.pb.h"
#include "CAiAlarmMsgInfo.h"
#include "net_msg_bus_api/MsgBusApi.h"
#include "dbms/rdb_api/CRdbAccess.h"
class CAiAlarmDataCollect : public QObject, public kbd_service::CIntelliAlmApi4Clt
{
Q_OBJECT
public:
static CAiAlarmDataCollect *instance();
virtual ~CAiAlarmDataCollect();
void refrence();
int getRefrenceCount();
bool isFaultRecallState();
virtual bool requestDelAlm(kbd_idlfile::SIntelliAlmDel &objDelAlm);
virtual bool requestSeprAlm(kbd_idlfile::SIntelliAlmSepr &objSeprAlm);
virtual bool requestMergeAlm(kbd_idlfile::SIntelliAlmMerge &objMergeAlm);
virtual void handleAllAlmMsg(int nDomainId,kbd_idlfile::SIntelliAlmAdd &objAllAlm);
virtual void handleAddAlmMsg(kbd_idlfile::SIntelliAlmAdd &objAddAlm);
virtual void handleDelAlmMsg(kbd_idlfile::SIntelliAlmDel &objDelAlm);
virtual void handleBrokenAlmMsg(kbd_idlfile::SIntelliAlmBroken &objBrokenAlm);
virtual void handleReleaseAlmMsg(kbd_idlfile::SIntelliAlmRelease &objReleaseAlm);
signals:
//< 启停定时器
void sigTimerShot(const bool bStop);
//< 定时更新通知model刷新界面
void sigUpdateAlarmView();
//< 通知所有告警插件禁用/使能告警操作
void sigAlarmOperateEnable(const bool &bEnable);
//< 通知model重新拉取告警消息
void sigMsgRefresh();
public slots:
void initialize();
void release();
void destory();
void slotTimerShot(const bool start);
void slotSwitchFaultRecallState(bool bFaultRecallState);
private:
CAiAlarmDataCollect();
int queryPriorityOrder(int &id);
private slots:
void slotAiAlarmStateChanged();
private:
int m_referenceCount;
bool m_bFaultRecallState;
QMutex *m_rtdbMutex;
QTimer * m_pAlternateTimer;
kbd_dbms::CRdbAccess * m_rtdbPriorityOrderAccess;
static CAiAlarmDataCollect * m_pInstance;
};
#endif // CAIALARMDATACOLLECT_H