[ref]同步711 711更新

This commit is contained in:
shi_jq 2025-03-17 16:53:15 +08:00
parent 8bef23a354
commit 7a7a833210
76 changed files with 792 additions and 601 deletions

View File

@ -1,4 +1,4 @@
#include "CAccidentReviewDialog.h" #include "CAccidentReviewDialog.h"
#include "public/pub_utility_api/FileUtil.h" #include "public/pub_utility_api/FileUtil.h"
#include "public/pub_logger_api/logger.h" #include "public/pub_logger_api/logger.h"
#include <QTreeWidget> #include <QTreeWidget>

View File

@ -1,4 +1,4 @@
#ifndef CACCIDENTREVIEWDIALOG_H #ifndef CACCIDENTREVIEWDIALOG_H
#define CACCIDENTREVIEWDIALOG_H #define CACCIDENTREVIEWDIALOG_H
#include <QObject> #include <QObject>

View File

@ -1,4 +1,4 @@
#include "CAiAlarmDataCollect.h" #include "CAiAlarmDataCollect.h"
#include "pub_logger_api/logger.h" #include "pub_logger_api/logger.h"
#include "CAlarmMsgManage.h" #include "CAlarmMsgManage.h"
#include <QDebug> #include <QDebug>

View File

@ -1,4 +1,4 @@
#ifndef CAIALARMDATACOLLECT_H #ifndef CAIALARMDATACOLLECT_H
#define CAIALARMDATACOLLECT_H #define CAIALARMDATACOLLECT_H
#include <QObject> #include <QObject>

View File

@ -1,4 +1,4 @@
#include "CAiAlarmDelegate.h" #include "CAiAlarmDelegate.h"
#include <QFile> #include <QFile>
#include "pub_utility_api/FileUtil.h" #include "pub_utility_api/FileUtil.h"
#include "pub_utility_api/FileStyle.h" #include "pub_utility_api/FileStyle.h"

View File

@ -1,4 +1,4 @@
#ifndef CAIALARMDELEGATE_H #ifndef CAIALARMDELEGATE_H
#define CAIALARMDELEGATE_H #define CAIALARMDELEGATE_H
#include <QObject> #include <QObject>

View File

@ -1,4 +1,4 @@
#include "CAiAlarmMsgInfo.h" #include "CAiAlarmMsgInfo.h"
#include <QDateTime> #include <QDateTime>
#include "CAlarmDataCollect.h" #include "CAlarmDataCollect.h"
#include <QDebug> #include <QDebug>

View File

@ -1,4 +1,4 @@
#ifndef CAIALARMMSGINFO_H #ifndef CAIALARMMSGINFO_H
#define CAIALARMMSGINFO_H #define CAIALARMMSGINFO_H

View File

@ -1,4 +1,4 @@
#include "CAiAlarmTreeItem.h" #include "CAiAlarmTreeItem.h"
#include "CAiAlarmMsgInfo.h" #include "CAiAlarmMsgInfo.h"
#include "CAlarmMsgInfo.h" #include "CAlarmMsgInfo.h"
#include "CAlarmCommon.h" #include "CAlarmCommon.h"

View File

@ -1,4 +1,4 @@
#ifndef CAIALARMTREEITEM_H #ifndef CAIALARMTREEITEM_H
#define CAIALARMTREEITEM_H #define CAIALARMTREEITEM_H
#include <QVector> #include <QVector>

View File

@ -1,4 +1,4 @@
#include "CAiAlarmTreeModel.h" #include "CAiAlarmTreeModel.h"
#include "CAlarmMsgManage.h" #include "CAlarmMsgManage.h"
#include "CAiAlarmDataCollect.h" #include "CAiAlarmDataCollect.h"
#include "CAlarmDataCollect.h" #include "CAlarmDataCollect.h"

View File

@ -1,4 +1,4 @@
#ifndef CAIALARMTREEMODEL_H #ifndef CAIALARMTREEMODEL_H
#define CAIALARMTREEMODEL_H #define CAIALARMTREEMODEL_H
#include <QAbstractItemModel> #include <QAbstractItemModel>

View File

@ -1,4 +1,4 @@
#include "CAiAlarmTreeView.h" #include "CAiAlarmTreeView.h"
#include <QHeaderView> #include <QHeaderView>
#include <QScrollBar> #include <QScrollBar>
#include <QStyleFactory> #include <QStyleFactory>

View File

@ -1,4 +1,4 @@
#ifndef CAIALARMTREEVIEW_H #ifndef CAIALARMTREEVIEW_H
#define CAIALARMTREEVIEW_H #define CAIALARMTREEVIEW_H
#include <QTreeView> #include <QTreeView>

View File

@ -1,8 +1,20 @@
#include "CAlarmBaseData.h" #include "CAlarmBaseData.h"
#include "perm_mng_api/PermMngApi.h" #include "perm_mng_api/PermMngApi.h"
#include "CAlarmCommon.h" #include "CAlarmCommon.h"
#include "pub_logger_api/logger.h" #include "pub_logger_api/logger.h"
//< 屏蔽xml_parser编译告警
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
#include "boost/property_tree/xml_parser.hpp" #include "boost/property_tree/xml_parser.hpp"
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#include "boost/typeof/typeof.hpp" #include "boost/typeof/typeof.hpp"
#include "boost/filesystem.hpp" #include "boost/filesystem.hpp"
#include "pub_utility_api/FileUtil.h" #include "pub_utility_api/FileUtil.h"
@ -139,7 +151,7 @@ int CAlarmBaseData::queryDomainIdByLocId(int loactionId)
if(m_ptrSysInfo) if(m_ptrSysInfo)
{ {
SLocationInfo stLocationInfo; SLocationInfo stLocationInfo;
if(kbdSuccess == m_ptrSysInfo->getLocationInfoById(loactionId, stLocationInfo)) if(iotSuccess == m_ptrSysInfo->getLocationInfoById(loactionId, stLocationInfo))
{ {
return stLocationInfo.nDomainId; return stLocationInfo.nDomainId;
} }
@ -154,7 +166,7 @@ bool CAlarmBaseData::queryAllPointDevGroup(int nDomainId, int nSubsystemId, cons
return false; return false;
} }
SAppInfo stAppInfo; SAppInfo stAppInfo;
if(kbdSuccess != m_ptrSysInfo->getAppInfoBySubsystemId(nSubsystemId, stAppInfo)) if(iotSuccess != m_ptrSysInfo->getAppInfoBySubsystemId(nSubsystemId, stAppInfo))
{ {
LOGERROR("queryAllPointDevGroup 获取应用ID失败"); LOGERROR("queryAllPointDevGroup 获取应用ID失败");
return false; return false;

View File

@ -1,4 +1,4 @@
#ifndef CALARMBASEDATA_H #ifndef CALARMBASEDATA_H
#define CALARMBASEDATA_H #define CALARMBASEDATA_H
#include <QObject> #include <QObject>

View File

@ -1,4 +1,4 @@
#ifndef CALARMCOLORINFO_H #ifndef CALARMCOLORINFO_H
#define CALARMCOLORINFO_H #define CALARMCOLORINFO_H
#include <QColor> #include <QColor>

View File

@ -1,4 +1,4 @@
#include "CAlarmColorWidget.h" #include "CAlarmColorWidget.h"
#include "ui_CAlarmColorWidget.h" #include "ui_CAlarmColorWidget.h"
#include <QColorDialog> #include <QColorDialog>
#include "CAlarmSetMng.h" #include "CAlarmSetMng.h"

View File

@ -1,4 +1,4 @@
#ifndef CALARMCOLORWIDGET_H #ifndef CALARMCOLORWIDGET_H
#define CALARMCOLORWIDGET_H #define CALARMCOLORWIDGET_H
#include <QWidget> #include <QWidget>

View File

@ -1,4 +1,4 @@
#ifndef CALARMCOMMON_H #ifndef CALARMCOMMON_H
#define CALARMCOMMON_H #define CALARMCOMMON_H
#include <QSharedPointer> #include <QSharedPointer>

View File

@ -1,4 +1,4 @@
#include "CAlarmDataCollect.h" #include "CAlarmDataCollect.h"
#include <QDateTime> #include <QDateTime>
#include "pub_logger_api/logger.h" #include "pub_logger_api/logger.h"
#include "CAlarmMsgManage.h" #include "CAlarmMsgManage.h"

View File

@ -1,4 +1,4 @@
#ifndef CALARMDATACOLLECT_H #ifndef CALARMDATACOLLECT_H
#define CALARMDATACOLLECT_H #define CALARMDATACOLLECT_H
#include <QObject> #include <QObject>

View File

@ -1,4 +1,4 @@
#include <QFile> #include <QFile>
#include <QPainter> #include <QPainter>
#include <QDomDocument> #include <QDomDocument>
#include "CAlarmDelegate.h" #include "CAlarmDelegate.h"

View File

@ -1,4 +1,4 @@
#ifndef CALARMDELEGATE_H #ifndef CALARMDELEGATE_H
#define CALARMDELEGATE_H #define CALARMDELEGATE_H
#include <QStyledItemDelegate> #include <QStyledItemDelegate>

View File

@ -1,4 +1,4 @@
#include <QStringList> #include <QStringList>
#include "CAlarmDeviceTreeItem.h" #include "CAlarmDeviceTreeItem.h"
#include "pub_logger_api/logger.h" #include "pub_logger_api/logger.h"
#include "Common.h" #include "Common.h"

View File

@ -1,4 +1,4 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/

View File

@ -1,4 +1,4 @@
#include "CAlarmDeviceTreeItem.h" #include "CAlarmDeviceTreeItem.h"
#include "CAlarmDeviceTreeModel.h" #include "CAlarmDeviceTreeModel.h"
#include "CAlarmMsgManage.h" #include "CAlarmMsgManage.h"
#include "CAlarmBaseData.h" #include "CAlarmBaseData.h"
@ -37,6 +37,20 @@ void CAlarmDeviceTreeModel::setupModelData(const QMap<int, QVector<SDevGroupInfo
QModelIndex modelIndex = createIndex(nDevIndex, 0, device); QModelIndex modelIndex = createIndex(nDevIndex, 0, device);
m_devTagIndex.insert(vec.at(nDevIndex).tag_name, modelIndex); m_devTagIndex.insert(vec.at(nDevIndex).tag_name, modelIndex);
m_devNameIndex.insert(locDesc + "." + vec.at(nDevIndex).description, modelIndex); m_devNameIndex.insert(locDesc + "." + vec.at(nDevIndex).description, modelIndex);
if(nDevIndex == vec.size() - 1)
{
CAlarmDeviceTreeItem * sys_device = new CAlarmDeviceTreeItem(".系统", location);
sys_device->setData("", Qt::ItemDataRole(TagRole));
sys_device->setData(TYPE_DEVGROUP, Qt::ItemDataRole(TypeRole));
sys_device->setData(vec.at(nDevIndex).domain, Qt::ItemDataRole(DomainRole));
sys_device->setData(vec.at(nDevIndex).location, Qt::ItemDataRole(LocationRole));
sys_device->setData(vec.at(nDevIndex).sub_system, Qt::ItemDataRole(SubsystemRole));
sys_device->setData(vec.at(nDevIndex).region, Qt::ItemDataRole(RegionRole));
QModelIndex sys_modelIndex = createIndex(nDevIndex+1, 0, sys_device);
m_devTagIndex.insert("", sys_modelIndex);
m_devNameIndex.insert("", sys_modelIndex);
}
} }
} }
} }
@ -160,9 +174,11 @@ QVariant CAlarmDeviceTreeModel::data(const QModelIndex &index, int role) const
if (Qt::DisplayRole == role) if (Qt::DisplayRole == role)
{ {
const QString &deviceGroup = item->data(Qt::ItemDataRole(TagRole)).toString(); const QString &deviceGroup = item->data(Qt::ItemDataRole(TagRole)).toString();
if(deviceGroup.isEmpty()) int nType = item->data(Qt::ItemDataRole(TypeRole)).toInt();
if(deviceGroup.isEmpty() && nType == TYPE_LOCATION)
{ {
return item->data(Qt::DisplayRole).toString(); //区域后面不加数量
return item->data(Qt::DisplayRole).toString();
} }
return item->data(Qt::DisplayRole).toString() + QString(" [%1]").arg(m_alarmDeviceGroupStatistical.value(deviceGroup,0)); return item->data(Qt::DisplayRole).toString() + QString(" [%1]").arg(m_alarmDeviceGroupStatistical.value(deviceGroup,0));
} }

