2025-03-14 17:05:48 +08:00
|
|
|
|
#ifndef ALARMMSGINFO_H
|
|
|
|
|
|
#define ALARMMSGINFO_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <QMetaType>
|
|
|
|
|
|
#include <QStringList>
|
|
|
|
|
|
#include <QSharedPointer>
|
|
|
|
|
|
#include "alarm_server_api/CAlmApiForAlmClt.h"
|
|
|
|
|
|
#include "CAlarmCommon.h"
|
|
|
|
|
|
//< 告警操作 权限定义
|
|
|
|
|
|
#define FUNC_SPE_ALARM_OPERATE ("FUNC_SPE_ALARM_OPERATE")
|
|
|
|
|
|
#define FUNC_SPE_ALARM_DELETE ("FUNC_SPE_ALARM_DELETE")
|
|
|
|
|
|
// 逻辑状态
|
|
|
|
|
|
enum E_ALARM_LOGICSTATE
|
|
|
|
|
|
{
|
|
|
|
|
|
E_ALS_ALARM = 0, // 告警状态
|
|
|
|
|
|
E_ALS_ALARM_CFM =1, // 告警确认状态
|
|
|
|
|
|
E_ALS_RETURN=2, // 告警返回状态
|
|
|
|
|
|
E_ALS_RETURN_CFM=3, // 告警返回确认状态
|
|
|
|
|
|
ALS_EVT_ONLY = 4, // 仅事件
|
|
|
|
|
|
|
|
|
|
|
|
//在原始告警窗删除后,可能还需要在智能告警窗展示
|
|
|
|
|
|
E_ALS_ALARM_DEL = 20, // 告警状态,且在原始告警窗已删除,可能是达到数量上限而删除
|
|
|
|
|
|
E_ALS_ALARM_CFM_DEL =21, // 告警确认状态,且在原始告警窗已删除
|
|
|
|
|
|
E_ALS_RETURN_DEL=22, // 告警返回状态,且在原始告警窗已删除,可能是达到数量上限而删除
|
|
|
|
|
|
E_ALS_RETURN_CFM_DEL=23, // 告警返回确认状态,且在原始告警窗已删除
|
|
|
|
|
|
E_ALS_BAD = 100
|
|
|
|
|
|
};
|
|
|
|
|
|
class CAlarmMsgInfo
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
CAlarmMsgInfo();
|
|
|
|
|
|
CAlarmMsgInfo(const CAlarmMsgInfo &other);
|
2025-03-17 09:23:17 +08:00
|
|
|
|
void initialize(const iot_idl::SAlmInfoToAlmClt &alarmInfo);
|
2025-03-14 17:05:48 +08:00
|
|
|
|
int getCameraInfoByTag(const QString &tag);
|
|
|
|
|
|
|
|
|
|
|
|
//< [优先级越小表示越大]-原始告警窗调用
|
|
|
|
|
|
bool lessThan(const AlarmMsgPtr &info, E_ALARM_SORTKEY sortkey = E_SORT_PRIORITY);
|
|
|
|
|
|
bool moreThan(const AlarmMsgPtr &info, E_ALARM_SORTKEY sortkey = E_SORT_PRIORITY);
|
|
|
|
|
|
|
|
|
|
|
|
//< [优先级越小表示越大]-智能告警窗调用
|
|
|
|
|
|
bool ailessThan(const AlarmMsgPtr &info, E_ALARM_SORTKEY sortkey = E_SORT_PRIORITY);
|
|
|
|
|
|
bool aimoreThan(const AlarmMsgPtr &info, E_ALARM_SORTKEY sortkey = E_SORT_PRIORITY);
|
|
|
|
|
|
|
|
|
|
|
|
bool ailessThan(const AiAlarmMsgPtr &info, E_ALARM_SORTKEY sortkey = E_SORT_PRIORITY);
|
|
|
|
|
|
bool aimoreThan(const AiAlarmMsgPtr &info, E_ALARM_SORTKEY sortkey = E_SORT_PRIORITY);
|
|
|
|
|
|
qint32 alm_type; //< 告警类型
|
|
|
|
|
|
int alm_status; //< 告警状态
|
|
|
|
|
|
E_ALARM_LOGICSTATE logic_state; //< 逻辑状态
|
|
|
|
|
|
quint64 time_stamp; //< 时标(RFC1305、POSIX时标标准)
|
|
|
|
|
|
qint32 domain_id; //< 域ID
|
|
|
|
|
|
qint32 location_id; //< 位置ID
|
|
|
|
|
|
qint32 app_id; //< 应用号
|
|
|
|
|
|
qint32 priority; //< 告警优先级id
|
|
|
|
|
|
qint32 if_water_alm; //< 是否流水账告警(0 替换式告警,1 流水账告警)
|
|
|
|
|
|
QString uuid_base64; //< uuid 主键
|
|
|
|
|
|
QString content; //< 告警内容
|
|
|
|
|
|
QStringList sound_file; //< 语音文件名
|
|
|
|
|
|
//可选
|
|
|
|
|
|
qint32 sub_system; //< 专业
|
|
|
|
|
|
qint32 dev_type; //< 设备类型ID
|
|
|
|
|
|
qint32 region_id; //< 责任区ID
|
|
|
|
|
|
QString dev_group_tag; //< 设备组
|
|
|
|
|
|
QString key_id_tag; //< 测点ID
|
|
|
|
|
|
QString graph_name; //< 告警关联画面名称
|
|
|
|
|
|
QString wave_file; //< 录波画面
|
|
|
|
|
|
//< Extend
|
|
|
|
|
|
qint32 priorityOrder; //< 优先级
|
|
|
|
|
|
QString device; //< 设备 (保留)
|
|
|
|
|
|
bool deleteFlag; //< 是否被删除
|
|
|
|
|
|
bool releaseFlag; //< 释放标志
|
|
|
|
|
|
bool m_needVideoAlm; //< 是否需要视频告警
|
|
|
|
|
|
QString m_camera;
|
|
|
|
|
|
QString m_preset;
|
|
|
|
|
|
E_TAGNAME_TYPE m_tagname_type;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//程序使用
|
|
|
|
|
|
int m_playNum; // 播放次数 默认0次
|
|
|
|
|
|
int m_alarmAction; //此告警对应的告警动作
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
bool operator==(const CAlarmMsgInfo &source, const CAlarmMsgInfo &target);
|
|
|
|
|
|
|
|
|
|
|
|
Q_DECLARE_METATYPE(CAlarmMsgInfo)
|
|
|
|
|
|
Q_DECLARE_METATYPE(AlarmMsgPtr)
|
|
|
|
|
|
|
|
|
|
|
|
#endif // ALARMMSGINFO_H
|