[ref]kbd->iot
This commit is contained in:
parent
c319dfbaa2
commit
f29a4a75e4
@ -3,8 +3,8 @@
|
|||||||
#include "pub_utility_api/I18N.h"
|
#include "pub_utility_api/I18N.h"
|
||||||
#include "pub_utility_api/FileStyle.h"
|
#include "pub_utility_api/FileStyle.h"
|
||||||
|
|
||||||
using namespace kbd_public;
|
using namespace iot_public;
|
||||||
using namespace kbd_dbms;
|
using namespace iot_dbms;
|
||||||
|
|
||||||
//#ff0000 255,0,0
|
//#ff0000 255,0,0
|
||||||
//#ff7414 255,116,20
|
//#ff7414 255,116,20
|
||||||
@ -24,7 +24,7 @@ CAlarmStatistics::CAlarmStatistics(QWidget *parent,bool editMode) :
|
|||||||
ui->comboBox_location->setView(new QListView());
|
ui->comboBox_location->setView(new QListView());
|
||||||
// 加载qss文件
|
// 加载qss文件
|
||||||
QString qss = QString();
|
QString qss = QString();
|
||||||
std::string strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
||||||
QFile qssfile1(QString::fromStdString(strFullPath));
|
QFile qssfile1(QString::fromStdString(strFullPath));
|
||||||
qssfile1.open(QFile::ReadOnly);
|
qssfile1.open(QFile::ReadOnly);
|
||||||
if (qssfile1.isOpen())
|
if (qssfile1.isOpen())
|
||||||
@ -38,7 +38,7 @@ CAlarmStatistics::CAlarmStatistics(QWidget *parent,bool editMode) :
|
|||||||
qDebug() << "public.qss 无法打开!";
|
qDebug() << "public.qss 无法打开!";
|
||||||
}
|
}
|
||||||
|
|
||||||
strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("alarm_statistics.qss") ;
|
strFullPath = iot_public::CFileStyle::getPathOfStyleFile("alarm_statistics.qss") ;
|
||||||
QFile qssfile2(QString::fromStdString(strFullPath));
|
QFile qssfile2(QString::fromStdString(strFullPath));
|
||||||
qssfile2.open(QFile::ReadOnly);
|
qssfile2.open(QFile::ReadOnly);
|
||||||
if (qssfile2.isOpen())
|
if (qssfile2.isOpen())
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#include "CCompareQueryThread.h"
|
#include "CCompareQueryThread.h"
|
||||||
|
|
||||||
using namespace kbd_public;
|
using namespace iot_public;
|
||||||
using namespace kbd_dbms;
|
using namespace iot_dbms;
|
||||||
|
|
||||||
CCompareQueryThread::CCompareQueryThread()
|
CCompareQueryThread::CCompareQueryThread()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -46,7 +46,7 @@ public:
|
|||||||
int getAlarmLevelIndexById( int nId, SAlarmLevel* &pAlarmLevel );
|
int getAlarmLevelIndexById( int nId, SAlarmLevel* &pAlarmLevel );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
kbd_dbms::CDbApi* m_pDb; // 数据库接口
|
iot_dbms::CDbApi* m_pDb; // 数据库接口
|
||||||
CAlarmModel* m_pAlarmModel; // 详细告警信息显示窗的model
|
CAlarmModel* m_pAlarmModel; // 详细告警信息显示窗的model
|
||||||
QList<QColor> m_listAlarmLevelColor; // 告警优先级的颜色集合
|
QList<QColor> m_listAlarmLevelColor; // 告警优先级的颜色集合
|
||||||
QList<SAlarmLevel*> m_listAlarmLevel; // 告警级别列表
|
QList<SAlarmLevel*> m_listAlarmLevel; // 告警级别列表
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#include "CStatisticsQueryThread.h"
|
#include "CStatisticsQueryThread.h"
|
||||||
|
|
||||||
using namespace kbd_public;
|
using namespace iot_public;
|
||||||
using namespace kbd_dbms;
|
using namespace iot_dbms;
|
||||||
|
|
||||||
CStatisticsQueryThread::CStatisticsQueryThread()
|
CStatisticsQueryThread::CStatisticsQueryThread()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -37,7 +37,7 @@ public:
|
|||||||
void getWavePath( QString sAppTagName, QString& sPath, QString& sErrorMsg );
|
void getWavePath( QString sAppTagName, QString& sPath, QString& sErrorMsg );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
kbd_dbms::CDbApi* m_pDb; // 数据库接口
|
iot_dbms::CDbApi* m_pDb; // 数据库接口
|
||||||
CAlarmModel* m_pAlarmModel; // 详细告警信息显示窗的model
|
CAlarmModel* m_pAlarmModel; // 详细告警信息显示窗的model
|
||||||
QList<QColor> m_listAlarmLevelColor; // 告警优先级的颜色集合
|
QList<QColor> m_listAlarmLevelColor; // 告警优先级的颜色集合
|
||||||
QList<SAlarmLevel*> m_listAlarmLevel; // 告警级别列表
|
QList<SAlarmLevel*> m_listAlarmLevel; // 告警级别列表
|
||||||
|
|||||||
@ -33,8 +33,8 @@ void CWaveListDialog::addFileNameList( QString sPath, QStringList listName )
|
|||||||
|
|
||||||
void CWaveListDialog::slotShowWave( QListWidgetItem* pItem )
|
void CWaveListDialog::slotShowWave( QListWidgetItem* pItem )
|
||||||
{
|
{
|
||||||
const std::string strPath = std::move(kbd_public::CFileUtil::getPathOfBinFile(
|
const std::string strPath = std::move(iot_public::CFileUtil::getPathOfBinFile(
|
||||||
std::string("WaveAnalyze") + kbd_public::CFileUtil::getProcSuffix()));
|
std::string("WaveAnalyze") + iot_public::CFileUtil::getProcSuffix()));
|
||||||
if(strPath.empty())
|
if(strPath.empty())
|
||||||
{
|
{
|
||||||
LOGERROR("未找到可执行文件WaveAnalyze");
|
LOGERROR("未找到可执行文件WaveAnalyze");
|
||||||
|
|||||||
@ -6,12 +6,12 @@
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
kbd_public::StartLogSystem( "BASE", "alarm_statistics" );
|
iot_public::StartLogSystem( "BASE", "alarm_statistics" );
|
||||||
|
|
||||||
CAlarmStatistics w( 0, false );
|
CAlarmStatistics w( 0, false );
|
||||||
w.show();
|
w.show();
|
||||||
int nRet = a.exec();
|
int nRet = a.exec();
|
||||||
|
|
||||||
kbd_public::StopLogSystem();
|
iot_public::StopLogSystem();
|
||||||
return nRet;
|
return nRet;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -98,7 +98,7 @@ void AddObjAlarmDialog::initMember()
|
|||||||
{
|
{
|
||||||
if(m_pWriteDb == NULL)
|
if(m_pWriteDb == NULL)
|
||||||
{
|
{
|
||||||
m_pWriteDb = new kbd_dbms::CDbApi(DB_CONN_MODEL_WRITE);
|
m_pWriteDb = new iot_dbms::CDbApi(DB_CONN_MODEL_WRITE);
|
||||||
m_pWriteDb->open();
|
m_pWriteDb->open();
|
||||||
}
|
}
|
||||||
if(m_model == NULL)
|
if(m_model == NULL)
|
||||||
|
|||||||
@ -69,7 +69,7 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
Ui::AddObjAlarmDialog *ui;
|
Ui::AddObjAlarmDialog *ui;
|
||||||
|
|
||||||
kbd_dbms::CDbApi *m_pWriteDb;
|
iot_dbms::CDbApi *m_pWriteDb;
|
||||||
|
|
||||||
QMap<int,QCheckBox*> m_alarmActionCheckMap;//选中的告警动作
|
QMap<int,QCheckBox*> m_alarmActionCheckMap;//选中的告警动作
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@ AlarmManageForm::AlarmManageForm(QWidget *parent,bool edit) :
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
QString qss = QString();
|
QString qss = QString();
|
||||||
|
|
||||||
std::string strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
||||||
QFile qssfile1(QString::fromStdString(strFullPath));
|
QFile qssfile1(QString::fromStdString(strFullPath));
|
||||||
qssfile1.open(QFile::ReadOnly);
|
qssfile1.open(QFile::ReadOnly);
|
||||||
if (qssfile1.isOpen())
|
if (qssfile1.isOpen())
|
||||||
@ -30,7 +30,7 @@ AlarmManageForm::AlarmManageForm(QWidget *parent,bool edit) :
|
|||||||
qDebug() << "public.qss 无法打开!";
|
qDebug() << "public.qss 无法打开!";
|
||||||
}
|
}
|
||||||
|
|
||||||
strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("alarmmng.qss") ;
|
strFullPath = iot_public::CFileStyle::getPathOfStyleFile("alarmmng.qss") ;
|
||||||
QFile qssfile2(QString::fromStdString(strFullPath));
|
QFile qssfile2(QString::fromStdString(strFullPath));
|
||||||
qssfile2.open(QFile::ReadOnly);
|
qssfile2.open(QFile::ReadOnly);
|
||||||
if (qssfile2.isOpen())
|
if (qssfile2.isOpen())
|
||||||
|
|||||||
@ -52,7 +52,7 @@ AlarmManageWidget::AlarmManageWidget(QWidget *parent, bool editMode) :
|
|||||||
initView();
|
initView();
|
||||||
m_pThread->start();
|
m_pThread->start();
|
||||||
}
|
}
|
||||||
QDir dir(QString::fromStdString(kbd_public::CFileUtil::getCurModuleDir()));
|
QDir dir(QString::fromStdString(iot_public::CFileUtil::getCurModuleDir()));
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
dir.cd("data");
|
dir.cd("data");
|
||||||
@ -86,8 +86,8 @@ void AlarmManageWidget::initMember()
|
|||||||
}
|
}
|
||||||
|
|
||||||
AlarmMng::instance()->moveToThread(m_pThread);
|
AlarmMng::instance()->moveToThread(m_pThread);
|
||||||
m_pWriteDb = new kbd_dbms::CDbApi(DB_CONN_MODEL_WRITE);
|
m_pWriteDb = new iot_dbms::CDbApi(DB_CONN_MODEL_WRITE);
|
||||||
m_pReadDb = new kbd_dbms::CDbApi(DB_CONN_MODEL_READ);
|
m_pReadDb = new iot_dbms::CDbApi(DB_CONN_MODEL_READ);
|
||||||
if(!m_pWriteDb->open())
|
if(!m_pWriteDb->open())
|
||||||
{
|
{
|
||||||
LOGERROR("打开数据库失败,error:%s",m_pWriteDb->getLastErrorString().toStdString().c_str());
|
LOGERROR("打开数据库失败,error:%s",m_pWriteDb->getLastErrorString().toStdString().c_str());
|
||||||
@ -202,7 +202,7 @@ bool AlarmManageWidget::initCurUser()
|
|||||||
{
|
{
|
||||||
m_userId = -1;
|
m_userId = -1;
|
||||||
m_usergId = -1;
|
m_usergId = -1;
|
||||||
kbd_service::CPermMngApiPtr permMngPtr = kbd_service::getPermMngInstance("base");
|
iot_service::CPermMngApiPtr permMngPtr = iot_service::getPermMngInstance("base");
|
||||||
if(permMngPtr == NULL || (PERM_NORMAL != permMngPtr->PermDllInit()))
|
if(permMngPtr == NULL || (PERM_NORMAL != permMngPtr->PermDllInit()))
|
||||||
{
|
{
|
||||||
LOGERROR("权限接口初始化失败!");
|
LOGERROR("权限接口初始化失败!");
|
||||||
|
|||||||
@ -126,8 +126,8 @@ private:
|
|||||||
|
|
||||||
QMap<int,int> m_alarmLevelIndexMap;
|
QMap<int,int> m_alarmLevelIndexMap;
|
||||||
|
|
||||||
kbd_dbms::CDbApi *m_pReadDb;
|
iot_dbms::CDbApi *m_pReadDb;
|
||||||
kbd_dbms::CDbApi *m_pWriteDb;
|
iot_dbms::CDbApi *m_pWriteDb;
|
||||||
|
|
||||||
int m_userId;
|
int m_userId;
|
||||||
int m_usergId;
|
int m_usergId;
|
||||||
|
|||||||
@ -6,8 +6,8 @@
|
|||||||
#include <QMutexLocker>
|
#include <QMutexLocker>
|
||||||
#include <QSqlQuery>
|
#include <QSqlQuery>
|
||||||
|
|
||||||
using namespace kbd_dbms;
|
using namespace iot_dbms;
|
||||||
using namespace kbd_public;
|
using namespace iot_public;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
AlarmMng *AlarmMng::pInstance = NULL;
|
AlarmMng *AlarmMng::pInstance = NULL;
|
||||||
@ -249,7 +249,7 @@ QList<QString> AlarmMng::getDiText()
|
|||||||
|
|
||||||
bool AlarmMng::getNomRptEditPerm()
|
bool AlarmMng::getNomRptEditPerm()
|
||||||
{
|
{
|
||||||
kbd_service::CPermMngApiPtr permMngPtr = kbd_service::getPermMngInstance("base");
|
iot_service::CPermMngApiPtr permMngPtr = iot_service::getPermMngInstance("base");
|
||||||
if(permMngPtr == NULL || (PERM_NORMAL != permMngPtr->PermDllInit()))
|
if(permMngPtr == NULL || (PERM_NORMAL != permMngPtr->PermDllInit()))
|
||||||
{
|
{
|
||||||
LOGERROR("权限接口初始化失败!");
|
LOGERROR("权限接口初始化失败!");
|
||||||
@ -278,12 +278,12 @@ AlarmMng::AlarmMng()
|
|||||||
{
|
{
|
||||||
mutex = new QMutex;
|
mutex = new QMutex;
|
||||||
|
|
||||||
m_pReadDb = new kbd_dbms::CDbApi(DB_CONN_MODEL_READ);
|
m_pReadDb = new iot_dbms::CDbApi(DB_CONN_MODEL_READ);
|
||||||
if(!m_pReadDb->open())
|
if(!m_pReadDb->open())
|
||||||
{
|
{
|
||||||
LOGERROR("打开数据库失败,error:%s",m_pReadDb->getLastErrorString().toStdString().c_str());
|
LOGERROR("打开数据库失败,error:%s",m_pReadDb->getLastErrorString().toStdString().c_str());
|
||||||
}
|
}
|
||||||
m_rtdbAccess = new kbd_dbms::CRdbAccess();
|
m_rtdbAccess = new iot_dbms::CRdbAccess();
|
||||||
loadLocInfo();
|
loadLocInfo();
|
||||||
loadDevgInfo();
|
loadDevgInfo();
|
||||||
loadDevInfo();
|
loadDevInfo();
|
||||||
@ -298,7 +298,7 @@ AlarmMng::AlarmMng()
|
|||||||
|
|
||||||
void AlarmMng::loadLocInfo()
|
void AlarmMng::loadLocInfo()
|
||||||
{
|
{
|
||||||
kbd_service::CPermMngApiPtr permMngPtr = kbd_service::getPermMngInstance("base");
|
iot_service::CPermMngApiPtr permMngPtr = iot_service::getPermMngInstance("base");
|
||||||
if(permMngPtr == NULL || (PERM_NORMAL != permMngPtr->PermDllInit()))
|
if(permMngPtr == NULL || (PERM_NORMAL != permMngPtr->PermDllInit()))
|
||||||
{
|
{
|
||||||
LOGERROR("权限接口初始化失败!");
|
LOGERROR("权限接口初始化失败!");
|
||||||
@ -320,8 +320,8 @@ void AlarmMng::loadLocInfo()
|
|||||||
id_value.second = "description";
|
id_value.second = "description";
|
||||||
if(m_rtdbAccess->open(strApplicationName.c_str(), strTableName.c_str()))
|
if(m_rtdbAccess->open(strApplicationName.c_str(), strTableName.c_str()))
|
||||||
{
|
{
|
||||||
kbd_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
iot_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
||||||
kbd_dbms::CRdbQueryResult result;
|
iot_dbms::CRdbQueryResult result;
|
||||||
std::vector<std::string> columns;
|
std::vector<std::string> columns;
|
||||||
columns.push_back(id_value.first);
|
columns.push_back(id_value.first);
|
||||||
columns.push_back(id_value.second);
|
columns.push_back(id_value.second);
|
||||||
@ -332,8 +332,8 @@ void AlarmMng::loadLocInfo()
|
|||||||
m_locMap.clear();
|
m_locMap.clear();
|
||||||
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
||||||
{
|
{
|
||||||
kbd_dbms::CVarType key;
|
iot_dbms::CVarType key;
|
||||||
kbd_dbms::CVarType value;
|
iot_dbms::CVarType value;
|
||||||
result.getColumnValue(nIndex, 0, key);
|
result.getColumnValue(nIndex, 0, key);
|
||||||
result.getColumnValue(nIndex, 1, value);
|
result.getColumnValue(nIndex, 1, value);
|
||||||
|
|
||||||
|
|||||||
@ -119,9 +119,9 @@ private:
|
|||||||
static AlarmMng * pInstance;
|
static AlarmMng * pInstance;
|
||||||
|
|
||||||
|
|
||||||
kbd_dbms::CDbApi * m_pReadDb;
|
iot_dbms::CDbApi * m_pReadDb;
|
||||||
|
|
||||||
kbd_dbms::CRdbAccess * m_rtdbAccess;
|
iot_dbms::CRdbAccess * m_rtdbAccess;
|
||||||
QMap<int,QString> m_locMap; //<车站ID,车站描述>
|
QMap<int,QString> m_locMap; //<车站ID,车站描述>
|
||||||
QMap<QString,QString> m_devgMap; //<设备组标签,设备组描述>
|
QMap<QString,QString> m_devgMap; //<设备组标签,设备组描述>
|
||||||
QMap<QString,QString> m_devMap; //<设备标签,设备描述>
|
QMap<QString,QString> m_devMap; //<设备标签,设备描述>
|
||||||
|
|||||||
@ -9,12 +9,12 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
std::string name="admin";
|
std::string name="admin";
|
||||||
std::string password ="kbdct";
|
std::string password ="kbdct";
|
||||||
kbd_public::StartLogSystem("HMI", "hmi");
|
iot_public::StartLogSystem("HMI", "hmi");
|
||||||
|
|
||||||
kbd_net::initMsgBus("HMI", "HMI");
|
iot_net::initMsgBus("HMI", "HMI");
|
||||||
|
|
||||||
int group =1;
|
int group =1;
|
||||||
kbd_service::CPermMngApiPtr perm = kbd_service::getPermMngInstance("base");
|
iot_service::CPermMngApiPtr perm = iot_service::getPermMngInstance("base");
|
||||||
if(!perm || PERM_NORMAL != perm->PermDllInit())
|
if(!perm || PERM_NORMAL != perm->PermDllInit())
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
@ -29,9 +29,9 @@ int main(int argc, char *argv[])
|
|||||||
w.show();
|
w.show();
|
||||||
a.exec();
|
a.exec();
|
||||||
}
|
}
|
||||||
kbd_net::releaseMsgBus();
|
iot_net::releaseMsgBus();
|
||||||
|
|
||||||
kbd_public::StopLogSystem();
|
iot_public::StopLogSystem();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -498,7 +498,7 @@ int CAddShieldDialog::getMonthOption()
|
|||||||
|
|
||||||
bool CAddShieldDialog::getCurUser(int &userId, int &usergId, QString &hostName, int &locationId)
|
bool CAddShieldDialog::getCurUser(int &userId, int &usergId, QString &hostName, int &locationId)
|
||||||
{
|
{
|
||||||
kbd_service::CPermMngApiPtr permMngPtr = kbd_service::getPermMngInstance("base");
|
iot_service::CPermMngApiPtr permMngPtr = iot_service::getPermMngInstance("base");
|
||||||
if(permMngPtr == NULL || (PERM_NORMAL != permMngPtr->PermDllInit()))
|
if(permMngPtr == NULL || (PERM_NORMAL != permMngPtr->PermDllInit()))
|
||||||
{
|
{
|
||||||
LOGERROR("权限接口初始化失败!");
|
LOGERROR("权限接口初始化失败!");
|
||||||
@ -514,9 +514,9 @@ bool CAddShieldDialog::getCurUser(int &userId, int &usergId, QString &hostName,
|
|||||||
LOGERROR("获取当前登录用户失败!");
|
LOGERROR("获取当前登录用户失败!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
kbd_public::SNodeInfo stNodeInfo;
|
iot_public::SNodeInfo stNodeInfo;
|
||||||
kbd_public::CSysInfoInterfacePtr spSysInfo;
|
iot_public::CSysInfoInterfacePtr spSysInfo;
|
||||||
if (!kbd_public::createSysInfoInstance(spSysInfo))
|
if (!iot_public::createSysInfoInstance(spSysInfo))
|
||||||
{
|
{
|
||||||
LOGERROR("创建系统信息访问库实例失败!");
|
LOGERROR("创建系统信息访问库实例失败!");
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -21,7 +21,7 @@ CAlarmShield::CAlarmShield(QWidget *parent, bool editMode) :
|
|||||||
if(!editMode)
|
if(!editMode)
|
||||||
{
|
{
|
||||||
QString style = QString();
|
QString style = QString();
|
||||||
std::string strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
||||||
QFile file1(QString::fromStdString(strFullPath));
|
QFile file1(QString::fromStdString(strFullPath));
|
||||||
if (file1.open(QIODevice::ReadOnly))
|
if (file1.open(QIODevice::ReadOnly))
|
||||||
{
|
{
|
||||||
@ -31,7 +31,7 @@ CAlarmShield::CAlarmShield(QWidget *parent, bool editMode) :
|
|||||||
}
|
}
|
||||||
file1.close();
|
file1.close();
|
||||||
|
|
||||||
strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("alarmShield.qss") ;
|
strFullPath = iot_public::CFileStyle::getPathOfStyleFile("alarmShield.qss") ;
|
||||||
QFile file2(QString::fromStdString(strFullPath));
|
QFile file2(QString::fromStdString(strFullPath));
|
||||||
if (file2.open(QIODevice::ReadOnly))
|
if (file2.open(QIODevice::ReadOnly))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -150,7 +150,7 @@ QMap<int, QString> CDbInfoManage::getShieldPropMap()
|
|||||||
|
|
||||||
bool CDbInfoManage::loadShieldObj(const int &shieldId, QList<ST_Shield_Obj> &objList)
|
bool CDbInfoManage::loadShieldObj(const int &shieldId, QList<ST_Shield_Obj> &objList)
|
||||||
{
|
{
|
||||||
kbd_dbms::CDbApi objReadDb(DB_CONN_MODEL_READ);
|
iot_dbms::CDbApi objReadDb(DB_CONN_MODEL_READ);
|
||||||
bool ret = objReadDb.open();
|
bool ret = objReadDb.open();
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
@ -188,7 +188,7 @@ bool CDbInfoManage::loadShieldObj(const int &shieldId, QList<ST_Shield_Obj> &obj
|
|||||||
|
|
||||||
bool CDbInfoManage::loadShieldObj(const QStringList &objList, QMap<int, QList<ST_Shield_Obj> > &objMap)
|
bool CDbInfoManage::loadShieldObj(const QStringList &objList, QMap<int, QList<ST_Shield_Obj> > &objMap)
|
||||||
{
|
{
|
||||||
kbd_dbms::CDbApi objReadDb(DB_CONN_MODEL_READ);
|
iot_dbms::CDbApi objReadDb(DB_CONN_MODEL_READ);
|
||||||
bool ret = objReadDb.open();
|
bool ret = objReadDb.open();
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
@ -232,7 +232,7 @@ bool CDbInfoManage::loadShieldObj(const QStringList &objList, QMap<int, QList<ST
|
|||||||
|
|
||||||
bool CDbInfoManage::loadShieldInfo(const QList<int> &objList, QList<ST_Shield_Info> &infoList)
|
bool CDbInfoManage::loadShieldInfo(const QList<int> &objList, QList<ST_Shield_Info> &infoList)
|
||||||
{
|
{
|
||||||
kbd_dbms::CDbApi objReadDb(DB_CONN_MODEL_READ);
|
iot_dbms::CDbApi objReadDb(DB_CONN_MODEL_READ);
|
||||||
bool ret = objReadDb.open();
|
bool ret = objReadDb.open();
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
@ -820,13 +820,13 @@ bool CDbInfoManage::checkOptPerm(const std::vector<int> &vecRegionOptId, const s
|
|||||||
CDbInfoManage::CDbInfoManage()
|
CDbInfoManage::CDbInfoManage()
|
||||||
{
|
{
|
||||||
initPermMng();
|
initPermMng();
|
||||||
m_rtdbAccess = new kbd_dbms::CRdbAccess();
|
m_rtdbAccess = new iot_dbms::CRdbAccess();
|
||||||
m_pWriteDb = new kbd_dbms::CDbApi(DB_CONN_MODEL_WRITE);
|
m_pWriteDb = new iot_dbms::CDbApi(DB_CONN_MODEL_WRITE);
|
||||||
m_pWriteDb->open();
|
m_pWriteDb->open();
|
||||||
|
|
||||||
// m_tagInfo.reserve(5000);
|
// m_tagInfo.reserve(5000);
|
||||||
|
|
||||||
kbd_dbms::CDbApi objReadDb(DB_CONN_MODEL_READ);
|
iot_dbms::CDbApi objReadDb(DB_CONN_MODEL_READ);
|
||||||
bool ret = objReadDb.open();
|
bool ret = objReadDb.open();
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
@ -845,7 +845,7 @@ CDbInfoManage::CDbInfoManage()
|
|||||||
|
|
||||||
void CDbInfoManage::initPermMng()
|
void CDbInfoManage::initPermMng()
|
||||||
{
|
{
|
||||||
m_ptrPermMng = kbd_service::getPermMngInstance("base");
|
m_ptrPermMng = iot_service::getPermMngInstance("base");
|
||||||
if(m_ptrPermMng == NULL || (PERM_NORMAL != m_ptrPermMng->PermDllInit()))
|
if(m_ptrPermMng == NULL || (PERM_NORMAL != m_ptrPermMng->PermDllInit()))
|
||||||
{
|
{
|
||||||
LOGERROR("权限接口初始化失败!");
|
LOGERROR("权限接口初始化失败!");
|
||||||
@ -892,8 +892,8 @@ void CDbInfoManage::loadRTLocation()
|
|||||||
std::string strTableName = "sys_model_location_info";
|
std::string strTableName = "sys_model_location_info";
|
||||||
if(m_rtdbAccess->open(strApplicationName.c_str(), strTableName.c_str()))
|
if(m_rtdbAccess->open(strApplicationName.c_str(), strTableName.c_str()))
|
||||||
{
|
{
|
||||||
kbd_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
iot_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
||||||
kbd_dbms::CRdbQueryResult result;
|
iot_dbms::CRdbQueryResult result;
|
||||||
std::vector<std::string> columns;
|
std::vector<std::string> columns;
|
||||||
columns.push_back("location_id");
|
columns.push_back("location_id");
|
||||||
columns.push_back("tag_name");
|
columns.push_back("tag_name");
|
||||||
@ -906,9 +906,9 @@ void CDbInfoManage::loadRTLocation()
|
|||||||
m_locationTag.clear();
|
m_locationTag.clear();
|
||||||
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
||||||
{
|
{
|
||||||
kbd_dbms::CVarType location_id;
|
iot_dbms::CVarType location_id;
|
||||||
kbd_dbms::CVarType tag_name;
|
iot_dbms::CVarType tag_name;
|
||||||
kbd_dbms::CVarType description;
|
iot_dbms::CVarType description;
|
||||||
result.getColumnValue(nIndex, 0, location_id);
|
result.getColumnValue(nIndex, 0, location_id);
|
||||||
result.getColumnValue(nIndex, 1, tag_name);
|
result.getColumnValue(nIndex, 1, tag_name);
|
||||||
result.getColumnValue(nIndex, 2, description);
|
result.getColumnValue(nIndex, 2, description);
|
||||||
@ -930,7 +930,7 @@ void CDbInfoManage::loadRTLocation()
|
|||||||
m_rtdbAccess->close();
|
m_rtdbAccess->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDbInfoManage::loadDevGroupInfo(kbd_dbms::CDbApi &objReadDb)
|
void CDbInfoManage::loadDevGroupInfo(iot_dbms::CDbApi &objReadDb)
|
||||||
{
|
{
|
||||||
QSqlQuery query;
|
QSqlQuery query;
|
||||||
|
|
||||||
@ -974,7 +974,7 @@ void CDbInfoManage::loadDevGroupInfo(kbd_dbms::CDbApi &objReadDb)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDbInfoManage::loadDeviceInfo(kbd_dbms::CDbApi &objReadDb)
|
void CDbInfoManage::loadDeviceInfo(iot_dbms::CDbApi &objReadDb)
|
||||||
{
|
{
|
||||||
QSqlQuery query;
|
QSqlQuery query;
|
||||||
|
|
||||||
@ -1002,7 +1002,7 @@ void CDbInfoManage::loadDeviceInfo(kbd_dbms::CDbApi &objReadDb)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDbInfoManage::loadPointInfo(kbd_dbms::CDbApi &objReadDb)
|
void CDbInfoManage::loadPointInfo(iot_dbms::CDbApi &objReadDb)
|
||||||
{
|
{
|
||||||
QSqlQuery query;
|
QSqlQuery query;
|
||||||
QStringList listType;
|
QStringList listType;
|
||||||
@ -1045,7 +1045,7 @@ void CDbInfoManage::loadPointInfo(kbd_dbms::CDbApi &objReadDb)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDbInfoManage::loadUserInfo(kbd_dbms::CDbApi &objReadDb)
|
void CDbInfoManage::loadUserInfo(iot_dbms::CDbApi &objReadDb)
|
||||||
{
|
{
|
||||||
QSqlQuery query;
|
QSqlQuery query;
|
||||||
QString sql = QString("select perm_id,perm_alias from rm_user_def");
|
QString sql = QString("select perm_id,perm_alias from rm_user_def");
|
||||||
@ -1059,7 +1059,7 @@ void CDbInfoManage::loadUserInfo(kbd_dbms::CDbApi &objReadDb)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDbInfoManage::loadShieldDefine(kbd_dbms::CDbApi &objReadDb)
|
void CDbInfoManage::loadShieldDefine(iot_dbms::CDbApi &objReadDb)
|
||||||
{
|
{
|
||||||
QSqlQuery query;
|
QSqlQuery query;
|
||||||
QString sql = QString("select shield_id,description,shield_prop from opt_shield_define");
|
QString sql = QString("select shield_id,description,shield_prop from opt_shield_define");
|
||||||
@ -1074,7 +1074,7 @@ void CDbInfoManage::loadShieldDefine(kbd_dbms::CDbApi &objReadDb)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDbInfoManage::loadShieldProperty(kbd_dbms::CDbApi &objReadDb)
|
void CDbInfoManage::loadShieldProperty(iot_dbms::CDbApi &objReadDb)
|
||||||
{
|
{
|
||||||
QSqlQuery query;
|
QSqlQuery query;
|
||||||
QString sql = QString("select actual_value,display_value from dict_menu_info where menu_name = '%1' ").arg("屏蔽属性");
|
QString sql = QString("select actual_value,display_value from dict_menu_info where menu_name = '%1' ").arg("屏蔽属性");
|
||||||
@ -1091,7 +1091,7 @@ void CDbInfoManage::loadShieldProperty(kbd_dbms::CDbApi &objReadDb)
|
|||||||
bool CDbInfoManage::getMaxId(int &timeId, int &shieldId)
|
bool CDbInfoManage::getMaxId(int &timeId, int &shieldId)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
kbd_dbms::CDbApi readDb(DB_CONN_MODEL_READ);
|
iot_dbms::CDbApi readDb(DB_CONN_MODEL_READ);
|
||||||
if(!readDb.open())
|
if(!readDb.open())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -57,20 +57,20 @@ private:
|
|||||||
QString getJoinStr(const QList<int> &list, char c);
|
QString getJoinStr(const QList<int> &list, char c);
|
||||||
|
|
||||||
void loadRTLocation();
|
void loadRTLocation();
|
||||||
void loadDevGroupInfo(kbd_dbms::CDbApi &objReadDb);
|
void loadDevGroupInfo(iot_dbms::CDbApi &objReadDb);
|
||||||
void loadDeviceInfo(kbd_dbms::CDbApi &objReadDb);
|
void loadDeviceInfo(iot_dbms::CDbApi &objReadDb);
|
||||||
void loadPointInfo(kbd_dbms::CDbApi &objReadDb);
|
void loadPointInfo(iot_dbms::CDbApi &objReadDb);
|
||||||
void loadUserInfo(kbd_dbms::CDbApi &objReadDb);
|
void loadUserInfo(iot_dbms::CDbApi &objReadDb);
|
||||||
void loadShieldDefine(kbd_dbms::CDbApi &objReadDb);
|
void loadShieldDefine(iot_dbms::CDbApi &objReadDb);
|
||||||
void loadShieldProperty(kbd_dbms::CDbApi &objReadDb);
|
void loadShieldProperty(iot_dbms::CDbApi &objReadDb);
|
||||||
|
|
||||||
bool getMaxId(int &timeId, int &shieldId);
|
bool getMaxId(int &timeId, int &shieldId);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static CDbInfoManage * m_pInstance;
|
static CDbInfoManage * m_pInstance;
|
||||||
kbd_service::CPermMngApiPtr m_ptrPermMng;
|
iot_service::CPermMngApiPtr m_ptrPermMng;
|
||||||
kbd_dbms::CRdbAccess * m_rtdbAccess;
|
iot_dbms::CRdbAccess * m_rtdbAccess;
|
||||||
kbd_dbms::CDbApi *m_pWriteDb;
|
iot_dbms::CDbApi *m_pWriteDb;
|
||||||
QMap<QString, int> m_regionMap;
|
QMap<QString, int> m_regionMap;
|
||||||
QMap<int, QString> m_locationInfo;
|
QMap<int, QString> m_locationInfo;
|
||||||
QMap<int, QString> m_locationTag;
|
QMap<int, QString> m_locationTag;
|
||||||
|
|||||||
@ -8,8 +8,8 @@ CHeaderView::CHeaderView(QWidget *parent, int nAddCheckBoxColumn):
|
|||||||
QHeaderView(Qt::Horizontal, parent),
|
QHeaderView(Qt::Horizontal, parent),
|
||||||
m_bChecked(false)
|
m_bChecked(false)
|
||||||
{
|
{
|
||||||
m_indicatorCheck = kbd_public::CFileUtil::getPathOfResFile("gui/icon/alarm/ckb-select.png").c_str();
|
m_indicatorCheck = iot_public::CFileUtil::getPathOfResFile("gui/icon/alarm/ckb-select.png").c_str();
|
||||||
m_indicatorUnCheck = kbd_public::CFileUtil::getPathOfResFile("gui/icon/alarm/unchecked.png").c_str();
|
m_indicatorUnCheck = iot_public::CFileUtil::getPathOfResFile("gui/icon/alarm/unchecked.png").c_str();
|
||||||
|
|
||||||
setSectionsClickable(true);
|
setSectionsClickable(true);
|
||||||
connect(this, SIGNAL(sectionClicked(int)), this, SLOT(onHeaderClicked(int)));
|
connect(this, SIGNAL(sectionClicked(int)), this, SLOT(onHeaderClicked(int)));
|
||||||
|
|||||||
@ -5,9 +5,9 @@
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
kbd_public::StartLogSystem("", "hmi");
|
iot_public::StartLogSystem("", "hmi");
|
||||||
|
|
||||||
kbd_service::CPermMngApiPtr perm = kbd_service::getPermMngInstance("base");
|
iot_service::CPermMngApiPtr perm = iot_service::getPermMngInstance("base");
|
||||||
if(!perm || PERM_NORMAL != perm->PermDllInit())
|
if(!perm || PERM_NORMAL != perm->PermDllInit())
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
@ -25,6 +25,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
a.exec();
|
a.exec();
|
||||||
|
|
||||||
kbd_public::StopLogSystem();
|
iot_public::StopLogSystem();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,18 +2,18 @@
|
|||||||
#include "dbms/db_api_ex/CDbApi.h"
|
#include "dbms/db_api_ex/CDbApi.h"
|
||||||
#include "CStatisCommon.h"
|
#include "CStatisCommon.h"
|
||||||
|
|
||||||
using namespace kbd_dbms;
|
using namespace iot_dbms;
|
||||||
|
|
||||||
CDataInfoManage *CDataInfoManage::m_pInstance = NULL;
|
CDataInfoManage *CDataInfoManage::m_pInstance = NULL;
|
||||||
|
|
||||||
CDataInfoManage::CDataInfoManage()
|
CDataInfoManage::CDataInfoManage()
|
||||||
{
|
{
|
||||||
m_rtdbAccess = new kbd_dbms::CRdbAccess();
|
m_rtdbAccess = new iot_dbms::CRdbAccess();
|
||||||
m_rtdbNetAcs = new kbd_dbms::CRdbNetApi();
|
m_rtdbNetAcs = new iot_dbms::CRdbNetApi();
|
||||||
m_nDomain = CN_InvalidDomainId;
|
m_nDomain = CN_InvalidDomainId;
|
||||||
if(kbd_public::createSysInfoInstance(m_ptrSysInfo))
|
if(iot_public::createSysInfoInstance(m_ptrSysInfo))
|
||||||
{
|
{
|
||||||
kbd_public::SNodeInfo sNodeInfo;
|
iot_public::SNodeInfo sNodeInfo;
|
||||||
m_ptrSysInfo->getLocalNodeInfo(sNodeInfo);
|
m_ptrSysInfo->getLocalNodeInfo(sNodeInfo);
|
||||||
m_nDomain = sNodeInfo.nDomainId;
|
m_nDomain = sNodeInfo.nDomainId;
|
||||||
}
|
}
|
||||||
@ -205,8 +205,8 @@ void CDataInfoManage::loadAlarmLevel()
|
|||||||
std::string strTableName = "alarm_level_define";
|
std::string strTableName = "alarm_level_define";
|
||||||
if(m_rtdbAccess->open(strApplicationName.c_str(), strTableName.c_str()))
|
if(m_rtdbAccess->open(strApplicationName.c_str(), strTableName.c_str()))
|
||||||
{
|
{
|
||||||
kbd_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
iot_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
||||||
kbd_dbms::CRdbQueryResult result;
|
iot_dbms::CRdbQueryResult result;
|
||||||
std::vector<std::string> columns;
|
std::vector<std::string> columns;
|
||||||
columns.push_back("priority_id");
|
columns.push_back("priority_id");
|
||||||
columns.push_back("priority_name");
|
columns.push_back("priority_name");
|
||||||
@ -224,9 +224,9 @@ void CDataInfoManage::loadAlarmLevel()
|
|||||||
m_alarmOrderMap.clear();
|
m_alarmOrderMap.clear();
|
||||||
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
||||||
{
|
{
|
||||||
kbd_dbms::CVarType key;
|
iot_dbms::CVarType key;
|
||||||
kbd_dbms::CVarType value;
|
iot_dbms::CVarType value;
|
||||||
kbd_dbms::CVarType order;
|
iot_dbms::CVarType order;
|
||||||
result.getColumnValue(nIndex, 0, key);
|
result.getColumnValue(nIndex, 0, key);
|
||||||
result.getColumnValue(nIndex, 1, value);
|
result.getColumnValue(nIndex, 1, value);
|
||||||
result.getColumnValue(nIndex, 2, order);
|
result.getColumnValue(nIndex, 2, order);
|
||||||
@ -245,8 +245,8 @@ void CDataInfoManage::loadLocation()
|
|||||||
std::string strTableName = "sys_model_location_info";
|
std::string strTableName = "sys_model_location_info";
|
||||||
if(m_rtdbAccess->open(strApplicationName.c_str(), strTableName.c_str()))
|
if(m_rtdbAccess->open(strApplicationName.c_str(), strTableName.c_str()))
|
||||||
{
|
{
|
||||||
kbd_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
iot_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
||||||
kbd_dbms::CRdbQueryResult result;
|
iot_dbms::CRdbQueryResult result;
|
||||||
std::vector<std::string> columns;
|
std::vector<std::string> columns;
|
||||||
columns.push_back("location_id");
|
columns.push_back("location_id");
|
||||||
columns.push_back("description");
|
columns.push_back("description");
|
||||||
@ -260,10 +260,10 @@ void CDataInfoManage::loadLocation()
|
|||||||
{
|
{
|
||||||
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
||||||
{
|
{
|
||||||
kbd_dbms::CVarType id;
|
iot_dbms::CVarType id;
|
||||||
kbd_dbms::CVarType desc;
|
iot_dbms::CVarType desc;
|
||||||
kbd_dbms::CVarType p_id;
|
iot_dbms::CVarType p_id;
|
||||||
kbd_dbms::CVarType type;
|
iot_dbms::CVarType type;
|
||||||
result.getColumnValue(nIndex, 0, id);
|
result.getColumnValue(nIndex, 0, id);
|
||||||
result.getColumnValue(nIndex, 1, desc);
|
result.getColumnValue(nIndex, 1, desc);
|
||||||
result.getColumnValue(nIndex, 2, p_id);
|
result.getColumnValue(nIndex, 2, p_id);
|
||||||
@ -300,8 +300,8 @@ void CDataInfoManage::loadDevType()
|
|||||||
std::string strTableName = "dev_type_def";
|
std::string strTableName = "dev_type_def";
|
||||||
if(m_rtdbAccess->open(strApplicationName.c_str(), strTableName.c_str()))
|
if(m_rtdbAccess->open(strApplicationName.c_str(), strTableName.c_str()))
|
||||||
{
|
{
|
||||||
kbd_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
iot_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
||||||
kbd_dbms::CRdbQueryResult result;
|
iot_dbms::CRdbQueryResult result;
|
||||||
std::vector<std::string> columns;
|
std::vector<std::string> columns;
|
||||||
columns.push_back("dev_type_id");
|
columns.push_back("dev_type_id");
|
||||||
columns.push_back("description");
|
columns.push_back("description");
|
||||||
@ -311,8 +311,8 @@ void CDataInfoManage::loadDevType()
|
|||||||
m_devTypeMap.clear();
|
m_devTypeMap.clear();
|
||||||
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
||||||
{
|
{
|
||||||
kbd_dbms::CVarType key;
|
iot_dbms::CVarType key;
|
||||||
kbd_dbms::CVarType value;
|
iot_dbms::CVarType value;
|
||||||
result.getColumnValue(nIndex, 0, key);
|
result.getColumnValue(nIndex, 0, key);
|
||||||
result.getColumnValue(nIndex, 1, value);
|
result.getColumnValue(nIndex, 1, value);
|
||||||
|
|
||||||
@ -327,7 +327,7 @@ void CDataInfoManage::loadDevInfo()
|
|||||||
{
|
{
|
||||||
std::string strTableName = "dev_info";
|
std::string strTableName = "dev_info";
|
||||||
m_rtdbNetAcs->connect(m_nDomain, CN_AppId_PSCADA);
|
m_rtdbNetAcs->connect(m_nDomain, CN_AppId_PSCADA);
|
||||||
kbd_idlfile::RdbRet objRet;
|
iot_idl::RdbRet objRet;
|
||||||
std::vector<std::string> columns;
|
std::vector<std::string> columns;
|
||||||
columns.push_back("tag_name");
|
columns.push_back("tag_name");
|
||||||
columns.push_back("description");
|
columns.push_back("description");
|
||||||
@ -389,8 +389,8 @@ void CDataInfoManage::loadAlarmStatus()
|
|||||||
std::string strTableName = "alarm_status_define";
|
std::string strTableName = "alarm_status_define";
|
||||||
if(m_rtdbAccess->open(strApplicationName.c_str(), strTableName.c_str()))
|
if(m_rtdbAccess->open(strApplicationName.c_str(), strTableName.c_str()))
|
||||||
{
|
{
|
||||||
kbd_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
iot_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
||||||
kbd_dbms::CRdbQueryResult result;
|
iot_dbms::CRdbQueryResult result;
|
||||||
std::vector<std::string> columns;
|
std::vector<std::string> columns;
|
||||||
columns.push_back("alarm_type");
|
columns.push_back("alarm_type");
|
||||||
columns.push_back("status_value");
|
columns.push_back("status_value");
|
||||||
@ -401,9 +401,9 @@ void CDataInfoManage::loadAlarmStatus()
|
|||||||
m_alarmStatusMap.clear();
|
m_alarmStatusMap.clear();
|
||||||
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
||||||
{
|
{
|
||||||
kbd_dbms::CVarType alarm_type;
|
iot_dbms::CVarType alarm_type;
|
||||||
kbd_dbms::CVarType status_value;
|
iot_dbms::CVarType status_value;
|
||||||
kbd_dbms::CVarType alarm_manner;
|
iot_dbms::CVarType alarm_manner;
|
||||||
result.getColumnValue(nIndex, 0, alarm_type);
|
result.getColumnValue(nIndex, 0, alarm_type);
|
||||||
result.getColumnValue(nIndex, 1, status_value);
|
result.getColumnValue(nIndex, 1, status_value);
|
||||||
result.getColumnValue(nIndex, 2, alarm_manner);
|
result.getColumnValue(nIndex, 2, alarm_manner);
|
||||||
@ -424,8 +424,8 @@ void CDataInfoManage::loadAlarmManner()
|
|||||||
std::string strTableName = "alarm_manner_define";
|
std::string strTableName = "alarm_manner_define";
|
||||||
if(m_rtdbAccess->open(strApplicationName.c_str(), strTableName.c_str()))
|
if(m_rtdbAccess->open(strApplicationName.c_str(), strTableName.c_str()))
|
||||||
{
|
{
|
||||||
kbd_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
iot_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
||||||
kbd_dbms::CRdbQueryResult result;
|
iot_dbms::CRdbQueryResult result;
|
||||||
std::vector<std::string> columns;
|
std::vector<std::string> columns;
|
||||||
columns.push_back("manner_id");
|
columns.push_back("manner_id");
|
||||||
columns.push_back("alarm_priority");
|
columns.push_back("alarm_priority");
|
||||||
@ -435,8 +435,8 @@ void CDataInfoManage::loadAlarmManner()
|
|||||||
m_alarmMannerMap.clear();
|
m_alarmMannerMap.clear();
|
||||||
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
||||||
{
|
{
|
||||||
kbd_dbms::CVarType key;
|
iot_dbms::CVarType key;
|
||||||
kbd_dbms::CVarType value;
|
iot_dbms::CVarType value;
|
||||||
result.getColumnValue(nIndex, 0, key);
|
result.getColumnValue(nIndex, 0, key);
|
||||||
result.getColumnValue(nIndex, 1, value);
|
result.getColumnValue(nIndex, 1, value);
|
||||||
|
|
||||||
@ -460,7 +460,7 @@ void CDataInfoManage::loadDevPoint()
|
|||||||
for(int nIndex=0; nIndex<listTable.length(); nIndex++)
|
for(int nIndex=0; nIndex<listTable.length(); nIndex++)
|
||||||
{
|
{
|
||||||
m_rtdbNetAcs->connect(m_nDomain, CN_AppId_PSCADA);
|
m_rtdbNetAcs->connect(m_nDomain, CN_AppId_PSCADA);
|
||||||
kbd_idlfile::RdbRet objRet;
|
iot_idl::RdbRet objRet;
|
||||||
std::vector<std::string> columns;
|
std::vector<std::string> columns;
|
||||||
columns.push_back("tag_name");
|
columns.push_back("tag_name");
|
||||||
columns.push_back("device");
|
columns.push_back("device");
|
||||||
|
|||||||
@ -43,9 +43,9 @@ private:
|
|||||||
void loadDevPoint();
|
void loadDevPoint();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
kbd_dbms::CRdbAccess * m_rtdbAccess;
|
iot_dbms::CRdbAccess * m_rtdbAccess;
|
||||||
kbd_dbms::CRdbNetApi * m_rtdbNetAcs;
|
iot_dbms::CRdbNetApi * m_rtdbNetAcs;
|
||||||
kbd_public::CSysInfoInterfacePtr m_ptrSysInfo;
|
iot_public::CSysInfoInterfacePtr m_ptrSysInfo;
|
||||||
int m_nDomain;
|
int m_nDomain;
|
||||||
QMap<int, QString> m_alarmLevelMap; //< alarm_level_define PRIORITY_ID - PRIORITY_NAME
|
QMap<int, QString> m_alarmLevelMap; //< alarm_level_define PRIORITY_ID - PRIORITY_NAME
|
||||||
QMap<int, int > m_alarmOrderMap; //< alarm_level_define PRIORITY_ID - PRIORITY_ORDER
|
QMap<int, int > m_alarmOrderMap; //< alarm_level_define PRIORITY_ID - PRIORITY_ORDER
|
||||||
|
|||||||
@ -17,7 +17,7 @@ void CHisEventManage::queryHisEventStatis(int location, int devType, qint64 star
|
|||||||
{
|
{
|
||||||
QTime time;
|
QTime time;
|
||||||
time.start();
|
time.start();
|
||||||
kbd_dbms::CTsdbConnPtr tsdbConnPtr;
|
iot_dbms::CTsdbConnPtr tsdbConnPtr;
|
||||||
if(!getValidTsdbConnPtr(tsdbConnPtr))
|
if(!getValidTsdbConnPtr(tsdbConnPtr))
|
||||||
{
|
{
|
||||||
LOGERROR("CTsdbQuery: 未获取到有效的TSDB连接!");
|
LOGERROR("CTsdbQuery: 未获取到有效的TSDB连接!");
|
||||||
@ -40,7 +40,7 @@ void CHisEventManage::queryHisEventContrast(QList<int> selectedList, qint64 star
|
|||||||
{
|
{
|
||||||
QTime time;
|
QTime time;
|
||||||
time.start();
|
time.start();
|
||||||
kbd_dbms::CTsdbConnPtr tsdbConnPtr;
|
iot_dbms::CTsdbConnPtr tsdbConnPtr;
|
||||||
if(!getValidTsdbConnPtr(tsdbConnPtr))
|
if(!getValidTsdbConnPtr(tsdbConnPtr))
|
||||||
{
|
{
|
||||||
LOGERROR("CTsdbQuery: 未获取到有效的TSDB连接!");
|
LOGERROR("CTsdbQuery: 未获取到有效的TSDB连接!");
|
||||||
@ -69,7 +69,7 @@ void CHisEventManage::queryHisEventContrast(QList<int> selectedList, qint64 star
|
|||||||
emit updateHisEventContrast(record);
|
emit updateHisEventContrast(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CHisEventManage::getValidTsdbConnPtr(kbd_dbms::CTsdbConnPtr &ptr)
|
bool CHisEventManage::getValidTsdbConnPtr(iot_dbms::CTsdbConnPtr &ptr)
|
||||||
{
|
{
|
||||||
if(m_tsdbConnPtr != NULL)
|
if(m_tsdbConnPtr != NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -19,7 +19,7 @@ public slots:
|
|||||||
void queryHisEventContrast(QList<int> selectedList, qint64 startTime, qint64 endTime, EN_STATIS_STYLE style);
|
void queryHisEventContrast(QList<int> selectedList, qint64 startTime, qint64 endTime, EN_STATIS_STYLE style);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool getValidTsdbConnPtr(kbd_dbms::CTsdbConnPtr &ptr);
|
bool getValidTsdbConnPtr(iot_dbms::CTsdbConnPtr &ptr);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void updateHisEventStatis(const QMap<qint64, QMap<int, int> > &event);
|
void updateHisEventStatis(const QMap<qint64, QMap<int, int> > &event);
|
||||||
@ -27,7 +27,7 @@ signals:
|
|||||||
void updateHisEventContrast(const QMap<QString, QMap<int, int> > &event);
|
void updateHisEventContrast(const QMap<QString, QMap<int, int> > &event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
kbd_dbms::CTsdbConnPtr m_tsdbConnPtr;
|
iot_dbms::CTsdbConnPtr m_tsdbConnPtr;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CHISEVENTMANAGE_H
|
#endif // CHISEVENTMANAGE_H
|
||||||
|
|||||||
@ -28,7 +28,7 @@ CMainWidget::~CMainWidget()
|
|||||||
{
|
{
|
||||||
if(!m_editMode)
|
if(!m_editMode)
|
||||||
{
|
{
|
||||||
kbd_dbms::releaseTsdbApi();
|
iot_dbms::releaseTsdbApi();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_pHisEventManage)
|
if(m_pHisEventManage)
|
||||||
@ -76,7 +76,7 @@ void CMainWidget::initialize()
|
|||||||
|
|
||||||
if(!m_editMode)
|
if(!m_editMode)
|
||||||
{
|
{
|
||||||
kbd_dbms::initTsdbApi();
|
iot_dbms::initTsdbApi();
|
||||||
|
|
||||||
loadAlarmColor();
|
loadAlarmColor();
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ void CMainWidget::initialize()
|
|||||||
void CMainWidget::initStyleSheet()
|
void CMainWidget::initStyleSheet()
|
||||||
{
|
{
|
||||||
QString style = QString();
|
QString style = QString();
|
||||||
std::string strFullPath = kbd_public::CFileStyle
|
std::string strFullPath = iot_public::CFileStyle
|
||||||
::getPathOfStyleFile("public.qss") ;
|
::getPathOfStyleFile("public.qss") ;
|
||||||
QFile file1(QString::fromStdString(strFullPath));
|
QFile file1(QString::fromStdString(strFullPath));
|
||||||
if (file1.open(QIODevice::ReadOnly))
|
if (file1.open(QIODevice::ReadOnly))
|
||||||
@ -98,7 +98,7 @@ void CMainWidget::initStyleSheet()
|
|||||||
}
|
}
|
||||||
file1.close();
|
file1.close();
|
||||||
|
|
||||||
strFullPath = kbd_public::CFileStyle
|
strFullPath = iot_public::CFileStyle
|
||||||
::getPathOfStyleFile("AlarmStatisWidget.qss") ;
|
::getPathOfStyleFile("AlarmStatisWidget.qss") ;
|
||||||
QFile file2(QString::fromStdString(strFullPath));
|
QFile file2(QString::fromStdString(strFullPath));
|
||||||
if (file2.open(QIODevice::ReadOnly))
|
if (file2.open(QIODevice::ReadOnly))
|
||||||
@ -116,7 +116,7 @@ void CMainWidget::initStyleSheet()
|
|||||||
|
|
||||||
void CMainWidget::loadAlarmColor()
|
void CMainWidget::loadAlarmColor()
|
||||||
{
|
{
|
||||||
QString filePath = QString::fromStdString(kbd_public::CFileUtil::getCurModuleDir())
|
QString filePath = QString::fromStdString(iot_public::CFileUtil::getCurModuleDir())
|
||||||
+ QString("../../data/model/alarm_color_define.xml");
|
+ QString("../../data/model/alarm_color_define.xml");
|
||||||
|
|
||||||
QDomDocument document;
|
QDomDocument document;
|
||||||
|
|||||||
@ -32,7 +32,7 @@ CTsdbQuery::~CTsdbQuery()
|
|||||||
{
|
{
|
||||||
int64 resultSize = 0;
|
int64 resultSize = 0;
|
||||||
//< 释放结果集
|
//< 释放结果集
|
||||||
std::vector<std::vector<kbd_dbms::SHisEventPoint> *>::iterator res = m_pVecResult->begin();
|
std::vector<std::vector<iot_dbms::SHisEventPoint> *>::iterator res = m_pVecResult->begin();
|
||||||
while(res != m_pVecResult->end())
|
while(res != m_pVecResult->end())
|
||||||
{
|
{
|
||||||
resultSize += (*res)->size();
|
resultSize += (*res)->size();
|
||||||
@ -98,8 +98,8 @@ bool CTsdbQuery::queryEventByUnit(qint64 startTime, qint64 endTime, QMap<QString
|
|||||||
|
|
||||||
for(size_t nIndex(0); nIndex < m_pVecResult->size(); nIndex++)
|
for(size_t nIndex(0); nIndex < m_pVecResult->size(); nIndex++)
|
||||||
{
|
{
|
||||||
std::vector<kbd_dbms::SHisEventPoint> *evetVector = m_pVecResult->at(nIndex);
|
std::vector<iot_dbms::SHisEventPoint> *evetVector = m_pVecResult->at(nIndex);
|
||||||
std::vector<kbd_dbms::SHisEventPoint>::iterator iter = evetVector->begin();
|
std::vector<iot_dbms::SHisEventPoint>::iterator iter = evetVector->begin();
|
||||||
for(; iter != evetVector->end(); iter++)
|
for(; iter != evetVector->end(); iter++)
|
||||||
{
|
{
|
||||||
int priority = getAlarmLevel(m_pVecMpKey->at(nIndex).m_pszTagName,
|
int priority = getAlarmLevel(m_pVecMpKey->at(nIndex).m_pszTagName,
|
||||||
@ -189,8 +189,8 @@ void CTsdbQuery::parseResult(qint64 startTime, qint64 endTime, EN_STATIS_MODE mo
|
|||||||
{
|
{
|
||||||
for(size_t nIndex(0); nIndex < m_pVecResult->size(); nIndex++)
|
for(size_t nIndex(0); nIndex < m_pVecResult->size(); nIndex++)
|
||||||
{
|
{
|
||||||
std::vector<kbd_dbms::SHisEventPoint> *evetVector = m_pVecResult->at(nIndex);
|
std::vector<iot_dbms::SHisEventPoint> *evetVector = m_pVecResult->at(nIndex);
|
||||||
std::vector<kbd_dbms::SHisEventPoint>::iterator iter = evetVector->begin();
|
std::vector<iot_dbms::SHisEventPoint>::iterator iter = evetVector->begin();
|
||||||
qint64 time = startTime;
|
qint64 time = startTime;
|
||||||
qint64 addTime = getAddMsecByMode(time, mode);
|
qint64 addTime = getAddMsecByMode(time, mode);
|
||||||
for(; iter != evetVector->end(); iter++)
|
for(; iter != evetVector->end(); iter++)
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
#include "tsdb_api/TsdbApi.h"
|
#include "tsdb_api/TsdbApi.h"
|
||||||
#include "db_his_query_api/DbHisQueryBase.h"
|
#include "db_his_query_api/DbHisQueryBase.h"
|
||||||
|
|
||||||
using namespace kbd_dbms;
|
using namespace iot_dbms;
|
||||||
class CTsdbQuery
|
class CTsdbQuery
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -28,7 +28,7 @@ private:
|
|||||||
std::vector<std::vector<SHisEventPoint> *> *m_pVecResult;
|
std::vector<std::vector<SHisEventPoint> *> *m_pVecResult;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
kbd_dbms::CTsdbConnPtr m_tsdbConnPtr;
|
iot_dbms::CTsdbConnPtr m_tsdbConnPtr;
|
||||||
QString m_strDevice;
|
QString m_strDevice;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -7,12 +7,12 @@
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
kbd_public::StartLogSystem("HMI", "AlarmStatisWidget");
|
iot_public::StartLogSystem("HMI", "AlarmStatisWidget");
|
||||||
if (!(kbd_net::initMsgBus("HMI", "HMI")))
|
if (!(iot_net::initMsgBus("HMI", "HMI")))
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
kbd_service::CPermMngApiPtr perm = kbd_service::getPermMngInstance("base");
|
iot_service::CPermMngApiPtr perm = iot_service::getPermMngInstance("base");
|
||||||
if(!perm || PERM_NORMAL != perm->PermDllInit())
|
if(!perm || PERM_NORMAL != perm->PermDllInit())
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
@ -23,7 +23,7 @@ int main(int argc, char *argv[])
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// kbd_service::CDpcdaForApp::initGlobalThread();
|
// iot_service::CDpcdaForApp::initGlobalThread();
|
||||||
|
|
||||||
{
|
{
|
||||||
LOGINFO("=========================== AlarmStatisWidget ===========================");
|
LOGINFO("=========================== AlarmStatisWidget ===========================");
|
||||||
@ -35,10 +35,10 @@ int main(int argc, char *argv[])
|
|||||||
app.exec();
|
app.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
// kbd_service::CDpcdaForApp::releaseGlobalThread();
|
// iot_service::CDpcdaForApp::releaseGlobalThread();
|
||||||
|
|
||||||
kbd_net::releaseMsgBus();
|
iot_net::releaseMsgBus();
|
||||||
kbd_public::StopLogSystem();
|
iot_public::StopLogSystem();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,7 +58,7 @@ void CAccidentReviewDialog::initView()
|
|||||||
void CAccidentReviewDialog::initTree()
|
void CAccidentReviewDialog::initTree()
|
||||||
{
|
{
|
||||||
QMap<int, QList<QPair<int, ST_NODE>>> m_mapNav;
|
QMap<int, QList<QPair<int, ST_NODE>>> m_mapNav;
|
||||||
readNavJson(QString::fromStdString(kbd_public::CFileUtil::getCurModuleDir())
|
readNavJson(QString::fromStdString(iot_public::CFileUtil::getCurModuleDir())
|
||||||
+ QString("../../data/model/NavigationWidget.json"), m_mapNav);
|
+ QString("../../data/model/NavigationWidget.json"), m_mapNav);
|
||||||
QList<QPair<int, ST_NODE>> nodeList = m_mapNav.value(-1);
|
QList<QPair<int, ST_NODE>> nodeList = m_mapNav.value(-1);
|
||||||
for(int nIndex=0; nIndex<nodeList.length(); nIndex++)
|
for(int nIndex=0; nIndex<nodeList.length(); nIndex++)
|
||||||
@ -78,7 +78,7 @@ void CAccidentReviewDialog::initTree()
|
|||||||
|
|
||||||
void CAccidentReviewDialog::getFilterNames(const QString &path)
|
void CAccidentReviewDialog::getFilterNames(const QString &path)
|
||||||
{
|
{
|
||||||
QString filePath = QString::fromStdString(kbd_public::CFileUtil::getCurModuleDir())
|
QString filePath = QString::fromStdString(iot_public::CFileUtil::getCurModuleDir())
|
||||||
+ QString("../../data/pic/");
|
+ QString("../../data/pic/");
|
||||||
m_fileNameList = getAllFile(filePath, filePath, path);
|
m_fileNameList = getAllFile(filePath, filePath, path);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
#include "CAlarmMsgManage.h"
|
#include "CAlarmMsgManage.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include "CAlarmDataCollect.h"
|
#include "CAlarmDataCollect.h"
|
||||||
using namespace kbd_service;
|
using namespace iot_service;
|
||||||
CAiAlarmDataCollect * CAiAlarmDataCollect::m_pInstance = NULL;
|
CAiAlarmDataCollect * CAiAlarmDataCollect::m_pInstance = NULL;
|
||||||
CAiAlarmDataCollect::CAiAlarmDataCollect()
|
CAiAlarmDataCollect::CAiAlarmDataCollect()
|
||||||
: CIntelliAlmApi4Clt(),
|
: CIntelliAlmApi4Clt(),
|
||||||
@ -12,7 +12,7 @@ CAiAlarmDataCollect::CAiAlarmDataCollect()
|
|||||||
m_pAlternateTimer(Q_NULLPTR)
|
m_pAlternateTimer(Q_NULLPTR)
|
||||||
{
|
{
|
||||||
m_rtdbMutex = new QMutex();
|
m_rtdbMutex = new QMutex();
|
||||||
m_rtdbPriorityOrderAccess = new kbd_dbms::CRdbAccess();
|
m_rtdbPriorityOrderAccess = new iot_dbms::CRdbAccess();
|
||||||
m_rtdbPriorityOrderAccess->open("base", "alarm_level_define");
|
m_rtdbPriorityOrderAccess->open("base", "alarm_level_define");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,25 +68,25 @@ bool CAiAlarmDataCollect::isFaultRecallState()
|
|||||||
return m_bFaultRecallState;
|
return m_bFaultRecallState;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CAiAlarmDataCollect::requestDelAlm(kbd_idlfile::SIntelliAlmDel &objDelAlm)
|
bool CAiAlarmDataCollect::requestDelAlm(iot_idl::SIntelliAlmDel &objDelAlm)
|
||||||
{
|
{
|
||||||
LOGDEBUG("请求删除!");
|
LOGDEBUG("请求删除!");
|
||||||
return kbd_service::CIntelliAlmApi4Clt::requestDelAlm(objDelAlm);
|
return iot_service::CIntelliAlmApi4Clt::requestDelAlm(objDelAlm);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CAiAlarmDataCollect::requestSeprAlm(kbd_idlfile::SIntelliAlmSepr &objSeprAlm)
|
bool CAiAlarmDataCollect::requestSeprAlm(iot_idl::SIntelliAlmSepr &objSeprAlm)
|
||||||
{
|
{
|
||||||
LOGDEBUG("请求分离!");
|
LOGDEBUG("请求分离!");
|
||||||
return kbd_service::CIntelliAlmApi4Clt::requestSeprAlm(objSeprAlm);
|
return iot_service::CIntelliAlmApi4Clt::requestSeprAlm(objSeprAlm);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CAiAlarmDataCollect::requestMergeAlm(kbd_idlfile::SIntelliAlmMerge &objMergeAlm)
|
bool CAiAlarmDataCollect::requestMergeAlm(iot_idl::SIntelliAlmMerge &objMergeAlm)
|
||||||
{
|
{
|
||||||
LOGDEBUG("请求合并!");
|
LOGDEBUG("请求合并!");
|
||||||
return kbd_service::CIntelliAlmApi4Clt::requestMergeAlm(objMergeAlm);
|
return iot_service::CIntelliAlmApi4Clt::requestMergeAlm(objMergeAlm);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAiAlarmDataCollect::handleAllAlmMsg(int nDomainId, kbd_idlfile::SIntelliAlmAdd &objAllAlm)
|
void CAiAlarmDataCollect::handleAllAlmMsg(int nDomainId, iot_idl::SIntelliAlmAdd &objAllAlm)
|
||||||
{
|
{
|
||||||
LOGINFO("========== AiAlarmDataCollect handleAllAlmMsg ==========");
|
LOGINFO("========== AiAlarmDataCollect handleAllAlmMsg ==========");
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ void CAiAlarmDataCollect::handleAllAlmMsg(int nDomainId, kbd_idlfile::SIntelliAl
|
|||||||
QList<AiAlarmMsgPtr> almList;
|
QList<AiAlarmMsgPtr> almList;
|
||||||
for(int nAddMsgIndex(0); nAddMsgIndex < nAlarmCount; nAddMsgIndex++)
|
for(int nAddMsgIndex(0); nAddMsgIndex < nAlarmCount; nAddMsgIndex++)
|
||||||
{
|
{
|
||||||
kbd_idlfile::SIntelliAlmInfo msg = objAllAlm.alm_info(nAddMsgIndex);
|
iot_idl::SIntelliAlmInfo msg = objAllAlm.alm_info(nAddMsgIndex);
|
||||||
AiAlarmMsgPtr alm(new CAiAlarmMsgInfo());
|
AiAlarmMsgPtr alm(new CAiAlarmMsgInfo());
|
||||||
alm->initialize(msg);
|
alm->initialize(msg);
|
||||||
alm->priorityOrder = queryPriorityOrder(alm->priority);
|
alm->priorityOrder = queryPriorityOrder(alm->priority);
|
||||||
@ -109,7 +109,7 @@ void CAiAlarmDataCollect::handleAllAlmMsg(int nDomainId, kbd_idlfile::SIntelliAl
|
|||||||
emit sigMsgRefresh();
|
emit sigMsgRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAiAlarmDataCollect::handleAddAlmMsg(kbd_idlfile::SIntelliAlmAdd &objAddAlm)
|
void CAiAlarmDataCollect::handleAddAlmMsg(iot_idl::SIntelliAlmAdd &objAddAlm)
|
||||||
{
|
{
|
||||||
LOGINFO("========== AiAlarmDataCollect handleAddAlmMsg ==========");
|
LOGINFO("========== AiAlarmDataCollect handleAddAlmMsg ==========");
|
||||||
QMutexLocker locker(m_rtdbMutex);
|
QMutexLocker locker(m_rtdbMutex);
|
||||||
@ -118,7 +118,7 @@ void CAiAlarmDataCollect::handleAddAlmMsg(kbd_idlfile::SIntelliAlmAdd &objAddAlm
|
|||||||
QList<AiAlarmMsgPtr> almList;
|
QList<AiAlarmMsgPtr> almList;
|
||||||
for(int nAddMsgIndex(0); nAddMsgIndex < nAlarmCount; nAddMsgIndex++)
|
for(int nAddMsgIndex(0); nAddMsgIndex < nAlarmCount; nAddMsgIndex++)
|
||||||
{
|
{
|
||||||
kbd_idlfile::SIntelliAlmInfo msg = objAddAlm.alm_info(nAddMsgIndex);
|
iot_idl::SIntelliAlmInfo msg = objAddAlm.alm_info(nAddMsgIndex);
|
||||||
AiAlarmMsgPtr alm(new CAiAlarmMsgInfo());
|
AiAlarmMsgPtr alm(new CAiAlarmMsgInfo());
|
||||||
alm->initialize(msg);
|
alm->initialize(msg);
|
||||||
alm->priorityOrder = queryPriorityOrder(alm->priority);
|
alm->priorityOrder = queryPriorityOrder(alm->priority);
|
||||||
@ -128,7 +128,7 @@ void CAiAlarmDataCollect::handleAddAlmMsg(kbd_idlfile::SIntelliAlmAdd &objAddAlm
|
|||||||
LOGDEBUG("AiAlarmDataCollect handleAddAlmMsg():count[%d]",nAlarmCount);
|
LOGDEBUG("AiAlarmDataCollect handleAddAlmMsg():count[%d]",nAlarmCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAiAlarmDataCollect::handleDelAlmMsg(kbd_idlfile::SIntelliAlmDel &objDelAlm)
|
void CAiAlarmDataCollect::handleDelAlmMsg(iot_idl::SIntelliAlmDel &objDelAlm)
|
||||||
{
|
{
|
||||||
LOGINFO("========== AiAlarmDataCollect handleDelAlmMsg ==========");
|
LOGINFO("========== AiAlarmDataCollect handleDelAlmMsg ==========");
|
||||||
QMutexLocker locker(m_rtdbMutex);
|
QMutexLocker locker(m_rtdbMutex);
|
||||||
@ -144,7 +144,7 @@ void CAiAlarmDataCollect::handleDelAlmMsg(kbd_idlfile::SIntelliAlmDel &objDelAlm
|
|||||||
LOGDEBUG("AiAlarmDataCollect handleDelAlmMsg():count[%d]",nAlarmCount);
|
LOGDEBUG("AiAlarmDataCollect handleDelAlmMsg():count[%d]",nAlarmCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAiAlarmDataCollect::handleBrokenAlmMsg(kbd_idlfile::SIntelliAlmBroken &objBrokenAlm)
|
void CAiAlarmDataCollect::handleBrokenAlmMsg(iot_idl::SIntelliAlmBroken &objBrokenAlm)
|
||||||
{
|
{
|
||||||
//先保证能够编译通过
|
//先保证能够编译通过
|
||||||
LOGINFO("========== AiAlarmDataCollect handleBrokenAlmMsg ==========");
|
LOGINFO("========== AiAlarmDataCollect handleBrokenAlmMsg ==========");
|
||||||
@ -160,7 +160,7 @@ void CAiAlarmDataCollect::handleBrokenAlmMsg(kbd_idlfile::SIntelliAlmBroken &obj
|
|||||||
LOGDEBUG("AiAlarmDataCollect handleBrokenAlmMsg():count[%d]",nAlarmCount);
|
LOGDEBUG("AiAlarmDataCollect handleBrokenAlmMsg():count[%d]",nAlarmCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAiAlarmDataCollect::handleReleaseAlmMsg(kbd_idlfile::SIntelliAlmRelease &objReleaseAlm)
|
void CAiAlarmDataCollect::handleReleaseAlmMsg(iot_idl::SIntelliAlmRelease &objReleaseAlm)
|
||||||
{
|
{
|
||||||
//先保证能够编译通过
|
//先保证能够编译通过
|
||||||
LOGINFO("========== AiAlarmDataCollect handleReleaseAlmMsg ==========");
|
LOGINFO("========== AiAlarmDataCollect handleReleaseAlmMsg ==========");
|
||||||
@ -226,8 +226,8 @@ void CAiAlarmDataCollect::slotSwitchFaultRecallState(bool bFaultRecallState)
|
|||||||
|
|
||||||
int CAiAlarmDataCollect::queryPriorityOrder(int &id)
|
int CAiAlarmDataCollect::queryPriorityOrder(int &id)
|
||||||
{
|
{
|
||||||
kbd_dbms::CTableLockGuard locker(*m_rtdbPriorityOrderAccess);
|
iot_dbms::CTableLockGuard locker(*m_rtdbPriorityOrderAccess);
|
||||||
kbd_dbms::CVarType value = -1000;
|
iot_dbms::CVarType value = -1000;
|
||||||
m_rtdbPriorityOrderAccess->getColumnValueByKey((void*)&id, "priority_order", value);
|
m_rtdbPriorityOrderAccess->getColumnValueByKey((void*)&id, "priority_order", value);
|
||||||
return value.toInt();
|
return value.toInt();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
#include "net_msg_bus_api/MsgBusApi.h"
|
#include "net_msg_bus_api/MsgBusApi.h"
|
||||||
#include "dbms/rdb_api/CRdbAccess.h"
|
#include "dbms/rdb_api/CRdbAccess.h"
|
||||||
|
|
||||||
class CAiAlarmDataCollect : public QObject, public kbd_service::CIntelliAlmApi4Clt
|
class CAiAlarmDataCollect : public QObject, public iot_service::CIntelliAlmApi4Clt
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
@ -25,21 +25,21 @@ public:
|
|||||||
|
|
||||||
bool isFaultRecallState();
|
bool isFaultRecallState();
|
||||||
|
|
||||||
virtual bool requestDelAlm(kbd_idlfile::SIntelliAlmDel &objDelAlm);
|
virtual bool requestDelAlm(iot_idl::SIntelliAlmDel &objDelAlm);
|
||||||
|
|
||||||
virtual bool requestSeprAlm(kbd_idlfile::SIntelliAlmSepr &objSeprAlm);
|
virtual bool requestSeprAlm(iot_idl::SIntelliAlmSepr &objSeprAlm);
|
||||||
|
|
||||||
virtual bool requestMergeAlm(kbd_idlfile::SIntelliAlmMerge &objMergeAlm);
|
virtual bool requestMergeAlm(iot_idl::SIntelliAlmMerge &objMergeAlm);
|
||||||
|
|
||||||
virtual void handleAllAlmMsg(int nDomainId,kbd_idlfile::SIntelliAlmAdd &objAllAlm);
|
virtual void handleAllAlmMsg(int nDomainId,iot_idl::SIntelliAlmAdd &objAllAlm);
|
||||||
|
|
||||||
virtual void handleAddAlmMsg(kbd_idlfile::SIntelliAlmAdd &objAddAlm);
|
virtual void handleAddAlmMsg(iot_idl::SIntelliAlmAdd &objAddAlm);
|
||||||
|
|
||||||
virtual void handleDelAlmMsg(kbd_idlfile::SIntelliAlmDel &objDelAlm);
|
virtual void handleDelAlmMsg(iot_idl::SIntelliAlmDel &objDelAlm);
|
||||||
|
|
||||||
virtual void handleBrokenAlmMsg(kbd_idlfile::SIntelliAlmBroken &objBrokenAlm);
|
virtual void handleBrokenAlmMsg(iot_idl::SIntelliAlmBroken &objBrokenAlm);
|
||||||
|
|
||||||
virtual void handleReleaseAlmMsg(kbd_idlfile::SIntelliAlmRelease &objReleaseAlm);
|
virtual void handleReleaseAlmMsg(iot_idl::SIntelliAlmRelease &objReleaseAlm);
|
||||||
signals:
|
signals:
|
||||||
//< 启停定时器
|
//< 启停定时器
|
||||||
void sigTimerShot(const bool bStop);
|
void sigTimerShot(const bool bStop);
|
||||||
@ -77,7 +77,7 @@ private:
|
|||||||
bool m_bFaultRecallState;
|
bool m_bFaultRecallState;
|
||||||
QMutex *m_rtdbMutex;
|
QMutex *m_rtdbMutex;
|
||||||
QTimer * m_pAlternateTimer;
|
QTimer * m_pAlternateTimer;
|
||||||
kbd_dbms::CRdbAccess * m_rtdbPriorityOrderAccess;
|
iot_dbms::CRdbAccess * m_rtdbPriorityOrderAccess;
|
||||||
static CAiAlarmDataCollect * m_pInstance;
|
static CAiAlarmDataCollect * m_pInstance;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -380,8 +380,8 @@ bool CAiAlarmDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, con
|
|||||||
wave = QString("%1%2%3").arg("\"").arg(wave).arg("\"");
|
wave = QString("%1%2%3").arg("\"").arg(wave).arg("\"");
|
||||||
LOGINFO("录波文件为:%s",wave.toStdString().c_str());
|
LOGINFO("录波文件为:%s",wave.toStdString().c_str());
|
||||||
|
|
||||||
const std::string strProc = std::move(kbd_public::CFileUtil::getPathOfBinFile(
|
const std::string strProc = std::move(iot_public::CFileUtil::getPathOfBinFile(
|
||||||
std::string("WaveAnalyze") + kbd_public::CFileUtil::getProcSuffix()));
|
std::string("WaveAnalyze") + iot_public::CFileUtil::getProcSuffix()));
|
||||||
if(strProc.empty())
|
if(strProc.empty())
|
||||||
LOGERROR("未找到可执行文件WaveAnalyze");
|
LOGERROR("未找到可执行文件WaveAnalyze");
|
||||||
else
|
else
|
||||||
@ -401,8 +401,8 @@ void CAiAlarmDelegate::slotLoadConfig()
|
|||||||
CAlarmSetMng::instance()->getEmptyInfo(m_emptyBackgroundColor,m_emptyTipColor,m_emptyTip);
|
CAlarmSetMng::instance()->getEmptyInfo(m_emptyBackgroundColor,m_emptyTipColor,m_emptyTip);
|
||||||
//CAlarmColorMng::instance()->getActAndFunc(m_act,m_func);
|
//CAlarmColorMng::instance()->getActAndFunc(m_act,m_func);
|
||||||
|
|
||||||
std::string style = kbd_public::CFileStyle::getCurStyle();
|
std::string style = iot_public::CFileStyle::getCurStyle();
|
||||||
m_strTrendPath = kbd_public::CFileUtil::getPathOfResFile("gui/icon/alarm/trend_"+style+".png").c_str();
|
m_strTrendPath = iot_public::CFileUtil::getPathOfResFile("gui/icon/alarm/trend_"+style+".png").c_str();
|
||||||
m_strVideoPath = kbd_public::CFileUtil::getPathOfResFile("gui/icon/alarm/video_"+style+".png").c_str();
|
m_strVideoPath = iot_public::CFileUtil::getPathOfResFile("gui/icon/alarm/video_"+style+".png").c_str();
|
||||||
m_strWavePath = kbd_public::CFileUtil::getPathOfResFile("gui/icon/alarm/wave_"+style+".png").c_str();
|
m_strWavePath = iot_public::CFileUtil::getPathOfResFile("gui/icon/alarm/wave_"+style+".png").c_str();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,7 +51,7 @@ CAiAlarmMsgInfo::CAiAlarmMsgInfo(const CAiAlarmMsgInfo &other): priority(0)
|
|||||||
m_tagname_type = other.m_tagname_type;
|
m_tagname_type = other.m_tagname_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAiAlarmMsgInfo::initialize(const kbd_idlfile::SIntelliAlmInfo &alarmInfo)
|
void CAiAlarmMsgInfo::initialize(const iot_idl::SIntelliAlmInfo &alarmInfo)
|
||||||
{
|
{
|
||||||
|
|
||||||
logic_state = (E_AiALARM_LOGICSTATE)alarmInfo.logic_state();
|
logic_state = (E_AiALARM_LOGICSTATE)alarmInfo.logic_state();
|
||||||
|
|||||||
@ -21,7 +21,7 @@ class CAiAlarmMsgInfo
|
|||||||
public:
|
public:
|
||||||
CAiAlarmMsgInfo();
|
CAiAlarmMsgInfo();
|
||||||
CAiAlarmMsgInfo(const CAiAlarmMsgInfo &other);
|
CAiAlarmMsgInfo(const CAiAlarmMsgInfo &other);
|
||||||
void initialize(const kbd_idlfile::SIntelliAlmInfo &alarmInfo);
|
void initialize(const iot_idl::SIntelliAlmInfo &alarmInfo);
|
||||||
|
|
||||||
//< [优先级越小表示越大]-智能告警窗调用
|
//< [优先级越小表示越大]-智能告警窗调用
|
||||||
bool ailessThan(const AlarmMsgPtr &info, E_ALARM_SORTKEY sortkey = E_SORT_PRIORITY);
|
bool ailessThan(const AlarmMsgPtr &info, E_ALARM_SORTKEY sortkey = E_SORT_PRIORITY);
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
#include "pub_utility_api/FileUtil.h"
|
#include "pub_utility_api/FileUtil.h"
|
||||||
#include "pub_utility_api/CharUtil.h"
|
#include "pub_utility_api/CharUtil.h"
|
||||||
|
|
||||||
using namespace kbd_public;
|
using namespace iot_public;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
CAlarmBaseData *CAlarmBaseData::pInstance = NULL;
|
CAlarmBaseData *CAlarmBaseData::pInstance = NULL;
|
||||||
@ -88,8 +88,8 @@ CAlarmBaseData::CAlarmBaseData(QObject *parent) :
|
|||||||
QObject(parent),
|
QObject(parent),
|
||||||
m_rtdbAccess(Q_NULLPTR)
|
m_rtdbAccess(Q_NULLPTR)
|
||||||
{
|
{
|
||||||
m_rtdbAccess = new kbd_dbms::CRdbAccess();
|
m_rtdbAccess = new iot_dbms::CRdbAccess();
|
||||||
m_pWriteDb = new kbd_dbms::CDbApi(DB_CONN_MODEL_WRITE);
|
m_pWriteDb = new iot_dbms::CDbApi(DB_CONN_MODEL_WRITE);
|
||||||
m_pWriteDb->open();
|
m_pWriteDb->open();
|
||||||
createSysInfoInstance(m_ptrSysInfo);
|
createSysInfoInstance(m_ptrSysInfo);
|
||||||
initData();
|
initData();
|
||||||
@ -97,7 +97,7 @@ CAlarmBaseData::CAlarmBaseData(QObject *parent) :
|
|||||||
|
|
||||||
void CAlarmBaseData::loadPermInfo()
|
void CAlarmBaseData::loadPermInfo()
|
||||||
{
|
{
|
||||||
kbd_service::CPermMngApiPtr permMngPtr = kbd_service::getPermMngInstance("base");
|
iot_service::CPermMngApiPtr permMngPtr = iot_service::getPermMngInstance("base");
|
||||||
m_listPermLocationId.clear();
|
m_listPermLocationId.clear();
|
||||||
m_listPermRegionId.clear();
|
m_listPermRegionId.clear();
|
||||||
if(permMngPtr != NULL)
|
if(permMngPtr != NULL)
|
||||||
@ -159,7 +159,7 @@ bool CAlarmBaseData::queryAllPointDevGroup(int nDomainId, int nSubsystemId, cons
|
|||||||
LOGERROR("queryAllPointDevGroup 获取应用ID失败");
|
LOGERROR("queryAllPointDevGroup 获取应用ID失败");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
kbd_dbms::CRdbNetApi rdbNetApi;
|
iot_dbms::CRdbNetApi rdbNetApi;
|
||||||
rdbNetApi.connect(nDomainId, stAppInfo.nId);
|
rdbNetApi.connect(nDomainId, stAppInfo.nId);
|
||||||
|
|
||||||
//< 查询所有设备
|
//< 查询所有设备
|
||||||
@ -259,8 +259,8 @@ void CAlarmBaseData::loadPriorityDescription()
|
|||||||
m_priorityDescriptionMap.clear();
|
m_priorityDescriptionMap.clear();
|
||||||
m_priorityOrderDescriptionMap.clear();
|
m_priorityOrderDescriptionMap.clear();
|
||||||
m_priorityPermDescriptionMap.clear();
|
m_priorityPermDescriptionMap.clear();
|
||||||
kbd_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
iot_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
||||||
kbd_dbms::CRdbQueryResult result;
|
iot_dbms::CRdbQueryResult result;
|
||||||
std::vector<std::string> columns;
|
std::vector<std::string> columns;
|
||||||
columns.push_back("priority_id");
|
columns.push_back("priority_id");
|
||||||
columns.push_back("priority_order");
|
columns.push_back("priority_order");
|
||||||
@ -270,9 +270,9 @@ void CAlarmBaseData::loadPriorityDescription()
|
|||||||
{
|
{
|
||||||
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
||||||
{
|
{
|
||||||
kbd_dbms::CVarType key;
|
iot_dbms::CVarType key;
|
||||||
kbd_dbms::CVarType order;
|
iot_dbms::CVarType order;
|
||||||
kbd_dbms::CVarType value;
|
iot_dbms::CVarType value;
|
||||||
result.getColumnValue(nIndex, 0, key);
|
result.getColumnValue(nIndex, 0, key);
|
||||||
result.getColumnValue(nIndex, 1, order);
|
result.getColumnValue(nIndex, 1, order);
|
||||||
result.getColumnValue(nIndex, 2, value);
|
result.getColumnValue(nIndex, 2, value);
|
||||||
@ -296,8 +296,8 @@ void CAlarmBaseData::loadLocationDescription()
|
|||||||
m_locationDescriptionMap.clear();
|
m_locationDescriptionMap.clear();
|
||||||
m_locationPermDescriptionMap.clear();
|
m_locationPermDescriptionMap.clear();
|
||||||
m_listPermLocationOrder.clear();
|
m_listPermLocationOrder.clear();
|
||||||
kbd_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
iot_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
||||||
kbd_dbms::CRdbQueryResult result;
|
iot_dbms::CRdbQueryResult result;
|
||||||
std::vector<std::string> columns;
|
std::vector<std::string> columns;
|
||||||
columns.push_back("location_id");
|
columns.push_back("location_id");
|
||||||
columns.push_back("description");
|
columns.push_back("description");
|
||||||
@ -310,11 +310,11 @@ void CAlarmBaseData::loadLocationDescription()
|
|||||||
{
|
{
|
||||||
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
||||||
{
|
{
|
||||||
kbd_dbms::CVarType id;
|
iot_dbms::CVarType id;
|
||||||
kbd_dbms::CVarType desc;
|
iot_dbms::CVarType desc;
|
||||||
kbd_dbms::CVarType tag;
|
iot_dbms::CVarType tag;
|
||||||
kbd_dbms::CVarType type;
|
iot_dbms::CVarType type;
|
||||||
kbd_dbms::CVarType pid;
|
iot_dbms::CVarType pid;
|
||||||
result.getColumnValue(nIndex, 0, id);
|
result.getColumnValue(nIndex, 0, id);
|
||||||
result.getColumnValue(nIndex, 1, desc);
|
result.getColumnValue(nIndex, 1, desc);
|
||||||
result.getColumnValue(nIndex, 2, tag);
|
result.getColumnValue(nIndex, 2, tag);
|
||||||
@ -389,8 +389,8 @@ void CAlarmBaseData::loadRegionDescription()
|
|||||||
{
|
{
|
||||||
m_regionDescriptionMap.clear();
|
m_regionDescriptionMap.clear();
|
||||||
m_regionPermDescriptionMap.clear();
|
m_regionPermDescriptionMap.clear();
|
||||||
kbd_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
iot_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
||||||
kbd_dbms::CRdbQueryResult result;
|
iot_dbms::CRdbQueryResult result;
|
||||||
std::vector<std::string> columns;
|
std::vector<std::string> columns;
|
||||||
columns.push_back("region_id");
|
columns.push_back("region_id");
|
||||||
columns.push_back("description");
|
columns.push_back("description");
|
||||||
@ -399,8 +399,8 @@ void CAlarmBaseData::loadRegionDescription()
|
|||||||
{
|
{
|
||||||
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
||||||
{
|
{
|
||||||
kbd_dbms::CVarType key;
|
iot_dbms::CVarType key;
|
||||||
kbd_dbms::CVarType value;
|
iot_dbms::CVarType value;
|
||||||
result.getColumnValue(nIndex, 0, key);
|
result.getColumnValue(nIndex, 0, key);
|
||||||
result.getColumnValue(nIndex, 1, value);
|
result.getColumnValue(nIndex, 1, value);
|
||||||
if(m_listPermRegionId.contains(key.toInt()))
|
if(m_listPermRegionId.contains(key.toInt()))
|
||||||
@ -420,8 +420,8 @@ void CAlarmBaseData::loadAlarmTypeDescription()
|
|||||||
if(m_rtdbAccess->open("base", "alarm_type_define"))
|
if(m_rtdbAccess->open("base", "alarm_type_define"))
|
||||||
{
|
{
|
||||||
m_alarmTypeDescriptionMap.clear();
|
m_alarmTypeDescriptionMap.clear();
|
||||||
kbd_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
iot_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
||||||
kbd_dbms::CRdbQueryResult result;
|
iot_dbms::CRdbQueryResult result;
|
||||||
std::vector<std::string> columns;
|
std::vector<std::string> columns;
|
||||||
columns.push_back("type_id");
|
columns.push_back("type_id");
|
||||||
columns.push_back("type_name");
|
columns.push_back("type_name");
|
||||||
@ -430,8 +430,8 @@ void CAlarmBaseData::loadAlarmTypeDescription()
|
|||||||
{
|
{
|
||||||
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
||||||
{
|
{
|
||||||
kbd_dbms::CVarType key;
|
iot_dbms::CVarType key;
|
||||||
kbd_dbms::CVarType value;
|
iot_dbms::CVarType value;
|
||||||
result.getColumnValue(nIndex, 0, key);
|
result.getColumnValue(nIndex, 0, key);
|
||||||
result.getColumnValue(nIndex, 1, value);
|
result.getColumnValue(nIndex, 1, value);
|
||||||
m_alarmTypeDescriptionMap[key.toInt()] = QString::fromStdString(value.toStdString());
|
m_alarmTypeDescriptionMap[key.toInt()] = QString::fromStdString(value.toStdString());
|
||||||
@ -445,8 +445,8 @@ void CAlarmBaseData::loadAlarmStatusDescription()
|
|||||||
if(m_rtdbAccess->open("base", "alarm_status_define"))
|
if(m_rtdbAccess->open("base", "alarm_status_define"))
|
||||||
{
|
{
|
||||||
m_alarmStatusDescriptionMap.clear();
|
m_alarmStatusDescriptionMap.clear();
|
||||||
kbd_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
iot_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
||||||
kbd_dbms::CRdbQueryResult result;
|
iot_dbms::CRdbQueryResult result;
|
||||||
std::vector<std::string> columns;
|
std::vector<std::string> columns;
|
||||||
columns.push_back("status_value");
|
columns.push_back("status_value");
|
||||||
columns.push_back("display_name");
|
columns.push_back("display_name");
|
||||||
@ -455,8 +455,8 @@ void CAlarmBaseData::loadAlarmStatusDescription()
|
|||||||
{
|
{
|
||||||
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
||||||
{
|
{
|
||||||
kbd_dbms::CVarType key;
|
iot_dbms::CVarType key;
|
||||||
kbd_dbms::CVarType value;
|
iot_dbms::CVarType value;
|
||||||
result.getColumnValue(nIndex, 0, key);
|
result.getColumnValue(nIndex, 0, key);
|
||||||
result.getColumnValue(nIndex, 1, value);
|
result.getColumnValue(nIndex, 1, value);
|
||||||
m_alarmStatusDescriptionMap[key.toInt()] = QString::fromStdString(value.toStdString());
|
m_alarmStatusDescriptionMap[key.toInt()] = QString::fromStdString(value.toStdString());
|
||||||
@ -470,8 +470,8 @@ void CAlarmBaseData::loadDeviceTypeDescription()
|
|||||||
if(m_rtdbAccess->open("base", "dev_type_def"))
|
if(m_rtdbAccess->open("base", "dev_type_def"))
|
||||||
{
|
{
|
||||||
m_deviceTypeDescriptionMap.clear();
|
m_deviceTypeDescriptionMap.clear();
|
||||||
kbd_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
iot_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
||||||
kbd_dbms::CRdbQueryResult result;
|
iot_dbms::CRdbQueryResult result;
|
||||||
std::vector<std::string> columns;
|
std::vector<std::string> columns;
|
||||||
columns.push_back("dev_type_id");
|
columns.push_back("dev_type_id");
|
||||||
columns.push_back("description");
|
columns.push_back("description");
|
||||||
@ -480,8 +480,8 @@ void CAlarmBaseData::loadDeviceTypeDescription()
|
|||||||
{
|
{
|
||||||
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
||||||
{
|
{
|
||||||
kbd_dbms::CVarType key;
|
iot_dbms::CVarType key;
|
||||||
kbd_dbms::CVarType value;
|
iot_dbms::CVarType value;
|
||||||
result.getColumnValue(nIndex, 0, key);
|
result.getColumnValue(nIndex, 0, key);
|
||||||
result.getColumnValue(nIndex, 1, value);
|
result.getColumnValue(nIndex, 1, value);
|
||||||
m_deviceTypeDescriptionMap[key.toInt()] = QString::fromStdString(value.toStdString());
|
m_deviceTypeDescriptionMap[key.toInt()] = QString::fromStdString(value.toStdString());
|
||||||
@ -495,8 +495,8 @@ void CAlarmBaseData::loadDeviceGroupDescription()
|
|||||||
if(m_rtdbAccess->open("base", "dev_group"))
|
if(m_rtdbAccess->open("base", "dev_group"))
|
||||||
{
|
{
|
||||||
m_deviceGroupDescriptionMap.clear();
|
m_deviceGroupDescriptionMap.clear();
|
||||||
kbd_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
iot_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
||||||
kbd_dbms::CRdbQueryResult result;
|
iot_dbms::CRdbQueryResult result;
|
||||||
std::vector<std::string> columns;
|
std::vector<std::string> columns;
|
||||||
columns.push_back("tag_name");
|
columns.push_back("tag_name");
|
||||||
columns.push_back("description");
|
columns.push_back("description");
|
||||||
@ -505,8 +505,8 @@ void CAlarmBaseData::loadDeviceGroupDescription()
|
|||||||
{
|
{
|
||||||
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
||||||
{
|
{
|
||||||
kbd_dbms::CVarType key;
|
iot_dbms::CVarType key;
|
||||||
kbd_dbms::CVarType value;
|
iot_dbms::CVarType value;
|
||||||
result.getColumnValue(nIndex, 0, key);
|
result.getColumnValue(nIndex, 0, key);
|
||||||
result.getColumnValue(nIndex, 1, value);
|
result.getColumnValue(nIndex, 1, value);
|
||||||
m_deviceGroupDescriptionMap[QString::fromStdString(key.toStdString())] = QString::fromStdString(value.toStdString());
|
m_deviceGroupDescriptionMap[QString::fromStdString(key.toStdString())] = QString::fromStdString(value.toStdString());
|
||||||
@ -517,7 +517,7 @@ void CAlarmBaseData::loadDeviceGroupDescription()
|
|||||||
|
|
||||||
void CAlarmBaseData::loadAlarmShowStatusDescription()
|
void CAlarmBaseData::loadAlarmShowStatusDescription()
|
||||||
{
|
{
|
||||||
const std::string strConfFullPath = kbd_public::CFileUtil::getPathOfCfgFile("alarmStatus.xml");
|
const std::string strConfFullPath = iot_public::CFileUtil::getPathOfCfgFile("alarmStatus.xml");
|
||||||
boost::property_tree::ptree pt;
|
boost::property_tree::ptree pt;
|
||||||
namespace xml = boost::property_tree::xml_parser;
|
namespace xml = boost::property_tree::xml_parser;
|
||||||
m_alarmShowStatusDescriptionMap.clear();
|
m_alarmShowStatusDescriptionMap.clear();
|
||||||
@ -553,7 +553,7 @@ void CAlarmBaseData::loadAlarmShowStatusDescription()
|
|||||||
|
|
||||||
void CAlarmBaseData::loadAlarmOtherStatusDescription()
|
void CAlarmBaseData::loadAlarmOtherStatusDescription()
|
||||||
{
|
{
|
||||||
const std::string strConfFullPath = kbd_public::CFileUtil::getPathOfCfgFile("alarmOther.xml");
|
const std::string strConfFullPath = iot_public::CFileUtil::getPathOfCfgFile("alarmOther.xml");
|
||||||
boost::property_tree::ptree pt;
|
boost::property_tree::ptree pt;
|
||||||
namespace xml = boost::property_tree::xml_parser;
|
namespace xml = boost::property_tree::xml_parser;
|
||||||
m_alarmOtherStatusDescriptionMap.clear();
|
m_alarmOtherStatusDescriptionMap.clear();
|
||||||
@ -581,21 +581,21 @@ void CAlarmBaseData::loadAlarmOtherStatusDescription()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CAlarmBaseData::queryAllDeviceDevGroup(kbd_dbms::CRdbNetApi &rdbNetApi, const QString &devg, QList<QString> &devList)
|
bool CAlarmBaseData::queryAllDeviceDevGroup(iot_dbms::CRdbNetApi &rdbNetApi, const QString &devg, QList<QString> &devList)
|
||||||
{
|
{
|
||||||
//< 查询设备组所有设备
|
//< 查询设备组所有设备
|
||||||
kbd_idlfile::RdbQuery msgQuery;
|
iot_idl::RdbQuery msgQuery;
|
||||||
msgQuery.set_strtablename("dev_info");
|
msgQuery.set_strtablename("dev_info");
|
||||||
msgQuery.add_strselectcolnamearr("tag_name");
|
msgQuery.add_strselectcolnamearr("tag_name");
|
||||||
kbd_idlfile::RdbCondition *pCondtion = msgQuery.add_msgcondition();
|
iot_idl::RdbCondition *pCondtion = msgQuery.add_msgcondition();
|
||||||
pCondtion->set_enlogic(kbd_idlfile::ENConditionLogic::enumCondAnd);
|
pCondtion->set_enlogic(iot_idl::ENConditionLogic::enumCondAnd);
|
||||||
pCondtion->set_enrelation(kbd_idlfile::ENConditionRelation::enumCondEqual);
|
pCondtion->set_enrelation(iot_idl::ENConditionRelation::enumCondEqual);
|
||||||
pCondtion->set_strcolumnname("group_tag_name");
|
pCondtion->set_strcolumnname("group_tag_name");
|
||||||
kbd_idlfile::SVariable *pCondValue = pCondtion->mutable_msgvalue();
|
iot_idl::SVariable *pCondValue = pCondtion->mutable_msgvalue();
|
||||||
pCondValue->set_edatatype(kbd_idlfile::DataType::CN_DATATYPE_STRING);
|
pCondValue->set_edatatype(iot_idl::DataType::CN_DATATYPE_STRING);
|
||||||
pCondValue->set_strvalue(devg.toStdString());
|
pCondValue->set_strvalue(devg.toStdString());
|
||||||
|
|
||||||
kbd_idlfile::RdbRet retMsg;
|
iot_idl::RdbRet retMsg;
|
||||||
bool bRet;
|
bool bRet;
|
||||||
bRet = rdbNetApi.query(msgQuery, retMsg);
|
bRet = rdbNetApi.query(msgQuery, retMsg);
|
||||||
if (false == bRet)
|
if (false == bRet)
|
||||||
@ -619,20 +619,20 @@ bool CAlarmBaseData::queryAllDeviceDevGroup(kbd_dbms::CRdbNetApi &rdbNetApi, con
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CAlarmBaseData::queryAllPointDevice(kbd_dbms::CRdbNetApi &rdbNetApi, const QString &device, const QString &table, QList<QString> &pointList)
|
bool CAlarmBaseData::queryAllPointDevice(iot_dbms::CRdbNetApi &rdbNetApi, const QString &device, const QString &table, QList<QString> &pointList)
|
||||||
{
|
{
|
||||||
kbd_idlfile::RdbQuery msgQuery;
|
iot_idl::RdbQuery msgQuery;
|
||||||
msgQuery.set_strtablename(table.toStdString().c_str());
|
msgQuery.set_strtablename(table.toStdString().c_str());
|
||||||
msgQuery.add_strselectcolnamearr("tag_name");
|
msgQuery.add_strselectcolnamearr("tag_name");
|
||||||
kbd_idlfile::RdbCondition *pCondtion = msgQuery.add_msgcondition();
|
iot_idl::RdbCondition *pCondtion = msgQuery.add_msgcondition();
|
||||||
pCondtion->set_enlogic(kbd_idlfile::ENConditionLogic::enumCondAnd);
|
pCondtion->set_enlogic(iot_idl::ENConditionLogic::enumCondAnd);
|
||||||
pCondtion->set_enrelation(kbd_idlfile::ENConditionRelation::enumCondEqual);
|
pCondtion->set_enrelation(iot_idl::ENConditionRelation::enumCondEqual);
|
||||||
pCondtion->set_strcolumnname("device");
|
pCondtion->set_strcolumnname("device");
|
||||||
kbd_idlfile::SVariable *pCondValue = pCondtion->mutable_msgvalue();
|
iot_idl::SVariable *pCondValue = pCondtion->mutable_msgvalue();
|
||||||
pCondValue->set_edatatype(kbd_idlfile::DataType::CN_DATATYPE_STRING);
|
pCondValue->set_edatatype(iot_idl::DataType::CN_DATATYPE_STRING);
|
||||||
pCondValue->set_strvalue(device.toStdString().c_str());
|
pCondValue->set_strvalue(device.toStdString().c_str());
|
||||||
|
|
||||||
kbd_idlfile::RdbRet retMsg;
|
iot_idl::RdbRet retMsg;
|
||||||
bool bRet;
|
bool bRet;
|
||||||
bRet = rdbNetApi.query(msgQuery, retMsg);
|
bRet = rdbNetApi.query(msgQuery, retMsg);
|
||||||
if (false == bRet)
|
if (false == bRet)
|
||||||
|
|||||||
@ -154,7 +154,7 @@ private:
|
|||||||
* @param rdbNetApi
|
* @param rdbNetApi
|
||||||
* @param devg
|
* @param devg
|
||||||
*/
|
*/
|
||||||
bool queryAllDeviceDevGroup(kbd_dbms::CRdbNetApi &rdbNetApi, const QString &devg, QList<QString> &devList);
|
bool queryAllDeviceDevGroup(iot_dbms::CRdbNetApi &rdbNetApi, const QString &devg, QList<QString> &devList);
|
||||||
/**
|
/**
|
||||||
* @brief queryAllPointDevice 查询表中设备下所有测点
|
* @brief queryAllPointDevice 查询表中设备下所有测点
|
||||||
* @param rdbNetApi
|
* @param rdbNetApi
|
||||||
@ -163,13 +163,13 @@ private:
|
|||||||
* @param pointList "digital.station.G01_dlq.r.value"
|
* @param pointList "digital.station.G01_dlq.r.value"
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bool queryAllPointDevice(kbd_dbms::CRdbNetApi &rdbNetApi, const QString &device, const QString &table, QList<QString> &pointList);
|
bool queryAllPointDevice(iot_dbms::CRdbNetApi &rdbNetApi, const QString &device, const QString &table, QList<QString> &pointList);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static CAlarmBaseData * pInstance;
|
static CAlarmBaseData * pInstance;
|
||||||
kbd_dbms::CRdbAccess * m_rtdbAccess;
|
iot_dbms::CRdbAccess * m_rtdbAccess;
|
||||||
kbd_dbms::CDbApi *m_pWriteDb;
|
iot_dbms::CDbApi *m_pWriteDb;
|
||||||
kbd_public::CSysInfoInterfacePtr m_ptrSysInfo;
|
iot_public::CSysInfoInterfacePtr m_ptrSysInfo;
|
||||||
QList<int> m_listPermLocationId; //< 原始告警车站权限
|
QList<int> m_listPermLocationId; //< 原始告警车站权限
|
||||||
QList<int> m_listPermRegionId; //< 原始告警责任区权限
|
QList<int> m_listPermRegionId; //< 原始告警责任区权限
|
||||||
QList<int> m_listPermLocationOrder; //< 有权限的loaction_id: 按location_no排序
|
QList<int> m_listPermLocationOrder; //< 有权限的loaction_id: 按location_no排序
|
||||||
|
|||||||
@ -6,8 +6,8 @@
|
|||||||
#include "CAiAlarmDataCollect.h"
|
#include "CAiAlarmDataCollect.h"
|
||||||
#include "alarm_server_api/AlarmCommonDef.h"
|
#include "alarm_server_api/AlarmCommonDef.h"
|
||||||
|
|
||||||
using namespace kbd_service;
|
using namespace iot_service;
|
||||||
using namespace kbd_dbms;
|
using namespace iot_dbms;
|
||||||
CAlarmDataCollect * CAlarmDataCollect::m_pInstance = NULL;
|
CAlarmDataCollect * CAlarmDataCollect::m_pInstance = NULL;
|
||||||
|
|
||||||
CAlarmDataCollect::CAlarmDataCollect()
|
CAlarmDataCollect::CAlarmDataCollect()
|
||||||
@ -20,7 +20,7 @@ CAlarmDataCollect::CAlarmDataCollect()
|
|||||||
m_removeNum(0)
|
m_removeNum(0)
|
||||||
{
|
{
|
||||||
m_rtdbMutex = new QMutex();
|
m_rtdbMutex = new QMutex();
|
||||||
m_rtdbAccess = new kbd_dbms::CRdbAccess();
|
m_rtdbAccess = new iot_dbms::CRdbAccess();
|
||||||
m_rtdbAccess->open("base", "alarm_level_define");
|
m_rtdbAccess->open("base", "alarm_level_define");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,17 +138,17 @@ void CAlarmDataCollect::slotSwitchFaultRecallState(bool bFaultRecallState)
|
|||||||
emit sigAlarmOperateEnable(!m_bFaultRecallState);
|
emit sigAlarmOperateEnable(!m_bFaultRecallState);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CAlarmDataCollect::requestCfmAlm(kbd_idlfile::SAlmCltCfmAlm &objCfmAlm)
|
bool CAlarmDataCollect::requestCfmAlm(iot_idl::SAlmCltCfmAlm &objCfmAlm)
|
||||||
{
|
{
|
||||||
return kbd_service::CAlmApiForAlmClt::requestCfmAlm(objCfmAlm);
|
return iot_service::CAlmApiForAlmClt::requestCfmAlm(objCfmAlm);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CAlarmDataCollect::requestDelAlm(kbd_idlfile::SAlmCltDelAlm &objDelAlm)
|
bool CAlarmDataCollect::requestDelAlm(iot_idl::SAlmCltDelAlm &objDelAlm)
|
||||||
{
|
{
|
||||||
return kbd_service::CAlmApiForAlmClt::requestDelAlm(objDelAlm);
|
return iot_service::CAlmApiForAlmClt::requestDelAlm(objDelAlm);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAlarmDataCollect::handleAllAlmMsg(int domainId, kbd_idlfile::SAlmCltAddAlm &objAllAlm)
|
void CAlarmDataCollect::handleAllAlmMsg(int domainId, iot_idl::SAlmCltAddAlm &objAllAlm)
|
||||||
{
|
{
|
||||||
if(!m_referenceCount)
|
if(!m_referenceCount)
|
||||||
{
|
{
|
||||||
@ -165,7 +165,7 @@ void CAlarmDataCollect::handleAllAlmMsg(int domainId, kbd_idlfile::SAlmCltAddAlm
|
|||||||
QList<AlarmMsgPtr> almList;
|
QList<AlarmMsgPtr> almList;
|
||||||
for(int nAddMsgIndex(0); nAddMsgIndex < nAlarmCount; nAddMsgIndex++)
|
for(int nAddMsgIndex(0); nAddMsgIndex < nAlarmCount; nAddMsgIndex++)
|
||||||
{
|
{
|
||||||
kbd_idlfile::SAlmInfoToAlmClt msg = objAllAlm.alm_info(nAddMsgIndex);
|
iot_idl::SAlmInfoToAlmClt msg = objAllAlm.alm_info(nAddMsgIndex);
|
||||||
AlarmMsgPtr alm(new CAlarmMsgInfo());
|
AlarmMsgPtr alm(new CAlarmMsgInfo());
|
||||||
alm->initialize(msg);
|
alm->initialize(msg);
|
||||||
alm->priorityOrder = queryPriorityOrder(alm->priority);
|
alm->priorityOrder = queryPriorityOrder(alm->priority);
|
||||||
@ -194,7 +194,7 @@ void CAlarmDataCollect::handleAllAlmMsg(int domainId, kbd_idlfile::SAlmCltAddAlm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAlarmDataCollect::handleAddAlmMsg(kbd_idlfile::SAlmCltAddAlm &objAddAlm)
|
void CAlarmDataCollect::handleAddAlmMsg(iot_idl::SAlmCltAddAlm &objAddAlm)
|
||||||
{
|
{
|
||||||
if(!m_referenceCount)
|
if(!m_referenceCount)
|
||||||
{
|
{
|
||||||
@ -207,7 +207,7 @@ void CAlarmDataCollect::handleAddAlmMsg(kbd_idlfile::SAlmCltAddAlm &objAddAlm)
|
|||||||
QList<AlarmMsgPtr> almList;
|
QList<AlarmMsgPtr> almList;
|
||||||
for(int nAddMsgIndex(0); nAddMsgIndex < nAlarmCount; nAddMsgIndex++)
|
for(int nAddMsgIndex(0); nAddMsgIndex < nAlarmCount; nAddMsgIndex++)
|
||||||
{
|
{
|
||||||
kbd_idlfile::SAlmInfoToAlmClt msg = objAddAlm.alm_info(nAddMsgIndex);
|
iot_idl::SAlmInfoToAlmClt msg = objAddAlm.alm_info(nAddMsgIndex);
|
||||||
AlarmMsgPtr alm(new CAlarmMsgInfo());
|
AlarmMsgPtr alm(new CAlarmMsgInfo());
|
||||||
alm->initialize(msg);
|
alm->initialize(msg);
|
||||||
alm->priorityOrder = queryPriorityOrder(alm->priority);
|
alm->priorityOrder = queryPriorityOrder(alm->priority);
|
||||||
@ -227,7 +227,7 @@ void CAlarmDataCollect::handleAddAlmMsg(kbd_idlfile::SAlmCltAddAlm &objAddAlm)
|
|||||||
LOGINFO("handleAddAlmMsg END[%d] ",nAlarmCount);
|
LOGINFO("handleAddAlmMsg END[%d] ",nAlarmCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAlarmDataCollect::handleCfmAlmMsg(kbd_idlfile::SAlmCltCfmAlm &objCfmAlm)
|
void CAlarmDataCollect::handleCfmAlmMsg(iot_idl::SAlmCltCfmAlm &objCfmAlm)
|
||||||
{
|
{
|
||||||
if(!m_referenceCount)
|
if(!m_referenceCount)
|
||||||
{
|
{
|
||||||
@ -247,7 +247,7 @@ void CAlarmDataCollect::handleCfmAlmMsg(kbd_idlfile::SAlmCltCfmAlm &objCfmAlm)
|
|||||||
LOGINFO("handleCfmAlmMsg END[%d] ",nAlarmCount);
|
LOGINFO("handleCfmAlmMsg END[%d] ",nAlarmCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAlarmDataCollect::handleDelAlmMsg(kbd_idlfile::SAlmCltDelAlm &objDelAlm)
|
void CAlarmDataCollect::handleDelAlmMsg(iot_idl::SAlmCltDelAlm &objDelAlm)
|
||||||
{
|
{
|
||||||
if(!m_referenceCount)
|
if(!m_referenceCount)
|
||||||
{
|
{
|
||||||
@ -269,7 +269,7 @@ void CAlarmDataCollect::handleDelAlmMsg(kbd_idlfile::SAlmCltDelAlm &objDelAlm)
|
|||||||
LOGINFO("handleDelAlmMsg END[%d] ",nAlarmCount);
|
LOGINFO("handleDelAlmMsg END[%d] ",nAlarmCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAlarmDataCollect::handleReleaseAlmMsg(kbd_idlfile::SAlmCltReleaseAlm &objRelAlm)
|
void CAlarmDataCollect::handleReleaseAlmMsg(iot_idl::SAlmCltReleaseAlm &objRelAlm)
|
||||||
{
|
{
|
||||||
if(!m_referenceCount)
|
if(!m_referenceCount)
|
||||||
{
|
{
|
||||||
@ -291,7 +291,7 @@ void CAlarmDataCollect::handleReleaseAlmMsg(kbd_idlfile::SAlmCltReleaseAlm &objR
|
|||||||
LOGINFO("handleReleaseAlmMsg END[%d] ",nAlarmCount);
|
LOGINFO("handleReleaseAlmMsg END[%d] ",nAlarmCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAlarmDataCollect::handleLinkWave2AlmMsg(kbd_idlfile::SAlmCltLinkWave2Alm &objWave2Alm)
|
void CAlarmDataCollect::handleLinkWave2AlmMsg(iot_idl::SAlmCltLinkWave2Alm &objWave2Alm)
|
||||||
{
|
{
|
||||||
if(!m_referenceCount)
|
if(!m_referenceCount)
|
||||||
{
|
{
|
||||||
@ -341,16 +341,16 @@ void CAlarmDataCollect::slotAlarmStateChanged()
|
|||||||
|
|
||||||
int CAlarmDataCollect::queryPriorityOrder(int &id)
|
int CAlarmDataCollect::queryPriorityOrder(int &id)
|
||||||
{
|
{
|
||||||
kbd_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
iot_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
||||||
kbd_dbms::CVarType value = -1000;
|
iot_dbms::CVarType value = -1000;
|
||||||
m_rtdbAccess->getColumnValueByKey((void*)&id, "priority_order", value);
|
m_rtdbAccess->getColumnValueByKey((void*)&id, "priority_order", value);
|
||||||
return value.toInt();
|
return value.toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
int CAlarmDataCollect::queryAlarmAction(const int &priority)
|
int CAlarmDataCollect::queryAlarmAction(const int &priority)
|
||||||
{
|
{
|
||||||
kbd_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
iot_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
||||||
kbd_dbms::CVarType value;
|
iot_dbms::CVarType value;
|
||||||
m_rtdbAccess->getColumnValueByKey((void*)&priority, "alarm_actions",value);
|
m_rtdbAccess->getColumnValueByKey((void*)&priority, "alarm_actions",value);
|
||||||
return value.toInt();
|
return value.toInt();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
#include "net_msg_bus_api/MsgBusApi.h"
|
#include "net_msg_bus_api/MsgBusApi.h"
|
||||||
#include "dbms/rdb_api/CRdbAccess.h"
|
#include "dbms/rdb_api/CRdbAccess.h"
|
||||||
|
|
||||||
class CAlarmDataCollect : public QObject, public kbd_service::CAlmApiForAlmClt
|
class CAlarmDataCollect : public QObject, public iot_service::CAlmApiForAlmClt
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
@ -25,21 +25,21 @@ public:
|
|||||||
|
|
||||||
bool isFaultRecallState();
|
bool isFaultRecallState();
|
||||||
|
|
||||||
virtual bool requestCfmAlm(kbd_idlfile::SAlmCltCfmAlm &objCfmAlm);
|
virtual bool requestCfmAlm(iot_idl::SAlmCltCfmAlm &objCfmAlm);
|
||||||
|
|
||||||
virtual bool requestDelAlm(kbd_idlfile::SAlmCltDelAlm &objDelAlm);
|
virtual bool requestDelAlm(iot_idl::SAlmCltDelAlm &objDelAlm);
|
||||||
|
|
||||||
virtual void handleAllAlmMsg(int domainId, kbd_idlfile::SAlmCltAddAlm &objAllAlm);
|
virtual void handleAllAlmMsg(int domainId, iot_idl::SAlmCltAddAlm &objAllAlm);
|
||||||
|
|
||||||
virtual void handleAddAlmMsg(kbd_idlfile::SAlmCltAddAlm &objAddAlm);
|
virtual void handleAddAlmMsg(iot_idl::SAlmCltAddAlm &objAddAlm);
|
||||||
|
|
||||||
virtual void handleCfmAlmMsg(kbd_idlfile::SAlmCltCfmAlm &objCfmAlm);
|
virtual void handleCfmAlmMsg(iot_idl::SAlmCltCfmAlm &objCfmAlm);
|
||||||
|
|
||||||
virtual void handleDelAlmMsg(kbd_idlfile::SAlmCltDelAlm &objDelAlm);
|
virtual void handleDelAlmMsg(iot_idl::SAlmCltDelAlm &objDelAlm);
|
||||||
|
|
||||||
virtual void handleReleaseAlmMsg(kbd_idlfile::SAlmCltReleaseAlm &objDelAlm);
|
virtual void handleReleaseAlmMsg(iot_idl::SAlmCltReleaseAlm &objDelAlm);
|
||||||
|
|
||||||
virtual void handleLinkWave2AlmMsg(kbd_idlfile::SAlmCltLinkWave2Alm &objWave2Alm);
|
virtual void handleLinkWave2AlmMsg(iot_idl::SAlmCltLinkWave2Alm &objWave2Alm);
|
||||||
|
|
||||||
void refresh();
|
void refresh();
|
||||||
signals:
|
signals:
|
||||||
@ -95,9 +95,9 @@ private:
|
|||||||
bool m_bFaultRecallState; //是否处于事故追忆
|
bool m_bFaultRecallState; //是否处于事故追忆
|
||||||
QMutex * m_rtdbMutex;
|
QMutex * m_rtdbMutex;
|
||||||
QTimer * m_pAlternateTimer;
|
QTimer * m_pAlternateTimer;
|
||||||
kbd_dbms::CRdbAccess * m_rtdbAccess;
|
iot_dbms::CRdbAccess * m_rtdbAccess;
|
||||||
kbd_dbms::CRdbAccess * m_rtdbAlmLvlDefTab; // 告警等级定义表
|
iot_dbms::CRdbAccess * m_rtdbAlmLvlDefTab; // 告警等级定义表
|
||||||
kbd_dbms::CRdbAccess * m_rtdbAlmActDefTab; // 告警动作定义表
|
iot_dbms::CRdbAccess * m_rtdbAlmActDefTab; // 告警动作定义表
|
||||||
bool m_bIsNeedUpdate; //< 是否消息确认(每秒更新)
|
bool m_bIsNeedUpdate; //< 是否消息确认(每秒更新)
|
||||||
bool m_bIsNeedRemove; //< 是否需要删除(每秒更新)
|
bool m_bIsNeedRemove; //< 是否需要删除(每秒更新)
|
||||||
bool m_bIsNeedRelease; //< 是否需要释放(每秒更新)-
|
bool m_bIsNeedRelease; //< 是否需要释放(每秒更新)-
|
||||||
|
|||||||
@ -269,8 +269,8 @@ bool CAlarmDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, const
|
|||||||
wave = QString("%1%2%3").arg("\"").arg(wave).arg("\"");
|
wave = QString("%1%2%3").arg("\"").arg(wave).arg("\"");
|
||||||
LOGINFO("录波文件为:%s",wave.toStdString().c_str());
|
LOGINFO("录波文件为:%s",wave.toStdString().c_str());
|
||||||
|
|
||||||
const std::string strProc = std::move(kbd_public::CFileUtil::getPathOfBinFile(
|
const std::string strProc = std::move(iot_public::CFileUtil::getPathOfBinFile(
|
||||||
std::string("WaveAnalyze") + kbd_public::CFileUtil::getProcSuffix()));
|
std::string("WaveAnalyze") + iot_public::CFileUtil::getProcSuffix()));
|
||||||
if(strProc.empty())
|
if(strProc.empty())
|
||||||
LOGERROR("未找到可执行文件WaveAnalyze");
|
LOGERROR("未找到可执行文件WaveAnalyze");
|
||||||
else
|
else
|
||||||
@ -300,8 +300,8 @@ void CAlarmDelegate::slotLoadConfig()
|
|||||||
m_isFlash = false;
|
m_isFlash = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string style = kbd_public::CFileStyle::getCurStyle();
|
std::string style = iot_public::CFileStyle::getCurStyle();
|
||||||
m_strTrendPath = kbd_public::CFileUtil::getPathOfResFile("gui/icon/alarm/trend_"+style+".png").c_str();
|
m_strTrendPath = iot_public::CFileUtil::getPathOfResFile("gui/icon/alarm/trend_"+style+".png").c_str();
|
||||||
m_strVideoPath = kbd_public::CFileUtil::getPathOfResFile("gui/icon/alarm/video_"+style+".png").c_str();
|
m_strVideoPath = iot_public::CFileUtil::getPathOfResFile("gui/icon/alarm/video_"+style+".png").c_str();
|
||||||
m_strWavePath = kbd_public::CFileUtil::getPathOfResFile("gui/icon/alarm/wave_"+style+".png").c_str();
|
m_strWavePath = iot_public::CFileUtil::getPathOfResFile("gui/icon/alarm/wave_"+style+".png").c_str();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,7 +41,7 @@ CAlarmFilterDialog::CAlarmFilterDialog(QWidget *parent) :
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setObjectName("alarm_dialog");
|
setObjectName("alarm_dialog");
|
||||||
QString qss = QString();
|
QString qss = QString();
|
||||||
std::string strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
||||||
QFile qssfile1(QString::fromStdString(strFullPath));
|
QFile qssfile1(QString::fromStdString(strFullPath));
|
||||||
qssfile1.open(QFile::ReadOnly);
|
qssfile1.open(QFile::ReadOnly);
|
||||||
if (qssfile1.isOpen())
|
if (qssfile1.isOpen())
|
||||||
@ -49,7 +49,7 @@ CAlarmFilterDialog::CAlarmFilterDialog(QWidget *parent) :
|
|||||||
qss += QLatin1String(qssfile1.readAll());
|
qss += QLatin1String(qssfile1.readAll());
|
||||||
qssfile1.close();
|
qssfile1.close();
|
||||||
}
|
}
|
||||||
strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("alarm.qss") ;
|
strFullPath = iot_public::CFileStyle::getPathOfStyleFile("alarm.qss") ;
|
||||||
QFile qssfile2(QString::fromStdString(strFullPath));
|
QFile qssfile2(QString::fromStdString(strFullPath));
|
||||||
qssfile2.open(QFile::ReadOnly);
|
qssfile2.open(QFile::ReadOnly);
|
||||||
if (qssfile2.isOpen())
|
if (qssfile2.isOpen())
|
||||||
@ -84,7 +84,7 @@ CAlarmFilterDialog::~CAlarmFilterDialog()
|
|||||||
|
|
||||||
void CAlarmFilterDialog::initialize()
|
void CAlarmFilterDialog::initialize()
|
||||||
{
|
{
|
||||||
m_rtdbAccess = new kbd_dbms::CRdbAccess();
|
m_rtdbAccess = new iot_dbms::CRdbAccess();
|
||||||
|
|
||||||
ui->level->setSelectionMode(QAbstractItemView::MultiSelection);
|
ui->level->setSelectionMode(QAbstractItemView::MultiSelection);
|
||||||
//ui->location->setSelectionMode(QAbstractItemView::MultiSelection);
|
//ui->location->setSelectionMode(QAbstractItemView::MultiSelection);
|
||||||
@ -161,12 +161,12 @@ void CAlarmFilterDialog::initialize()
|
|||||||
ui->status->addItem(value);
|
ui->status->addItem(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
kbd_public::CSysInfoInterfacePtr spSysInfo;
|
iot_public::CSysInfoInterfacePtr spSysInfo;
|
||||||
if (kbd_public::createSysInfoInstance(spSysInfo))
|
if (iot_public::createSysInfoInstance(spSysInfo))
|
||||||
{
|
{
|
||||||
std::vector<kbd_public::SSubsystemInfo> vecSubsystemInfo;
|
std::vector<iot_public::SSubsystemInfo> vecSubsystemInfo;
|
||||||
spSysInfo->getAllSubsystemInfo(vecSubsystemInfo);
|
spSysInfo->getAllSubsystemInfo(vecSubsystemInfo);
|
||||||
foreach (kbd_public::SSubsystemInfo info, vecSubsystemInfo)
|
foreach (iot_public::SSubsystemInfo info, vecSubsystemInfo)
|
||||||
{
|
{
|
||||||
if(info.nId <= CN_AppId_COMAPP)
|
if(info.nId <= CN_AppId_COMAPP)
|
||||||
{
|
{
|
||||||
@ -717,12 +717,12 @@ void CAlarmFilterDialog::slot_updateCheckStatusState()
|
|||||||
void CAlarmFilterDialog::slot_updateDevice(const QString &subSystem)
|
void CAlarmFilterDialog::slot_updateDevice(const QString &subSystem)
|
||||||
{
|
{
|
||||||
int nSubSystemId = -1;
|
int nSubSystemId = -1;
|
||||||
kbd_public::CSysInfoInterfacePtr spSysInfo;
|
iot_public::CSysInfoInterfacePtr spSysInfo;
|
||||||
if (kbd_public::createSysInfoInstance(spSysInfo))
|
if (iot_public::createSysInfoInstance(spSysInfo))
|
||||||
{
|
{
|
||||||
std::vector<kbd_public::SSubsystemInfo> vecSubsystemInfo;
|
std::vector<iot_public::SSubsystemInfo> vecSubsystemInfo;
|
||||||
spSysInfo->getAllSubsystemInfo(vecSubsystemInfo);
|
spSysInfo->getAllSubsystemInfo(vecSubsystemInfo);
|
||||||
foreach (kbd_public::SSubsystemInfo info, vecSubsystemInfo)
|
foreach (iot_public::SSubsystemInfo info, vecSubsystemInfo)
|
||||||
{
|
{
|
||||||
if(subSystem.toStdString() == info.strDesc)
|
if(subSystem.toStdString() == info.strDesc)
|
||||||
{
|
{
|
||||||
@ -733,34 +733,34 @@ void CAlarmFilterDialog::slot_updateDevice(const QString &subSystem)
|
|||||||
|
|
||||||
ui->deviceType->clear();
|
ui->deviceType->clear();
|
||||||
|
|
||||||
QList<kbd_dbms::CVarType> values;
|
QList<iot_dbms::CVarType> values;
|
||||||
|
|
||||||
if(nSubSystemId != -1)
|
if(nSubSystemId != -1)
|
||||||
{
|
{
|
||||||
kbd_dbms::CVarType subSystemId = nSubSystemId;
|
iot_dbms::CVarType subSystemId = nSubSystemId;
|
||||||
if(m_rtdbAccess->open("base", "dev_type_def"))
|
if(m_rtdbAccess->open("base", "dev_type_def"))
|
||||||
{
|
{
|
||||||
kbd_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
iot_dbms::CTableLockGuard locker(*m_rtdbAccess);
|
||||||
kbd_dbms::CONDINFO condition;
|
iot_dbms::CONDINFO condition;
|
||||||
condition.relationop = ATTRCOND_EQU;
|
condition.relationop = ATTRCOND_EQU;
|
||||||
memcpy(condition.name, "sub_system", strlen("sub_system") );
|
memcpy(condition.name, "sub_system", strlen("sub_system") );
|
||||||
condition.conditionval = subSystemId;
|
condition.conditionval = subSystemId;
|
||||||
std::vector<std::string> columns;
|
std::vector<std::string> columns;
|
||||||
columns.push_back("description");
|
columns.push_back("description");
|
||||||
|
|
||||||
kbd_dbms::CRdbQueryResult result;
|
iot_dbms::CRdbQueryResult result;
|
||||||
if(m_rtdbAccess->select(condition, result, columns))
|
if(m_rtdbAccess->select(condition, result, columns))
|
||||||
{
|
{
|
||||||
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
for(int nIndex(0); nIndex < result.getRecordCount(); nIndex++)
|
||||||
{
|
{
|
||||||
kbd_dbms::CVarType value;
|
iot_dbms::CVarType value;
|
||||||
result.getColumnValue(nIndex, 0, value);
|
result.getColumnValue(nIndex, 0, value);
|
||||||
values.append(value);
|
values.append(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach (kbd_dbms::CVarType value, values)
|
foreach (iot_dbms::CVarType value, values)
|
||||||
{
|
{
|
||||||
ui->deviceType->addItem(value.c_str());
|
ui->deviceType->addItem(value.c_str());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -102,7 +102,7 @@ private:
|
|||||||
private:
|
private:
|
||||||
Ui::CAlarmFilterDialog *ui;
|
Ui::CAlarmFilterDialog *ui;
|
||||||
|
|
||||||
kbd_dbms::CRdbAccess * m_rtdbAccess;
|
iot_dbms::CRdbAccess * m_rtdbAccess;
|
||||||
QMap<int, QString> m_priorityMap;
|
QMap<int, QString> m_priorityMap;
|
||||||
QMap<int, QString> m_locationMap;
|
QMap<int, QString> m_locationMap;
|
||||||
QMap<int, QString> m_regionMap;
|
QMap<int, QString> m_regionMap;
|
||||||
|
|||||||
@ -53,7 +53,7 @@ CAlarmForm::CAlarmForm(QWidget *parent) :
|
|||||||
m_isNeedAccidentReview(true),
|
m_isNeedAccidentReview(true),
|
||||||
m_strAccidenPath(QString())
|
m_strAccidenPath(QString())
|
||||||
{
|
{
|
||||||
m_communicator = new kbd_net::CMbCommunicator();
|
m_communicator = new iot_net::CMbCommunicator();
|
||||||
qRegisterMetaType<QItemSelection>("QItemSelection");
|
qRegisterMetaType<QItemSelection>("QItemSelection");
|
||||||
qRegisterMetaType< QList<QVector<QString> > >("QList<QVector<QString> >");
|
qRegisterMetaType< QList<QVector<QString> > >("QList<QVector<QString> >");
|
||||||
qRegisterMetaType<QVector<bool> >("QVector<bool>");
|
qRegisterMetaType<QVector<bool> >("QVector<bool>");
|
||||||
@ -176,13 +176,13 @@ CAlarmForm::~CAlarmForm()
|
|||||||
|
|
||||||
void CAlarmForm::initialize()
|
void CAlarmForm::initialize()
|
||||||
{
|
{
|
||||||
if (!kbd_public::createSysInfoInstance(m_ptrSysInfo))
|
if (!iot_public::createSysInfoInstance(m_ptrSysInfo))
|
||||||
{
|
{
|
||||||
LOGERROR("创建系统信息访问库实例失败!");
|
LOGERROR("创建系统信息访问库实例失败!");
|
||||||
}
|
}
|
||||||
if(m_pReadDb == NULL)
|
if(m_pReadDb == NULL)
|
||||||
{
|
{
|
||||||
m_pReadDb = new kbd_dbms::CDbApi(DB_CONN_MODEL_READ);
|
m_pReadDb = new iot_dbms::CDbApi(DB_CONN_MODEL_READ);
|
||||||
if(!m_pReadDb->open())
|
if(!m_pReadDb->open())
|
||||||
{
|
{
|
||||||
LOGERROR("数据库打开失败,%s",m_pReadDb->getLastErrorString().toStdString().c_str());
|
LOGERROR("数据库打开失败,%s",m_pReadDb->getLastErrorString().toStdString().c_str());
|
||||||
@ -255,7 +255,7 @@ void CAlarmForm::updateAlarmOperatePerm()
|
|||||||
m_listLocationOptId.clear();
|
m_listLocationOptId.clear();
|
||||||
m_listRegionDelId.clear();
|
m_listRegionDelId.clear();
|
||||||
m_listLocationDelId.clear();
|
m_listLocationDelId.clear();
|
||||||
kbd_public::SNodeInfo stNodeInfo;
|
iot_public::SNodeInfo stNodeInfo;
|
||||||
if (!m_ptrSysInfo)
|
if (!m_ptrSysInfo)
|
||||||
{
|
{
|
||||||
if(!createSysInfoInstance(m_ptrSysInfo))
|
if(!createSysInfoInstance(m_ptrSysInfo))
|
||||||
@ -268,7 +268,7 @@ void CAlarmForm::updateAlarmOperatePerm()
|
|||||||
m_nodeName = stNodeInfo.strName;
|
m_nodeName = stNodeInfo.strName;
|
||||||
m_nDomainId = stNodeInfo.nDomainId;
|
m_nDomainId = stNodeInfo.nDomainId;
|
||||||
|
|
||||||
kbd_service::CPermMngApiPtr permMngPtr = kbd_service::getPermMngInstance("base");
|
iot_service::CPermMngApiPtr permMngPtr = iot_service::getPermMngInstance("base");
|
||||||
if(permMngPtr != NULL)
|
if(permMngPtr != NULL)
|
||||||
{
|
{
|
||||||
permMngPtr->PermDllInit();
|
permMngPtr->PermDllInit();
|
||||||
@ -1638,7 +1638,7 @@ void CAlarmForm::removeAlarm0()
|
|||||||
}
|
}
|
||||||
QList<AlarmMsgPtr> listInfo = m_pModel->getListShowAlarmInfo();
|
QList<AlarmMsgPtr> listInfo = m_pModel->getListShowAlarmInfo();
|
||||||
//声明告警删除package
|
//声明告警删除package
|
||||||
QMap<int, kbd_idlfile::SAlmCltDelAlm *> pkgMap; //Domain-DelPkg;
|
QMap<int, iot_idl::SAlmCltDelAlm *> pkgMap; //Domain-DelPkg;
|
||||||
int permSkip = -1; //< 不具备确认权限时是否跳过: 0-单步跳过、1-全部跳过
|
int permSkip = -1; //< 不具备确认权限时是否跳过: 0-单步跳过、1-全部跳过
|
||||||
int unConfirmSkip = -1; //< 未确认告警是否跳过: 0-单步跳过、1-全部跳过
|
int unConfirmSkip = -1; //< 未确认告警是否跳过: 0-单步跳过、1-全部跳过
|
||||||
|
|
||||||
@ -1734,17 +1734,17 @@ void CAlarmForm::removeAlarm0()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//构建告警删除package
|
//构建告警删除package
|
||||||
QMap<int, kbd_idlfile::SAlmCltDelAlm *>::iterator it = pkgMap.find(info->domain_id);
|
QMap<int, iot_idl::SAlmCltDelAlm *>::iterator it = pkgMap.find(info->domain_id);
|
||||||
if(it == pkgMap.end())
|
if(it == pkgMap.end())
|
||||||
{
|
{
|
||||||
kbd_idlfile::SAlmCltDelAlm * pkg = new kbd_idlfile::SAlmCltDelAlm();
|
iot_idl::SAlmCltDelAlm * pkg = new iot_idl::SAlmCltDelAlm();
|
||||||
pkg->set_domain_id(info->domain_id);
|
pkg->set_domain_id(info->domain_id);
|
||||||
pkgMap[info->domain_id] = pkg;
|
pkgMap[info->domain_id] = pkg;
|
||||||
}
|
}
|
||||||
pkgMap.value(info->domain_id)->add_uuid_base64(info->uuid_base64.toStdString());
|
pkgMap.value(info->domain_id)->add_uuid_base64(info->uuid_base64.toStdString());
|
||||||
}
|
}
|
||||||
//请求删除
|
//请求删除
|
||||||
foreach (kbd_idlfile::SAlmCltDelAlm * pkg, pkgMap)
|
foreach (iot_idl::SAlmCltDelAlm * pkg, pkgMap)
|
||||||
{
|
{
|
||||||
if(CAlarmDataCollect::instance()->requestDelAlm(*pkg)!= true)
|
if(CAlarmDataCollect::instance()->requestDelAlm(*pkg)!= true)
|
||||||
{
|
{
|
||||||
@ -1771,8 +1771,8 @@ void CAlarmForm::removeAlarm1()
|
|||||||
QList<AiAlarmMsgPtr> aimsgList; //选中的智能告警
|
QList<AiAlarmMsgPtr> aimsgList; //选中的智能告警
|
||||||
QList<AlarmMsgPtr> msgList; //选中的原始告警
|
QList<AlarmMsgPtr> msgList; //选中的原始告警
|
||||||
//声明智能告警删除package
|
//声明智能告警删除package
|
||||||
QMap<int, kbd_idlfile::SIntelliAlmDel *> aipkgMap; //Domain-DelPkg; ai
|
QMap<int, iot_idl::SIntelliAlmDel *> aipkgMap; //Domain-DelPkg; ai
|
||||||
QMap<int, kbd_idlfile::SAlmCltDelAlm *> pkgMap; //Domain-DelPkg; alarm
|
QMap<int, iot_idl::SAlmCltDelAlm *> pkgMap; //Domain-DelPkg; alarm
|
||||||
int permSkip = -1; //< 不具备确认权限时是否跳过: 0-单步跳过、1-全部跳过
|
int permSkip = -1; //< 不具备确认权限时是否跳过: 0-单步跳过、1-全部跳过
|
||||||
int unConfirmSkip = -1; //< 未确认告警是否跳过: 0-单步跳过、1-全部跳过
|
int unConfirmSkip = -1; //< 未确认告警是否跳过: 0-单步跳过、1-全部跳过
|
||||||
QModelIndexList::iterator modelIndexIter = modelIndexList.begin();
|
QModelIndexList::iterator modelIndexIter = modelIndexList.begin();
|
||||||
@ -1895,10 +1895,10 @@ void CAlarmForm::removeAlarm1()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//构建告警删除package
|
//构建告警删除package
|
||||||
QMap<int, kbd_idlfile::SAlmCltDelAlm *>::iterator it = pkgMap.find(info->domain_id);
|
QMap<int, iot_idl::SAlmCltDelAlm *>::iterator it = pkgMap.find(info->domain_id);
|
||||||
if(it == pkgMap.end())
|
if(it == pkgMap.end())
|
||||||
{
|
{
|
||||||
kbd_idlfile::SAlmCltDelAlm * pkg = new kbd_idlfile::SAlmCltDelAlm();
|
iot_idl::SAlmCltDelAlm * pkg = new iot_idl::SAlmCltDelAlm();
|
||||||
pkg->set_domain_id(info->domain_id);
|
pkg->set_domain_id(info->domain_id);
|
||||||
pkgMap[info->domain_id] = pkg;
|
pkgMap[info->domain_id] = pkg;
|
||||||
}
|
}
|
||||||
@ -1991,17 +1991,17 @@ void CAlarmForm::removeAlarm1()
|
|||||||
}
|
}
|
||||||
int domain_id = aimsgList.at(aialarm)->domain_id;
|
int domain_id = aimsgList.at(aialarm)->domain_id;
|
||||||
QString aiuuid = aimsgList.at(aialarm)->uuid_base64;
|
QString aiuuid = aimsgList.at(aialarm)->uuid_base64;
|
||||||
QMap<int, kbd_idlfile::SIntelliAlmDel *>::iterator it = aipkgMap.find(domain_id);
|
QMap<int, iot_idl::SIntelliAlmDel *>::iterator it = aipkgMap.find(domain_id);
|
||||||
if(it == aipkgMap.end())
|
if(it == aipkgMap.end())
|
||||||
{
|
{
|
||||||
kbd_idlfile::SIntelliAlmDel * pkg = new kbd_idlfile::SIntelliAlmDel();
|
iot_idl::SIntelliAlmDel * pkg = new iot_idl::SIntelliAlmDel();
|
||||||
pkg->set_domain_id(domain_id);
|
pkg->set_domain_id(domain_id);
|
||||||
aipkgMap[domain_id] = pkg;
|
aipkgMap[domain_id] = pkg;
|
||||||
}
|
}
|
||||||
aipkgMap.value(domain_id)->add_uuid_base64(aiuuid.toStdString());
|
aipkgMap.value(domain_id)->add_uuid_base64(aiuuid.toStdString());
|
||||||
}
|
}
|
||||||
//请求删除
|
//请求删除
|
||||||
foreach (kbd_idlfile::SAlmCltDelAlm * pkg, pkgMap)
|
foreach (iot_idl::SAlmCltDelAlm * pkg, pkgMap)
|
||||||
{
|
{
|
||||||
if(CAlarmDataCollect::instance()->requestDelAlm(*pkg)!= true)
|
if(CAlarmDataCollect::instance()->requestDelAlm(*pkg)!= true)
|
||||||
{
|
{
|
||||||
@ -2011,7 +2011,7 @@ void CAlarmForm::removeAlarm1()
|
|||||||
qDeleteAll(pkgMap);
|
qDeleteAll(pkgMap);
|
||||||
pkgMap.clear();
|
pkgMap.clear();
|
||||||
//请求删除
|
//请求删除
|
||||||
foreach (kbd_idlfile::SIntelliAlmDel * pkg, aipkgMap)
|
foreach (iot_idl::SIntelliAlmDel * pkg, aipkgMap)
|
||||||
{
|
{
|
||||||
if(CAiAlarmDataCollect::instance()->requestDelAlm(*pkg) != true)
|
if(CAiAlarmDataCollect::instance()->requestDelAlm(*pkg) != true)
|
||||||
{
|
{
|
||||||
@ -2040,7 +2040,7 @@ void CAlarmForm::confirmAlarm0()
|
|||||||
|
|
||||||
//构建告警确认package
|
//构建告警确认package
|
||||||
QMap<QString,AlarmMsgPtr> msgMap; //要确认的告警
|
QMap<QString,AlarmMsgPtr> msgMap; //要确认的告警
|
||||||
QMap<QString, kbd_idlfile::SAlmCltCfmAlm *> pkgMap; //Domain-DelPkg;
|
QMap<QString, iot_idl::SAlmCltCfmAlm *> pkgMap; //Domain-DelPkg;
|
||||||
|
|
||||||
int permSkip = -1; //< 不具备确认权限时是否跳过: 0-单步跳过、1-全部跳过
|
int permSkip = -1; //< 不具备确认权限时是否跳过: 0-单步跳过、1-全部跳过
|
||||||
QModelIndexList::iterator modelIndexIter = modelIndexList.begin();
|
QModelIndexList::iterator modelIndexIter = modelIndexList.begin();
|
||||||
@ -2100,10 +2100,10 @@ void CAlarmForm::confirmAlarm0()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QString key = QString("%1_%2_%3").arg(almIter.value()->domain_id).arg(almIter.value()->alm_type).arg(almIter.value()->app_id);
|
QString key = QString("%1_%2_%3").arg(almIter.value()->domain_id).arg(almIter.value()->alm_type).arg(almIter.value()->app_id);
|
||||||
QMap<QString, kbd_idlfile::SAlmCltCfmAlm *>::iterator it = pkgMap.find(key);
|
QMap<QString, iot_idl::SAlmCltCfmAlm *>::iterator it = pkgMap.find(key);
|
||||||
if(it == pkgMap.end())
|
if(it == pkgMap.end())
|
||||||
{
|
{
|
||||||
kbd_idlfile::SAlmCltCfmAlm * pkg = new kbd_idlfile::SAlmCltCfmAlm();
|
iot_idl::SAlmCltCfmAlm * pkg = new iot_idl::SAlmCltCfmAlm();
|
||||||
pkg->set_node_name(m_nodeName);
|
pkg->set_node_name(m_nodeName);
|
||||||
pkg->set_user_id(m_userId);
|
pkg->set_user_id(m_userId);
|
||||||
pkg->set_confirm_time(QDateTime::currentMSecsSinceEpoch());
|
pkg->set_confirm_time(QDateTime::currentMSecsSinceEpoch());
|
||||||
@ -2118,7 +2118,7 @@ void CAlarmForm::confirmAlarm0()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//请求确认
|
//请求确认
|
||||||
foreach (kbd_idlfile::SAlmCltCfmAlm * pkg, pkgMap)
|
foreach (iot_idl::SAlmCltCfmAlm * pkg, pkgMap)
|
||||||
{
|
{
|
||||||
if(CAlarmDataCollect::instance()->requestCfmAlm(*pkg) != true)
|
if(CAlarmDataCollect::instance()->requestCfmAlm(*pkg) != true)
|
||||||
{
|
{
|
||||||
@ -2146,7 +2146,7 @@ void CAlarmForm::confirmAlarm1()
|
|||||||
QMap<QString,AlarmMsgPtr> msgMap; //要确认的告警
|
QMap<QString,AlarmMsgPtr> msgMap; //要确认的告警
|
||||||
msgMap.clear();
|
msgMap.clear();
|
||||||
//构建告警确认package
|
//构建告警确认package
|
||||||
QMap<QString, kbd_idlfile::SAlmCltCfmAlm *> pkgMap; //Domain-DelPkg;
|
QMap<QString, iot_idl::SAlmCltCfmAlm *> pkgMap; //Domain-DelPkg;
|
||||||
int permSkip = -1; //< 不具备确认权限时是否跳过: 0-单步跳过、1-全部跳过
|
int permSkip = -1; //< 不具备确认权限时是否跳过: 0-单步跳过、1-全部跳过
|
||||||
QModelIndexList::iterator modelIndexIter = modelIndexList.begin();
|
QModelIndexList::iterator modelIndexIter = modelIndexList.begin();
|
||||||
for(;modelIndexIter != modelIndexList.end();modelIndexIter++)
|
for(;modelIndexIter != modelIndexList.end();modelIndexIter++)
|
||||||
@ -2231,10 +2231,10 @@ void CAlarmForm::confirmAlarm1()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
QString key = QString("%1_%2_%3").arg(almIter.value()->domain_id).arg(almIter.value()->alm_type).arg(almIter.value()->app_id);
|
QString key = QString("%1_%2_%3").arg(almIter.value()->domain_id).arg(almIter.value()->alm_type).arg(almIter.value()->app_id);
|
||||||
QMap<QString, kbd_idlfile::SAlmCltCfmAlm *>::iterator it = pkgMap.find(key);
|
QMap<QString, iot_idl::SAlmCltCfmAlm *>::iterator it = pkgMap.find(key);
|
||||||
if(it == pkgMap.end())
|
if(it == pkgMap.end())
|
||||||
{
|
{
|
||||||
kbd_idlfile::SAlmCltCfmAlm * pkg = new kbd_idlfile::SAlmCltCfmAlm();
|
iot_idl::SAlmCltCfmAlm * pkg = new iot_idl::SAlmCltCfmAlm();
|
||||||
pkg->set_node_name(m_nodeName);
|
pkg->set_node_name(m_nodeName);
|
||||||
pkg->set_user_id(m_userId);
|
pkg->set_user_id(m_userId);
|
||||||
pkg->set_confirm_time(QDateTime::currentMSecsSinceEpoch());
|
pkg->set_confirm_time(QDateTime::currentMSecsSinceEpoch());
|
||||||
@ -2247,7 +2247,7 @@ void CAlarmForm::confirmAlarm1()
|
|||||||
pkgMap.value(key)->add_time_stamp(almIter.value()->time_stamp);
|
pkgMap.value(key)->add_time_stamp(almIter.value()->time_stamp);
|
||||||
pkgMap.value(key)->add_uuid_base64(almIter.value()->uuid_base64.toStdString());
|
pkgMap.value(key)->add_uuid_base64(almIter.value()->uuid_base64.toStdString());
|
||||||
}
|
}
|
||||||
foreach (kbd_idlfile::SAlmCltCfmAlm * pkg, pkgMap)
|
foreach (iot_idl::SAlmCltCfmAlm * pkg, pkgMap)
|
||||||
{
|
{
|
||||||
if(CAlarmDataCollect::instance()->requestCfmAlm(*pkg) != true)
|
if(CAlarmDataCollect::instance()->requestCfmAlm(*pkg) != true)
|
||||||
{
|
{
|
||||||
@ -2312,7 +2312,7 @@ void CAlarmForm::rightMerge1()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QMap<int, kbd_idlfile::SIntelliAlmMerge *> pkgMap;
|
QMap<int, iot_idl::SIntelliAlmMerge *> pkgMap;
|
||||||
QList<AlarmMsgPtr> listPtr;
|
QList<AlarmMsgPtr> listPtr;
|
||||||
listPtr.clear();
|
listPtr.clear();
|
||||||
int permSkip = -1;
|
int permSkip = -1;
|
||||||
@ -2399,7 +2399,7 @@ void CAlarmForm::rightMerge1()
|
|||||||
int32 domain_id = listPtr.at(x)->domain_id;
|
int32 domain_id = listPtr.at(x)->domain_id;
|
||||||
if(!pkgMap.keys().contains(domain_id))
|
if(!pkgMap.keys().contains(domain_id))
|
||||||
{
|
{
|
||||||
kbd_idlfile::SIntelliAlmMerge *pkg =new kbd_idlfile::SIntelliAlmMerge();
|
iot_idl::SIntelliAlmMerge *pkg =new iot_idl::SIntelliAlmMerge();
|
||||||
pkg->set_domain_id(domain_id);
|
pkg->set_domain_id(domain_id);
|
||||||
pkgMap[domain_id] = pkg;
|
pkgMap[domain_id] = pkg;
|
||||||
}
|
}
|
||||||
@ -2419,7 +2419,7 @@ void CAlarmForm::rightMerge1()
|
|||||||
pkgMap.clear();
|
pkgMap.clear();
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
foreach (kbd_idlfile::SIntelliAlmMerge * pkg, pkgMap)
|
foreach (iot_idl::SIntelliAlmMerge * pkg, pkgMap)
|
||||||
{
|
{
|
||||||
if(CAiAlarmDataCollect::instance()->requestMergeAlm(*pkg) != true)
|
if(CAiAlarmDataCollect::instance()->requestMergeAlm(*pkg) != true)
|
||||||
{
|
{
|
||||||
@ -2540,7 +2540,7 @@ void CAlarmForm::rightSepr1()
|
|||||||
}
|
}
|
||||||
//拼包
|
//拼包
|
||||||
int domain_id = msgList.at(0)->domain_id;
|
int domain_id = msgList.at(0)->domain_id;
|
||||||
kbd_idlfile::SIntelliAlmSepr *pkg = new kbd_idlfile::SIntelliAlmSepr();
|
iot_idl::SIntelliAlmSepr *pkg = new iot_idl::SIntelliAlmSepr();
|
||||||
pkg->set_domain_id(domain_id);
|
pkg->set_domain_id(domain_id);
|
||||||
for(int index(0);index<msgList.size();index++)
|
for(int index(0);index<msgList.size();index++)
|
||||||
{
|
{
|
||||||
@ -2898,7 +2898,7 @@ void CAlarmForm::test(QStringList tagList)
|
|||||||
|
|
||||||
void CAlarmForm::inhibitAlm(const AlarmMsgPtr &alm)
|
void CAlarmForm::inhibitAlm(const AlarmMsgPtr &alm)
|
||||||
{
|
{
|
||||||
kbd_net::CMbMessage msg;
|
iot_net::CMbMessage msg;
|
||||||
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;
|
||||||
@ -2945,7 +2945,7 @@ void CAlarmForm::inhibitAlm(const AlarmMsgPtr &alm)
|
|||||||
|
|
||||||
bool CAlarmForm::permCheck(int location, int region)
|
bool CAlarmForm::permCheck(int location, int region)
|
||||||
{
|
{
|
||||||
kbd_service::CPermMngApiPtr permMngPtr = kbd_service::getPermMngInstance("base");
|
iot_service::CPermMngApiPtr permMngPtr = iot_service::getPermMngInstance("base");
|
||||||
if(permMngPtr != NULL)
|
if(permMngPtr != NULL)
|
||||||
{
|
{
|
||||||
permMngPtr->PermDllInit();
|
permMngPtr->PermDllInit();
|
||||||
@ -3008,7 +3008,7 @@ int CAlarmForm::createReqHead(SOptReqHead &head, const AlarmMsgPtr &alm)
|
|||||||
int loginSec;
|
int loginSec;
|
||||||
std::string instanceName;
|
std::string instanceName;
|
||||||
|
|
||||||
kbd_service::CPermMngApiPtr permMng = kbd_service::getPermMngInstance("base");
|
iot_service::CPermMngApiPtr permMng = iot_service::getPermMngInstance("base");
|
||||||
if(permMng != NULL)
|
if(permMng != NULL)
|
||||||
{
|
{
|
||||||
if(permMng->PermDllInit() != PERM_NORMAL)
|
if(permMng->PermDllInit() != PERM_NORMAL)
|
||||||
@ -3030,7 +3030,7 @@ int CAlarmForm::createReqHead(SOptReqHead &head, const AlarmMsgPtr &alm)
|
|||||||
|
|
||||||
if(m_ptrSysInfo != Q_NULLPTR)
|
if(m_ptrSysInfo != Q_NULLPTR)
|
||||||
{
|
{
|
||||||
kbd_public::SAppInfo stAppInfo;
|
iot_public::SAppInfo stAppInfo;
|
||||||
m_ptrSysInfo->getAppInfoBySubsystemId(alm->sub_system,stAppInfo);
|
m_ptrSysInfo->getAppInfoBySubsystemId(alm->sub_system,stAppInfo);
|
||||||
head.nAppID = stAppInfo.nId;
|
head.nAppID = stAppInfo.nId;
|
||||||
}else
|
}else
|
||||||
|
|||||||
@ -214,8 +214,8 @@ private:
|
|||||||
int createReqHead(SOptReqHead &head, const AlarmMsgPtr &alm);
|
int createReqHead(SOptReqHead &head, const AlarmMsgPtr &alm);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
kbd_public::CSysInfoInterfacePtr m_ptrSysInfo;
|
iot_public::CSysInfoInterfacePtr m_ptrSysInfo;
|
||||||
kbd_dbms::CDbApi *m_pReadDb;
|
iot_dbms::CDbApi *m_pReadDb;
|
||||||
|
|
||||||
QLineEdit * m_pSearchTextEdit;
|
QLineEdit * m_pSearchTextEdit;
|
||||||
QPushButton * m_pSearchButton;
|
QPushButton * m_pSearchButton;
|
||||||
@ -231,7 +231,7 @@ private:
|
|||||||
CAiAlarmDelegate * m_aiDelegate;
|
CAiAlarmDelegate * m_aiDelegate;
|
||||||
CAlarmDeviceTreeModel * m_pDeviceModel;
|
CAlarmDeviceTreeModel * m_pDeviceModel;
|
||||||
CAiAlarmTreeModel *m_treeModel;
|
CAiAlarmTreeModel *m_treeModel;
|
||||||
kbd_net::CMbCommunicator *m_communicator;
|
iot_net::CMbCommunicator *m_communicator;
|
||||||
int m_userId;
|
int m_userId;
|
||||||
std::string m_nodeName;
|
std::string m_nodeName;
|
||||||
int m_nDomainId;
|
int m_nDomainId;
|
||||||
|
|||||||
@ -17,7 +17,7 @@ CAlarmInhibitDialog::CAlarmInhibitDialog(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
QString qss = QString();
|
QString qss = QString();
|
||||||
std::string strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
||||||
QFile qssfile1(QString::fromStdString(strFullPath));
|
QFile qssfile1(QString::fromStdString(strFullPath));
|
||||||
qssfile1.open(QFile::ReadOnly);
|
qssfile1.open(QFile::ReadOnly);
|
||||||
if (qssfile1.isOpen())
|
if (qssfile1.isOpen())
|
||||||
@ -25,7 +25,7 @@ CAlarmInhibitDialog::CAlarmInhibitDialog(QWidget *parent) :
|
|||||||
qss += QLatin1String(qssfile1.readAll());
|
qss += QLatin1String(qssfile1.readAll());
|
||||||
qssfile1.close();
|
qssfile1.close();
|
||||||
}
|
}
|
||||||
strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("alarm.qss") ;
|
strFullPath = iot_public::CFileStyle::getPathOfStyleFile("alarm.qss") ;
|
||||||
QFile qssfile2(QString::fromStdString(strFullPath));
|
QFile qssfile2(QString::fromStdString(strFullPath));
|
||||||
qssfile2.open(QFile::ReadOnly);
|
qssfile2.open(QFile::ReadOnly);
|
||||||
if (qssfile2.isOpen())
|
if (qssfile2.isOpen())
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
using namespace kbd_public;
|
using namespace iot_public;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
const int DOCK_ROW_COUNT = 3;
|
const int DOCK_ROW_COUNT = 3;
|
||||||
const int MAX_ROW_COUNT = 15000;
|
const int MAX_ROW_COUNT = 15000;
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
#include <QDomNodeList>
|
#include <QDomNodeList>
|
||||||
#include <QRegExp>
|
#include <QRegExp>
|
||||||
|
|
||||||
using namespace kbd_public;
|
using namespace iot_public;
|
||||||
CAlarmMediaPlayer * CAlarmMediaPlayer::m_pInstance = NULL;
|
CAlarmMediaPlayer * CAlarmMediaPlayer::m_pInstance = NULL;
|
||||||
CAlarmMediaPlayer *CAlarmMediaPlayer::instance()
|
CAlarmMediaPlayer *CAlarmMediaPlayer::instance()
|
||||||
{
|
{
|
||||||
@ -37,7 +37,7 @@ CAlarmMediaPlayer::CAlarmMediaPlayer()
|
|||||||
:m_bHaveValidAudioDev(true),m_pMediaPlayer(Q_NULLPTR),m_pTextToSpeech(Q_NULLPTR),m_pTimerCheckAudioDev(Q_NULLPTR),m_voice(100)
|
:m_bHaveValidAudioDev(true),m_pMediaPlayer(Q_NULLPTR),m_pTextToSpeech(Q_NULLPTR),m_pTimerCheckAudioDev(Q_NULLPTR),m_voice(100)
|
||||||
{
|
{
|
||||||
m_readFlag = true;
|
m_readFlag = true;
|
||||||
QDir dir(QString::fromStdString(kbd_public::CFileUtil::getCurModuleDir()));
|
QDir dir(QString::fromStdString(iot_public::CFileUtil::getCurModuleDir()));
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
dir.cd("data");
|
dir.cd("data");
|
||||||
@ -184,7 +184,7 @@ void CAlarmMediaPlayer::initSpeech()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//添加语音转文本处理条件
|
//添加语音转文本处理条件
|
||||||
QFile file(kbd_public::CFileUtil::getPathOfCfgFile("alarmSpeechTextTrans.xml" , CN_DIR_PRODUCT).c_str());
|
QFile file(iot_public::CFileUtil::getPathOfCfgFile("alarmSpeechTextTrans.xml" , CN_DIR_PRODUCT).c_str());
|
||||||
if (!file.open(QFile::ReadWrite))
|
if (!file.open(QFile::ReadWrite))
|
||||||
{
|
{
|
||||||
LOGERROR("打开语音文本转换文件失败,默认不进行语音转换");
|
LOGERROR("打开语音文本转换文件失败,默认不进行语音转换");
|
||||||
|
|||||||
@ -76,7 +76,7 @@ CAlarmMsgInfo::CAlarmMsgInfo(const CAlarmMsgInfo &other): m_alarmAction(0)
|
|||||||
wave_file = other.wave_file;
|
wave_file = other.wave_file;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAlarmMsgInfo::initialize(const kbd_idlfile::SAlmInfoToAlmClt &alarmInfo)
|
void CAlarmMsgInfo::initialize(const iot_idl::SAlmInfoToAlmClt &alarmInfo)
|
||||||
{
|
{
|
||||||
alm_type = alarmInfo.alm_type();
|
alm_type = alarmInfo.alm_type();
|
||||||
alm_status = alarmInfo.alm_status();
|
alm_status = alarmInfo.alm_status();
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class CAlarmMsgInfo
|
|||||||
public:
|
public:
|
||||||
CAlarmMsgInfo();
|
CAlarmMsgInfo();
|
||||||
CAlarmMsgInfo(const CAlarmMsgInfo &other);
|
CAlarmMsgInfo(const CAlarmMsgInfo &other);
|
||||||
void initialize(const kbd_idlfile::SAlmInfoToAlmClt &alarmInfo);
|
void initialize(const iot_idl::SAlmInfoToAlmClt &alarmInfo);
|
||||||
int getCameraInfoByTag(const QString &tag);
|
int getCameraInfoByTag(const QString &tag);
|
||||||
|
|
||||||
//< [优先级越小表示越大]-原始告警窗调用
|
//< [优先级越小表示越大]-原始告警窗调用
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
#include "pub_logger_api/logger.h"
|
#include "pub_logger_api/logger.h"
|
||||||
#include "CAlarmBaseData.h"
|
#include "CAlarmBaseData.h"
|
||||||
|
|
||||||
using namespace kbd_public;
|
using namespace iot_public;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
CAlarmMsgManage *CAlarmMsgManage::pInstance = NULL;
|
CAlarmMsgManage *CAlarmMsgManage::pInstance = NULL;
|
||||||
@ -37,7 +37,7 @@ CAlarmMsgManage::CAlarmMsgManage()
|
|||||||
m_nAlmTotal(0)
|
m_nAlmTotal(0)
|
||||||
{
|
{
|
||||||
mutex = new QMutex();
|
mutex = new QMutex();
|
||||||
QDir dir(QString::fromStdString(kbd_public::CFileUtil::getCurModuleDir()));
|
QDir dir(QString::fromStdString(iot_public::CFileUtil::getCurModuleDir()));
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
dir.cd("data");
|
dir.cd("data");
|
||||||
@ -60,13 +60,13 @@ CAlarmMsgManage::CAlarmMsgManage()
|
|||||||
m_all.clear();
|
m_all.clear();
|
||||||
m_aiall.clear();
|
m_aiall.clear();
|
||||||
|
|
||||||
m_rtdbAlarmActionAccess = new kbd_dbms::CRdbAccess();
|
m_rtdbAlarmActionAccess = new iot_dbms::CRdbAccess();
|
||||||
m_rtdbAlarmActionAccess->open("base", "alarm_level_define");
|
m_rtdbAlarmActionAccess->open("base", "alarm_level_define");
|
||||||
|
|
||||||
m_rtdbLocationDescriptionAccess = new kbd_dbms::CRdbAccess();
|
m_rtdbLocationDescriptionAccess = new iot_dbms::CRdbAccess();
|
||||||
m_rtdbLocationDescriptionAccess->open("base", "sys_model_location_info");
|
m_rtdbLocationDescriptionAccess->open("base", "sys_model_location_info");
|
||||||
|
|
||||||
m_rtdbAppDescriptionAccess = new kbd_dbms::CRdbAccess();
|
m_rtdbAppDescriptionAccess = new iot_dbms::CRdbAccess();
|
||||||
m_rtdbAppDescriptionAccess->open("base", "sys_model_app_info");
|
m_rtdbAppDescriptionAccess->open("base", "sys_model_app_info");
|
||||||
|
|
||||||
loadPermInfo();
|
loadPermInfo();
|
||||||
@ -1868,24 +1868,24 @@ void CAlarmMsgManage::dealDelayAi()
|
|||||||
|
|
||||||
int CAlarmMsgManage::queryAlarmAction(const int &priority)
|
int CAlarmMsgManage::queryAlarmAction(const int &priority)
|
||||||
{
|
{
|
||||||
kbd_dbms::CTableLockGuard locker(*m_rtdbAlarmActionAccess);
|
iot_dbms::CTableLockGuard locker(*m_rtdbAlarmActionAccess);
|
||||||
kbd_dbms::CVarType value;
|
iot_dbms::CVarType value;
|
||||||
m_rtdbAlarmActionAccess->getColumnValueByKey((void*)&priority, "alarm_actions",value);
|
m_rtdbAlarmActionAccess->getColumnValueByKey((void*)&priority, "alarm_actions",value);
|
||||||
return value.toInt();
|
return value.toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CAlarmMsgManage::queryLocationDescription(int id)
|
QString CAlarmMsgManage::queryLocationDescription(int id)
|
||||||
{
|
{
|
||||||
kbd_dbms::CTableLockGuard locker(*m_rtdbLocationDescriptionAccess);
|
iot_dbms::CTableLockGuard locker(*m_rtdbLocationDescriptionAccess);
|
||||||
kbd_dbms::CVarType value;
|
iot_dbms::CVarType value;
|
||||||
m_rtdbLocationDescriptionAccess->getColumnValueByKey((void*)&id, "description", value);
|
m_rtdbLocationDescriptionAccess->getColumnValueByKey((void*)&id, "description", value);
|
||||||
return value.c_str();
|
return value.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CAlarmMsgManage::queryAppDescription(int id)
|
QString CAlarmMsgManage::queryAppDescription(int id)
|
||||||
{
|
{
|
||||||
kbd_dbms::CTableLockGuard locker(*m_rtdbAppDescriptionAccess);
|
iot_dbms::CTableLockGuard locker(*m_rtdbAppDescriptionAccess);
|
||||||
kbd_dbms::CVarType value;
|
iot_dbms::CVarType value;
|
||||||
m_rtdbAppDescriptionAccess->getColumnValueByKey((void*)&id, "description", value);
|
m_rtdbAppDescriptionAccess->getColumnValueByKey((void*)&id, "description", value);
|
||||||
return value.c_str();
|
return value.c_str();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -372,9 +372,9 @@ private:
|
|||||||
|
|
||||||
QMutex * mutex;
|
QMutex * mutex;
|
||||||
|
|
||||||
kbd_dbms::CRdbAccess * m_rtdbAlarmActionAccess;
|
iot_dbms::CRdbAccess * m_rtdbAlarmActionAccess;
|
||||||
kbd_dbms::CRdbAccess * m_rtdbLocationDescriptionAccess;
|
iot_dbms::CRdbAccess * m_rtdbLocationDescriptionAccess;
|
||||||
kbd_dbms::CRdbAccess * m_rtdbAppDescriptionAccess;
|
iot_dbms::CRdbAccess * m_rtdbAppDescriptionAccess;
|
||||||
|
|
||||||
int m_nNDelComAlarmCount; //< 未删除未确认数量 N--not Del--delete Com--confirm
|
int m_nNDelComAlarmCount; //< 未删除未确认数量 N--not Del--delete Com--confirm
|
||||||
QHash<QString, AlarmMsgPtr> m_infos;
|
QHash<QString, AlarmMsgPtr> m_infos;
|
||||||
|
|||||||
@ -41,7 +41,7 @@ CAlarmPlugin::CAlarmPlugin(QWidget *parent, bool editMode)
|
|||||||
#ifdef OS_LINUX
|
#ifdef OS_LINUX
|
||||||
QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + "/plugins");
|
QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + "/plugins");
|
||||||
#endif
|
#endif
|
||||||
std::string strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
||||||
QFile qssfile1(QString::fromStdString(strFullPath));
|
QFile qssfile1(QString::fromStdString(strFullPath));
|
||||||
qssfile1.open(QFile::ReadOnly);
|
qssfile1.open(QFile::ReadOnly);
|
||||||
if (qssfile1.isOpen())
|
if (qssfile1.isOpen())
|
||||||
@ -49,7 +49,7 @@ CAlarmPlugin::CAlarmPlugin(QWidget *parent, bool editMode)
|
|||||||
qss += QLatin1String(qssfile1.readAll());
|
qss += QLatin1String(qssfile1.readAll());
|
||||||
qssfile1.close();
|
qssfile1.close();
|
||||||
}
|
}
|
||||||
strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("alarm.qss") ;
|
strFullPath = iot_public::CFileStyle::getPathOfStyleFile("alarm.qss") ;
|
||||||
QFile qssfile2(QString::fromStdString(strFullPath));
|
QFile qssfile2(QString::fromStdString(strFullPath));
|
||||||
qssfile2.open(QFile::ReadOnly);
|
qssfile2.open(QFile::ReadOnly);
|
||||||
if (qssfile2.isOpen())
|
if (qssfile2.isOpen())
|
||||||
@ -242,7 +242,7 @@ void CAlarmPlugin::initialize(int mode)
|
|||||||
|
|
||||||
void CAlarmPlugin::loadConfig()
|
void CAlarmPlugin::loadConfig()
|
||||||
{
|
{
|
||||||
QFile file(kbd_public::CFileUtil::getPathOfCfgFile("intelli_alm_cfg.xml",CN_DIR_PLATFORM).c_str());
|
QFile file(iot_public::CFileUtil::getPathOfCfgFile("intelli_alm_cfg.xml",CN_DIR_PLATFORM).c_str());
|
||||||
if (!file.open(QFile::ReadWrite))
|
if (!file.open(QFile::ReadWrite))
|
||||||
{
|
{
|
||||||
LOGERROR("打开智能告警配置文件失败,默认不启动");
|
LOGERROR("打开智能告警配置文件失败,默认不启动");
|
||||||
@ -332,7 +332,7 @@ int CAlarmPlugin::confirmAlarm(const QList<AlarmMsgPtr> &msgs)
|
|||||||
return cofirmNum;
|
return cofirmNum;
|
||||||
}
|
}
|
||||||
//< 可能有部分告警没有确认权限
|
//< 可能有部分告警没有确认权限
|
||||||
QMap<QString, kbd_idlfile::SAlmCltCfmAlm *> pkgMap; //Domain-DelPkg;
|
QMap<QString, iot_idl::SAlmCltCfmAlm *> pkgMap; //Domain-DelPkg;
|
||||||
for(int nIndex(0); nIndex < msgs.size(); nIndex++)
|
for(int nIndex(0); nIndex < msgs.size(); nIndex++)
|
||||||
{
|
{
|
||||||
AlarmMsgPtr info = msgs.at(nIndex);
|
AlarmMsgPtr info = msgs.at(nIndex);
|
||||||
@ -362,10 +362,10 @@ int CAlarmPlugin::confirmAlarm(const QList<AlarmMsgPtr> &msgs)
|
|||||||
if(regionEnable && locationEnable)
|
if(regionEnable && locationEnable)
|
||||||
{
|
{
|
||||||
QString key = QString("%1_%2_%3").arg(info->domain_id).arg(info->alm_type).arg(info->app_id);
|
QString key = QString("%1_%2_%3").arg(info->domain_id).arg(info->alm_type).arg(info->app_id);
|
||||||
QMap<QString, kbd_idlfile::SAlmCltCfmAlm *>::iterator it = pkgMap.find(key);
|
QMap<QString, iot_idl::SAlmCltCfmAlm *>::iterator it = pkgMap.find(key);
|
||||||
if(it == pkgMap.end())
|
if(it == pkgMap.end())
|
||||||
{
|
{
|
||||||
kbd_idlfile::SAlmCltCfmAlm * pkg = new kbd_idlfile::SAlmCltCfmAlm();
|
iot_idl::SAlmCltCfmAlm * pkg = new iot_idl::SAlmCltCfmAlm();
|
||||||
pkg->set_node_name(m_currentNodeName);
|
pkg->set_node_name(m_currentNodeName);
|
||||||
pkg->set_user_id(m_currentUsrId);
|
pkg->set_user_id(m_currentUsrId);
|
||||||
pkg->set_confirm_time(QDateTime::currentMSecsSinceEpoch());
|
pkg->set_confirm_time(QDateTime::currentMSecsSinceEpoch());
|
||||||
@ -381,7 +381,7 @@ int CAlarmPlugin::confirmAlarm(const QList<AlarmMsgPtr> &msgs)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//请求确认
|
//请求确认
|
||||||
foreach (kbd_idlfile::SAlmCltCfmAlm * pkg, pkgMap)
|
foreach (iot_idl::SAlmCltCfmAlm * pkg, pkgMap)
|
||||||
{
|
{
|
||||||
if(CAlarmDataCollect::instance()->requestCfmAlm(*pkg) != true)
|
if(CAlarmDataCollect::instance()->requestCfmAlm(*pkg) != true)
|
||||||
{
|
{
|
||||||
@ -406,7 +406,7 @@ int CAlarmPlugin::removeAlarm(const QList<AlarmMsgPtr> &msgs)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
//< 可能有部分告警没有删除权限
|
//< 可能有部分告警没有删除权限
|
||||||
QMap<int32, kbd_idlfile::SAlmCltDelAlm *> pkgMap;
|
QMap<int32, iot_idl::SAlmCltDelAlm *> pkgMap;
|
||||||
for(int nIndex(0); nIndex < msgs.size(); nIndex++)
|
for(int nIndex(0); nIndex < msgs.size(); nIndex++)
|
||||||
{
|
{
|
||||||
AlarmMsgPtr info = msgs.at(nIndex);
|
AlarmMsgPtr info = msgs.at(nIndex);
|
||||||
@ -432,10 +432,10 @@ int CAlarmPlugin::removeAlarm(const QList<AlarmMsgPtr> &msgs)
|
|||||||
}
|
}
|
||||||
if(regionEnable && locationEnable)
|
if(regionEnable && locationEnable)
|
||||||
{
|
{
|
||||||
QMap<int32, kbd_idlfile::SAlmCltDelAlm *>::iterator it = pkgMap.find(info->domain_id);
|
QMap<int32, iot_idl::SAlmCltDelAlm *>::iterator it = pkgMap.find(info->domain_id);
|
||||||
if(it == pkgMap.end())
|
if(it == pkgMap.end())
|
||||||
{
|
{
|
||||||
kbd_idlfile::SAlmCltDelAlm * pkg = new kbd_idlfile::SAlmCltDelAlm();
|
iot_idl::SAlmCltDelAlm * pkg = new iot_idl::SAlmCltDelAlm();
|
||||||
pkg->set_domain_id(info->domain_id);
|
pkg->set_domain_id(info->domain_id);
|
||||||
pkgMap[info->domain_id] = pkg;
|
pkgMap[info->domain_id] = pkg;
|
||||||
}
|
}
|
||||||
@ -443,7 +443,7 @@ int CAlarmPlugin::removeAlarm(const QList<AlarmMsgPtr> &msgs)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//请求删除
|
//请求删除
|
||||||
foreach (kbd_idlfile::SAlmCltDelAlm * pkg, pkgMap)
|
foreach (iot_idl::SAlmCltDelAlm * pkg, pkgMap)
|
||||||
{
|
{
|
||||||
if(CAlarmDataCollect::instance()->requestDelAlm(*pkg) != true)
|
if(CAlarmDataCollect::instance()->requestDelAlm(*pkg) != true)
|
||||||
{
|
{
|
||||||
@ -1355,9 +1355,9 @@ void CAlarmPlugin::updateAlarmOperatePerm()
|
|||||||
m_vecRegionDelId.clear();
|
m_vecRegionDelId.clear();
|
||||||
m_vecLocationDelId.clear();
|
m_vecLocationDelId.clear();
|
||||||
|
|
||||||
kbd_public::SNodeInfo stNodeInfo;
|
iot_public::SNodeInfo stNodeInfo;
|
||||||
kbd_public::CSysInfoInterfacePtr spSysInfo;
|
iot_public::CSysInfoInterfacePtr spSysInfo;
|
||||||
if (!kbd_public::createSysInfoInstance(spSysInfo))
|
if (!iot_public::createSysInfoInstance(spSysInfo))
|
||||||
{
|
{
|
||||||
LOGERROR("创建系统信息访问库实例失败!");
|
LOGERROR("创建系统信息访问库实例失败!");
|
||||||
return;
|
return;
|
||||||
@ -1365,7 +1365,7 @@ void CAlarmPlugin::updateAlarmOperatePerm()
|
|||||||
spSysInfo->getLocalNodeInfo(stNodeInfo);
|
spSysInfo->getLocalNodeInfo(stNodeInfo);
|
||||||
|
|
||||||
m_currentNodeName = stNodeInfo.strName;
|
m_currentNodeName = stNodeInfo.strName;
|
||||||
kbd_service::CPermMngApiPtr permMngPtr = kbd_service::getPermMngInstance("base");
|
iot_service::CPermMngApiPtr permMngPtr = iot_service::getPermMngInstance("base");
|
||||||
if(permMngPtr != NULL)
|
if(permMngPtr != NULL)
|
||||||
{
|
{
|
||||||
permMngPtr->PermDllInit();
|
permMngPtr->PermDllInit();
|
||||||
|
|||||||
@ -25,7 +25,7 @@ CAlarmSetDlg::CAlarmSetDlg(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
QString qss = QString();
|
QString qss = QString();
|
||||||
std::string strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
||||||
QFile qssfile1(QString::fromStdString(strFullPath));
|
QFile qssfile1(QString::fromStdString(strFullPath));
|
||||||
qssfile1.open(QFile::ReadOnly);
|
qssfile1.open(QFile::ReadOnly);
|
||||||
if (qssfile1.isOpen())
|
if (qssfile1.isOpen())
|
||||||
@ -33,7 +33,7 @@ CAlarmSetDlg::CAlarmSetDlg(QWidget *parent) :
|
|||||||
qss += QLatin1String(qssfile1.readAll());
|
qss += QLatin1String(qssfile1.readAll());
|
||||||
qssfile1.close();
|
qssfile1.close();
|
||||||
}
|
}
|
||||||
strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("alarm.qss") ;
|
strFullPath = iot_public::CFileStyle::getPathOfStyleFile("alarm.qss") ;
|
||||||
QFile qssfile2(QString::fromStdString(strFullPath));
|
QFile qssfile2(QString::fromStdString(strFullPath));
|
||||||
qssfile2.open(QFile::ReadOnly);
|
qssfile2.open(QFile::ReadOnly);
|
||||||
if (qssfile2.isOpen())
|
if (qssfile2.isOpen())
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
#include "pub_utility_api/FileUtil.h"
|
#include "pub_utility_api/FileUtil.h"
|
||||||
#include "CAlarmBaseData.h"
|
#include "CAlarmBaseData.h"
|
||||||
|
|
||||||
using namespace kbd_public;
|
using namespace iot_public;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
CAlarmSetMng *CAlarmSetMng::pInstance = NULL;
|
CAlarmSetMng *CAlarmSetMng::pInstance = NULL;
|
||||||
@ -41,7 +41,7 @@ CAlarmSetMng::CAlarmSetMng()
|
|||||||
void CAlarmSetMng::loadXMLCfg()
|
void CAlarmSetMng::loadXMLCfg()
|
||||||
{
|
{
|
||||||
m_colorMap.clear();
|
m_colorMap.clear();
|
||||||
QString filePath = QString::fromStdString(kbd_public::CFileUtil::getCurModuleDir()) + QString("../../data/model/alarm_color_define.xml");
|
QString filePath = QString::fromStdString(iot_public::CFileUtil::getCurModuleDir()) + QString("../../data/model/alarm_color_define.xml");
|
||||||
QDomDocument document;
|
QDomDocument document;
|
||||||
QFile file(filePath);
|
QFile file(filePath);
|
||||||
if (!file.open(QIODevice::ReadOnly))
|
if (!file.open(QIODevice::ReadOnly))
|
||||||
|
|||||||
@ -66,7 +66,7 @@ private:
|
|||||||
static CAlarmSetMng * pInstance;
|
static CAlarmSetMng * pInstance;
|
||||||
|
|
||||||
|
|
||||||
kbd_dbms::CRdbAccess * m_rtdbAccess;
|
iot_dbms::CRdbAccess * m_rtdbAccess;
|
||||||
|
|
||||||
QMap<int, QString> m_priorityOrderDescriptionMap;
|
QMap<int, QString> m_priorityOrderDescriptionMap;
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@ CAlarmShiledDialog::CAlarmShiledDialog(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
QString qss = QString();
|
QString qss = QString();
|
||||||
std::string strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
||||||
QFile qssfile1(QString::fromStdString(strFullPath));
|
QFile qssfile1(QString::fromStdString(strFullPath));
|
||||||
qssfile1.open(QFile::ReadOnly);
|
qssfile1.open(QFile::ReadOnly);
|
||||||
if (qssfile1.isOpen())
|
if (qssfile1.isOpen())
|
||||||
@ -23,7 +23,7 @@ CAlarmShiledDialog::CAlarmShiledDialog(QWidget *parent) :
|
|||||||
qss += QLatin1String(qssfile1.readAll());
|
qss += QLatin1String(qssfile1.readAll());
|
||||||
qssfile1.close();
|
qssfile1.close();
|
||||||
}
|
}
|
||||||
strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("alarm.qss") ;
|
strFullPath = iot_public::CFileStyle::getPathOfStyleFile("alarm.qss") ;
|
||||||
QFile qssfile2(QString::fromStdString(strFullPath));
|
QFile qssfile2(QString::fromStdString(strFullPath));
|
||||||
qssfile2.open(QFile::ReadOnly);
|
qssfile2.open(QFile::ReadOnly);
|
||||||
if (qssfile2.isOpen())
|
if (qssfile2.isOpen())
|
||||||
@ -80,7 +80,7 @@ QWidget *CAlarmShiledDialog::createCustomWidget(const QString &name)
|
|||||||
}
|
}
|
||||||
fileName += ".so";
|
fileName += ".so";
|
||||||
#endif
|
#endif
|
||||||
std::string filePath = kbd_public::CFileUtil::getPathOfBinFile(fileName.toStdString());
|
std::string filePath = iot_public::CFileUtil::getPathOfBinFile(fileName.toStdString());
|
||||||
path = QString::fromStdString(filePath);
|
path = QString::fromStdString(filePath);
|
||||||
QPluginLoader loader(path);
|
QPluginLoader loader(path);
|
||||||
QObject *plugin = loader.instance();
|
QObject *plugin = loader.instance();
|
||||||
|
|||||||
@ -305,7 +305,7 @@ void CAlarmWidget::confirmAlarm(const int &row)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
kbd_idlfile::SAlmCltCfmAlm * pkg = new kbd_idlfile::SAlmCltCfmAlm();
|
iot_idl::SAlmCltCfmAlm * pkg = new iot_idl::SAlmCltCfmAlm();
|
||||||
pkg->set_node_name(m_nodeName);
|
pkg->set_node_name(m_nodeName);
|
||||||
pkg->set_user_id(m_userId);
|
pkg->set_user_id(m_userId);
|
||||||
pkg->set_confirm_time(QDateTime::currentMSecsSinceEpoch());
|
pkg->set_confirm_time(QDateTime::currentMSecsSinceEpoch());
|
||||||
@ -355,9 +355,9 @@ void CAlarmWidget::setEnableLevel(bool isNeed)
|
|||||||
|
|
||||||
bool CAlarmWidget::updateAlarmOperatePerm()
|
bool CAlarmWidget::updateAlarmOperatePerm()
|
||||||
{
|
{
|
||||||
kbd_public::SNodeInfo stNodeInfo;
|
iot_public::SNodeInfo stNodeInfo;
|
||||||
kbd_public::CSysInfoInterfacePtr spSysInfo;
|
iot_public::CSysInfoInterfacePtr spSysInfo;
|
||||||
if (!kbd_public::createSysInfoInstance(spSysInfo))
|
if (!iot_public::createSysInfoInstance(spSysInfo))
|
||||||
{
|
{
|
||||||
LOGERROR("创建系统信息访问库实例失败!");
|
LOGERROR("创建系统信息访问库实例失败!");
|
||||||
return false;
|
return false;
|
||||||
@ -368,7 +368,7 @@ bool CAlarmWidget::updateAlarmOperatePerm()
|
|||||||
m_listRegionOptId.clear();
|
m_listRegionOptId.clear();
|
||||||
m_listLocationDelId.clear();
|
m_listLocationDelId.clear();
|
||||||
m_listRegionDelId.clear();
|
m_listRegionDelId.clear();
|
||||||
kbd_service::CPermMngApiPtr permMngPtr = kbd_service::getPermMngInstance("base");
|
iot_service::CPermMngApiPtr permMngPtr = iot_service::getPermMngInstance("base");
|
||||||
if(permMngPtr != NULL)
|
if(permMngPtr != NULL)
|
||||||
{
|
{
|
||||||
permMngPtr->PermDllInit();
|
permMngPtr->PermDllInit();
|
||||||
|
|||||||
@ -41,12 +41,12 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
kbd_public::StartLogSystem("HMI", "hmi");
|
iot_public::StartLogSystem("HMI", "hmi");
|
||||||
if (!(kbd_net::initMsgBus("HMI", "HMI")))
|
if (!(iot_net::initMsgBus("HMI", "HMI")))
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
kbd_service::CPermMngApiPtr perm = kbd_service::getPermMngInstance("base");
|
iot_service::CPermMngApiPtr perm = iot_service::getPermMngInstance("base");
|
||||||
if(!perm || PERM_NORMAL != perm->PermDllInit())
|
if(!perm || PERM_NORMAL != perm->PermDllInit())
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
@ -67,8 +67,8 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
//<释放消息总线
|
//<释放消息总线
|
||||||
kbd_net::releaseMsgBus();
|
iot_net::releaseMsgBus();
|
||||||
kbd_public::StopLogSystem();
|
iot_public::StopLogSystem();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include "CAssetUuid.h"
|
#include "CAssetUuid.h"
|
||||||
|
|
||||||
using namespace kbd_dbms;
|
using namespace iot_dbms;
|
||||||
|
|
||||||
CAssetDataMng *CAssetDataMng::m_pInstance = NULL;
|
CAssetDataMng *CAssetDataMng::m_pInstance = NULL;
|
||||||
|
|
||||||
@ -653,7 +653,7 @@ QString CAssetDataMng::getRandomId()
|
|||||||
CAssetDataMng::CAssetDataMng():
|
CAssetDataMng::CAssetDataMng():
|
||||||
m_referenceCount(0)
|
m_referenceCount(0)
|
||||||
{
|
{
|
||||||
m_pWriteDb = new kbd_dbms::CDbApi(DB_CONN_MODEL_WRITE);
|
m_pWriteDb = new iot_dbms::CDbApi(DB_CONN_MODEL_WRITE);
|
||||||
m_pWriteDb->open();
|
m_pWriteDb->open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -68,7 +68,7 @@ private:
|
|||||||
private:
|
private:
|
||||||
static CAssetDataMng * m_pInstance;
|
static CAssetDataMng * m_pInstance;
|
||||||
|
|
||||||
kbd_dbms::CDbApi *m_pWriteDb;
|
iot_dbms::CDbApi *m_pWriteDb;
|
||||||
|
|
||||||
int m_referenceCount;
|
int m_referenceCount;
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@ CAssetDelegate::CAssetDelegate(CAssetTableModel *model, QObject *parent)
|
|||||||
m_pModel(model),
|
m_pModel(model),
|
||||||
style(QString())
|
style(QString())
|
||||||
{
|
{
|
||||||
style = QString::fromStdString(kbd_public::CFileStyle::getCurStyle()) ;
|
style = QString::fromStdString(iot_public::CFileStyle::getCurStyle()) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAssetDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
void CAssetDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||||
@ -44,7 +44,7 @@ void CAssetDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option
|
|||||||
|
|
||||||
button.rect.adjust(option.rect.width() - 40, option.rect.height()/2-10, -12, -(option.rect.height()/2-10));
|
button.rect.adjust(option.rect.width() - 40, option.rect.height()/2-10, -12, -(option.rect.height()/2-10));
|
||||||
//QString file = "../../common/resource/zh/gui/icon/asset/record.png";
|
//QString file = "../../common/resource/zh/gui/icon/asset/record.png";
|
||||||
QString file = kbd_public::CFileUtil::getPathOfResFile("gui/icon/asset/record.png").c_str();
|
QString file = iot_public::CFileUtil::getPathOfResFile("gui/icon/asset/record.png").c_str();
|
||||||
button.iconSize = QSize(button.rect.width()+2,button.rect.height()+2);
|
button.iconSize = QSize(button.rect.width()+2,button.rect.height()+2);
|
||||||
button.icon = QIcon(file);
|
button.icon = QIcon(file);
|
||||||
button.features = QStyleOptionButton::Flat;
|
button.features = QStyleOptionButton::Flat;
|
||||||
|
|||||||
@ -24,7 +24,7 @@ CAssetWidget::CAssetWidget(QWidget *parent, bool editMode)
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
QString qss = QString();
|
QString qss = QString();
|
||||||
std::string strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
||||||
QFile qssfile1(QString::fromStdString(strFullPath));
|
QFile qssfile1(QString::fromStdString(strFullPath));
|
||||||
qssfile1.open(QFile::ReadOnly);
|
qssfile1.open(QFile::ReadOnly);
|
||||||
if (qssfile1.isOpen())
|
if (qssfile1.isOpen())
|
||||||
@ -38,7 +38,7 @@ CAssetWidget::CAssetWidget(QWidget *parent, bool editMode)
|
|||||||
qDebug() << "public.qss 无法打开!";
|
qDebug() << "public.qss 无法打开!";
|
||||||
}
|
}
|
||||||
|
|
||||||
strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("asset.qss") ;
|
strFullPath = iot_public::CFileStyle::getPathOfStyleFile("asset.qss") ;
|
||||||
QFile qssfile2(QString::fromStdString(strFullPath));
|
QFile qssfile2(QString::fromStdString(strFullPath));
|
||||||
qssfile2.open(QFile::ReadOnly);
|
qssfile2.open(QFile::ReadOnly);
|
||||||
if (qssfile2.isOpen())
|
if (qssfile2.isOpen())
|
||||||
|
|||||||
@ -16,7 +16,7 @@ CPropertyDialog::CPropertyDialog(int mode, int loc, QString devg, QWidget *paren
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
this->setWindowTitle(tr("添加"));
|
this->setWindowTitle(tr("添加"));
|
||||||
QString qss = QString();
|
QString qss = QString();
|
||||||
std::string strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
||||||
QFile qssfile1(QString::fromStdString(strFullPath));
|
QFile qssfile1(QString::fromStdString(strFullPath));
|
||||||
qssfile1.open(QFile::ReadOnly);
|
qssfile1.open(QFile::ReadOnly);
|
||||||
if (qssfile1.isOpen())
|
if (qssfile1.isOpen())
|
||||||
@ -30,7 +30,7 @@ CPropertyDialog::CPropertyDialog(int mode, int loc, QString devg, QWidget *paren
|
|||||||
qDebug() << "public.qss 无法打开!";
|
qDebug() << "public.qss 无法打开!";
|
||||||
}
|
}
|
||||||
|
|
||||||
strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("asset.qss") ;
|
strFullPath = iot_public::CFileStyle::getPathOfStyleFile("asset.qss") ;
|
||||||
QFile qssfile2(QString::fromStdString(strFullPath));
|
QFile qssfile2(QString::fromStdString(strFullPath));
|
||||||
qssfile2.open(QFile::ReadOnly);
|
qssfile2.open(QFile::ReadOnly);
|
||||||
if (qssfile2.isOpen())
|
if (qssfile2.isOpen())
|
||||||
|
|||||||
@ -18,7 +18,7 @@ CRecordDialog::CRecordDialog(int mode, AssetInfo info, QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
QString qss = QString();
|
QString qss = QString();
|
||||||
std::string strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
||||||
QFile qssfile1(QString::fromStdString(strFullPath));
|
QFile qssfile1(QString::fromStdString(strFullPath));
|
||||||
qssfile1.open(QFile::ReadOnly);
|
qssfile1.open(QFile::ReadOnly);
|
||||||
if (qssfile1.isOpen())
|
if (qssfile1.isOpen())
|
||||||
@ -32,7 +32,7 @@ CRecordDialog::CRecordDialog(int mode, AssetInfo info, QWidget *parent) :
|
|||||||
qDebug() << "public.qss 无法打开!";
|
qDebug() << "public.qss 无法打开!";
|
||||||
}
|
}
|
||||||
|
|
||||||
strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("asset.qss") ;
|
strFullPath = iot_public::CFileStyle::getPathOfStyleFile("asset.qss") ;
|
||||||
QFile qssfile2(QString::fromStdString(strFullPath));
|
QFile qssfile2(QString::fromStdString(strFullPath));
|
||||||
qssfile2.open(QFile::ReadOnly);
|
qssfile2.open(QFile::ReadOnly);
|
||||||
if (qssfile2.isOpen())
|
if (qssfile2.isOpen())
|
||||||
|
|||||||
@ -12,7 +12,7 @@ CRecordPropertyDialog::CRecordPropertyDialog(int mode, const AssetInfo &assetInf
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
QString qss = QString();
|
QString qss = QString();
|
||||||
std::string strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
||||||
QFile qssfile1(QString::fromStdString(strFullPath));
|
QFile qssfile1(QString::fromStdString(strFullPath));
|
||||||
qssfile1.open(QFile::ReadOnly);
|
qssfile1.open(QFile::ReadOnly);
|
||||||
if (qssfile1.isOpen())
|
if (qssfile1.isOpen())
|
||||||
@ -26,7 +26,7 @@ CRecordPropertyDialog::CRecordPropertyDialog(int mode, const AssetInfo &assetInf
|
|||||||
qDebug() << "public.qss 无法打开!";
|
qDebug() << "public.qss 无法打开!";
|
||||||
}
|
}
|
||||||
|
|
||||||
strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("asset.qss") ;
|
strFullPath = iot_public::CFileStyle::getPathOfStyleFile("asset.qss") ;
|
||||||
QFile qssfile2(QString::fromStdString(strFullPath));
|
QFile qssfile2(QString::fromStdString(strFullPath));
|
||||||
qssfile2.open(QFile::ReadOnly);
|
qssfile2.open(QFile::ReadOnly);
|
||||||
if (qssfile2.isOpen())
|
if (qssfile2.isOpen())
|
||||||
|
|||||||
@ -38,8 +38,8 @@ void CBIWidget::initWidget(bool editMode)
|
|||||||
QGridLayout *layout = new QGridLayout(this);
|
QGridLayout *layout = new QGridLayout(this);
|
||||||
m_imageLabel = new QLabel(this);
|
m_imageLabel = new QLabel(this);
|
||||||
m_imageLabel->setScaledContents(true);
|
m_imageLabel->setScaledContents(true);
|
||||||
std::string style = kbd_public::CFileStyle::getCurStyle();
|
std::string style = iot_public::CFileStyle::getCurStyle();
|
||||||
QString file = kbd_public::CFileUtil::getPathOfResFile("gui/icon/bi/face_"+style+".png").c_str();
|
QString file = iot_public::CFileUtil::getPathOfResFile("gui/icon/bi/face_"+style+".png").c_str();
|
||||||
m_imageLabel->setPixmap(QPixmap(file));
|
m_imageLabel->setPixmap(QPixmap(file));
|
||||||
layout->addWidget(m_imageLabel);
|
layout->addWidget(m_imageLabel);
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
@ -64,8 +64,8 @@ bool CBIWidget::slotBIdentify()
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
std::string style = kbd_public::CFileStyle::getCurStyle();
|
std::string style = iot_public::CFileStyle::getCurStyle();
|
||||||
QString file = kbd_public::CFileUtil::getPathOfResFile("gui/icon/bi/face_"+style+".png").c_str();
|
QString file = iot_public::CFileUtil::getPathOfResFile("gui/icon/bi/face_"+style+".png").c_str();
|
||||||
m_imageLabel->setPixmap(QPixmap(file));
|
m_imageLabel->setPixmap(QPixmap(file));
|
||||||
if(!m_permMng)
|
if(!m_permMng)
|
||||||
{
|
{
|
||||||
@ -82,8 +82,8 @@ void CBIWidget::slotCancelBIdentify()
|
|||||||
{
|
{
|
||||||
m_isRecognizing = false;
|
m_isRecognizing = false;
|
||||||
m_permMng->cancelBioIdentify();
|
m_permMng->cancelBioIdentify();
|
||||||
std::string style = kbd_public::CFileStyle::getCurStyle();
|
std::string style = iot_public::CFileStyle::getCurStyle();
|
||||||
QString file = kbd_public::CFileUtil::getPathOfResFile("gui/icon/bi/face_"+style+".png").c_str();
|
QString file = iot_public::CFileUtil::getPathOfResFile("gui/icon/bi/face_"+style+".png").c_str();
|
||||||
m_imageLabel->setPixmap(QPixmap(file));
|
m_imageLabel->setPixmap(QPixmap(file));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -210,8 +210,8 @@ void CBIWidget::slotRecvBioResult()
|
|||||||
delete[] img;
|
delete[] img;
|
||||||
if(pixmap.isNull())
|
if(pixmap.isNull())
|
||||||
{
|
{
|
||||||
std::string style = kbd_public::CFileStyle::getCurStyle();
|
std::string style = iot_public::CFileStyle::getCurStyle();
|
||||||
QString file = kbd_public::CFileUtil::getPathOfResFile("gui/icon/bi/face_"+style+".png").c_str();
|
QString file = iot_public::CFileUtil::getPathOfResFile("gui/icon/bi/face_"+style+".png").c_str();
|
||||||
m_imageLabel->setPixmap(QPixmap(file));
|
m_imageLabel->setPixmap(QPixmap(file));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include "perm_mng_api/PermMngApi.h"
|
#include "perm_mng_api/PermMngApi.h"
|
||||||
|
|
||||||
using namespace kbd_service;
|
using namespace iot_service;
|
||||||
|
|
||||||
class CBIWidget : public QWidget
|
class CBIWidget : public QWidget
|
||||||
{
|
{
|
||||||
|
|||||||
@ -55,7 +55,7 @@ void CBreadcrumbNavWidget::initialize()
|
|||||||
|
|
||||||
void CBreadcrumbNavWidget::initStyleSheet()
|
void CBreadcrumbNavWidget::initStyleSheet()
|
||||||
{
|
{
|
||||||
std::string strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("breadcrumbNav.qss") ;
|
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("breadcrumbNav.qss") ;
|
||||||
QFile qssfile2(QString::fromStdString(strFullPath));
|
QFile qssfile2(QString::fromStdString(strFullPath));
|
||||||
qssfile2.open(QFile::ReadOnly);
|
qssfile2.open(QFile::ReadOnly);
|
||||||
if (qssfile2.isOpen())
|
if (qssfile2.isOpen())
|
||||||
@ -67,7 +67,7 @@ void CBreadcrumbNavWidget::initStyleSheet()
|
|||||||
|
|
||||||
void CBreadcrumbNavWidget::setCurrentGraph(const QString &data, const QString &name)
|
void CBreadcrumbNavWidget::setCurrentGraph(const QString &data, const QString &name)
|
||||||
{
|
{
|
||||||
std::string currentPath = kbd_public::CFileUtil::getCurModuleDir();
|
std::string currentPath = iot_public::CFileUtil::getCurModuleDir();
|
||||||
QDir dir(QString::fromStdString(currentPath));
|
QDir dir(QString::fromStdString(currentPath));
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
CNavInfoManage::CNavInfoManage(QObject *parent)
|
CNavInfoManage::CNavInfoManage(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
{
|
{
|
||||||
std::string currentPath = kbd_public::CFileUtil::getCurModuleDir();
|
std::string currentPath = iot_public::CFileUtil::getCurModuleDir();
|
||||||
QDir dir(QString::fromStdString(currentPath));
|
QDir dir(QString::fromStdString(currentPath));
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
|
|||||||
@ -21,7 +21,7 @@ BriefReportWidget::BriefReportWidget(QWidget *parent, bool editMode) :
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
QString qss;
|
QString qss;
|
||||||
std::string strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
||||||
QFile qssFile1(QString::fromStdString(strFullPath));
|
QFile qssFile1(QString::fromStdString(strFullPath));
|
||||||
qssFile1.open(QFile::ReadOnly);
|
qssFile1.open(QFile::ReadOnly);
|
||||||
if (qssFile1.isOpen())
|
if (qssFile1.isOpen())
|
||||||
@ -34,7 +34,7 @@ BriefReportWidget::BriefReportWidget(QWidget *parent, bool editMode) :
|
|||||||
{
|
{
|
||||||
qDebug() << "public.qss 无法打开!";
|
qDebug() << "public.qss 无法打开!";
|
||||||
}
|
}
|
||||||
strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("BriefReport.qss") ;
|
strFullPath = iot_public::CFileStyle::getPathOfStyleFile("BriefReport.qss") ;
|
||||||
QFile qssFile2(QString::fromStdString(strFullPath));
|
QFile qssFile2(QString::fromStdString(strFullPath));
|
||||||
qssFile2.open(QFile::ReadOnly);
|
qssFile2.open(QFile::ReadOnly);
|
||||||
if (qssFile2.isOpen())
|
if (qssFile2.isOpen())
|
||||||
@ -63,12 +63,12 @@ BriefReportWidget::~BriefReportWidget()
|
|||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
|
|
||||||
// kbd_public::StopLogSystem();
|
// iot_public::StopLogSystem();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BriefReportWidget::Init()
|
void BriefReportWidget::Init()
|
||||||
{
|
{
|
||||||
// kbd_public::StartLogSystem("HMI", "BriefReportWidget" );
|
// iot_public::StartLogSystem("HMI", "BriefReportWidget" );
|
||||||
|
|
||||||
ui->PushButton3->setVisible(false);
|
ui->PushButton3->setVisible(false);
|
||||||
ui->PushButton4->setVisible(false);
|
ui->PushButton4->setVisible(false);
|
||||||
@ -171,7 +171,7 @@ void BriefReportWidget::Init()
|
|||||||
|
|
||||||
void BriefReportWidget::InitData()
|
void BriefReportWidget::InitData()
|
||||||
{
|
{
|
||||||
kbd_dbms::CDbApi *m_pReadDb = new kbd_dbms::CDbApi(DB_CONN_MODEL_READ);
|
iot_dbms::CDbApi *m_pReadDb = new iot_dbms::CDbApi(DB_CONN_MODEL_READ);
|
||||||
if(!m_pReadDb->open())
|
if(!m_pReadDb->open())
|
||||||
{
|
{
|
||||||
LOGERROR("打开数据库连接失败! %s", m_pReadDb->getLastErrorString().toStdString().c_str());
|
LOGERROR("打开数据库连接失败! %s", m_pReadDb->getLastErrorString().toStdString().c_str());
|
||||||
|
|||||||
@ -6,7 +6,7 @@ QueryThread::QueryThread(): location_id(0)
|
|||||||
isStop = false;
|
isStop = false;
|
||||||
islocation = false;
|
islocation = false;
|
||||||
|
|
||||||
m_pReadDb = new kbd_dbms::CDbApi(DB_CONN_HIS_READ);
|
m_pReadDb = new iot_dbms::CDbApi(DB_CONN_HIS_READ);
|
||||||
if (!m_pReadDb->open())
|
if (!m_pReadDb->open())
|
||||||
{
|
{
|
||||||
LOGERROR("打开数据库连接失败! %s", m_pReadDb->getLastErrorString().toStdString().c_str());
|
LOGERROR("打开数据库连接失败! %s", m_pReadDb->getLastErrorString().toStdString().c_str());
|
||||||
|
|||||||
@ -32,7 +32,7 @@ private:
|
|||||||
std::vector<HIS_EVENT_BRIEF> Events_Operates;
|
std::vector<HIS_EVENT_BRIEF> Events_Operates;
|
||||||
//QVector<HIS_EVENT> Events_Operates;
|
//QVector<HIS_EVENT> Events_Operates;
|
||||||
|
|
||||||
kbd_dbms::CDbApi *m_pReadDb;
|
iot_dbms::CDbApi *m_pReadDb;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QUERYTHREAD_H
|
#endif // QUERYTHREAD_H
|
||||||
|
|||||||
@ -49,7 +49,7 @@ void BTRealDataCollect::initMsg()
|
|||||||
{
|
{
|
||||||
if(m_pMbComm == NULL)
|
if(m_pMbComm == NULL)
|
||||||
{
|
{
|
||||||
m_pMbComm = new kbd_net::CMbCommunicator("BusbarTemperatureWidget");
|
m_pMbComm = new iot_net::CMbCommunicator("BusbarTemperatureWidget");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ void BTRealDataCollect::clearMsg()
|
|||||||
{
|
{
|
||||||
if(m_pMbComm)
|
if(m_pMbComm)
|
||||||
{
|
{
|
||||||
kbd_net::CMbMessage objMsg;
|
iot_net::CMbMessage objMsg;
|
||||||
while(m_pMbComm->recvMsg(objMsg, 0))
|
while(m_pMbComm->recvMsg(objMsg, 0))
|
||||||
{}
|
{}
|
||||||
}
|
}
|
||||||
@ -107,14 +107,14 @@ void BTRealDataCollect::recvMessage()
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
kbd_net::CMbMessage objMsg;
|
iot_net::CMbMessage objMsg;
|
||||||
for(int i = 0; i < 6; i++)
|
for(int i = 0; i < 6; i++)
|
||||||
{
|
{
|
||||||
if(m_pMbComm->recvMsg(objMsg, 0))
|
if(m_pMbComm->recvMsg(objMsg, 0))
|
||||||
{
|
{
|
||||||
if(objMsg.isValid())
|
if(objMsg.isValid())
|
||||||
{
|
{
|
||||||
if(objMsg.getMsgType() != kbd_idlfile::MT_DP_CHANGE_DATA)
|
if(objMsg.getMsgType() != iot_idl::MT_DP_CHANGE_DATA)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -160,16 +160,16 @@ void BTRealDataCollect::processChangeData()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int BTRealDataCollect::parserMsg(const kbd_net::CMbMessage &msg)
|
int BTRealDataCollect::parserMsg(const iot_net::CMbMessage &msg)
|
||||||
{
|
{
|
||||||
kbd_idlfile::SRealTimeDataPkg changeDataPackage;
|
iot_idl::SRealTimeDataPkg changeDataPackage;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
changeDataPackage.ParseFromArray(msg.getDataPtr(),(int)msg.getDataSize());
|
changeDataPackage.ParseFromArray(msg.getDataPtr(),(int)msg.getDataSize());
|
||||||
int aiSize = changeDataPackage.stairtd_size();
|
int aiSize = changeDataPackage.stairtd_size();
|
||||||
if(aiSize > 0)
|
if(aiSize > 0)
|
||||||
{
|
{
|
||||||
kbd_idlfile::SAiRealTimeData aiStru;
|
iot_idl::SAiRealTimeData aiStru;
|
||||||
QString tagName;
|
QString tagName;
|
||||||
float value;
|
float value;
|
||||||
uint status;
|
uint status;
|
||||||
@ -190,7 +190,7 @@ int BTRealDataCollect::parserMsg(const kbd_net::CMbMessage &msg)
|
|||||||
int diSize = changeDataPackage.stdirtd_size();
|
int diSize = changeDataPackage.stdirtd_size();
|
||||||
if(diSize > 0)
|
if(diSize > 0)
|
||||||
{
|
{
|
||||||
kbd_idlfile::SDiRealTimeData diStu;
|
iot_idl::SDiRealTimeData diStu;
|
||||||
QString tagName;
|
QString tagName;
|
||||||
int value;
|
int value;
|
||||||
uint status;
|
uint status;
|
||||||
@ -207,7 +207,7 @@ int BTRealDataCollect::parserMsg(const kbd_net::CMbMessage &msg)
|
|||||||
int piSize = changeDataPackage.stpirtd_size();
|
int piSize = changeDataPackage.stpirtd_size();
|
||||||
if(piSize > 0)
|
if(piSize > 0)
|
||||||
{
|
{
|
||||||
kbd_idlfile::SPiRealTimeData piStu;
|
iot_idl::SPiRealTimeData piStu;
|
||||||
QString tagName;
|
QString tagName;
|
||||||
double value;
|
double value;
|
||||||
uint status;
|
uint status;
|
||||||
@ -224,7 +224,7 @@ int BTRealDataCollect::parserMsg(const kbd_net::CMbMessage &msg)
|
|||||||
int miSize = changeDataPackage.stmirtd_size();
|
int miSize = changeDataPackage.stmirtd_size();
|
||||||
if(miSize > 0)
|
if(miSize > 0)
|
||||||
{
|
{
|
||||||
kbd_idlfile::SMiRealTimeData miStu;
|
iot_idl::SMiRealTimeData miStu;
|
||||||
QString tagName;
|
QString tagName;
|
||||||
int value;
|
int value;
|
||||||
uint status;
|
uint status;
|
||||||
|
|||||||
@ -39,9 +39,9 @@ private:
|
|||||||
bool addSub();
|
bool addSub();
|
||||||
bool delSub();
|
bool delSub();
|
||||||
|
|
||||||
int parserMsg(const kbd_net::CMbMessage &);
|
int parserMsg(const iot_net::CMbMessage &);
|
||||||
|
|
||||||
kbd_net::CMbCommunicator *m_pMbComm;
|
iot_net::CMbCommunicator *m_pMbComm;
|
||||||
QTimer * m_pTimer;
|
QTimer * m_pTimer;
|
||||||
int m_nTimeCount;
|
int m_nTimeCount;
|
||||||
QMap<QString, QPair<float, uint>> m_aiMap;
|
QMap<QString, QPair<float, uint>> m_aiMap;
|
||||||
|
|||||||
@ -215,8 +215,8 @@ void BusbarTemperatureWidget::initializeChart()
|
|||||||
|
|
||||||
initStyle();
|
initStyle();
|
||||||
|
|
||||||
kbd_service::CDpcdaForApp::initGlobalThread();
|
iot_service::CDpcdaForApp::initGlobalThread();
|
||||||
m_pDpcdaForApp = new kbd_service::CDpcdaForApp();
|
m_pDpcdaForApp = new iot_service::CDpcdaForApp();
|
||||||
|
|
||||||
//接收实时数据信号槽
|
//接收实时数据信号槽
|
||||||
connect(BTRealDataCollect::instance(), &BTRealDataCollect::signal_updateAi, this, &BusbarTemperatureWidget::slotUpdateAi);
|
connect(BTRealDataCollect::instance(), &BTRealDataCollect::signal_updateAi, this, &BusbarTemperatureWidget::slotUpdateAi);
|
||||||
@ -232,7 +232,7 @@ void BusbarTemperatureWidget::initializeChart()
|
|||||||
void BusbarTemperatureWidget::initStyle()
|
void BusbarTemperatureWidget::initStyle()
|
||||||
{
|
{
|
||||||
QString qss = QString();
|
QString qss = QString();
|
||||||
std::string strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
||||||
QFile qssfile1(QString::fromStdString(strFullPath));
|
QFile qssfile1(QString::fromStdString(strFullPath));
|
||||||
qssfile1.open(QFile::ReadOnly);
|
qssfile1.open(QFile::ReadOnly);
|
||||||
if (qssfile1.isOpen())
|
if (qssfile1.isOpen())
|
||||||
@ -242,7 +242,7 @@ void BusbarTemperatureWidget::initStyle()
|
|||||||
}
|
}
|
||||||
qssfile1.close();
|
qssfile1.close();
|
||||||
|
|
||||||
std::string style = kbd_public::CFileStyle::getPathOfStyleFile("busbarTemperature.qss") ;
|
std::string style = iot_public::CFileStyle::getPathOfStyleFile("busbarTemperature.qss") ;
|
||||||
QFile file(QString::fromStdString(style));
|
QFile file(QString::fromStdString(style));
|
||||||
file.open(QFile::ReadOnly);
|
file.open(QFile::ReadOnly);
|
||||||
if (file.isOpen())
|
if (file.isOpen())
|
||||||
@ -509,7 +509,7 @@ void BusbarTemperatureWidget::onTreeClicked(QTreeWidgetItem *item, int column)
|
|||||||
chart->update();
|
chart->update();
|
||||||
|
|
||||||
//订阅实时数据
|
//订阅实时数据
|
||||||
kbd_dbms::CDbApi objReader(DB_CONN_MODEL_READ);
|
iot_dbms::CDbApi objReader(DB_CONN_MODEL_READ);
|
||||||
if(!objReader.open())
|
if(!objReader.open())
|
||||||
{
|
{
|
||||||
return;// tr("数据库连接打开失败!");
|
return;// tr("数据库连接打开失败!");
|
||||||
@ -579,7 +579,7 @@ void BusbarTemperatureWidget::slotShowChange(bool checked)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString BusbarTemperatureWidget::QueryDevinfoTagName(const QString& groupTagName, kbd_dbms::CDbApi& objReader) const
|
QString BusbarTemperatureWidget::QueryDevinfoTagName(const QString& groupTagName, iot_dbms::CDbApi& objReader) const
|
||||||
{
|
{
|
||||||
if(!objReader.isOpen())
|
if(!objReader.isOpen())
|
||||||
{
|
{
|
||||||
@ -588,11 +588,11 @@ QString BusbarTemperatureWidget::QueryDevinfoTagName(const QString& groupTagName
|
|||||||
|
|
||||||
QList<QString> listColName;
|
QList<QString> listColName;
|
||||||
listColName.append("DESCRIPTION");
|
listColName.append("DESCRIPTION");
|
||||||
kbd_dbms::CDbCondition objCondition;
|
iot_dbms::CDbCondition objCondition;
|
||||||
objCondition.m_sColName = "TAG_NAME";
|
objCondition.m_sColName = "TAG_NAME";
|
||||||
objCondition.m_value = groupTagName;
|
objCondition.m_value = groupTagName;
|
||||||
objCondition.m_eCompare = kbd_dbms::CDbCondition::COMPARE_EQ;
|
objCondition.m_eCompare = iot_dbms::CDbCondition::COMPARE_EQ;
|
||||||
objCondition.m_eLogic = kbd_dbms::CDbCondition::LOGIC_AND;
|
objCondition.m_eLogic = iot_dbms::CDbCondition::LOGIC_AND;
|
||||||
|
|
||||||
QSqlQuery objQuery;
|
QSqlQuery objQuery;
|
||||||
if(objReader.select("dev_info", listColName, objCondition, objQuery))
|
if(objReader.select("dev_info", listColName, objCondition, objQuery))
|
||||||
@ -605,7 +605,7 @@ QString BusbarTemperatureWidget::QueryDevinfoTagName(const QString& groupTagName
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QMap<QString, QString> BusbarTemperatureWidget::QueryAnalogTagName(const QString& device, kbd_dbms::CDbApi& objReader)
|
QMap<QString, QString> BusbarTemperatureWidget::QueryAnalogTagName(const QString& device, iot_dbms::CDbApi& objReader)
|
||||||
{
|
{
|
||||||
if(!objReader.isOpen())
|
if(!objReader.isOpen())
|
||||||
{
|
{
|
||||||
@ -616,11 +616,11 @@ QMap<QString, QString> BusbarTemperatureWidget::QueryAnalogTagName(const QString
|
|||||||
listColName.append("TAG_NAME");
|
listColName.append("TAG_NAME");
|
||||||
listColName.append("DESCRIPTION");
|
listColName.append("DESCRIPTION");
|
||||||
|
|
||||||
kbd_dbms::CDbCondition objCondition;
|
iot_dbms::CDbCondition objCondition;
|
||||||
objCondition.m_sColName = "DEVICE";
|
objCondition.m_sColName = "DEVICE";
|
||||||
objCondition.m_value = device;
|
objCondition.m_value = device;
|
||||||
objCondition.m_eCompare = kbd_dbms::CDbCondition::COMPARE_EQ;
|
objCondition.m_eCompare = iot_dbms::CDbCondition::COMPARE_EQ;
|
||||||
objCondition.m_eLogic = kbd_dbms::CDbCondition::LOGIC_AND;
|
objCondition.m_eLogic = iot_dbms::CDbCondition::LOGIC_AND;
|
||||||
|
|
||||||
QSqlQuery objQuery;
|
QSqlQuery objQuery;
|
||||||
QMap<QString, QString> analogTagName;
|
QMap<QString, QString> analogTagName;
|
||||||
|
|||||||
@ -114,7 +114,7 @@ private:
|
|||||||
void initializeChart();
|
void initializeChart();
|
||||||
void initStyle();
|
void initStyle();
|
||||||
bool m_isEditMode;
|
bool m_isEditMode;
|
||||||
kbd_service::CDpcdaForApp* m_pDpcdaForApp;
|
iot_service::CDpcdaForApp* m_pDpcdaForApp;
|
||||||
void subscribe();
|
void subscribe();
|
||||||
void unsubscribeAll();
|
void unsubscribeAll();
|
||||||
void updateChart();
|
void updateChart();
|
||||||
@ -142,8 +142,8 @@ private:
|
|||||||
QMap<int, QPair<QString, float>> m_barYValueMap;
|
QMap<int, QPair<QString, float>> m_barYValueMap;
|
||||||
|
|
||||||
|
|
||||||
QMap<QString, QString> QueryAnalogTagName(const QString& device, kbd_dbms::CDbApi& objReader) ;
|
QMap<QString, QString> QueryAnalogTagName(const QString& device, iot_dbms::CDbApi& objReader) ;
|
||||||
QString QueryDevinfoTagName(const QString& groupTagName, kbd_dbms::CDbApi& objReader) const;
|
QString QueryDevinfoTagName(const QString& groupTagName, iot_dbms::CDbApi& objReader) const;
|
||||||
|
|
||||||
QString setDeviceTitle();
|
QString setDeviceTitle();
|
||||||
ShowInfoWidget* m_pPopupWidget;
|
ShowInfoWidget* m_pPopupWidget;
|
||||||
|
|||||||
@ -7,12 +7,12 @@
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
kbd_public::StartLogSystem( "BASE", "alarm_statistics" );
|
iot_public::StartLogSystem( "BASE", "alarm_statistics" );
|
||||||
|
|
||||||
BusbarTemperatureWidget w( 0, false );
|
BusbarTemperatureWidget w( 0, false );
|
||||||
w.show();
|
w.show();
|
||||||
int nRet = a.exec();
|
int nRet = a.exec();
|
||||||
|
|
||||||
kbd_public::StopLogSystem();
|
iot_public::StopLogSystem();
|
||||||
return nRet;
|
return nRet;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -106,7 +106,7 @@ void CButtonGroupWidget::initView()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string currentPath = kbd_public::CFileUtil::getCurModuleDir();
|
std::string currentPath = iot_public::CFileUtil::getCurModuleDir();
|
||||||
QDir dir(QString::fromStdString(currentPath));
|
QDir dir(QString::fromStdString(currentPath));
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
CJsonReader::CJsonReader(QObject *parent)
|
CJsonReader::CJsonReader(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
{
|
{
|
||||||
std::string currentPath = kbd_public::CFileUtil::getCurModuleDir();
|
std::string currentPath = iot_public::CFileUtil::getCurModuleDir();
|
||||||
QDir dir(QString::fromStdString(currentPath));
|
QDir dir(QString::fromStdString(currentPath));
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
|
|||||||
@ -48,7 +48,7 @@ void CRealDataCollect::initMsg()
|
|||||||
{
|
{
|
||||||
if(m_pMbComm == NULL)
|
if(m_pMbComm == NULL)
|
||||||
{
|
{
|
||||||
m_pMbComm = new kbd_net::CMbCommunicator("ChanStatusWidget");
|
m_pMbComm = new iot_net::CMbCommunicator("ChanStatusWidget");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ void CRealDataCollect::clearMsg()
|
|||||||
{
|
{
|
||||||
if(m_pMbComm)
|
if(m_pMbComm)
|
||||||
{
|
{
|
||||||
kbd_net::CMbMessage objMsg;
|
iot_net::CMbMessage objMsg;
|
||||||
while(m_pMbComm->recvMsg(objMsg, 0))
|
while(m_pMbComm->recvMsg(objMsg, 0))
|
||||||
{}
|
{}
|
||||||
}
|
}
|
||||||
@ -106,14 +106,14 @@ void CRealDataCollect::recvMessage()
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
kbd_net::CMbMessage objMsg;
|
iot_net::CMbMessage objMsg;
|
||||||
for(int i = 0; i < 6; i++)
|
for(int i = 0; i < 6; i++)
|
||||||
{
|
{
|
||||||
if(m_pMbComm->recvMsg(objMsg, 0))
|
if(m_pMbComm->recvMsg(objMsg, 0))
|
||||||
{
|
{
|
||||||
if(objMsg.isValid())
|
if(objMsg.isValid())
|
||||||
{
|
{
|
||||||
if(objMsg.getMsgType() != kbd_idlfile::MT_DP_CHANGE_DATA)
|
if(objMsg.getMsgType() != iot_idl::MT_DP_CHANGE_DATA)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -165,16 +165,16 @@ void CRealDataCollect::processChangeData()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int CRealDataCollect::parserMsg(const kbd_net::CMbMessage &msg)
|
int CRealDataCollect::parserMsg(const iot_net::CMbMessage &msg)
|
||||||
{
|
{
|
||||||
kbd_idlfile::SRealTimeDataPkg changeDataPackage;
|
iot_idl::SRealTimeDataPkg changeDataPackage;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
changeDataPackage.ParseFromArray(msg.getDataPtr(),(int)msg.getDataSize());
|
changeDataPackage.ParseFromArray(msg.getDataPtr(),(int)msg.getDataSize());
|
||||||
int aiSize = changeDataPackage.stairtd_size();
|
int aiSize = changeDataPackage.stairtd_size();
|
||||||
if(aiSize > 0)
|
if(aiSize > 0)
|
||||||
{
|
{
|
||||||
kbd_idlfile::SAiRealTimeData aiStru;
|
iot_idl::SAiRealTimeData aiStru;
|
||||||
QString tagName;
|
QString tagName;
|
||||||
float value;
|
float value;
|
||||||
uint status;
|
uint status;
|
||||||
@ -191,7 +191,7 @@ int CRealDataCollect::parserMsg(const kbd_net::CMbMessage &msg)
|
|||||||
int diSize = changeDataPackage.stdirtd_size();
|
int diSize = changeDataPackage.stdirtd_size();
|
||||||
if(diSize > 0)
|
if(diSize > 0)
|
||||||
{
|
{
|
||||||
kbd_idlfile::SDiRealTimeData diStu;
|
iot_idl::SDiRealTimeData diStu;
|
||||||
QString tagName;
|
QString tagName;
|
||||||
int value;
|
int value;
|
||||||
uint status;
|
uint status;
|
||||||
@ -208,7 +208,7 @@ int CRealDataCollect::parserMsg(const kbd_net::CMbMessage &msg)
|
|||||||
int piSize = changeDataPackage.stpirtd_size();
|
int piSize = changeDataPackage.stpirtd_size();
|
||||||
if(piSize > 0)
|
if(piSize > 0)
|
||||||
{
|
{
|
||||||
kbd_idlfile::SPiRealTimeData piStu;
|
iot_idl::SPiRealTimeData piStu;
|
||||||
QString tagName;
|
QString tagName;
|
||||||
double value;
|
double value;
|
||||||
uint status;
|
uint status;
|
||||||
@ -225,7 +225,7 @@ int CRealDataCollect::parserMsg(const kbd_net::CMbMessage &msg)
|
|||||||
int miSize = changeDataPackage.stmirtd_size();
|
int miSize = changeDataPackage.stmirtd_size();
|
||||||
if(miSize > 0)
|
if(miSize > 0)
|
||||||
{
|
{
|
||||||
kbd_idlfile::SMiRealTimeData miStu;
|
iot_idl::SMiRealTimeData miStu;
|
||||||
QString tagName;
|
QString tagName;
|
||||||
int value;
|
int value;
|
||||||
uint status;
|
uint status;
|
||||||
@ -242,44 +242,44 @@ int CRealDataCollect::parserMsg(const kbd_net::CMbMessage &msg)
|
|||||||
int utSize = changeDataPackage.sttblrtd_size();
|
int utSize = changeDataPackage.sttblrtd_size();
|
||||||
if(utSize > 0)
|
if(utSize > 0)
|
||||||
{
|
{
|
||||||
kbd_idlfile::STableRealTimeData uiStu;
|
iot_idl::STableRealTimeData uiStu;
|
||||||
QString tagName;
|
QString tagName;
|
||||||
QVariant value;
|
QVariant value;
|
||||||
for(int i = 0;i < utSize; i++)
|
for(int i = 0;i < utSize; i++)
|
||||||
{
|
{
|
||||||
uiStu = changeDataPackage.sttblrtd(i);
|
uiStu = changeDataPackage.sttblrtd(i);
|
||||||
tagName = QString::fromStdString(uiStu.strtagname());
|
tagName = QString::fromStdString(uiStu.strtagname());
|
||||||
kbd_idlfile::SVariable temp = uiStu.varvalue();
|
iot_idl::SVariable temp = uiStu.varvalue();
|
||||||
if(temp.edatatype() == kbd_idlfile::DataType::CN_DATATYPE_BOOL)
|
if(temp.edatatype() == iot_idl::DataType::CN_DATATYPE_BOOL)
|
||||||
{
|
{
|
||||||
value = QVariant::fromValue(temp.bvalue());
|
value = QVariant::fromValue(temp.bvalue());
|
||||||
}
|
}
|
||||||
else if(temp.edatatype() == kbd_idlfile::DataType::CN_DATATYPE_UINT32)
|
else if(temp.edatatype() == iot_idl::DataType::CN_DATATYPE_UINT32)
|
||||||
{
|
{
|
||||||
value = QVariant::fromValue(temp.uvalue());
|
value = QVariant::fromValue(temp.uvalue());
|
||||||
}
|
}
|
||||||
else if(temp.edatatype() == kbd_idlfile::DataType::CN_DATATYPE_INT32)
|
else if(temp.edatatype() == iot_idl::DataType::CN_DATATYPE_INT32)
|
||||||
{
|
{
|
||||||
value = QVariant::fromValue(temp.nvalue());
|
value = QVariant::fromValue(temp.nvalue());
|
||||||
}
|
}
|
||||||
else if(temp.edatatype() == kbd_idlfile::DataType::CN_DATATYPE_UINT64)
|
else if(temp.edatatype() == iot_idl::DataType::CN_DATATYPE_UINT64)
|
||||||
{
|
{
|
||||||
value = QVariant::fromValue(temp.ulvalue());
|
value = QVariant::fromValue(temp.ulvalue());
|
||||||
}
|
}
|
||||||
else if(temp.edatatype() == kbd_idlfile::DataType::CN_DATATYPE_INT64)
|
else if(temp.edatatype() == iot_idl::DataType::CN_DATATYPE_INT64)
|
||||||
{
|
{
|
||||||
value = QVariant::fromValue(temp.lvalue());
|
value = QVariant::fromValue(temp.lvalue());
|
||||||
}
|
}
|
||||||
else if(temp.edatatype() == kbd_idlfile::DataType::CN_DATATYPE_FLOAT)
|
else if(temp.edatatype() == iot_idl::DataType::CN_DATATYPE_FLOAT)
|
||||||
{
|
{
|
||||||
value = QVariant::fromValue(temp.fvalue());
|
value = QVariant::fromValue(temp.fvalue());
|
||||||
}
|
}
|
||||||
else if(temp.edatatype() == kbd_idlfile::DataType::CN_DATATYPE_DOUBLE)
|
else if(temp.edatatype() == iot_idl::DataType::CN_DATATYPE_DOUBLE)
|
||||||
{
|
{
|
||||||
value = QVariant::fromValue(temp.dvalue());
|
value = QVariant::fromValue(temp.dvalue());
|
||||||
}
|
}
|
||||||
else if(temp.edatatype() == kbd_idlfile::DataType::CN_DATATYPE_STRING ||
|
else if(temp.edatatype() == iot_idl::DataType::CN_DATATYPE_STRING ||
|
||||||
temp.edatatype() == kbd_idlfile::DataType::CN_DATATYPE_BYTES)
|
temp.edatatype() == iot_idl::DataType::CN_DATATYPE_BYTES)
|
||||||
{
|
{
|
||||||
QString str = QString::fromStdString(temp.strvalue());
|
QString str = QString::fromStdString(temp.strvalue());
|
||||||
value = QVariant::fromValue(str);
|
value = QVariant::fromValue(str);
|
||||||
|
|||||||
@ -26,7 +26,7 @@ private:
|
|||||||
bool addSub();
|
bool addSub();
|
||||||
bool delSub();
|
bool delSub();
|
||||||
|
|
||||||
int parserMsg(const kbd_net::CMbMessage &);
|
int parserMsg(const iot_net::CMbMessage &);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void recvMessage();
|
void recvMessage();
|
||||||
@ -40,7 +40,7 @@ signals:
|
|||||||
void signal_updateUi(QMap<QString, QVariant> uiMap);
|
void signal_updateUi(QMap<QString, QVariant> uiMap);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
kbd_net::CMbCommunicator *m_pMbComm;
|
iot_net::CMbCommunicator *m_pMbComm;
|
||||||
QTimer * m_pTimer;
|
QTimer * m_pTimer;
|
||||||
int m_nTimeCount;
|
int m_nTimeCount;
|
||||||
QMap<QString, QPair<float, uint>> m_aiMap;
|
QMap<QString, QPair<float, uint>> m_aiMap;
|
||||||
|
|||||||
@ -84,7 +84,7 @@ void ChanStatusWidget::setColumnWidth(int column, int width)
|
|||||||
void ChanStatusWidget::initStyle()
|
void ChanStatusWidget::initStyle()
|
||||||
{
|
{
|
||||||
QString qss = QString();
|
QString qss = QString();
|
||||||
std::string strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
||||||
QFile qssfile1(QString::fromStdString(strFullPath));
|
QFile qssfile1(QString::fromStdString(strFullPath));
|
||||||
qssfile1.open(QFile::ReadOnly);
|
qssfile1.open(QFile::ReadOnly);
|
||||||
if (qssfile1.isOpen())
|
if (qssfile1.isOpen())
|
||||||
@ -93,7 +93,7 @@ void ChanStatusWidget::initStyle()
|
|||||||
qssfile1.close();
|
qssfile1.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("chanStatus.qss") ;
|
strFullPath = iot_public::CFileStyle::getPathOfStyleFile("chanStatus.qss") ;
|
||||||
QFile qssfile2(QString::fromStdString(strFullPath));
|
QFile qssfile2(QString::fromStdString(strFullPath));
|
||||||
qssfile2.open(QFile::ReadOnly);
|
qssfile2.open(QFile::ReadOnly);
|
||||||
if (qssfile2.isOpen())
|
if (qssfile2.isOpen())
|
||||||
@ -140,7 +140,7 @@ void ChanStatusWidget::initView()
|
|||||||
|
|
||||||
void ChanStatusWidget::initData()
|
void ChanStatusWidget::initData()
|
||||||
{
|
{
|
||||||
kbd_dbms::CDbApi objDbApi(DB_CONN_MODEL_READ);
|
iot_dbms::CDbApi objDbApi(DB_CONN_MODEL_READ);
|
||||||
if(!objDbApi.open())
|
if(!objDbApi.open())
|
||||||
{
|
{
|
||||||
LOGERROR("关系库打开失败 %s", objDbApi.getLastErrorString().toStdString().c_str());
|
LOGERROR("关系库打开失败 %s", objDbApi.getLastErrorString().toStdString().c_str());
|
||||||
@ -154,8 +154,8 @@ void ChanStatusWidget::initData()
|
|||||||
listColName << "LOCATION_ID";
|
listColName << "LOCATION_ID";
|
||||||
listColName << "TAG_NAME";
|
listColName << "TAG_NAME";
|
||||||
listColName << "DESCRIPTION";
|
listColName << "DESCRIPTION";
|
||||||
QList<kbd_dbms::CDbOrder> listOrderBy;
|
QList<iot_dbms::CDbOrder> listOrderBy;
|
||||||
listOrderBy << kbd_dbms::CDbOrder("LOCATION_ID", kbd_dbms::CDbOrder::ORDER_ASC);
|
listOrderBy << iot_dbms::CDbOrder("LOCATION_ID", iot_dbms::CDbOrder::ORDER_ASC);
|
||||||
if(!objDbApi.select("sys_model_location_info", listColName, listOrderBy, objQuery))
|
if(!objDbApi.select("sys_model_location_info", listColName, listOrderBy, objQuery))
|
||||||
{
|
{
|
||||||
LOGERROR("查询位置信息失败 %s", objDbApi.getLastErrorString().toStdString().c_str());
|
LOGERROR("查询位置信息失败 %s", objDbApi.getLastErrorString().toStdString().c_str());
|
||||||
@ -205,8 +205,8 @@ void ChanStatusWidget::initData()
|
|||||||
listColName << "NET_DESC3";
|
listColName << "NET_DESC3";
|
||||||
listColName << "NET_DESC4";
|
listColName << "NET_DESC4";
|
||||||
listColName << "COMM_PROPERTY";
|
listColName << "COMM_PROPERTY";
|
||||||
QList<kbd_dbms::CDbOrder> listOrderBy;
|
QList<iot_dbms::CDbOrder> listOrderBy;
|
||||||
listOrderBy << kbd_dbms::CDbOrder("CHAN_NO", kbd_dbms::CDbOrder::ORDER_ASC);
|
listOrderBy << iot_dbms::CDbOrder("CHAN_NO", iot_dbms::CDbOrder::ORDER_ASC);
|
||||||
if(!objDbApi.select("fes_channel_para", listColName, listOrderBy, objQuery))
|
if(!objDbApi.select("fes_channel_para", listColName, listOrderBy, objQuery))
|
||||||
{
|
{
|
||||||
LOGERROR("查询通道信息失败 %s", objDbApi.getLastErrorString().toStdString().c_str());
|
LOGERROR("查询通道信息失败 %s", objDbApi.getLastErrorString().toStdString().c_str());
|
||||||
@ -295,7 +295,7 @@ void ChanStatusWidget::initData()
|
|||||||
|
|
||||||
void ChanStatusWidget::initConnect()
|
void ChanStatusWidget::initConnect()
|
||||||
{
|
{
|
||||||
m_pDpcdaForApp = new kbd_service::CDpcdaForApp();
|
m_pDpcdaForApp = new iot_service::CDpcdaForApp();
|
||||||
|
|
||||||
connect(m_pTreeWidget, &QTreeWidget::itemClicked, this, &ChanStatusWidget::slotItemClicked);
|
connect(m_pTreeWidget, &QTreeWidget::itemClicked, this, &ChanStatusWidget::slotItemClicked);
|
||||||
connect(CRealDataCollect::instance(), &CRealDataCollect::signal_updateUi, this, &ChanStatusWidget::slotUpdateUi);
|
connect(CRealDataCollect::instance(), &CRealDataCollect::signal_updateUi, this, &ChanStatusWidget::slotUpdateUi);
|
||||||
|
|||||||
@ -42,7 +42,7 @@ private:
|
|||||||
QTableView * m_pTableView;
|
QTableView * m_pTableView;
|
||||||
QPushButton * m_btnExport;
|
QPushButton * m_btnExport;
|
||||||
ChanTableModel * m_pChanModel;
|
ChanTableModel * m_pChanModel;
|
||||||
kbd_service::CDpcdaForApp *m_pDpcdaForApp;
|
iot_service::CDpcdaForApp *m_pDpcdaForApp;
|
||||||
QMap<int, QPair<QString, QString> > m_locMap; //< ID, <TAG, DESC>
|
QMap<int, QPair<QString, QString> > m_locMap; //< ID, <TAG, DESC>
|
||||||
QMap<QString, QList<SChanStatus>> m_dataMap; //< LOC_TAG - Chan
|
QMap<QString, QList<SChanStatus>> m_dataMap; //< LOC_TAG - Chan
|
||||||
};
|
};
|
||||||
|
|||||||
@ -6,13 +6,13 @@
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
kbd_public::StartLogSystem("", "hmi");
|
iot_public::StartLogSystem("", "hmi");
|
||||||
if (!(kbd_net::initMsgBus("HMI", "HMI")))
|
if (!(iot_net::initMsgBus("HMI", "HMI")))
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
kbd_service::CDpcdaForApp::initGlobalThread();
|
iot_service::CDpcdaForApp::initGlobalThread();
|
||||||
|
|
||||||
{
|
{
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
@ -22,10 +22,10 @@ int main(int argc, char *argv[])
|
|||||||
a.exec();
|
a.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
kbd_service::CDpcdaForApp::releaseGlobalThread();
|
iot_service::CDpcdaForApp::releaseGlobalThread();
|
||||||
|
|
||||||
kbd_net::releaseMsgBus();
|
iot_net::releaseMsgBus();
|
||||||
kbd_public::StopLogSystem();
|
iot_public::StopLogSystem();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,7 @@ CConstCurves::CConstCurves(bool editMode, QVector<void *> ptrVec, QWidget *paren
|
|||||||
|
|
||||||
initView();
|
initView();
|
||||||
QString style = QString();
|
QString style = QString();
|
||||||
std::string strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("constCurves.qss") ;
|
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("constCurves.qss") ;
|
||||||
QFile file1(QString::fromStdString(strFullPath));
|
QFile file1(QString::fromStdString(strFullPath));
|
||||||
if (file1.open(QIODevice::ReadOnly))
|
if (file1.open(QIODevice::ReadOnly))
|
||||||
{
|
{
|
||||||
@ -26,7 +26,7 @@ CConstCurves::CConstCurves(bool editMode, QVector<void *> ptrVec, QWidget *paren
|
|||||||
}
|
}
|
||||||
file1.close();
|
file1.close();
|
||||||
|
|
||||||
strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("constCurves.qss") ;
|
strFullPath = iot_public::CFileStyle::getPathOfStyleFile("constCurves.qss") ;
|
||||||
QFile file2(QString::fromStdString(strFullPath));
|
QFile file2(QString::fromStdString(strFullPath));
|
||||||
if (file2.open(QIODevice::ReadOnly))
|
if (file2.open(QIODevice::ReadOnly))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#include "CDbInterface.h"
|
#include "CDbInterface.h"
|
||||||
|
|
||||||
using namespace kbd_dbms;
|
using namespace iot_dbms;
|
||||||
|
|
||||||
CDbInterface::CDbInterface()
|
CDbInterface::CDbInterface()
|
||||||
: m_pReadDb(NULL)
|
: m_pReadDb(NULL)
|
||||||
|
|||||||
@ -34,7 +34,7 @@ private:
|
|||||||
void readFesConst();
|
void readFesConst();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
kbd_dbms::CDbApi * m_pReadDb;
|
iot_dbms::CDbApi * m_pReadDb;
|
||||||
QMultiMap<QString, SFesConst> m_fesConstMap;
|
QMultiMap<QString, SFesConst> m_fesConstMap;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -31,7 +31,7 @@ CMessageManage::~CMessageManage()
|
|||||||
|
|
||||||
bool CMessageManage::sendMessage(const SReadQueue& queueList, int nDstDomainId)
|
bool CMessageManage::sendMessage(const SReadQueue& queueList, int nDstDomainId)
|
||||||
{
|
{
|
||||||
kbd_net::CMbMessage msg;
|
iot_net::CMbMessage msg;
|
||||||
msg.setMsgType(MT_OPT_COMMON_DOWN);
|
msg.setMsgType(MT_OPT_COMMON_DOWN);
|
||||||
msg.setSubject(E_PSCADA_APPID, CH_HMI_TO_OPT_OPTCMD_DOWN);
|
msg.setSubject(E_PSCADA_APPID, CH_HMI_TO_OPT_OPTCMD_DOWN);
|
||||||
COptCustCtrlRequest cOptCustCtrlRequest;
|
COptCustCtrlRequest cOptCustCtrlRequest;
|
||||||
@ -63,7 +63,7 @@ bool CMessageManage::sendMessage(const SReadQueue& queueList, int nDstDomainId)
|
|||||||
void CMessageManage::recvMessage()
|
void CMessageManage::recvMessage()
|
||||||
{
|
{
|
||||||
// test();
|
// test();
|
||||||
kbd_net::CMbMessage msg;
|
iot_net::CMbMessage msg;
|
||||||
if(m_communicator->recvMsg(msg, 50))
|
if(m_communicator->recvMsg(msg, 50))
|
||||||
{
|
{
|
||||||
if(msg.getMsgType() != MT_OPT_COMMON_UP)
|
if(msg.getMsgType() != MT_OPT_COMMON_UP)
|
||||||
@ -111,7 +111,7 @@ void CMessageManage::initMsg()
|
|||||||
{
|
{
|
||||||
if(m_communicator == NULL)
|
if(m_communicator == NULL)
|
||||||
{
|
{
|
||||||
m_communicator = new kbd_net::CMbCommunicator();
|
m_communicator = new iot_net::CMbCommunicator();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -30,8 +30,8 @@ struct SReplyQueue
|
|||||||
QList<double> valueList;
|
QList<double> valueList;
|
||||||
};
|
};
|
||||||
|
|
||||||
using namespace kbd_public;
|
using namespace iot_public;
|
||||||
using namespace kbd_service;
|
using namespace iot_service;
|
||||||
class CMessageManage : public QObject
|
class CMessageManage : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -61,7 +61,7 @@ private:
|
|||||||
void test();
|
void test();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
kbd_net::CMbCommunicator *m_communicator;
|
iot_net::CMbCommunicator *m_communicator;
|
||||||
CSysInfoInterfacePtr m_sysInfo;
|
CSysInfoInterfacePtr m_sysInfo;
|
||||||
CPermMngApiPtr m_permMng;
|
CPermMngApiPtr m_permMng;
|
||||||
QTimer *m_timer;
|
QTimer *m_timer;
|
||||||
|
|||||||
@ -7,12 +7,12 @@
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
kbd_public::StartLogSystem("", "hmi");
|
iot_public::StartLogSystem("", "hmi");
|
||||||
if (!(kbd_net::initMsgBus("HMI", "HMI")))
|
if (!(iot_net::initMsgBus("HMI", "HMI")))
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
kbd_service::CPermMngApiPtr perm = kbd_service::getPermMngInstance("base");
|
iot_service::CPermMngApiPtr perm = iot_service::getPermMngInstance("base");
|
||||||
if(!perm || PERM_NORMAL != perm->PermDllInit())
|
if(!perm || PERM_NORMAL != perm->PermDllInit())
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
@ -23,7 +23,7 @@ int main(int argc, char *argv[])
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
kbd_service::CDpcdaForApp::initGlobalThread();
|
iot_service::CDpcdaForApp::initGlobalThread();
|
||||||
|
|
||||||
{
|
{
|
||||||
LOGINFO("===========================ConstCurves===========================");
|
LOGINFO("===========================ConstCurves===========================");
|
||||||
@ -36,10 +36,10 @@ int main(int argc, char *argv[])
|
|||||||
app.exec();
|
app.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
kbd_service::CDpcdaForApp::releaseGlobalThread();
|
iot_service::CDpcdaForApp::releaseGlobalThread();
|
||||||
|
|
||||||
kbd_net::releaseMsgBus();
|
iot_net::releaseMsgBus();
|
||||||
kbd_public::StopLogSystem();
|
iot_public::StopLogSystem();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,9 +9,9 @@
|
|||||||
#include "perm_mng_api/PermMngApi.h"
|
#include "perm_mng_api/PermMngApi.h"
|
||||||
#include "pub_logger_api/logger.h"
|
#include "pub_logger_api/logger.h"
|
||||||
#include "pub_sysinfo_api/SysInfoApi.h"
|
#include "pub_sysinfo_api/SysInfoApi.h"
|
||||||
using namespace kbd_dbms;
|
using namespace iot_dbms;
|
||||||
using namespace kbd_public;
|
using namespace iot_public;
|
||||||
using namespace kbd_service;
|
using namespace iot_service;
|
||||||
|
|
||||||
CDataOptWidget::CDataOptWidget(bool editMode, QWidget *parent)
|
CDataOptWidget::CDataOptWidget(bool editMode, QWidget *parent)
|
||||||
: QWidget(parent),
|
: QWidget(parent),
|
||||||
@ -110,7 +110,7 @@ void CDataOptWidget::setTagType(int actual)
|
|||||||
void CDataOptWidget::initStyleSheet()
|
void CDataOptWidget::initStyleSheet()
|
||||||
{
|
{
|
||||||
QString qss = QString();
|
QString qss = QString();
|
||||||
std::string strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
||||||
QFile qssfile1(QString::fromStdString(strFullPath));
|
QFile qssfile1(QString::fromStdString(strFullPath));
|
||||||
qssfile1.open(QFile::ReadOnly);
|
qssfile1.open(QFile::ReadOnly);
|
||||||
if (qssfile1.isOpen())
|
if (qssfile1.isOpen())
|
||||||
@ -119,7 +119,7 @@ void CDataOptWidget::initStyleSheet()
|
|||||||
qssfile1.close();
|
qssfile1.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
// strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("relaySetting.qss") ;
|
// strFullPath = iot_public::CFileStyle::getPathOfStyleFile("relaySetting.qss") ;
|
||||||
// QFile qssfile2(QString::fromStdString(strFullPath));
|
// QFile qssfile2(QString::fromStdString(strFullPath));
|
||||||
// qssfile2.open(QFile::ReadOnly);
|
// qssfile2.open(QFile::ReadOnly);
|
||||||
// if (qssfile2.isOpen())
|
// if (qssfile2.isOpen())
|
||||||
@ -382,7 +382,7 @@ void CDataOptWidget::updateCount()
|
|||||||
|
|
||||||
bool CDataOptWidget::permCheck(int location, int region)
|
bool CDataOptWidget::permCheck(int location, int region)
|
||||||
{
|
{
|
||||||
kbd_service::CPermMngApiPtr permMngPtr = kbd_service::getPermMngInstance("base");
|
iot_service::CPermMngApiPtr permMngPtr = iot_service::getPermMngInstance("base");
|
||||||
QString mess;
|
QString mess;
|
||||||
if(permMngPtr != NULL)
|
if(permMngPtr != NULL)
|
||||||
{
|
{
|
||||||
@ -437,7 +437,7 @@ void CDataOptWidget::initMsg()
|
|||||||
{
|
{
|
||||||
if(m_communicator == Q_NULLPTR)
|
if(m_communicator == Q_NULLPTR)
|
||||||
{
|
{
|
||||||
m_communicator = new kbd_net::CMbCommunicator();
|
m_communicator = new iot_net::CMbCommunicator();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -693,7 +693,7 @@ bool CDataOptWidget::cancelItemSetValue(const QString &desc,const QString &tagNa
|
|||||||
|
|
||||||
void CDataOptWidget::removeOptTagInfo(const STOptTagInfo &info)
|
void CDataOptWidget::removeOptTagInfo(const STOptTagInfo &info)
|
||||||
{
|
{
|
||||||
kbd_net::CMbMessage msg;
|
iot_net::CMbMessage msg;
|
||||||
msg.setMsgType(MT_OPT_COMMON_DOWN);
|
msg.setMsgType(MT_OPT_COMMON_DOWN);
|
||||||
msg.setSubject(info.subSystem, CH_HMI_TO_OPT_OPTCMD_DOWN);
|
msg.setSubject(info.subSystem, CH_HMI_TO_OPT_OPTCMD_DOWN);
|
||||||
SOptTagSet sOptTagSet;
|
SOptTagSet sOptTagSet;
|
||||||
|
|||||||
@ -92,10 +92,10 @@ signals:
|
|||||||
private:
|
private:
|
||||||
Ui::CDataOptWidget *ui;
|
Ui::CDataOptWidget *ui;
|
||||||
|
|
||||||
kbd_dbms::CDbApi * m_pReadDb;
|
iot_dbms::CDbApi * m_pReadDb;
|
||||||
|
|
||||||
kbd_net::CMbCommunicator *m_communicator;
|
iot_net::CMbCommunicator *m_communicator;
|
||||||
kbd_public::CSysInfoInterfacePtr m_pSysInfo;
|
iot_public::CSysInfoInterfacePtr m_pSysInfo;
|
||||||
QMap<int,STLocationInfo> m_locMap;
|
QMap<int,STLocationInfo> m_locMap;
|
||||||
QList<int> m_locOrder;
|
QList<int> m_locOrder;
|
||||||
QMap<int,QString> m_subMap;
|
QMap<int,QString> m_subMap;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "pub_logger_api/logger.h"
|
#include "pub_logger_api/logger.h"
|
||||||
|
|
||||||
using namespace kbd_dbms;
|
using namespace iot_dbms;
|
||||||
CDataOptWork::CDataOptWork(QObject *parent) : QObject(parent)
|
CDataOptWork::CDataOptWork(QObject *parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
m_pReadDb = new CDbApi(DB_CONN_MODEL_READ);
|
m_pReadDb = new CDbApi(DB_CONN_MODEL_READ);
|
||||||
@ -72,7 +72,7 @@ void CDataOptWork::slotSearch(int domainId, int appid)
|
|||||||
bool CDataOptWork::readTagInfo()
|
bool CDataOptWork::readTagInfo()
|
||||||
{
|
{
|
||||||
m_optTagInfoList.clear();
|
m_optTagInfoList.clear();
|
||||||
kbd_idlfile::RdbRet objRdbRet;
|
iot_idl::RdbRet objRdbRet;
|
||||||
bool bRet = false;
|
bool bRet = false;
|
||||||
|
|
||||||
std::vector <std::string> vecColumn = {"key_id_tag","tag_type","opt_time","location_id","sub_system","set_value","state_text","host_name","user_name","user_group"};
|
std::vector <std::string> vecColumn = {"key_id_tag","tag_type","opt_time","location_id","sub_system","set_value","state_text","host_name","user_name","user_group"};
|
||||||
|
|||||||
@ -51,8 +51,8 @@ private:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
kbd_dbms::CDbApi * m_pReadDb;
|
iot_dbms::CDbApi * m_pReadDb;
|
||||||
kbd_dbms::CRdbNetApi m_objRdbNetApi; //< 网络查询对象
|
iot_dbms::CRdbNetApi m_objRdbNetApi; //< 网络查询对象
|
||||||
|
|
||||||
QList<STOptTagInfo> m_optTagInfoList;
|
QList<STOptTagInfo> m_optTagInfoList;
|
||||||
QMap<QString,STTagInfo> m_TagInfoMap;
|
QMap<QString,STTagInfo> m_TagInfoMap;
|
||||||
|
|||||||
@ -8,12 +8,12 @@
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
kbd_public::StartLogSystem("HMI", "hmi");
|
iot_public::StartLogSystem("HMI", "hmi");
|
||||||
if (!(kbd_net::initMsgBus("HMI", "HMI")))
|
if (!(iot_net::initMsgBus("HMI", "HMI")))
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
kbd_service::CPermMngApiPtr perm = kbd_service::getPermMngInstance("base");
|
iot_service::CPermMngApiPtr perm = iot_service::getPermMngInstance("base");
|
||||||
if(!perm || PERM_NORMAL != perm->PermDllInit())
|
if(!perm || PERM_NORMAL != perm->PermDllInit())
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
@ -31,7 +31,7 @@ int main(int argc, char *argv[])
|
|||||||
a.exec();
|
a.exec();
|
||||||
}
|
}
|
||||||
//<释放消息总线
|
//<释放消息总线
|
||||||
kbd_net::releaseMsgBus();
|
iot_net::releaseMsgBus();
|
||||||
kbd_public::StopLogSystem();
|
iot_public::StopLogSystem();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
#include "public/pub_sysinfo_api/SysInfoApi.h"
|
#include "public/pub_sysinfo_api/SysInfoApi.h"
|
||||||
#include "public/pub_logger_api/logger.h"
|
#include "public/pub_logger_api/logger.h"
|
||||||
|
|
||||||
using namespace kbd_dbms;
|
using namespace iot_dbms;
|
||||||
|
|
||||||
CDbInterface::CDbInterface()
|
CDbInterface::CDbInterface()
|
||||||
: m_pReadDb(NULL),
|
: m_pReadDb(NULL),
|
||||||
@ -38,12 +38,12 @@ void CDbInterface::initialize()
|
|||||||
LOGERROR("打开数据库连接失败! %s", m_pReadDb->getLastErrorString().toStdString().c_str());
|
LOGERROR("打开数据库连接失败! %s", m_pReadDb->getLastErrorString().toStdString().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
m_rtdbAccess = new kbd_dbms::CRdbAccess();
|
m_rtdbAccess = new iot_dbms::CRdbAccess();
|
||||||
|
|
||||||
nCurDomain = CN_InvalidDomainId;
|
nCurDomain = CN_InvalidDomainId;
|
||||||
kbd_public::SNodeInfo stNodeInfo;
|
iot_public::SNodeInfo stNodeInfo;
|
||||||
kbd_public::CSysInfoInterfacePtr spSysInfo;
|
iot_public::CSysInfoInterfacePtr spSysInfo;
|
||||||
if (!kbd_public::createSysInfoInstance(spSysInfo))
|
if (!iot_public::createSysInfoInstance(spSysInfo))
|
||||||
{
|
{
|
||||||
LOGERROR("创建系统信息访问库实例失败!");
|
LOGERROR("创建系统信息访问库实例失败!");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,8 +29,8 @@ private:
|
|||||||
void loadDictMenuInfo();
|
void loadDictMenuInfo();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
kbd_dbms::CDbApi * m_pReadDb;
|
iot_dbms::CDbApi * m_pReadDb;
|
||||||
kbd_dbms::CRdbAccess * m_rtdbAccess;
|
iot_dbms::CRdbAccess * m_rtdbAccess;
|
||||||
int nCurDomain;
|
int nCurDomain;
|
||||||
QMap<QString, QMap<int, QString> > m_dictText; //< state_text_name actual_value,display_value
|
QMap<QString, QMap<int, QString> > m_dictText; //< state_text_name actual_value,display_value
|
||||||
QMap<QString, int> m_dictMenu; //< menu_macro_name,actual_value
|
QMap<QString, int> m_dictMenu; //< menu_macro_name,actual_value
|
||||||
|
|||||||
@ -22,7 +22,7 @@ CDevHisDataWidget::CDevHisDataWidget(bool editMode, QVector<void *> ptrVec, QWid
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
QString style = QString();
|
QString style = QString();
|
||||||
std::string strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss") ;
|
||||||
QFile file1(QString::fromStdString(strFullPath));
|
QFile file1(QString::fromStdString(strFullPath));
|
||||||
if (file1.open(QIODevice::ReadOnly))
|
if (file1.open(QIODevice::ReadOnly))
|
||||||
{
|
{
|
||||||
@ -32,7 +32,7 @@ CDevHisDataWidget::CDevHisDataWidget(bool editMode, QVector<void *> ptrVec, QWid
|
|||||||
}
|
}
|
||||||
file1.close();
|
file1.close();
|
||||||
|
|
||||||
strFullPath = kbd_public::CFileStyle::getPathOfStyleFile("deviceHisData.qss") ;
|
strFullPath = iot_public::CFileStyle::getPathOfStyleFile("deviceHisData.qss") ;
|
||||||
QFile file2(QString::fromStdString(strFullPath));
|
QFile file2(QString::fromStdString(strFullPath));
|
||||||
if (file2.open(QIODevice::ReadOnly))
|
if (file2.open(QIODevice::ReadOnly))
|
||||||
{
|
{
|
||||||
@ -171,7 +171,7 @@ void CDevHisDataWidget::initView()
|
|||||||
|
|
||||||
void CDevHisDataWidget::initData()
|
void CDevHisDataWidget::initData()
|
||||||
{
|
{
|
||||||
kbd_dbms::initTsdbApi();
|
iot_dbms::initTsdbApi();
|
||||||
|
|
||||||
m_dbInterface = new CDbInterface();
|
m_dbInterface = new CDbInterface();
|
||||||
m_hisDataManage = new CHisDataManage(Q_NULLPTR, m_dbInterface);
|
m_hisDataManage = new CHisDataManage(Q_NULLPTR, m_dbInterface);
|
||||||
|
|||||||
@ -14,7 +14,7 @@ struct SDevManage
|
|||||||
{
|
{
|
||||||
QString tag_name;
|
QString tag_name;
|
||||||
QString description;
|
QString description;
|
||||||
kbd_dbms::EnMeasPiontType pointType; //< MPT_AI ,MPT_DI ,MPT_MIX ,MPT_ACC
|
iot_dbms::EnMeasPiontType pointType; //< MPT_AI ,MPT_DI ,MPT_MIX ,MPT_ACC
|
||||||
};
|
};
|
||||||
|
|
||||||
class CDevHisDataWidget : public QWidget
|
class CDevHisDataWidget : public QWidget
|
||||||
|
|||||||
@ -20,7 +20,7 @@ CHisDataManage::~CHisDataManage()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CHisDataManage::getValidTsdbConnPtr(kbd_dbms::CTsdbConnPtr &ptr)
|
bool CHisDataManage::getValidTsdbConnPtr(iot_dbms::CTsdbConnPtr &ptr)
|
||||||
{
|
{
|
||||||
if(m_tsdbConnPtr != NULL)
|
if(m_tsdbConnPtr != NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user