View File

@ -1,4 +1,4 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/

View File

@ -1,4 +1,4 @@
#include "CAlarmDeviceTreeView.h" #include "CAlarmDeviceTreeView.h"
#include "CAlarmDeviceTreeModel.h" #include "CAlarmDeviceTreeModel.h"
#include "CAlarmDeviceTreeItem.h" #include "CAlarmDeviceTreeItem.h"
#include <QMenu> #include <QMenu>
@ -10,6 +10,7 @@ CAlarmDeviceTreeView::CAlarmDeviceTreeView(QWidget *parent)
} }
/*
void CAlarmDeviceTreeView::contextMenuEvent(QContextMenuEvent *event) void CAlarmDeviceTreeView::contextMenuEvent(QContextMenuEvent *event)
{ {
CAlarmDeviceTreeModel * pModel = dynamic_cast<CAlarmDeviceTreeModel *>(model()); CAlarmDeviceTreeModel * pModel = dynamic_cast<CAlarmDeviceTreeModel *>(model());
@ -33,25 +34,26 @@ void CAlarmDeviceTreeView::contextMenuEvent(QContextMenuEvent *event)
} }
return; return;
} }
*/
//void CAlarmDeviceTreeView::contextMenuEvent(QContextMenuEvent *event) void CAlarmDeviceTreeView::contextMenuEvent(QContextMenuEvent *event)
//{ {
// CAlarmDeviceTreeModel * pModel = dynamic_cast<CAlarmDeviceTreeModel *>(model()); CAlarmDeviceTreeModel * pModel = dynamic_cast<CAlarmDeviceTreeModel *>(model());
// if(Q_NULLPTR != pModel) if(Q_NULLPTR != pModel)
// { {
// QMenu menu; QMenu menu;
// CAlarmDeviceTreeItem * pItem = static_cast<CAlarmDeviceTreeItem*>(indexAt(event->pos()).internalPointer()); CAlarmDeviceTreeItem * pItem = static_cast<CAlarmDeviceTreeItem*>(indexAt(event->pos()).internalPointer());
// if (Q_NULLPTR == pItem) if (Q_NULLPTR == pItem)
// { {
// menu.addAction(tr("全选"), [=](){ pModel->setAllDeviceCheckState(Qt::Checked); }); menu.addAction(tr("全选"), [=](){ pModel->setAllDeviceCheckState(Qt::Checked); });
// menu.addAction(tr("清空"), [=](){ pModel->setAllDeviceCheckState(Qt::Unchecked); }); menu.addAction(tr("清空"), [=](){ pModel->setAllDeviceCheckState(Qt::Unchecked); });
// } }
// else if (Q_NULLPTR != pItem && pItem->childCount() > 0) else if (Q_NULLPTR != pItem && pItem->childCount() > 0)
// { {
// menu.addAction(tr("选择"), [=](){ pModel->setDeviceCheckState(indexAt(event->pos()), Qt::Checked); }); menu.addAction(tr("选择"), [=](){ pModel->setDeviceCheckState(indexAt(event->pos()), Qt::Checked); });
// menu.addAction(tr("清除"), [=](){ pModel->setDeviceCheckState(indexAt(event->pos()), Qt::Unchecked); }); menu.addAction(tr("清除"), [=](){ pModel->setDeviceCheckState(indexAt(event->pos()), Qt::Unchecked); });
// } }
// menu.exec(event->globalPos()); menu.exec(event->globalPos());
// } }
// return; return;
//} }

View File

@ -1,4 +1,4 @@
#ifndef CALARMDEVICETREEVIEW_H #ifndef CALARMDEVICETREEVIEW_H
#define CALARMDEVICETREEVIEW_H #define CALARMDEVICETREEVIEW_H
#include <QTreeView> #include <QTreeView>

View File

@ -1,4 +1,4 @@
#include "CAlarmFilterDialog.h" #include "CAlarmFilterDialog.h"
#include "ui_CAlarmFilterDialog.h" #include "ui_CAlarmFilterDialog.h"
#include "public/pub_sysinfo_api/SysInfoApi.h" #include "public/pub_sysinfo_api/SysInfoApi.h"
#include "pub_utility_api/FileStyle.h" #include "pub_utility_api/FileStyle.h"

View File

@ -1,4 +1,4 @@
#ifndef CALARMFILTERDIALOG_H #ifndef CALARMFILTERDIALOG_H
#define CALARMFILTERDIALOG_H #define CALARMFILTERDIALOG_H
#include <QMap> #include <QMap>

View File

@ -6,13 +6,13 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>657</width> <width>1000</width>
<height>510</height> <height>546</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>530</width> <width>1000</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>

View File

