HM-SPMS/product/src/gui/plugin/DataOptWidget/CDataOptWidget.cpp
2025-03-17 09:23:17 +08:00

779 lines
23 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

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

#include "CDataOptWidget.h"
#include "ui_CDataOptWidget.h"
#include "pub_utility_api/FileStyle.h"
#include <QFile>
#include <QComboBox>
#include <QMessageBox>
#include <QDateTime>
#include "Common.h"
#include "perm_mng_api/PermMngApi.h"
#include "pub_logger_api/logger.h"
#include "pub_sysinfo_api/SysInfoApi.h"
using namespace iot_dbms;
using namespace iot_public;
using namespace iot_service;
CDataOptWidget::CDataOptWidget(bool editMode, QWidget *parent)
: QWidget(parent),
ui(new Ui::CDataOptWidget),
m_pReadDb(Q_NULLPTR),
m_communicator(Q_NULLPTR),
m_pThread(Q_NULLPTR),
m_pWork(Q_NULLPTR),
m_editMode(editMode),
m_domainId(-1),
m_appId(-1)
{
ui->setupUi(this);
qRegisterMetaType<QList<STOptTagInfo> >("QList<STOptTagInfo>");
initStyleSheet();
if(!m_editMode)
{
m_pReadDb = new CDbApi(DB_CONN_MODEL_READ);
m_pReadDb->open();
if(m_pThread == Q_NULLPTR)
{
m_pThread = new QThread();
}
if(m_pWork == Q_NULLPTR)
{
m_pWork = new CDataOptWork();
}
m_pWork->moveToThread(m_pThread);
connect(m_pThread,&QThread::finished,m_pWork,&QObject::deleteLater);
connect(this,&CDataOptWidget::sigSearch,m_pWork,&CDataOptWork::slotSearch,Qt::QueuedConnection);
connect(m_pWork,&CDataOptWork::sigShowMess,this,&CDataOptWidget::slotShowMess,Qt::QueuedConnection);
connect(m_pWork,&CDataOptWork::sigBrush,this,&CDataOptWidget::slotBrush,Qt::QueuedConnection);
connect(ui->pBrush,&QPushButton::clicked,this,&CDataOptWidget::search);
connect(ui->pCancelSetValue,&QPushButton::clicked,this,&CDataOptWidget::cancelSetValue);
initialize();
m_pThread->start();
search();
}
}
CDataOptWidget::~CDataOptWidget()
{
if(m_pReadDb)
{
m_pReadDb->close();
delete m_pReadDb;
}
m_pReadDb = Q_NULLPTR;
if(m_pThread)
{
m_pThread->exit();
m_pThread->wait();
delete m_pThread;
}
m_pThread = Q_NULLPTR;
delete ui;
}
void CDataOptWidget::setTagType(int actual)
{
if(m_editMode)
{
return ;
}
if(actual <= 0)
{
ui->cType->blockSignals(true);
ui->cType->clear();
ui->cType->addItem(tr("全部"),-1);
QMap<int,QString>::iterator pos = m_typeMap.begin();
while (pos != m_typeMap.end()) {
ui->cType->addItem(pos.value(),pos.key());
pos++;
}
ui->cType->blockSignals(false);
}else
{
ui->cType->blockSignals(true);
ui->cType->clear();
ui->cType->addItem(m_typeMap.value(actual),actual);
ui->cType->blockSignals(false);
ui->label_2->setHidden(true);
ui->cType->setHidden(true);
ui->treeWidget->setColumnHidden(COL_TYPE,true);
ui->treeWidget->setColumnHidden(COL_SETVALUE,true);
}
search();
}
void CDataOptWidget::initStyleSheet()
{
QString qss = QString();
std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss") ;
QFile qssfile1(QString::fromStdString(strFullPath));
qssfile1.open(QFile::ReadOnly);
if (qssfile1.isOpen())
{
qss += QLatin1String(qssfile1.readAll());
qssfile1.close();
}
// strFullPath = iot_public::CFileStyle::getPathOfStyleFile("relaySetting.qss") ;
// QFile qssfile2(QString::fromStdString(strFullPath));
// qssfile2.open(QFile::ReadOnly);
// if (qssfile2.isOpen())
// {
// qss += QLatin1String(qssfile2.readAll());
// qssfile2.close();
// }
if(!qss.isEmpty())
{
setStyleSheet(qss);
}
}
void CDataOptWidget::initialize()
{
if(!createSysInfoInstance(m_pSysInfo))
{
LOGERROR("创建系统信息访问库实例失败!");
}
initMsg();
initData();
initView();
initConn();
}
void CDataOptWidget::initData()
{
loadLoc();
loadSub();
loadDevG();
loadTagType();//dict_menu_info
}
void CDataOptWidget::initView()
{
ui->cLocation->blockSignals(true);
ui->cSub->blockSignals(true);
ui->cType->blockSignals(true);
ui->cLocation->clear();
foreach (const int &locId, m_locOrder) {
ui->cLocation->addItem(m_locMap.value(locId).desc, locId);
}
ui->cSub->clear();
QMap<int,QString>::iterator itor = m_subMap.begin();
while (itor != m_subMap.end()) {
ui->cSub->addItem(itor.value(),itor.key());
itor++;
}
ui->cType->clear();
QMap<int,QString>::iterator pos = m_typeMap.begin();
while (pos != m_typeMap.end()) {
ui->cType->addItem(pos.value(),pos.key());
pos++;
}
ui->cLocation->blockSignals(false);
ui->cSub->blockSignals(false);
ui->cType->blockSignals(false);
setDefaultWidth();
setColumnHidden(COL_SUBSYSTEM,true);
setColumnHidden(COL_STATETEXT,true);
setColumnHidden(COL_USERGROUP,true);
setColumnHidden(COL_KEYIDTAG,true);
setColumnHidden(COL_TABLE,true);
ui->treeWidget->setSortingEnabled(true);
ui->treeWidget->sortByColumn(COL_OPTTIME, Qt::DescendingOrder);
}
void CDataOptWidget::initConn()
{
connect(ui->cLocation,&QComboBox::currentTextChanged,this,&CDataOptWidget::filter);
connect(ui->cSub,&QComboBox::currentTextChanged,this,&CDataOptWidget::filter);
connect(ui->cType,&QComboBox::currentTextChanged,this,&CDataOptWidget::filter);
}
void CDataOptWidget::loadLoc()
{
if(!m_pReadDb->isOpen())
{
return ;
}
QSqlQuery query;
QString sqlQuery = QString("select LOCATION_ID,DESCRIPTION,DOMAIN_ID from sys_model_location_info order by LOCATION_NO");
m_pReadDb->execute(sqlQuery, query);
while(query.next())
{
STLocationInfo loc;
loc.id = query.value(0).toInt();
loc.desc = query.value(1).toString();
loc.domainId = query.value(2).toInt();
m_locMap.insert(loc.id, loc);
m_locOrder.push_back(loc.id);
}
}
void CDataOptWidget::loadSub()
{
if(!m_pReadDb->isOpen())
{
return ;
}
QSqlQuery query;
QString sqlQuery = QString("select SUB_SYSTEM_ID,DESCRIPTION from sys_model_sub_system_info where SUB_SYSTEM_ID > 3");
m_pReadDb->execute(sqlQuery, query);
while(query.next())
{
int id = query.value(0).toInt();
QString desc = query.value(1).toString();
m_subMap.insert(id, desc);
}
}
void CDataOptWidget::loadDevG()
{
if(!m_pReadDb->isOpen())
{
return ;
}
QSqlQuery query;
QString sqlQuery = QString("select TAG_NAME,DESCRIPTION from dev_group");
m_pReadDb->execute(sqlQuery, query);
while(query.next())
{
QString tag = query.value(0).toString();
QString desc = query.value(1).toString();
m_devgMap.insert(tag, desc);
}
}
void CDataOptWidget::loadTagType()
{
if(!m_pReadDb->isOpen())
{
return ;
}
QSqlQuery query;
QString sqlQuery = QString("select ACTUAL_VALUE,DISPLAY_VALUE from dict_menu_info where menu_name = '标签类型'");
m_pReadDb->execute(sqlQuery, query);
while(query.next())
{
int actual = query.value(0).toInt();
QString display = query.value(1).toString();
m_typeMap.insert(actual, display);
}
}
void CDataOptWidget::updateTree(const QList<STOptTagInfo> &dataList)
{
ui->treeWidget->clear();
ui->treeWidget->setSortingEnabled(false);
QList<int> typeList = m_typeMap.keys();
QMap<QString, QTreeWidgetItem*> devGroupMap; //< 设备组所在节点
for(int index(0);index<dataList.count();index++)
{
if(!typeList.contains(dataList[index].tagType))
{
continue;
}
STTagInfo tagInfo = m_pWork->getTagInfoByPointTagName(dataList[index].tagName);
//< 找到设备组所在树节点
QTreeWidgetItem * parent = Q_NULLPTR;
QMap<QString, QTreeWidgetItem*>::iterator iter = devGroupMap.find(tagInfo.devgName);
if(iter == devGroupMap.end())
{
QTreeWidgetItem * devgItem = new QTreeWidgetItem;
devgItem->setText(COL_TAGNAME, m_devgMap.value(tagInfo.devgName,tr("未知")));
devgItem->setData(COL_TAGNAME, Qt::UserRole, tagInfo.devgName);
devgItem->setData(COL_TAGNAME, Qt::UserRole+1, TYPE_DEVGROUP);
devgItem->setText(COL_OPTTIME, QDateTime::fromMSecsSinceEpoch(dataList[index].optTime).toString("yyyy-MM-dd hh:mm:ss"));
devgItem->setData(COL_OPTTIME, Qt::UserRole, dataList[index].optTime); //< 用于排序
ui->treeWidget->addTopLevelItem(devgItem);
devGroupMap.insert(tagInfo.devgName, devgItem);
parent = devgItem;
}
else
{
if(dataList[index].optTime > iter.value()->data(COL_OPTTIME, Qt::UserRole).toInt())
{
iter.value()->setData(COL_OPTTIME, Qt::UserRole, dataList[index].optTime);
iter.value()->setText(COL_OPTTIME, QDateTime::fromMSecsSinceEpoch(dataList[index].optTime).toString("yyyy-MM-dd hh:mm:ss"));
}
parent = iter.value();
}
QTreeWidgetItem *item = new QTreeWidgetItem(parent);
item->setText(COL_TAGNAME, tagInfo.desc);
item->setData(COL_TAGNAME, Qt::UserRole, tagInfo.tagName);
item->setData(COL_TAGNAME, Qt::UserRole+1, TYPE_POINT);
item->setText(COL_LOCATION, m_locMap.value(dataList[index].locationId).desc);
item->setData(COL_LOCATION, Qt::UserRole, dataList[index].locationId);
item->setText(COL_DEVICE, tagInfo.devDesc);
item->setData(COL_DEVICE, Qt::UserRole, tagInfo.devName);
item->setText(COL_TYPE, m_typeMap.value(dataList[index].tagType, tr("未知")));
item->setData(COL_TYPE, Qt::UserRole, dataList[index].tagType);
item->setText(COL_OPTTIME, QDateTime::fromMSecsSinceEpoch(dataList[index].optTime).toString("yyyy-MM-dd hh:mm:ss"));
item->setData(COL_OPTTIME, Qt::UserRole, dataList[index].optTime);
item->setText(COL_SUBSYSTEM, m_subMap.value(dataList[index].subSystem,tr("未知")));
item->setData(COL_SUBSYSTEM, Qt::UserRole, dataList[index].subSystem);
item->setText(COL_SETVALUE, QString::number(dataList[index].setValue));
item->setData(COL_SETVALUE, Qt::UserRole, dataList[index].setValue);
item->setText(COL_STATETEXT, dataList[index].stateText);
item->setData(COL_STATETEXT, Qt::UserRole, dataList[index].stateText);
item->setText(COL_HOSTNAME, dataList[index].hostName);
item->setData(COL_HOSTNAME, Qt::UserRole, dataList[index].hostName);
item->setText(COL_USERNAME, dataList[index].userName);
item->setData(COL_USERNAME, Qt::UserRole, dataList[index].userName);
item->setText(COL_USERGROUP, dataList[index].userGroup);
item->setData(COL_USERGROUP, Qt::UserRole, dataList[index].userGroup);
item->setText(COL_KEYIDTAG, dataList[index].keyIdTag);
item->setData(COL_KEYIDTAG, Qt::UserRole, dataList[index].keyIdTag);
item->setText(COL_TABLE, dataList[index].table);
item->setData(COL_TABLE, Qt::UserRole,dataList[index].table);
}
filter("");
ui->treeWidget->setSortingEnabled(true);
}
void CDataOptWidget::updateCount()
{
int showRowCount = 0;
for(int nIndex(0); nIndex< ui->treeWidget->topLevelItemCount(); nIndex++)
{
QTreeWidgetItem *item = ui->treeWidget->topLevelItem(nIndex);
for(int nChildIndex(0); nChildIndex<item->childCount(); nChildIndex++)
{
if(!item->child(nChildIndex)->isHidden())
{
showRowCount++;
}
}
}
ui->lCount->setNum(showRowCount);
}
bool CDataOptWidget::permCheck(int location, int region)
{
iot_service::CPermMngApiPtr permMngPtr = iot_service::getPermMngInstance("base");
QString mess;
if(permMngPtr != NULL)
{
permMngPtr->PermDllInit();
int nUserGrpId;
int nLevel;
int nLoginSec;
std::string strInstanceName;
int userId;
if(PERM_NORMAL != permMngPtr->CurUser(userId, nUserGrpId, nLevel, nLoginSec, strInstanceName))
{
userId = -1;
mess = QString(tr("获取当前登录用户失败!"));
slotShowMess(mess);
return false;
}
std::vector <int> vecRegionOptId;
QList<int> regList;
QList<int> locList;
std::vector <int> vecLocationOptId;
if(PERM_NORMAL == permMngPtr->GetSpeFunc(OPT_FUNC_SPE_OPT_OVERRIDE, vecRegionOptId, vecLocationOptId))
{
std::vector <int>::iterator region = vecRegionOptId.begin();
while (region != vecRegionOptId.end())
{
regList.append(*region++);
}
std::vector <int>::iterator location = vecLocationOptId.begin();
while (location != vecLocationOptId.end())
{
locList.append(*location++);
}
}
if(locList.contains(location) && regList.contains(region))
{
return true;
}else
{
mess = QString(tr("无操作权限!"));
slotShowMess(mess);
return false;
}
}
mess = QString(tr("初始化权限失败!"));
slotShowMess(mess);
return false;
}
void CDataOptWidget::initMsg()
{
if(m_communicator == Q_NULLPTR)
{
m_communicator = new iot_net::CMbCommunicator();
}
}
int CDataOptWidget::createReqHead(SOptReqHead &head)
{
SNodeInfo nodeInfo;
int userID = -1;
int usergID = -1;
int level;
int loginSec;
std::string instanceName;
CSysInfoInterfacePtr sysInfo;
if(createSysInfoInstance(sysInfo) == false)
{
LOGERROR("创建系统信息访问库实例失败!");
return kbdFailed;
}
else
{
sysInfo->getLocalNodeInfo(nodeInfo);
}
CPermMngApiPtr permMng = getPermMngInstance("base");
if(permMng != NULL)
{
if(permMng->PermDllInit() != PERM_NORMAL)
{
LOGERROR("权限接口初始化失败!");
return kbdFailed;
}else
{
if(PERM_NORMAL != permMng->CurUser(userID, usergID, level, loginSec, instanceName))
{
userID = -1;
return kbdFailed;
}
}
}
head.strSrcTag = "dataOptWidget";
head.nSrcDomainID = nodeInfo.nDomainId;
head.nDstDomainID = m_domainId;
head.nAppID = m_appId;
head.strHostName = nodeInfo.strName;
head.strInstName = instanceName;
head.strCommName = m_communicator->getName();
head.nUserID = userID;
head.nUserGroupID = usergID;
head.nOptTime = QDateTime::currentDateTime().toMSecsSinceEpoch();
return kbdSuccess;
}
void CDataOptWidget::filter(const QString &text)
{
Q_UNUSED(text)
int nLocId = ui->cLocation->currentData().toInt();
int nSubId = ui->cSub->currentData().toInt();
int nTypeId = ui->cType->currentData().toInt();
for(int nTopIndex(0); nTopIndex<ui->treeWidget->topLevelItemCount(); nTopIndex++)
{
bool isAllHide = true;
QTreeWidgetItem * parent = ui->treeWidget->topLevelItem(nTopIndex);
for(int nChildIndex(0); nChildIndex<parent->childCount(); nChildIndex++)
{
if(nLocId != parent->child(nChildIndex)->data(COL_LOCATION, Qt::UserRole).toInt())
{
parent->child(nChildIndex)->setHidden(true);
}
else if(nSubId != parent->child(nChildIndex)->data(COL_SUBSYSTEM, Qt::UserRole).toInt())
{
parent->child(nChildIndex)->setHidden(true);
}
else if(nTypeId != -1 && nTypeId != parent->child(nChildIndex)->data(COL_TYPE, Qt::UserRole).toInt())
{
parent->child(nChildIndex)->setHidden(true);
}
else
{
parent->child(nChildIndex)->setHidden(false);
isAllHide = false;
}
}
if(isAllHide)
{
parent->setHidden(true);
}
else
{
parent->setHidden(false);
}
}
ui->treeWidget->expandAll();
updateCount();
}
void CDataOptWidget::slotShowMess(const QString &mess)
{
QMessageBox::warning(this, tr("提示"), mess, QMessageBox::Ok);
}
void CDataOptWidget::slotBrush(const QList<STOptTagInfo> &optTagInfoList)
{
updateTree(optTagInfoList);
updateCount();
}
void CDataOptWidget::setColumnHidden(int column, bool hide)
{
ui->treeWidget->setColumnHidden(column, hide);
}
void CDataOptWidget::setColumnWidth(int column, int width)
{
ui->treeWidget->setColumnWidth(column,width);
}
void CDataOptWidget::setRowHeight(int height)
{
ui->treeWidget->header()->setDefaultSectionSize(height);
}
void CDataOptWidget::setDefaultWidth()
{
setColumnWidth(COL_TAGNAME,200);
setColumnWidth(COL_LOCATION,200);
setColumnWidth(COL_DEVICE,200);
setColumnWidth(COL_TYPE,150);
setColumnWidth(COL_OPTTIME,200);
setColumnWidth(COL_SETVALUE,100);
setColumnWidth(COL_HOSTNAME,150);
setColumnWidth(COL_USERNAME,150);
}
void CDataOptWidget::cancelSetValue()
{
QString mess = QString(tr("当前未选中任何项!"));
QList<QTreeWidgetItem*> list = ui->treeWidget->selectedItems();
if (list.size() <= 0)
{
slotShowMess(mess);
return;
}
struct itemData
{
QString tagName;
QString tagDesc;
int tagType;
inline bool operator==(const itemData &other) const
{
if(tagName != other.tagName)
{
return false;
}
return tagType == other.tagType;
}
};
QList<itemData> itemDataList = {};
QList<QTreeWidgetItem*>::iterator iter= list.begin();
for(; iter!=list.end(); ++iter)
{
QTreeWidgetItem *item = *iter;
int type = item->data(COL_TAGNAME, Qt::UserRole+1).toInt();
if(type == TYPE_DEVGROUP)
{
for(int n=0; n<item->childCount(); n++)
{
if(item->child(n)->isHidden())
{
continue;
}
itemData sItemData;
sItemData.tagName = item->child(n)->data(COL_TAGNAME, Qt::UserRole).toString();
sItemData.tagDesc = item->child(n)->text(COL_TAGNAME);
sItemData.tagType = item->child(n)->data(COL_TYPE, Qt::UserRole).toInt();
if(itemDataList.isEmpty())
{
itemDataList.append(sItemData);
}
else if(std::find(itemDataList.begin(), itemDataList.end(), sItemData) == itemDataList.end())
{
itemDataList.append(sItemData);
}
else
{
LOGINFO("取消置数: 重复[%s %d]", sItemData.tagName.toStdString().c_str(), sItemData.tagType);
}
}
}
else if(type == TYPE_POINT)
{
itemData sItemData;
sItemData.tagName = item->data(COL_TAGNAME, Qt::UserRole).toString();
sItemData.tagDesc = item->text(COL_TAGNAME);
sItemData.tagType = item->data(COL_TYPE, Qt::UserRole).toInt();
if(itemDataList.isEmpty())
{
itemDataList.append(sItemData);
}
else if(std::find(itemDataList.begin(), itemDataList.end(), sItemData) == itemDataList.end())
{
itemDataList.append(sItemData);
}
else
{
LOGINFO("取消置数: 重复[%s %d]", sItemData.tagName.toStdString().c_str(), sItemData.tagType);
}
}
else
{
LOGERROR("取消置数: 未知树节点类型[%d]", type);
}
}
LOGINFO("取消置数: [%d]", itemDataList.length());
for(int nIndex(0); nIndex<itemDataList.length(); nIndex++)
{
itemData& data = itemDataList[nIndex];
if(!cancelItemSetValue(data.tagDesc,data.tagName,data.tagType))
{
break;
}
}
filter("");
}
bool CDataOptWidget::cancelItemSetValue(const QString &desc,const QString &tagName, int tagType)
{
STOptTagInfo info;
if(m_pWork->getOptTagInfoByTagAndType(tagName,tagType,info) !=kbdSuccess )
{
slotShowMess(tr("获取标签操作信息有误,%1").arg(desc));
return false;
}
STTagInfo tagInfo;
if(m_pWork->getTagInfoByTag(tagName,tagInfo) !=kbdSuccess )
{
slotShowMess(tr("获取标签信息有误,%1").arg(desc));
return false;
}
if(!permCheck(info.locationId,tagInfo.region))
{
return false;
}
removeOptTagInfo(info);
return true;
}
void CDataOptWidget::removeOptTagInfo(const STOptTagInfo &info)
{
iot_net::CMbMessage msg;
msg.setMsgType(MT_OPT_COMMON_DOWN);
msg.setSubject(info.subSystem, CH_HMI_TO_OPT_OPTCMD_DOWN);
SOptTagSet sOptTagSet;
SOptTagQueue optTagQueue;
COptTagSet cOptTagSet;
if(createReqHead(sOptTagSet.stHead)!= kbdSuccess)
{
return ;
}
optTagQueue.strKeyIdTag = info.keyIdTag.toStdString();
optTagQueue.nIsSet = 0;// 0取消1设置
optTagQueue.fSetValue = info.setValue;
optTagQueue.strStateText = info.stateText.toStdString();
optTagQueue.bIsPointQuery = 1;
optTagQueue.nLocationId = info.locationId;
optTagQueue.nSubSystem = info.subSystem;
sOptTagSet.vecTagQueue.push_back(optTagQueue);
std::string content = cOptTagSet.generate(sOptTagSet);
int type = info.tagType;
if(type == 1)
{
msg.setMsgType(MT_OPT_TAG_VALUE_SET);
}else if(type == 2)
{
msg.setMsgType(MT_OPT_PINHIBIT_REF);
}else if(type == 3)
{
msg.setMsgType(MT_OPT_PINHIBIT_ALARM);
}else
{
msg.setMsgType(MT_OPT_PINHIBIT_CTRL);
}
msg.setData(content);
if(!m_communicator->sendMsgToDomain(msg, m_domainId))
{
QString mess = QString(tr("下发取消命令失败"));
slotShowMess(mess);
}else
{
removeItemOptTagInfo(info);
m_pWork->removeOneOptTagInfo(info);
updateCount();
}
}
void CDataOptWidget::removeItemOptTagInfo(const STOptTagInfo &info)
{
for(int nTopIndex(0); nTopIndex<ui->treeWidget->topLevelItemCount(); nTopIndex++)
{
QTreeWidgetItem * parent = ui->treeWidget->topLevelItem(nTopIndex);
for(int nChildIndex(0); nChildIndex<parent->childCount(); nChildIndex++)
{
QString tagName = parent->child(nChildIndex)->data(COL_TAGNAME, Qt::UserRole).toString();
int tagType = parent->child(nChildIndex)->data(COL_TYPE, Qt::UserRole).toInt();
if(info.tagName == tagName && info.tagType == tagType)
{
parent->takeChild(nChildIndex--);
break;
}
}
if(parent->childCount() == 0)
{
ui->treeWidget->takeTopLevelItem(nTopIndex--);
}
}
}
void CDataOptWidget::search()
{
m_domainId = m_locMap.value(ui->cLocation->currentData().toInt()).domainId;
if(m_pSysInfo != Q_NULLPTR)
{
SAppInfo stAppInfo;
m_pSysInfo->getAppInfoBySubsystemId(ui->cSub->currentData().toInt(),stAppInfo);
m_appId = stAppInfo.nId;
emit sigSearch(m_domainId,m_appId);
}
}