[ref]同步711
This commit is contained in:
parent
67583b747f
commit
7470b86880
@ -1,4 +1,4 @@
|
||||
#include "LoadDefTblWidget.h"
|
||||
#include "LoadDefTblWidget.h"
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include "CustomWidget/kbdselectpointdlg.h"
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
class LoadStatPluginWidget : public QObject,public CPluginWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "kbd.PluginWidgetInterface/1.0")
|
||||
Q_PLUGIN_METADATA(IID HMI_WidgetPlugin_IID)
|
||||
Q_INTERFACES(CPluginWidgetInterface)
|
||||
|
||||
public:
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "CConditionModel.h"
|
||||
#include "CConditionModel.h"
|
||||
#include "CDbInterfaceMng.h"
|
||||
|
||||
CConditionModel::CConditionModel(QObject *parent)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifndef CCONDITIONMODEL_H
|
||||
#ifndef CCONDITIONMODEL_H
|
||||
#define CCONDITIONMODEL_H
|
||||
|
||||
#include <QAbstractTableModel>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "CDbInterfaceMng.h"
|
||||
#include "CDbInterfaceMng.h"
|
||||
#include "service/perm_mng_api/PermMngApi.h"
|
||||
#include "pub_logger_api/logger.h"
|
||||
|
||||
@ -93,7 +93,7 @@ int CDbInterfaceMng::getCtrlGrpTextByCtrlPoint(const QString &tag,QString &ctrlG
|
||||
{
|
||||
if(!m_pWriteDb->isOpen())
|
||||
{
|
||||
return kbdFailed;
|
||||
return iotFailed;
|
||||
}
|
||||
QSqlQuery query;
|
||||
QString sqlQuery = QString("select %1.ctrl_act_name,%2.description from %1 left join %2 on %1.tag_name = %2.tag_name where %2.tag_name = '%3' ").arg("digital_control").arg("digital").arg(tag);
|
||||
@ -105,7 +105,7 @@ int CDbInterfaceMng::getCtrlGrpTextByCtrlPoint(const QString &tag,QString &ctrlG
|
||||
ctrlGrpText = query.value(0).toString();
|
||||
title = query.value(1).toString();
|
||||
}
|
||||
return kbdSuccess;
|
||||
return iotSuccess;
|
||||
}
|
||||
|
||||
QMap<int, QString> CDbInterfaceMng::getDigitalTextMapByKey(const QString &key)
|
||||
@ -217,45 +217,45 @@ int CDbInterfaceMng::addPointLock(const QString &tag, int digitalValue, int chec
|
||||
{
|
||||
if(!m_pWriteDb->isOpen())
|
||||
{
|
||||
return kbdFailed;
|
||||
return iotFailed;
|
||||
}
|
||||
QString sqlQuery = QString("insert into point_lock_config_info(tag_name,actual_value,isEnable) values('%1',%2,%3)").arg(tag).arg(QString::number(digitalValue)).arg(QString::number(check));
|
||||
|
||||
if(m_pWriteDb->execute(sqlQuery))
|
||||
{
|
||||
return kbdSuccess;
|
||||
return iotSuccess;
|
||||
}
|
||||
return kbdFailed;
|
||||
return iotFailed;
|
||||
}
|
||||
|
||||
int CDbInterfaceMng::delPointLock(const QString &tag, int digitalValue)
|
||||
{
|
||||
if(!m_pWriteDb->isOpen())
|
||||
{
|
||||
return kbdFailed;
|
||||
return iotFailed;
|
||||
}
|
||||
QString sqlQuery = QString("delete from point_lock_config_info where tag_name='%1' and actual_value='%2'").arg(tag).arg(QString::number(digitalValue));
|
||||
|
||||
if(m_pWriteDb->execute(sqlQuery))
|
||||
{
|
||||
return kbdSuccess;
|
||||
return iotSuccess;
|
||||
}
|
||||
return kbdFailed;
|
||||
return iotFailed;
|
||||
}
|
||||
|
||||
int CDbInterfaceMng::updatePointLock(const QString &tag, int digitalValue, bool isEnable)
|
||||
{
|
||||
if(!m_pWriteDb->isOpen())
|
||||
{
|
||||
return kbdFailed;
|
||||
return iotFailed;
|
||||
}
|
||||
QString sqlQuery = QString("update point_lock_config_info set isEnable = %1 where tag_name = '%2' and actual_value = %3").arg(isEnable?1:0).arg(tag).arg(digitalValue);
|
||||
|
||||
if(m_pWriteDb->execute(sqlQuery))
|
||||
{
|
||||
return kbdSuccess;
|
||||
return iotSuccess;
|
||||
}
|
||||
return kbdFailed;
|
||||
return iotFailed;
|
||||
}
|
||||
|
||||
QString CDbInterfaceMng::getDevgByDevTag(const QString dev)
|
||||
@ -267,7 +267,7 @@ int CDbInterfaceMng::addConditionLock(const QString &tag, int value, ConditionIn
|
||||
{
|
||||
if(!m_pWriteDb->isOpen())
|
||||
{
|
||||
return kbdFailed;
|
||||
return iotFailed;
|
||||
}
|
||||
QString sqlQuery = QString();
|
||||
sqlQuery = QString("insert into point_lock_condition_info(tag_name,actual_value,condition_tag_name,condition_desc,condition1"
|
||||
@ -278,16 +278,16 @@ int CDbInterfaceMng::addConditionLock(const QString &tag, int value, ConditionIn
|
||||
qDebug()<<sqlQuery;
|
||||
if(m_pWriteDb->execute(sqlQuery))
|
||||
{
|
||||
return kbdSuccess;
|
||||
return iotSuccess;
|
||||
}
|
||||
return kbdFailed;
|
||||
return iotFailed;
|
||||
}
|
||||
|
||||
int CDbInterfaceMng::delConditionLock(const QString &tag, int value, ConditionInfoPtr condInfo)
|
||||
{
|
||||
if(!m_pWriteDb->isOpen())
|
||||
{
|
||||
return kbdFailed;
|
||||
return iotFailed;
|
||||
}
|
||||
|
||||
QString sql = QString("delete from point_lock_condition_info where tag_name ='%1' and actual_value = %2 and condition_tag_name = '%3' ")
|
||||
@ -295,12 +295,12 @@ int CDbInterfaceMng::delConditionLock(const QString &tag, int value, ConditionIn
|
||||
|
||||
if(m_pWriteDb->execute(sql))
|
||||
{
|
||||
return kbdSuccess;
|
||||
return iotSuccess;
|
||||
}else
|
||||
{
|
||||
return kbdFailed;
|
||||
return iotFailed;
|
||||
}
|
||||
return kbdFailed;
|
||||
return iotFailed;
|
||||
}
|
||||
|
||||
QString CDbInterfaceMng::getDevgDescByDevTag(const QString dev)
|
||||
@ -312,7 +312,7 @@ int CDbInterfaceMng::getPointDesc(const QString &tag, const QString &table, QStr
|
||||
{
|
||||
if(!m_pWriteDb->isOpen())
|
||||
{
|
||||
return kbdFailed;
|
||||
return iotFailed;
|
||||
}
|
||||
QSqlQuery query;
|
||||
QString sqlQuery = QString("select description from %1 where tag_name = '%2' ").arg(table).arg(tag);
|
||||
@ -322,9 +322,9 @@ int CDbInterfaceMng::getPointDesc(const QString &tag, const QString &table, QStr
|
||||
while(query.next())
|
||||
{
|
||||
description = query.value(0).toString();
|
||||
return kbdSuccess;
|
||||
return iotSuccess;
|
||||
}
|
||||
return kbdFailed;
|
||||
return iotFailed;
|
||||
}
|
||||
|
||||
CDbInterfaceMng::CDbInterfaceMng()
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifndef CDBINTERFACEMNG_H
|
||||
#ifndef CDBINTERFACEMNG_H
|
||||
#define CDBINTERFACEMNG_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "CPointInfo.h"
|
||||
#include "CPointInfo.h"
|
||||
|
||||
CPointInfo::CPointInfo()
|
||||
{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifndef CPOINTINFO_H
|
||||
#ifndef CPOINTINFO_H
|
||||
#define CPOINTINFO_H
|
||||
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifndef CPOINTLOCKCOMMON_H
|
||||
#ifndef CPOINTLOCKCOMMON_H
|
||||
#define CPOINTLOCKCOMMON_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "CPointLockPluginWidget.h"
|
||||
#include "CPointLockPluginWidget.h"
|
||||
#include <QWidget>
|
||||
#include "CPointLockWidget.h"
|
||||
#include "pub_logger_api/logger.h"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifndef CPOINTLOCKPLUGINWIDGET_H
|
||||
#ifndef CPOINTLOCKPLUGINWIDGET_H
|
||||
#define CPOINTLOCKPLUGINWIDGET_H
|
||||
|
||||
#include <QObject>
|
||||
@ -7,7 +7,7 @@
|
||||
class CPointLockPluginWidget : public QObject, public CPluginWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "kbd.PluginWidgetInterface/1.0")
|
||||
Q_PLUGIN_METADATA(IID HMI_WidgetPlugin_IID)
|
||||
Q_INTERFACES(CPluginWidgetInterface)
|
||||
|
||||
public:
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "CPointLockWidget.h"
|
||||
#include "CPointLockWidget.h"
|
||||
#include "ui_CPointLockWidget.h"
|
||||
#include "db_api_ex/CDbApi.h"
|
||||
#include <QSqlQuery>
|
||||
@ -80,7 +80,7 @@ void CPointLockWidget::init(QString tag)
|
||||
if(m_strTable == "digital")
|
||||
{
|
||||
QString ctrlGrgText = QString();
|
||||
if(CDbInterfaceMng::instance()->getCtrlGrpTextByCtrlPoint(m_tag, ctrlGrgText, title) == kbdFailed)
|
||||
if(CDbInterfaceMng::instance()->getCtrlGrpTextByCtrlPoint(m_tag, ctrlGrgText, title) == iotFailed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -97,7 +97,7 @@ void CPointLockWidget::init(QString tag)
|
||||
ui->comboBox->setEditable(true);
|
||||
QValidator *validator = new QDoubleValidator();
|
||||
ui->comboBox->lineEdit()->setValidator(validator);
|
||||
if(CDbInterfaceMng::instance()->getPointDesc(m_tag, m_strTable, title) == kbdFailed)
|
||||
if(CDbInterfaceMng::instance()->getPointDesc(m_tag, m_strTable, title) == iotFailed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -149,7 +149,7 @@ void CPointLockWidget::slotDelCondition()
|
||||
int value;
|
||||
getCtrlValue(value);
|
||||
ConditionInfoPtr info = m_pCondModel->getDataByIndex(modelIndexList.at(0));
|
||||
if(CDbInterfaceMng::instance()->delConditionLock(m_tag,value,info) == kbdSuccess)
|
||||
if(CDbInterfaceMng::instance()->delConditionLock(m_tag,value,info) == iotSuccess)
|
||||
{
|
||||
m_pCondModel->removeData(modelIndexList.at(0));
|
||||
//showMess(tr("提示"),tr("删除成功"));
|
||||
@ -183,7 +183,7 @@ void CPointLockWidget::slotOkClicked()
|
||||
PointInfoPtr pointInfo = CDbInterfaceMng::instance()->getLockConfigInfo(m_tag,value);
|
||||
if(pointInfo == Q_NULLPTR)
|
||||
{
|
||||
if(CDbInterfaceMng::instance()->addPointLock(m_tag,value,1) == kbdFailed)
|
||||
if(CDbInterfaceMng::instance()->addPointLock(m_tag,value,1) == iotFailed)
|
||||
{
|
||||
showMess(tr("提示"),tr("添加失败"));
|
||||
return;
|
||||
@ -209,7 +209,7 @@ void CPointLockWidget::slotOkClicked()
|
||||
info->value1 = ui->dValue1->value();
|
||||
info->value2 = ui->dValue2->value();
|
||||
}
|
||||
if(CDbInterfaceMng::instance()->addConditionLock(m_tag,value,info) == kbdSuccess)
|
||||
if(CDbInterfaceMng::instance()->addConditionLock(m_tag,value,info) == iotSuccess)
|
||||
{
|
||||
initTable();
|
||||
if(m_strTable == "analog" && ui->comboBox->findText(QString::number(value)) == -1)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifndef CPOINTLOCKWIDGET_H
|
||||
#ifndef CPOINTLOCKWIDGET_H
|
||||
#define CPOINTLOCKWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifndef POINTLOCKCOMMON_H
|
||||
#ifndef POINTLOCKCOMMON_H
|
||||
#define POINTLOCKCOMMON_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "CMyCalendar.h"
|
||||
#include "CMyCalendar.h"
|
||||
#include "ui_CMyCalendar.h"
|
||||
#include <pub_logger_api/logger.h>
|
||||
#include <QMessageBox>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifndef CMYCALENDAR_H
|
||||
#ifndef CMYCALENDAR_H
|
||||
#define CMYCALENDAR_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "CRecordWidget.h"
|
||||
#include "CRecordWidget.h"
|
||||
#include "ui_CRecordWidget.h"
|
||||
#include <QMessageBox>
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifndef CRECORDWIDGET_H
|
||||
#ifndef CRECORDWIDGET_H
|
||||
#define CRECORDWIDGET_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "CShiftPluginWidget.h"
|
||||
#include "CShiftPluginWidget.h"
|
||||
#include "CShiftWidget.h"
|
||||
|
||||
CShiftPluginWidget::CShiftPluginWidget(QObject *parent): QObject(parent)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifndef CSHIFTPLUGINWIDGET_H
|
||||
#ifndef CSHIFTPLUGINWIDGET_H
|
||||
#define CSHIFTPLUGINWIDGET_H
|
||||
|
||||
#include <QObject>
|
||||
@ -6,7 +6,7 @@
|
||||
class CShiftPluginWidget : public QObject, public CPluginWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "kbd.PluginWidgetInterface/1.0")
|
||||
Q_PLUGIN_METADATA(IID HMI_WidgetPlugin_IID)
|
||||
Q_INTERFACES(CPluginWidgetInterface)
|
||||
public:
|
||||
CShiftPluginWidget(QObject *parent = 0);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "CShiftWidget.h"
|
||||
#include "CShiftWidget.h"
|
||||
#include "ui_CShiftWidget.h"
|
||||
#include <QMessageBox>
|
||||
#include <QFileDialog>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifndef CSHIFTWIDGET_H
|
||||
#ifndef CSHIFTWIDGET_H
|
||||
#define CSHIFTWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "HandoverWidget.h"
|
||||
#include "HandoverWidget.h"
|
||||
#include "ui_HandoverWidget.h"
|
||||
#include <QScrollArea>
|
||||
#include "QueryThread.h"
|
||||
@ -393,17 +393,17 @@ void HandoverWidget::loadXml()
|
||||
CCommonConfigParse configParse;
|
||||
std::string strFilePath = "../../common/sysconfig/";
|
||||
std::string strFileName = "shiftWidget.xml";
|
||||
if(kbdSuccess == configParse.load(strFilePath,strFileName))
|
||||
if(iotSuccess == configParse.load(strFilePath,strFileName))
|
||||
{
|
||||
int num = 0;
|
||||
if(kbdSuccess == configParse.getIntValue("shiftWidget","levelNum",num))
|
||||
if(iotSuccess == configParse.getIntValue("shiftWidget","levelNum",num))
|
||||
{
|
||||
|
||||
for(int index(1);index<=num;index++)
|
||||
{
|
||||
QString name = QString("level%1").arg(QString::number(index));
|
||||
int value = 0;
|
||||
if(kbdSuccess == configParse.getIntValue("shiftWidget",name.toStdString(),value))
|
||||
if(iotSuccess == configParse.getIntValue("shiftWidget",name.toStdString(),value))
|
||||
{
|
||||
m_keyAlmLevelList.append(value);
|
||||
LOGDEBUG("loadXml() index:%d name:%s value:%d",index,name.toStdString().c_str(),value);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifndef HANDOVERWIDGET_H
|
||||
#ifndef HANDOVERWIDGET_H
|
||||
#define HANDOVERWIDGET_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "QueryThread.h"
|
||||
#include "QueryThread.h"
|
||||
#include "pub_utility_api/CommonConfigParse.h"
|
||||
#include "Common.h"
|
||||
#include "pub_logger_api/logger.h"
|
||||
@ -32,17 +32,17 @@ void QueryThread::loadXml()
|
||||
CCommonConfigParse configParse;
|
||||
std::string strFilePath = "../../common/sysconfig/";
|
||||
std::string strFileName = "shiftWidget.xml";
|
||||
if(kbdSuccess == configParse.load(strFilePath,strFileName))
|
||||
if(iotSuccess == configParse.load(strFilePath,strFileName))
|
||||
{
|
||||
int num = 0;
|
||||
if(kbdSuccess == configParse.getIntValue("shiftWidget","levelNum",num))
|
||||
if(iotSuccess == configParse.getIntValue("shiftWidget","levelNum",num))
|
||||
{
|
||||
|
||||
for(int index(1);index<=num;index++)
|
||||
{
|
||||
QString name = QString("level%1").arg(QString::number(index));
|
||||
int value = 0;
|
||||
if(kbdSuccess == configParse.getIntValue("shiftWidget",name.toStdString(),value))
|
||||
if(iotSuccess == configParse.getIntValue("shiftWidget",name.toStdString(),value))
|
||||
{
|
||||
m_keyAlmLevelList.append(value);
|
||||
LOGDEBUG("loadXml() index:%d name:%s value:%d",index,name.toStdString().c_str(),value);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifndef QUERYTHREAD_H
|
||||
#ifndef QUERYTHREAD_H
|
||||
#define QUERYTHREAD_H
|
||||
|
||||
#include <QThread>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "SelectGroupWidget.h"
|
||||
#include "SelectGroupWidget.h"
|
||||
#include "ui_SelectGroupWidget.h"
|
||||
#include <QMessageBox>
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifndef SELECTGROUPWIDGET_H
|
||||
#ifndef SELECTGROUPWIDGET_H
|
||||
#define SELECTGROUPWIDGET_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifndef SHIFTCOMMON_H
|
||||
#ifndef SHIFTCOMMON_H
|
||||
#define SHIFTCOMMON_H
|
||||
|
||||
typedef struct
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user