@ -1,4 +1,4 @@
#include "CAlarmForm.h" #include "CAlarmForm.h"
#include <QMenu> #include <QMenu>
#include <QMessageBox> #include <QMessageBox>
#include <QFileDialog> #include <QFileDialog>
@ -38,6 +38,7 @@
#include "CAlarmBaseData.h" #include "CAlarmBaseData.h"
#include "CAlarmShiledDialog.h" #include "CAlarmShiledDialog.h"
#include "CAccidentReviewDialog.h" #include "CAccidentReviewDialog.h"
#include "pub_utility_api/FileStyle.h"
CAlarmForm::CAlarmForm(QWidget *parent) : CAlarmForm::CAlarmForm(QWidget *parent) :
QWidget(parent), QWidget(parent),
m_ptrSysInfo(Q_NULLPTR), m_ptrSysInfo(Q_NULLPTR),
@ -63,7 +64,7 @@ CAlarmForm::CAlarmForm(QWidget *parent) :
ui->alarmView->setObjectName("alarmView"); ui->alarmView->setObjectName("alarmView");
ui->splitter->setStretchFactor(0,1); ui->splitter->setStretchFactor(0,1);
ui->splitter->setStretchFactor(1,6); ui->splitter->setStretchFactor(1,6);
initStyle();
QHBoxLayout * pHBoxLayout = new QHBoxLayout(ui->deviceView->header()); QHBoxLayout * pHBoxLayout = new QHBoxLayout(ui->deviceView->header());
m_pSearchTextEdit = new QLineEdit(ui->deviceView->header()); m_pSearchTextEdit = new QLineEdit(ui->deviceView->header());
m_pSearchTextEdit->setObjectName("searchTextEdit"); m_pSearchTextEdit->setObjectName("searchTextEdit");
@ -132,6 +133,24 @@ CAlarmForm::CAlarmForm(QWidget *parent) :
m_thread->start(); m_thread->start();
} }
void CAlarmForm::initStyle(){
QString qss = QString();
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("alarmForm.qss") ;
QFile qssfile2(QString::fromStdString(strFullPath));
qssfile2.open(QFile::ReadOnly);
if (qssfile2.isOpen())
{
qss += QLatin1String(qssfile2.readAll());
qssfile2.close();
}
if(!qss.isEmpty())
{
setStyleSheet(qss);
}
}
CAlarmForm::~CAlarmForm() CAlarmForm::~CAlarmForm()
{ {
if(m_communicator != Q_NULLPTR) if(m_communicator != Q_NULLPTR)
@ -207,7 +226,7 @@ void CAlarmForm::initialize()
//< lingdaoyaoqiu //< lingdaoyaoqiu
{ {
QSettings columFlags("KBD_HMI", "alarm config"); QSettings columFlags("IOT_HMI", "alarm config");
if(!columFlags.contains(QString("alarm/colum_0"))) if(!columFlags.contains(QString("alarm/colum_0")))
{ {
columFlags.setValue(QString("alarm/colum_0"), false); //< 时间 columFlags.setValue(QString("alarm/colum_0"), false); //< 时间
@ -216,8 +235,8 @@ void CAlarmForm::initialize()
columFlags.setValue(QString("alarm/colum_3"), true); //< 责任区 columFlags.setValue(QString("alarm/colum_3"), true); //< 责任区
columFlags.setValue(QString("alarm/colum_4"), true); //< 告警类型 columFlags.setValue(QString("alarm/colum_4"), true); //< 告警类型
columFlags.setValue(QString("alarm/colum_5"), false); //< 告警状态 columFlags.setValue(QString("alarm/colum_5"), false); //< 告警状态
columFlags.setValue(QString("alarm/colum_6"), false); //< 确认状态 columFlags.setValue(QString("alarm/colum_6"), true); //< 确认状态
columFlags.setValue(QString("alarm/colum_7"), false); //< columFlags.setValue(QString("alarm/colum_7"), true); //<
} }
} }
ui->comboBox->setModel(m_pListWidget1->model()); ui->comboBox->setModel(m_pListWidget1->model());
@ -692,7 +711,8 @@ void CAlarmForm::setAlarmModel(CAlarmItemModel *model,CAiAlarmTreeModel *treeMod
connect(ui->alarmView->horizontalHeader(), SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), m_pModel, SLOT(sortColumn(int,Qt::SortOrder))); connect(ui->alarmView->horizontalHeader(), SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), m_pModel, SLOT(sortColumn(int,Qt::SortOrder)));
connect(ui->aiAlarmTreeView->header(),&QHeaderView::sortIndicatorChanged, m_treeModel,&CAiAlarmTreeModel::sortColumn); connect(ui->aiAlarmTreeView->header(),&QHeaderView::sortIndicatorChanged, m_treeModel,&CAiAlarmTreeModel::sortColumn);
connect(ui->aiAlarmTreeView,&CAiAlarmTreeView::doubleClicked, this,&CAlarmForm::aiAlmDoubleClicked); //先注释掉,想启用的话可以通过脚本绑定
//connect(ui->aiAlarmTreeView,&CAiAlarmTreeView::doubleClicked, this,&CAlarmForm::aiAlmDoubleClicked);
ui->confirm->setEnabled(true); ui->confirm->setEnabled(true);
ui->remove->setEnabled(true); ui->remove->setEnabled(true);
//原始告警窗 //原始告警窗
@ -703,7 +723,7 @@ void CAlarmForm::setAlarmModel(CAlarmItemModel *model,CAiAlarmTreeModel *treeMod
ui->alarmView->setColumnWidth(5, 150); ui->alarmView->setColumnWidth(5, 150);
ui->alarmView->setColumnWidth(6, 120); ui->alarmView->setColumnWidth(6, 120);
QSettings columFlags("KBD_HMI", "alarm config"); QSettings columFlags("IOT_HMI", "alarm config");
for(int nColumnIndex(0); nColumnIndex < m_pModel->columnCount() - 1; nColumnIndex++) for(int nColumnIndex(0); nColumnIndex < m_pModel->columnCount() - 1; nColumnIndex++)
{ {
bool visible = columFlags.value(QString("alarm/colum_%1").arg(nColumnIndex)).toBool(); bool visible = columFlags.value(QString("alarm/colum_%1").arg(nColumnIndex)).toBool();
@ -761,7 +781,7 @@ void CAlarmForm::setAlarmModel(CAlarmItemModel *model)
ui->alarmView->setColumnWidth(6, 120); ui->alarmView->setColumnWidth(6, 120);
QSettings columFlags("KBD_HMI", "alarm config"); QSettings columFlags("IOT_HMI", "alarm config");
for(int nColumnIndex(0); nColumnIndex < m_pModel->columnCount() - 1; nColumnIndex++) for(int nColumnIndex(0); nColumnIndex < m_pModel->columnCount() - 1; nColumnIndex++)
{ {
bool visible = columFlags.value(QString("alarm/colum_%1").arg(nColumnIndex)).toBool(); bool visible = columFlags.value(QString("alarm/colum_%1").arg(nColumnIndex)).toBool();
@ -774,6 +794,7 @@ void CAlarmForm::setAlarmModel(CAlarmItemModel *model)
{ {
connect(m_pDeviceModel, &CAlarmDeviceTreeModel::itemCheckStateChanged, this, &CAlarmForm::deviceGroupFilterChanged); connect(m_pDeviceModel, &CAlarmDeviceTreeModel::itemCheckStateChanged, this, &CAlarmForm::deviceGroupFilterChanged);
connect(m_pDeviceModel, &CAlarmDeviceTreeModel::inhibitDevGroupAlm, this, &CAlarmForm::slotInhibitDevGroupAlm); connect(m_pDeviceModel, &CAlarmDeviceTreeModel::inhibitDevGroupAlm, this, &CAlarmForm::slotInhibitDevGroupAlm);
connect(CAlarmDataCollect::instance(),&CAlarmDataCollect::sigDevTreeUpdate,m_pDeviceModel,&CAlarmDeviceTreeModel::slotDevTreeUpdate);
} }
initFilter(); initFilter();
} }
@ -1337,7 +1358,7 @@ void CAlarmForm::contextMenuStack0Event(QContextMenuEvent *event)
connect(action, &QAction::triggered, [=](){ connect(action, &QAction::triggered, [=](){
ui->alarmView->setColumnHidden(nColumnIndex, !action->isChecked()); ui->alarmView->setColumnHidden(nColumnIndex, !action->isChecked());
ui->aiAlarmTreeView->setColumnHidden(nColumnIndex, !action->isChecked()); ui->aiAlarmTreeView->setColumnHidden(nColumnIndex, !action->isChecked());
QSettings columFlags("KBD_HMI", "alarm config"); QSettings columFlags("IOT_HMI", "alarm config");
columFlags.setValue(QString("alarm/colum_%1").arg(nColumnIndex), !action->isChecked()); columFlags.setValue(QString("alarm/colum_%1").arg(nColumnIndex), !action->isChecked());
}); });
} }
@ -1460,7 +1481,7 @@ void CAlarmForm::contextMenuStack1Event(QContextMenuEvent *event)
connect(action, &QAction::triggered, [=](){ connect(action, &QAction::triggered, [=](){
ui->alarmView->setColumnHidden(nColumnIndex, !action->isChecked()); ui->alarmView->setColumnHidden(nColumnIndex, !action->isChecked());
ui->aiAlarmTreeView->setColumnHidden(nColumnIndex, !action->isChecked()); ui->aiAlarmTreeView->setColumnHidden(nColumnIndex, !action->isChecked());
QSettings columFlags("KBD_HMI", "alarm config"); QSettings columFlags("IOT_HMI", "alarm config");
columFlags.setValue(QString("alarm/colum_%1").arg(nColumnIndex), !action->isChecked()); columFlags.setValue(QString("alarm/colum_%1").arg(nColumnIndex), !action->isChecked());
}); });
} }
@ -2902,17 +2923,15 @@ void CAlarmForm::inhibitAlm(const AlarmMsgPtr &alm)
msg.setSubject(alm->sub_system, CH_HMI_TO_OPT_OPTCMD_DOWN); msg.setSubject(alm->sub_system, CH_HMI_TO_OPT_OPTCMD_DOWN);
SOptTagSet sOptTagSet; SOptTagSet sOptTagSet;
SOptTagQueue optTagQueue; SOptTagQueue optTagQueue;
COptTagSet cOptTagSet;
if(createReqHead(sOptTagSet.stHead,alm)!= kbdSuccess) if(createReqHead(sOptTagSet.stHead,alm)!= iotSuccess)
{ {
return ; return ;
} }
QString keyIdTag = alm->key_id_tag; QString keyIdTag = alm->key_id_tag;
if(keyIdTag.endsWith(".value")) if(keyIdTag.endsWith(".value"))
{ {
//禁止告警和实时数据代码一致,要不实时数据 插件取消告警会失败; keyIdTag.replace(QString(".value"),QString(".status"));
// keyIdTag.replace(QString(".value"),QString(".status"));
}else }else
{ {
return ; return ;
@ -2927,7 +2946,7 @@ void CAlarmForm::inhibitAlm(const AlarmMsgPtr &alm)
optTagQueue.nSubSystem = alm->sub_system; optTagQueue.nSubSystem = alm->sub_system;
sOptTagSet.vecTagQueue.push_back(optTagQueue); sOptTagSet.vecTagQueue.push_back(optTagQueue);
std::string content = cOptTagSet.generate(sOptTagSet); std::string content = COptTagSet::generate(sOptTagSet);
msg.setMsgType(MT_OPT_PINHIBIT_ALARM); msg.setMsgType(MT_OPT_PINHIBIT_ALARM);
@ -2998,7 +3017,7 @@ int CAlarmForm::createReqHead(SOptReqHead &head, const AlarmMsgPtr &alm)
if(!createSysInfoInstance(m_ptrSysInfo)) if(!createSysInfoInstance(m_ptrSysInfo))
{ {
LOGERROR("创建系统信息访问库实例失败!"); LOGERROR("创建系统信息访问库实例失败!");
return kbdFailed; return iotFailed;
} }
} }
@ -3014,13 +3033,13 @@ int CAlarmForm::createReqHead(SOptReqHead &head, const AlarmMsgPtr &alm)
if(permMng->PermDllInit() != PERM_NORMAL) if(permMng->PermDllInit() != PERM_NORMAL)
{ {
LOGERROR("权限接口初始化失败!"); LOGERROR("权限接口初始化失败!");
return kbdFailed; return iotFailed;
}else }else
{ {
if(PERM_NORMAL != permMng->CurUser(userID, usergID, level, loginSec, instanceName)) if(PERM_NORMAL != permMng->CurUser(userID, usergID, level, loginSec, instanceName))
{ {
userID = -1; userID = -1;
return kbdFailed; return iotFailed;
} }
} }
} }
@ -3044,7 +3063,7 @@ int CAlarmForm::createReqHead(SOptReqHead &head, const AlarmMsgPtr &alm)
head.nUserGroupID = usergID; head.nUserGroupID = usergID;
head.nOptTime = QDateTime::currentDateTime().toMSecsSinceEpoch(); head.nOptTime = QDateTime::currentDateTime().toMSecsSinceEpoch();
return kbdSuccess; return iotSuccess;
} }
void CAlarmForm::reloadDevTree() void CAlarmForm::reloadDevTree()

View File

@ -1,4 +1,4 @@
#ifndef CALARMFORM_H #ifndef CALARMFORM_H
#define CALARMFORM_H #define CALARMFORM_H
#include <QWidget> #include <QWidget>
@ -49,7 +49,7 @@ public:
void initialize(); void initialize();
void init(); void init();
void initStyle();
void setAlarmModel(CAlarmItemModel * model, CAiAlarmTreeModel *treeModel); void setAlarmModel(CAlarmItemModel * model, CAiAlarmTreeModel *treeModel);
void setAlarmModel(CAlarmItemModel * model); void setAlarmModel(CAlarmItemModel * model);

View File

@ -40,25 +40,55 @@
<property name="lineWidth"> <property name="lineWidth">
<number>0</number> <number>0</number>
</property> </property>
<layout class="QGridLayout" name="gridLayout_4"> <layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="bottomMargin"> <property name="rightMargin">
<number>9</number> <number>9</number>
</property> </property>
<property name="verticalSpacing"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item row="0" column="0"> <property name="horizontalSpacing">
<widget class="QFrame" name="frame_2"> <number>0</number>
</property>
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="3" column="0">
<widget class="QFrame" name="frame_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>40</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::StyledPanel</enum> <enum>QFrame::StyledPanel</enum>
</property> </property>
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
@ -66,414 +96,141 @@
<number>0</number> <number>0</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>9</number> <number>0</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="verticalSpacing"> <item>
<number>0</number> <layout class="QHBoxLayout" name="horizontalLayout_3">
</property> <property name="leftMargin">
<item row="0" column="0"> <number>0</number>
<layout class="QHBoxLayout" name="horizontalLayout"> </property>
<property name="spacing"> <property name="bottomMargin">
<number>6</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QPushButton" name="inhibit"> <widget class="QLabel" name="label">
<property name="text">
<string>当前显示数量:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="showRow">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>55</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="maximumSize">
<size>
<width>100</width>
<height>26</height>
</size>
</property>
<property name="text"> <property name="text">
<string>禁止列表</string> <string>0</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="filter"> <widget class="QLabel" name="label_2">
<property name="sizePolicy"> <property name="text">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <string>过滤告警数量:</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
</widget>
</item>
<item>
<widget class="QLabel" name="filterRow">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>45</width> <width>55</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="maximumSize">
<size>
<width>45</width>
<height>26</height>
</size>
</property>
<property name="text"> <property name="text">
<string>过滤</string> <string>0</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="print">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>45</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>45</width>
<height>26</height>
</size>
</property>
<property name="text">
<string>导出</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>26</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string>优先级:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox">
<property name="minimumSize">
<size>
<width>125</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>26</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>26</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string>位置:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_2">
<property name="minimumSize">
<size>
<width>113</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>26</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>26</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string>告警状态:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_3">
<property name="minimumSize">
<size>
<width>138</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>26</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>26</height>
</size>
</property>
<property name="text">
<string>时间:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>26</height>
</size>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="horizontalSpacing">
<number>2</number>
</property>
<property name="verticalSpacing">
<number>3</number>
</property>
<item row="0" column="1">
<widget class="QLabel" name="showRow">
<property name="minimumSize">
<size>
<width>55</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>过滤告警数量:</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>当前显示数量:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="filterRow">
<property name="minimumSize">
<size>
<width>55</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="checkBox">
<property name="minimumSize">
<size>
<width>80</width>
<height>26</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>26</height>
</size>
</property>
<property name="text">
<string>智能告警</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>13</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="confirm">
<property name="enabled">
<bool>false</bool>
</property>
<property name="maximumSize">
<size>
<width>45</width>
<height>26</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>确认</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="remove">
<property name="enabled">
<bool>false</bool>
</property>
<property name="maximumSize">
<size>
<width>45</width>
<height>26</height>
</size>
</property>
<property name="text">
<string>删除</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="inhiAlarm">
<property name="minimumSize">
<size>
<width>45</width>
<height>26</height>
</size>
</property>
<property name="text">
<string>禁止告警</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="set">
<property name="maximumSize">
<size>
<width>45</width>
<height>26</height>
</size>
</property>
<property name="text">
<string>设置</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="closeBtn">
<property name="maximumSize">
<size>
<width>45</width>
<height>26</height>
</size>
</property>
<property name="text">
<string>关闭</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item>
<widget class="QCheckBox" name="checkBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>26</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>1000</width>
<height>26</height>
</size>
</property>
<property name="text">
<string>智能告警</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>800</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="set">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>26</height>
</size>
</property>
<property name="text">
<string>设置</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="closeBtn">
<property name="maximumSize">
<size>
<width>60</width>
<height>26</height>
</size>
</property>
<property name="text">
<string>关闭</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="2" column="0">
<widget class="QSplitter" name="splitter"> <widget class="QSplitter" name="splitter">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
@ -503,7 +260,7 @@
</widget> </widget>
<widget class="QStackedWidget" name="stackedWidget"> <widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="page"> <widget class="QWidget" name="page">
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
@ -522,7 +279,7 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item row="0" column="0"> <item row="1" column="0">
<widget class="CAlarmView" name="alarmView"> <widget class="CAlarmView" name="alarmView">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
@ -578,6 +335,332 @@
</widget> </widget>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item row="0" column="11">
<widget class="QPushButton" name="inhibit">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>26</height>
</size>
</property>
<property name="text">
<string>禁止列表</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>26</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string>优先级:</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_4">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>26</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string>位置:</string>
</property>
</widget>
</item>
<item row="0" column="10">
<widget class="QPushButton" name="filter">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>65</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>65</width>
<height>26</height>
</size>
</property>
<property name="text">
<string>过滤</string>
</property>
</widget>
</item>
<item row="0" column="12">
<widget class="QPushButton" name="print">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>65</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>65</width>
<height>26</height>
</size>
</property>
<property name="text">
<string>导出</string>
</property>
</widget>
</item>
<item row="0" column="13">
<widget class="QPushButton" name="remove">
<property name="enabled">
<bool>false</bool>
</property>
<property name="maximumSize">
<size>
<width>65</width>
<height>26</height>
</size>
</property>
<property name="text">
<string>删除</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QComboBox" name="comboBox_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>1000</width>
<height>26</height>
</size>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>26</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>1000</width>
<height>26</height>
</size>
</property>
</widget>
</item>
<item row="0" column="15">
<widget class="QPushButton" name="inhiAlarm">
<property name="minimumSize">
<size>
<width>45</width>
<height>26</height>
</size>
</property>
<property name="text">
<string>禁止告警</string>
</property>
</widget>
</item>
<item row="0" column="14">
<widget class="QPushButton" name="confirm">
<property name="enabled">
<bool>false</bool>
</property>
<property name="maximumSize">
<size>
<width>65</width>
<height>26</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>确认</string>
</property>
</widget>
</item>
<item row="0" column="9">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>200</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_6">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>26</height>
</size>
</property>
<property name="text">
<string>时间:</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_5">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>26</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string>告警状态:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>26</height>
</size>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QComboBox" name="comboBox_3">
<property name="minimumSize">
<size>
<width>250</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>26</height>
</size>
</property>
</widget>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>

View File

@ -1,4 +1,4 @@
#include "CAlarmInhibitDialog.h" #include "CAlarmInhibitDialog.h"
#include "ui_CAlarmInhibitDialog.h" #include "ui_CAlarmInhibitDialog.h"
#include <QDateTime> #include <QDateTime>
#include <QFile> #include <QFile>

View File

@ -1,4 +1,4 @@
#ifndef CALARMINHIBITDIALOG_H #ifndef CALARMINHIBITDIALOG_H
#define CALARMINHIBITDIALOG_H #define CALARMINHIBITDIALOG_H
#include <QMap> #include <QMap>

View File

@ -1,4 +1,4 @@
#include "CAlarmItemModel.h" #include "CAlarmItemModel.h"
#include "CAlarmMsgInfo.h" #include "CAlarmMsgInfo.h"
#include <QModelIndex> #include <QModelIndex>
#include <QHeaderView> #include <QHeaderView>
@ -8,7 +8,19 @@
#include "CAlarmMsgManage.h" #include "CAlarmMsgManage.h"
#include "perm_mng_api/PermMngApi.h" #include "perm_mng_api/PermMngApi.h"
#include <QDebug> #include <QDebug>
//< 屏蔽xml_parser编译告警
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
#include "boost/property_tree/xml_parser.hpp" #include "boost/property_tree/xml_parser.hpp"
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#include "boost/typeof/typeof.hpp" #include "boost/typeof/typeof.hpp"
#include "boost/filesystem.hpp" #include "boost/filesystem.hpp"
#include "Common.h" #include "Common.h"
@ -351,11 +363,11 @@ void CAlarmItemModel::sortColumn(int column, Qt::SortOrder order)
{ {
if(order == Qt::AscendingOrder) if(order == Qt::AscendingOrder)
{ {
m_order = Qt::DescendingOrder; m_order = Qt::AscendingOrder;
} }
else else
{ {
m_order = Qt::AscendingOrder; m_order = Qt::DescendingOrder;
} }
m_sortKey = (E_ALARM_SORTKEY)column; m_sortKey = (E_ALARM_SORTKEY)column;
beginResetModel(); beginResetModel();

View File

@ -1,4 +1,4 @@
#ifndef CALARMITEMMODEL_H #ifndef CALARMITEMMODEL_H
#define CALARMITEMMODEL_H #define CALARMITEMMODEL_H
#include <QSet> #include <QSet>

View File

@ -1,4 +1,4 @@

#ifdef OS_WINDOWS #ifdef OS_WINDOWS
//< 为了检测可用声卡 //< 为了检测可用声卡
#include <mmdeviceapi.h> #include <mmdeviceapi.h>
@ -16,11 +16,6 @@
#include "CAlarmSetMng.h" #include "CAlarmSetMng.h"
#include "service/alarm_server_api/AlarmCommonDef.h" #include "service/alarm_server_api/AlarmCommonDef.h"
#include "CAlarmMsgManage.h" #include "CAlarmMsgManage.h"
#include <QDomDocument>
#include <QDomElement>
#include <QDomNode>
#include <QDomNodeList>
#include <QRegExp>
using namespace iot_public; using namespace iot_public;
CAlarmMediaPlayer * CAlarmMediaPlayer::m_pInstance = NULL; CAlarmMediaPlayer * CAlarmMediaPlayer::m_pInstance = NULL;
@ -183,40 +178,6 @@ void CAlarmMediaPlayer::initSpeech()
} }
} }
} }
//添加语音转文本处理条件
QFile file(iot_public::CFileUtil::getPathOfCfgFile("alarmSpeechTextTrans.xml" , CN_DIR_PRODUCT).c_str());
if (!file.open(QFile::ReadWrite))
{
LOGERROR("打开语音文本转换文件失败,默认不进行语音转换");
return;
}
QDomDocument doc;
if (!doc.setContent(&file))
{
file.close();
LOGERROR("打开语音文本转换文件失败,默认不进行语音转换");
return;
}
file.close();
QDomElement root = doc.documentElement();
if(root.isElement())
{
QDomNodeList nodeList = root.childNodes();
for(int i = 0 ; i < nodeList.count() ; i++)
{
QDomNode node = nodeList.at(i);
if(node.isElement())
{
QDomElement element = node.toElement();
if(element.tagName() == "Condition" && element.attribute("enable") == "true")
{
m_mapSpeechTxtTrans.insert(element.attribute("key"),element.attribute("value"));
}
}
}
}
} }
@ -263,17 +224,6 @@ void CAlarmMediaPlayer::insertAudioCuesStop(const AlarmMsgPtr &info)
} }
} }
void CAlarmMediaPlayer::speechTextTrans(QString &strContent)
{
// strContent = "110KV回路503弹簧开关10A保护A线";
//文本转换处理
auto iter = m_mapSpeechTxtTrans.begin();
for(;iter != m_mapSpeechTxtTrans.end() ; iter++)
{
strContent.replace(QRegExp(iter.key() , Qt::CaseInsensitive) , iter.value());
}
}
void CAlarmMediaPlayer::setVolumeEnable(bool bEnable) void CAlarmMediaPlayer::setVolumeEnable(bool bEnable)
{ {
if(bEnable) if(bEnable)
@ -467,8 +417,6 @@ void CAlarmMediaPlayer::updateAudioCuesSpeech()
if(!alarmContent.isEmpty()) if(!alarmContent.isEmpty())
{ {
//读取配置文件,更改读取方式
speechTextTrans(alarmContent);
m_pTextToSpeech->say(alarmContent); m_pTextToSpeech->say(alarmContent);
} }
} }

View File

@ -1,4 +1,4 @@
#ifndef CALARMMEDIAPLAYER_H #ifndef CALARMMEDIAPLAYER_H
#define CALARMMEDIAPLAYER_H #define CALARMMEDIAPLAYER_H
#include <QObject> #include <QObject>
@ -53,8 +53,6 @@ private:
void insertAudioCuesStop(const AlarmMsgPtr &info); void insertAudioCuesStop(const AlarmMsgPtr &info);
void speechTextTrans(QString &strContent);//读取配置文件,调整文本语音输出
private slots: private slots:
/** /**
* @brief playerStateChanged * @brief playerStateChanged
@ -92,7 +90,6 @@ private:
QString m_engine; QString m_engine;
QString m_language; QString m_language;
QString m_voiceName; QString m_voiceName;
QMap<QString,QString> m_mapSpeechTxtTrans;
bool m_readFlag; bool m_readFlag;

View File

@ -1,4 +1,4 @@
#include "CAlarmMsgInfo.h" #include "CAlarmMsgInfo.h"
#include <QDateTime> #include <QDateTime>
#include "CAlarmDataCollect.h" #include "CAlarmDataCollect.h"
#include <QDebug> #include <QDebug>

View File

@ -1,4 +1,4 @@
#ifndef ALARMMSGINFO_H #ifndef ALARMMSGINFO_H
#define ALARMMSGINFO_H #define ALARMMSGINFO_H
#include <QMetaType> #include <QMetaType>

View File

@ -1,4 +1,4 @@
#include "CAlarmMsgManage.h" #include "CAlarmMsgManage.h"
#include <QMutex> #include <QMutex>
#include <QMutexLocker> #include <QMutexLocker>
#include <QDateTime> #include <QDateTime>
@ -8,7 +8,18 @@
#include <QDebug> #include <QDebug>
#include "perm_mng_api/PermMngApi.h" #include "perm_mng_api/PermMngApi.h"
//< 屏蔽xml_parser编译告警
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
#include "boost/property_tree/xml_parser.hpp" #include "boost/property_tree/xml_parser.hpp"
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#include "boost/typeof/typeof.hpp" #include "boost/typeof/typeof.hpp"
#include "boost/filesystem.hpp" #include "boost/filesystem.hpp"
#include "Common.h" #include "Common.h"
@ -201,12 +212,18 @@ void CAlarmMsgManage::updataDevGroupByDev(QString devGroup, QString device)
} }
} }
QHash<int, QMap<QString, QSet<QString> > > CAlarmMsgManage::getLocNotConfirmAlmInfo() const QHash<int, QMap<QString, QSet<QString> > > &CAlarmMsgManage::getLocNotConfirmAlmInfo() const
{ {
QMutexLocker locker(mutex); QMutexLocker locker(mutex);
return m_alarmLNCAlm; return m_alarmLNCAlm;
} }
const QHash<int, QMap<int, QSet<QString> > > &CAlarmMsgManage::getLocPriorityNotConfirmAlmInfo() const
{
QMutexLocker locker(mutex);
return m_alarmLNCPAlm;
}
void CAlarmMsgManage::getAllInhibitAlm(QList<AlarmMsgPtr> &almList) void CAlarmMsgManage::getAllInhibitAlm(QList<AlarmMsgPtr> &almList)
{ {
QMutexLocker locker(mutex); QMutexLocker locker(mutex);
@ -929,42 +946,80 @@ void CAlarmMsgManage::locSubStats(const AlarmMsgPtr &msg)
} }
} }
void CAlarmMsgManage::addNotConfirmAlm(int locId, const QString &devg, const QString &uuid) void CAlarmMsgManage::addNotConfirmAlm(const AlarmMsgPtr &msg)
{ {
QHash<int,QMap<QString,QSet<QString> > >::iterator it =m_alarmLNCAlm.find(locId); //< 按设备组
QHash<int,QMap<QString,QSet<QString> > >::iterator it =m_alarmLNCAlm.find(msg->location_id);
if(it != m_alarmLNCAlm.end()) if(it != m_alarmLNCAlm.end())
{ {
QMap<QString,QSet<QString> > &devgMap = it.value(); QMap<QString,QSet<QString> > &devgMap = it.value();
QMap<QString,QSet<QString> >::iterator pos = devgMap.find(devg); QMap<QString,QSet<QString> >::iterator pos = devgMap.find(msg->dev_group_tag);
if(pos != devgMap.end()) if(pos != devgMap.end())
{ {
pos.value().insert(uuid); pos.value().insert(msg->uuid_base64);
}else }else
{ {
QSet<QString> uuidSet; QSet<QString> uuidSet;
uuidSet.insert(uuid); uuidSet.insert(msg->uuid_base64);
devgMap[devg] = uuidSet; devgMap[msg->dev_group_tag] = uuidSet;
} }
}else }else
{ {
QMap<QString,QSet<QString> > devgMap; QMap<QString,QSet<QString> > devgMap;
QSet<QString> uuidSet; QSet<QString> uuidSet;
uuidSet.insert(uuid); uuidSet.insert(msg->uuid_base64);
devgMap[devg] = uuidSet; devgMap[msg->dev_group_tag] = uuidSet;
m_alarmLNCAlm[locId] = devgMap; m_alarmLNCAlm[msg->location_id] = devgMap;
}
//< 按告警等级
QHash<int,QMap<int,QSet<QString> > >::iterator pIt =m_alarmLNCPAlm.find(msg->location_id);
if(pIt != m_alarmLNCPAlm.end())
{
QMap<int,QSet<QString> > &pMap = pIt.value();
QMap<int,QSet<QString> >::iterator pos = pMap.find(msg->priority);
if(pos != pMap.end())
{
pos.value().insert(msg->uuid_base64);
}else
{
QSet<QString> uuidSet;
uuidSet.insert(msg->uuid_base64);
pMap[msg->priority] = uuidSet;
}
}else
{
QMap<int,QSet<QString> > pMap;
QSet<QString> uuidSet;
uuidSet.insert(msg->uuid_base64);
pMap[msg->priority] = uuidSet;
m_alarmLNCPAlm[msg->location_id] = pMap;
} }
} }
void CAlarmMsgManage::delNotConfirmAlm(int locId, const QString &devg, const QString &uuid) void CAlarmMsgManage::delNotConfirmAlm(const AlarmMsgPtr &msg)
{ {
QHash<int,QMap<QString,QSet<QString> > >::iterator it =m_alarmLNCAlm.find(locId); //< 按设备组
QHash<int,QMap<QString,QSet<QString> > >::iterator it =m_alarmLNCAlm.find(msg->location_id);
if(it != m_alarmLNCAlm.end()) if(it != m_alarmLNCAlm.end())
{ {
QMap<QString,QSet<QString> > &devgMap = it.value(); QMap<QString,QSet<QString> > &devgMap = it.value();
QMap<QString,QSet<QString> >::iterator pos = devgMap.find(devg); QMap<QString,QSet<QString> >::iterator pos = devgMap.find(msg->dev_group_tag);
if(pos != devgMap.end()) if(pos != devgMap.end())
{ {
pos.value().remove(uuid); pos.value().remove(msg->uuid_base64);
}
}
//< 按告警等级
QHash<int,QMap<int,QSet<QString> > >::iterator pIt =m_alarmLNCPAlm.find(msg->location_id);
if(pIt != m_alarmLNCPAlm.end())
{
QMap<int,QSet<QString> > &pMap = pIt.value();
QMap<int,QSet<QString> >::iterator pos = pMap.find(msg->priority);
if(pos != pMap.end())
{
pos.value().remove(msg->uuid_base64);
} }
} }
} }
@ -1080,7 +1135,7 @@ void CAlarmMsgManage::initAlarm()
if(E_ALS_ALARM == (*itpos)->logic_state || E_ALS_RETURN == (*itpos)->logic_state )//未确认数量(界面显示未确认) if(E_ALS_ALARM == (*itpos)->logic_state || E_ALS_RETURN == (*itpos)->logic_state )//未确认数量(界面显示未确认)
{ {
addNotConfirmAlm((*itpos)->location_id,(*itpos)->dev_group_tag,(*itpos)->uuid_base64); addNotConfirmAlm(*itpos);
++m_nNDelComAlarmCount; ++m_nNDelComAlarmCount;
} }
updateMsgAction((*itpos)); updateMsgAction((*itpos));
@ -1314,7 +1369,7 @@ void CAlarmMsgManage::addAlarmMsg(const QList<AlarmMsgPtr> &msgList)
} }
if(E_ALS_ALARM == (*itpos)->logic_state || E_ALS_RETURN == (*itpos)->logic_state )//未确认数量(界面显示未确认) if(E_ALS_ALARM == (*itpos)->logic_state || E_ALS_RETURN == (*itpos)->logic_state )//未确认数量(界面显示未确认)
{ {
addNotConfirmAlm((*itpos)->location_id,(*itpos)->dev_group_tag,(*itpos)->uuid_base64); addNotConfirmAlm(*itpos);
++m_nNDelComAlarmCount; ++m_nNDelComAlarmCount;
} }
updateMsgAction(*itpos); updateMsgAction(*itpos);
@ -1390,7 +1445,7 @@ void CAlarmMsgManage::confirmAlarmMsg(const QList<QString> &uuidList)
oldMsg->logic_state = E_ALS_RETURN_CFM; oldMsg->logic_state = E_ALS_RETURN_CFM;
--m_nNDelComAlarmCount; --m_nNDelComAlarmCount;
} }
delNotConfirmAlm(oldMsg->location_id,oldMsg->dev_group_tag,oldMsg->uuid_base64); delNotConfirmAlm(oldMsg);
}else }else
{ {
AlarmMsgPtr oldMsg_ = m_all.value(uuid, NULL); AlarmMsgPtr oldMsg_ = m_all.value(uuid, NULL);
@ -1447,7 +1502,7 @@ int CAlarmMsgManage::removeAlarmMsg(const QList<QString> &uuidList)
} }
if(E_ALS_ALARM == oldMsg->logic_state) if(E_ALS_ALARM == oldMsg->logic_state)
{ {
delNotConfirmAlm(oldMsg->location_id,oldMsg->dev_group_tag,oldMsg->uuid_base64); delNotConfirmAlm(oldMsg);
--m_nNDelComAlarmCount; --m_nNDelComAlarmCount;
oldMsg->logic_state = E_ALS_ALARM_DEL; oldMsg->logic_state = E_ALS_ALARM_DEL;
} }
@ -1457,7 +1512,7 @@ int CAlarmMsgManage::removeAlarmMsg(const QList<QString> &uuidList)
} }
else if(E_ALS_RETURN == oldMsg->logic_state) else if(E_ALS_RETURN == oldMsg->logic_state)
{ {
delNotConfirmAlm(oldMsg->location_id,oldMsg->dev_group_tag,oldMsg->uuid_base64); delNotConfirmAlm(oldMsg);
--m_nNDelComAlarmCount; --m_nNDelComAlarmCount;
oldMsg->logic_state = E_ALS_RETURN_DEL; oldMsg->logic_state = E_ALS_RETURN_DEL;
} }
@ -1574,7 +1629,7 @@ void CAlarmMsgManage::removeAlarmMsgByDomainID(const int &domainId)
{ {
if(E_ALS_ALARM == (*it)->logic_state || E_ALS_RETURN == (*it)->logic_state) if(E_ALS_ALARM == (*it)->logic_state || E_ALS_RETURN == (*it)->logic_state)
{ {
delNotConfirmAlm((*it)->location_id,(*it)->dev_group_tag,(*it)->uuid_base64); delNotConfirmAlm(*it);
--m_nNDelComAlarmCount; --m_nNDelComAlarmCount;
} }
removeAudioCues(it.value()); removeAudioCues(it.value());
@ -1788,7 +1843,7 @@ void CAlarmMsgManage::msgArrived()
if(E_ALS_ALARM == m_listMsgAddCache.at(num)->logic_state || E_ALS_RETURN == m_listMsgAddCache.at(num)->logic_state )//未删除未确认数量(界面显示未确认) if(E_ALS_ALARM == m_listMsgAddCache.at(num)->logic_state || E_ALS_RETURN == m_listMsgAddCache.at(num)->logic_state )//未删除未确认数量(界面显示未确认)
{ {
addNotConfirmAlm(m_listMsgAddCache.at(num)->location_id,m_listMsgAddCache.at(num)->dev_group_tag,m_listMsgAddCache.at(num)->uuid_base64); addNotConfirmAlm(m_listMsgAddCache.at(num));
++m_nNDelComAlarmCount; ++m_nNDelComAlarmCount;
} }
updateMsgAction(m_listMsgAddCache.at(num)); updateMsgAction(m_listMsgAddCache.at(num));

View File

@ -1,4 +1,4 @@
#ifndef CALARMMSGMANAGE_H #ifndef CALARMMSGMANAGE_H
#define CALARMMSGMANAGE_H #define CALARMMSGMANAGE_H
#include <QObject> #include <QObject>
@ -79,7 +79,8 @@ public:
QHash<int,QMap<int,int> > getLocAlmInfo(); QHash<int,QMap<int,int> > getLocAlmInfo();
void updataDevGroupByDev(QString devGroup, QString device); void updataDevGroupByDev(QString devGroup, QString device);
QHash<int,QMap<QString,QSet<QString> > > getLocNotConfirmAlmInfo(); const QHash<int,QMap<QString,QSet<QString> > > &getLocNotConfirmAlmInfo() const;
const QHash<int, QMap<int, QSet<QString> > > &getLocPriorityNotConfirmAlmInfo() const;
void getAllInhibitAlm(QList<AlarmMsgPtr> &almList); void getAllInhibitAlm(QList<AlarmMsgPtr> &almList);
signals: signals:
@ -267,18 +268,14 @@ private:
void locSubStats(const AlarmMsgPtr &msg); void locSubStats(const AlarmMsgPtr &msg);
/** /**
* @brief addNotConfirmAlm uuid * @brief addNotConfirmAlm uuid
* @param locId * @param msg
* @param devg
* @param uuid
*/ */
void addNotConfirmAlm(int locId,const QString &devg,const QString &uuid); void addNotConfirmAlm(const AlarmMsgPtr &msg);
/** /**
* @brief delNotConfirmAlm uuid集合中删除 * @brief delNotConfirmAlm uuid集合中删除
* @param locId * @param msg
* @param devg
* @param uuid
*/ */
void delNotConfirmAlm(int locId,const QString &devg,const QString &uuid); void delNotConfirmAlm(const AlarmMsgPtr &msg);
signals: signals:
/** /**
* @brief sigAiMsgRemove * @brief sigAiMsgRemove
@ -406,6 +403,7 @@ private:
QHash<int,QMap<int,int > > m_alarmLPAlm; //< <车站id,<告警等级,告警数量> > QHash<int,QMap<int,int > > m_alarmLPAlm; //< <车站id,<告警等级,告警数量> >
QHash<int,QMap<QString,QSet<QString> > > m_alarmLNCAlm;//< <车站id,<设备组,<未确认告警uuid> > > QHash<int,QMap<QString,QSet<QString> > > m_alarmLNCAlm;//< <车站id,<设备组,<未确认告警uuid> > >
QHash<int,QMap<int,QSet<QString> > > m_alarmLNCPAlm;//< <车站id,<告警等级,<未确认告警uuid> > >
QList<AiAlarmMsgPtr> m_delaydeal; //延迟处理的智能告警 QList<AiAlarmMsgPtr> m_delaydeal; //延迟处理的智能告警

View File

@ -1,4 +1,4 @@
#include "CAlarmPlugin.h" #include "CAlarmPlugin.h"
#include <QMediaPlaylist> #include <QMediaPlaylist>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QFile> #include <QFile>
@ -693,13 +693,13 @@ int CAlarmPlugin::getLocNotConfirmAlmCount(int loc)
{ {
return count; return count;
} }
QHash<int,QMap<QString,QSet<QString> > > locCountMap = CAlarmMsgManage::instance()->getLocNotConfirmAlmInfo(); const QHash<int,QMap<QString,QSet<QString> > > &locCountMap = CAlarmMsgManage::instance()->getLocNotConfirmAlmInfo();
QHash<int,QMap<QString,QSet<QString> > >::iterator it = locCountMap.find(loc); QHash<int,QMap<QString,QSet<QString> > >::const_iterator it = locCountMap.find(loc);
if(it !=locCountMap.end()) if(it !=locCountMap.end())
{ {
QMap<QString,QSet<QString> > devgCountMap = it.value(); QMap<QString,QSet<QString> > devgCountMap = it.value();
QMap<QString,QSet<QString> >::iterator pos = devgCountMap.begin(); QMap<QString,QSet<QString> >::const_iterator pos = devgCountMap.begin();
while (pos != devgCountMap.end()) { while (pos != devgCountMap.end()) {
count += pos.value().count(); count += pos.value().count();
@ -710,6 +710,28 @@ int CAlarmPlugin::getLocNotConfirmAlmCount(int loc)
return count; return count;
} }
QStringList CAlarmPlugin::getLocNotConfirmAlmInfo(int loc)
{
QStringList result;
result.clear();
if(loc < 0){
return result;
}
const QHash<int, QMap<int,QSet<QString> > > &locCountMap = CAlarmMsgManage::instance()->getLocPriorityNotConfirmAlmInfo();
QHash<int, QMap<int,QSet<QString> > >::const_iterator it = locCountMap.find(loc);
if(it != locCountMap.end())
{
const QMap<int,QSet<QString> > &pMap = it.value();
QMap<int,QSet<QString> >::const_iterator pos = pMap.constBegin();
while (pos != pMap.constEnd())
{
result.append( QString("%1_%2").arg(pos.key()).arg(pos.value().count()) );
pos++;
}
}
return result;
}
int CAlarmPlugin::getDevgNotConfirmAlmCount(const QString &devg) int CAlarmPlugin::getDevgNotConfirmAlmCount(const QString &devg)
{ {
int count =0; int count =0;
@ -717,13 +739,13 @@ int CAlarmPlugin::getDevgNotConfirmAlmCount(const QString &devg)
{ {
return count; return count;
} }
QHash<int,QMap<QString,QSet<QString> > > locCountMap = CAlarmMsgManage::instance()->getLocNotConfirmAlmInfo(); const QHash<int,QMap<QString,QSet<QString> > > &locCountMap = CAlarmMsgManage::instance()->getLocNotConfirmAlmInfo();
QHash<int,QMap<QString,QSet<QString> > >::iterator it = locCountMap.begin(); QHash<int,QMap<QString,QSet<QString> > >::const_iterator it = locCountMap.begin();
while (it !=locCountMap.end()) while (it !=locCountMap.end())
{ {
QMap<QString,QSet<QString> > devgCountMap = it.value(); QMap<QString,QSet<QString> > devgCountMap = it.value();
QMap<QString,QSet<QString> >::iterator pos = devgCountMap.find(devg); QMap<QString,QSet<QString> >::const_iterator pos = devgCountMap.find(devg);
if(pos != devgCountMap.end()) if(pos != devgCountMap.end())
{ {
count = pos.value().count(); count = pos.value().count();
@ -903,6 +925,18 @@ void CAlarmPlugin::setDeviceGroup(const QString &deviceGroup)
} }
void CAlarmPlugin::setPriorityFilter(int PriorityFilter)
{
bool isCheck = true;
QList<int> priorityList;
priorityList.append(PriorityFilter);
if(m_pModel)
{
m_pModel->setPriorityFilter(isCheck,priorityList);
}
}
void CAlarmPlugin::setPointTag(const QString &pointList) void CAlarmPlugin::setPointTag(const QString &pointList)
{ {
if(m_bIsEditMode || E_Alarm_Pop != m_mode) if(m_bIsEditMode || E_Alarm_Pop != m_mode)

View File

@ -1,4 +1,4 @@
#ifndef CALARMPLUGIN_H #ifndef CALARMPLUGIN_H
#define CALARMPLUGIN_H #define CALARMPLUGIN_H
#include <QWidget> #include <QWidget>
@ -102,6 +102,12 @@ public slots:
* @return * @return
*/ */
int getLocNotConfirmAlmCount(int loc); int getLocNotConfirmAlmCount(int loc);
/**
* @brief getLocNotConfirmAlmInfo
* @param loc id
* @return QString _告警数量 ex:1_23 123
*/
QStringList getLocNotConfirmAlmInfo(int loc);
/** /**
* @brief getDevgNotConfirmAlmCount * @brief getDevgNotConfirmAlmCount
* @param devg * @param devg
@ -207,11 +213,20 @@ public slots:
* @param device * @param device
*/ */
void setDevice(const QString &device); void setDevice(const QString &device);
/** /**
* @brief setDeviceGroup * @brief setDeviceGroup
* @param deviceGroup * @param deviceGroup
*/ */
void setDeviceGroup(const QString &deviceGroup); void setDeviceGroup(const QString &deviceGroup);
/**
* @brief setPriorityFilter
* @param deviceGroup
*/
void setPriorityFilter(int PriorityFilter);
/** /**
* @brief setPointTag () * @brief setPointTag ()
* @param pointList * @param pointList

View File

@ -1,4 +1,4 @@
#include <QWidget> #include <QWidget>
#include "CAlarmPluginWidget.h" #include "CAlarmPluginWidget.h"
#include "CAlarmPlugin.h" #include "CAlarmPlugin.h"
#include "pub_logger_api/logger.h" #include "pub_logger_api/logger.h"

View File

@ -1,4 +1,4 @@
#ifndef CALARMPLUGINWIDGET_H #ifndef CALARMPLUGINWIDGET_H
#define CALARMPLUGINWIDGET_H #define CALARMPLUGINWIDGET_H
#include <QObject> #include <QObject>
@ -7,7 +7,7 @@
class CAlarmPluginWidget : public QObject, public CPluginWidgetInterface class CAlarmPluginWidget : public QObject, public CPluginWidgetInterface
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "kbd.PluginWidgetInterface/1.0") Q_PLUGIN_METADATA(IID HMI_WidgetPlugin_IID)
Q_INTERFACES(CPluginWidgetInterface) Q_INTERFACES(CPluginWidgetInterface)
public: public:

View File

@ -1,4 +1,4 @@
#include "CAlarmSetDlg.h" #include "CAlarmSetDlg.h"
#include "ui_CAlarmSetDlg.h" #include "ui_CAlarmSetDlg.h"
#include <QDomDocument> #include <QDomDocument>
#include "pub_utility_api/FileUtil.h" #include "pub_utility_api/FileUtil.h"

View File

@ -1,4 +1,4 @@
#ifndef CALARMSETDLG_H #ifndef CALARMSETDLG_H
#define CALARMSETDLG_H #define CALARMSETDLG_H
#include <QDialog> #include <QDialog>

View File

@ -1,4 +1,4 @@
#include "CAlarmSetMng.h" #include "CAlarmSetMng.h"
#include <QDomDocument> #include <QDomDocument>
#include "pub_logger_api/logger.h" #include "pub_logger_api/logger.h"
#include <QFile> #include <QFile>

View File

@ -1,4 +1,4 @@
#ifndef CALARMSETMNG_H #ifndef CALARMSETMNG_H
#define CALARMSETMNG_H #define CALARMSETMNG_H
#include <QObject> #include <QObject>

View File

@ -1,4 +1,4 @@
#include "CAlarmShiledDialog.h" #include "CAlarmShiledDialog.h"
#include "ui_CAlarmShiledDialog.h" #include "ui_CAlarmShiledDialog.h"
#include <QPluginLoader> #include <QPluginLoader>
#include <QDir> #include <QDir>

View File

@ -1,4 +1,4 @@
#include "CAlarmTaskMngDlg.h" #include "CAlarmTaskMngDlg.h"
#include "ui_CAlarmTaskMngDlg.h" #include "ui_CAlarmTaskMngDlg.h"
#include <QMessageBox> #include <QMessageBox>
#include <CAlarmMsgInfo.h> #include <CAlarmMsgInfo.h>

View File

@ -1,4 +1,4 @@
#ifndef CALARMTASKMNGDLG_H #ifndef CALARMTASKMNGDLG_H
#define CALARMTASKMNGDLG_H #define CALARMTASKMNGDLG_H
#include <QDialog> #include <QDialog>

View File

@ -1,4 +1,4 @@
#include <QHeaderView> #include <QHeaderView>
#include <QMouseEvent> #include <QMouseEvent>
#include "CAlarmView.h" #include "CAlarmView.h"
#include <QScrollBar> #include <QScrollBar>

View File

@ -1,4 +1,4 @@
#ifndef CALARMVIEW_H #ifndef CALARMVIEW_H
#define CALARMVIEW_H #define CALARMVIEW_H
#include <QTableView> #include <QTableView>

View File

@ -1,4 +1,4 @@
#include "CAlarmWidget.h" #include "CAlarmWidget.h"
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QTableView> #include <QTableView>
#include <QHeaderView> #include <QHeaderView>

View File

@ -1,4 +1,4 @@
#ifndef CALARMWINDOW_H #ifndef CALARMWINDOW_H
#define CALARMWINDOW_H #define CALARMWINDOW_H
#include <QWidget> #include <QWidget>

View File

@ -1,4 +1,4 @@
#include "CDisposalPlanDialog.h" #include "CDisposalPlanDialog.h"
#include "ui_CDisposalPlanDialog.h" #include "ui_CDisposalPlanDialog.h"
#include "CAiAlarmMsgInfo.h" #include "CAiAlarmMsgInfo.h"
#include <QDate> #include <QDate>

View File

@ -1,4 +1,4 @@
#ifndef CDISPOSALPLANDIALOG_H #ifndef CDISPOSALPLANDIALOG_H
#define CDISPOSALPLANDIALOG_H #define CDISPOSALPLANDIALOG_H
#include <QDialog> #include <QDialog>

View File

@ -1,4 +1,4 @@
#include "CMyCalendar.h" #include "CMyCalendar.h"
#include "ui_CMyCalendar.h" #include "ui_CMyCalendar.h"
#include <pub_logger_api/logger.h> #include <pub_logger_api/logger.h>
#include <QMessageBox> #include <QMessageBox>

View File

@ -1,4 +1,4 @@
#ifndef CMYCALENDAR_H #ifndef CMYCALENDAR_H
#define CMYCALENDAR_H #define CMYCALENDAR_H
#include <QWidget> #include <QWidget>

View File

@ -1,4 +1,4 @@
#include "CMyCheckBox.h" #include "CMyCheckBox.h"
#include <QMouseEvent> #include <QMouseEvent>
CMyCheckBox::CMyCheckBox(QString text, QWidget *parent) CMyCheckBox::CMyCheckBox(QString text, QWidget *parent)

View File

@ -1,4 +1,4 @@
#ifndef MYCHECKBOX_H #ifndef MYCHECKBOX_H
#define MYCHECKBOX_H #define MYCHECKBOX_H
#include <QCheckBox> #include <QCheckBox>

View File

@ -1,4 +1,4 @@
#include "CMyListWidget.h" #include "CMyListWidget.h"
CMyListWidget::CMyListWidget(QWidget *parent):QListWidget(parent) CMyListWidget::CMyListWidget(QWidget *parent):QListWidget(parent)
{ {

View File

@ -1,4 +1,4 @@
#ifndef CMYLISTWIDGET_H #ifndef CMYLISTWIDGET_H
#define CMYLISTWIDGET_H #define CMYLISTWIDGET_H
#include <QListWidget> #include <QListWidget>

View File

@ -1,4 +1,4 @@
#include "CPdfPrinter.h" #include "CPdfPrinter.h"
#include <QDebug> #include <QDebug>
#include <QHeaderView> #include <QHeaderView>
#include <QMessageBox> #include <QMessageBox>

View File

@ -1,4 +1,4 @@
/** /**
* @file AlarmWidget pdf打印excel * @file AlarmWidget pdf打印excel
* @brief * @brief
* @author jxd * @author jxd

View File

@ -1,4 +1,4 @@
#include "CTableViewPrinter.h" #include "CTableViewPrinter.h"
#include "CAlarmCommon.h" #include "CAlarmCommon.h"
#include "CAlarmBaseData.h" #include "CAlarmBaseData.h"
CTableViewPrinter::CTableViewPrinter(CAlarmItemModel *model): CTableViewPrinter::CTableViewPrinter(CAlarmItemModel *model):

View File

@ -1,4 +1,4 @@
#ifndef CTABLEVIEWPRINTER_H #ifndef CTABLEVIEWPRINTER_H
#define CTABLEVIEWPRINTER_H #define CTABLEVIEWPRINTER_H
#include "CAlarmItemModel.h" #include "CAlarmItemModel.h"
class QVariant; class QVariant;

View File

@ -1,4 +1,4 @@
#include "CTreeViewPrinter.h" #include "CTreeViewPrinter.h"
#include "CAiAlarmTreeItem.h" #include "CAiAlarmTreeItem.h"
CTreeViewPrinter::CTreeViewPrinter(CAiAlarmTreeModel *model): CTreeViewPrinter::CTreeViewPrinter(CAiAlarmTreeModel *model):
m_pModel(model) m_pModel(model)

View File

@ -1,4 +1,4 @@
#ifndef CTREEVIEWPRINTER_H #ifndef CTREEVIEWPRINTER_H
#define CTREEVIEWPRINTER_H #define CTREEVIEWPRINTER_H
#include "CAiAlarmTreeModel.h" #include "CAiAlarmTreeModel.h"
class QVariant; class QVariant;

View File

@ -1,4 +1,4 @@
#include <QApplication> #include <QApplication>
#include "CAlarmPlugin.h" #include "CAlarmPlugin.h"
#include "pub_logger_api/logger.h" #include "pub_logger_api/logger.h"
#include "net_msg_bus_api/MsgBusApi.h" #include "net_msg_bus_api/MsgBusApi.h"
@ -12,7 +12,7 @@ int main(int argc, char *argv[])
//<初始化消息总线 //<初始化消息总线
QStringList arguments=QCoreApplication::arguments(); QStringList arguments=QCoreApplication::arguments();
std::string name="admin"; std::string name="admin";
std::string password ="kbdct"; std::string password ="admin";
int group =1; int group =1;
for(int index(0);index<arguments.size();index++) for(int index(0);index<arguments.size();index++)
{ {