[ref]同步711

This commit is contained in:
shi_jq 2025-03-13 15:19:51 +08:00
parent 2318011ca8
commit 15d70635cb
65 changed files with 4980 additions and 4315 deletions

View File

@ -1,6 +1,12 @@
#include "CommonCfgpluginwidget.h" #include "CommonCfgpluginwidget.h"
#include "commonwidget.h" #include "commonwidget.h"
#include <QTranslator>
#include <QWidget>
#include <QApplication>
#include "../model_common/common.h"
#include "pub_widget/PubWidgetInit.h"
CommonCfgPluginWidget::CommonCfgPluginWidget(QObject *parent) : QObject(parent) CommonCfgPluginWidget::CommonCfgPluginWidget(QObject *parent) : QObject(parent)
{ {
@ -15,6 +21,12 @@ bool CommonCfgPluginWidget::createWidget(QWidget *parent, bool editMode, QWidget
{ {
Q_UNUSED(ptrVec) Q_UNUSED(ptrVec)
Q_UNUSED(editMode) Q_UNUSED(editMode)
QTranslator * qtTranslator = new QTranslator;
qtTranslator->load(Common::getTranslatePath("Common_config_plugin_EN.qm"));
qApp->installTranslator(qtTranslator);
iot_public::installTranslator(Common::getLanguage().toStdString());
CommonWidget *pWidget = new CommonWidget(parent); CommonWidget *pWidget = new CommonWidget(parent);
*widget = (QWidget *)pWidget; *widget = (QWidget *)pWidget;
*pTrendWindow = (IPluginWidget *)pWidget; *pTrendWindow = (IPluginWidget *)pWidget;

View File

@ -7,7 +7,7 @@
class CommonCfgPluginWidget : public QObject, public CPluginWidgetInterface class CommonCfgPluginWidget : public QObject, public CPluginWidgetInterface
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "kbd.PluginWidgetInterface/1.0") Q_PLUGIN_METADATA(IID HMI_WidgetPlugin_IID)
Q_INTERFACES(CPluginWidgetInterface) Q_INTERFACES(CPluginWidgetInterface)
public: public:

View File

@ -36,12 +36,13 @@ PLATFORM_INCLUDE_PATH = $$SRC_ROOT_PATH/../../platform/src/include/
INCLUDEPATH += $$PWD\ INCLUDEPATH += $$PWD\
$$PLATFORM_INCLUDE_PATH/tools/model_common \ $$PLATFORM_INCLUDE_PATH/tools/model_common \
$$PLATFORM_INCLUDE_PATH/tools/model_table \ $$PLATFORM_INCLUDE_PATH/tools/model_table \
$$PLATFORM_INCLUDE_PATH/tools/model_excel/xlsx $$PLATFORM_INCLUDE_PATH/public/pub_excel/xlsx
LIBS += -lmodel_common -lmodel_excel LIBS += -lmodel_common -lpub_excel
LIBS += -lmodel_table -lScriptForm_lua LIBS += -lmodel_table -lScriptForm_lua
LIBS += -lpub_widget
HEADERS += \ HEADERS += \
commonwidget.h \ commonwidget.h \
@ -67,3 +68,5 @@ SOURCES += \
kbdstatetextwidget.cpp \ kbdstatetextwidget.cpp \
CommonCfgpluginwidget.cpp CommonCfgpluginwidget.cpp
TRANSLATIONS += Common_config_plugin_EN.ts

View File

@ -12,7 +12,7 @@
#include "kbdlockdefinewidget.h" #include "kbdlockdefinewidget.h"
#include "kbdlockparawidget.h" #include "kbdlockparawidget.h"
#include "kbdstatetextwidget.h" #include "kbdstatetextwidget.h"
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include "kbdctrlactwidget.h" #include "kbdctrlactwidget.h"
#include "kbdoutlinewidget.h" #include "kbdoutlinewidget.h"
#include <QFileDialog> #include <QFileDialog>
@ -84,15 +84,20 @@ QWidget *CommonWidget::initTotal()
QToolBar *bar = new QToolBar(widget); QToolBar *bar = new QToolBar(widget);
m_tableTotal = new KbdTable(widget,REWRITE_COMMIT); m_tableTotal = new KbdTable(widget,REWRITE_COMMIT);
bar->setIconSize(QSize(24,24)); QAction* act = nullptr;
act = bar->addAction(tr("添加记录"),this,SLOT(onAddTableTotalRow()));
bar->addAction(QIcon(":/icons/icons/new.png"),tr("添加记录"),this,SLOT(onAddTableTotalRow())); bar->widgetForAction(act)->setObjectName("icon_add");
bar->addAction(QIcon(":/icons/icons/delete.png"),tr("删除记录"),m_tableTotal,SLOT(onRemoveRowNotCommit())); act = bar->addAction(tr("删除记录"),m_tableTotal,SLOT(onRemoveRowNotCommit()));
bar->addAction(QIcon(":/icons/icons/undo.png"),tr("撤销更改"),m_tableTotal,SLOT(onUndo())); bar->widgetForAction(act)->setObjectName("icon_delete");
bar->addAction(QIcon(":/icons/icons/save.png"),tr("保存"),this,SLOT(onSaveTableTotal())); act = bar->addAction(tr("撤销更改"),m_tableTotal,SLOT(onUndo()));
bar->widgetForAction(act)->setObjectName("icon_undo");
act = bar->addAction(tr("保存"),this,SLOT(onSaveTableTotal()));
bar->widgetForAction(act)->setObjectName("icon_save");
bar->addSeparator(); bar->addSeparator();
bar->addAction(QIcon(":/icons/icons/Excel-export.png"),tr("Excel导出"),m_tableTotal,SLOT(onExcelExport())); act = bar->addAction(tr("Excel导出"),m_tableTotal,SLOT(onExcelExport()));
bar->addAction(QIcon(":/icons/icons/Excel-Impor.png"),tr("Excel导入"),m_tableTotal,SLOT(onImportExcel())); bar->widgetForAction(act)->setObjectName("icon_excel_export");
act = bar->addAction(tr("Excel导入"),m_tableTotal,SLOT(onImportExcel()));
bar->widgetForAction(act)->setObjectName("icon_excel_import");
vLayout1->addWidget(bar); vLayout1->addWidget(bar);
vLayout1->addWidget(m_tableTotal); vLayout1->addWidget(m_tableTotal);
@ -124,13 +129,20 @@ QWidget *CommonWidget::creatPointTypeWidget()
kbdSearchWidget* search = new kbdSearchWidget(widget); kbdSearchWidget* search = new kbdSearchWidget(widget);
QToolBar *bar = new QToolBar(widget); QToolBar *bar = new QToolBar(widget);
bar->addAction(QIcon(":/icons/icons/new.png"),tr("添加记录"),this,SLOT(onAddPointTypeTableRow())); QAction* act = nullptr;
bar->addAction(QIcon(":/icons/icons/delete.png"),tr("删除记录"),m_tablePointType->getTable(),SLOT(onRemoveRowNotCommit())); act = bar->addAction(tr("添加记录"),this,SLOT(onAddPointTypeTableRow()));
bar->addAction(QIcon(":/icons/icons/undo.png"),tr("撤销更改"),m_tablePointType->getTable(),SLOT(onUndo())); bar->widgetForAction(act)->setObjectName("icon_add");
bar->addAction(QIcon(":/icons/icons/save.png"),tr("保存"),[this](){m_tablePointType->getTable()->saveWithReWrite(false);}); act = bar->addAction(tr("删除记录"),m_tablePointType->getTable(),SLOT(onRemoveRowNotCommit()));
bar->widgetForAction(act)->setObjectName("icon_delete");
act = bar->addAction(tr("撤销更改"),m_tablePointType->getTable(),SLOT(onUndo()));
bar->widgetForAction(act)->setObjectName("icon_undo");
act = bar->addAction(tr("保存"),[this](){m_tablePointType->getTable()->saveWithReWrite(false);});
bar->widgetForAction(act)->setObjectName("icon_save");
bar->addSeparator(); bar->addSeparator();
bar->addAction(QIcon(":/icons/icons/Excel-export.png"),tr("Excel导出"),m_tablePointType->getTable(),SLOT(onExcelExport())); act = bar->addAction(tr("Excel导出"),m_tablePointType->getTable(),SLOT(onExcelExport()));
bar->addAction(QIcon(":/icons/icons/Excel-Impor.png"),tr("Excel导入"),m_tablePointType->getTable(),SLOT(onImportExcel())); bar->widgetForAction(act)->setObjectName("icon_excel_export");
act = bar->addAction(tr("Excel导入"),m_tablePointType->getTable(),SLOT(onImportExcel()));
bar->widgetForAction(act)->setObjectName("icon_excel_import");
hLayout->addWidget(bar); hLayout->addWidget(bar);
hLayout->addSpacing(10); hLayout->addSpacing(10);
@ -389,7 +401,7 @@ void CommonWidget::onExport()
QFile file(filePath); QFile file(filePath);
if(!file.open(QIODevice::WriteOnly)) if(!file.open(QIODevice::WriteOnly))
{ {
QMessageBox::information(this,tr("消息"),tr("文件打开不成功")); N_MessageBox::information(this,tr("消息"),tr("文件打开不成功"));
return ; return ;
} }
QXlsx::Document xlsx(&file); QXlsx::Document xlsx(&file);
@ -399,15 +411,15 @@ void CommonWidget::onExport()
{ {
if(xlsx.saveAs(filePath)) if(xlsx.saveAs(filePath))
{ {
QMessageBox::information(this,tr("消息"),tr("导出配置成功!\n导出路径:")+filePath); N_MessageBox::information(this,tr("消息"),tr("导出配置成功!\n导出路径:")+filePath);
} }
else else
{ {
QMessageBox::information(this,tr("消息"),tr("保存失败")); N_MessageBox::information(this,tr("消息"),tr("保存失败"));
} }
} }
else else
QMessageBox::information(this,tr("消息"),tr("导出失败:%1").arg(error)); N_MessageBox::information(this,tr("消息"),tr("导出失败:%1").arg(error));
/* /*
@ -417,9 +429,9 @@ void CommonWidget::onExport()
QString filePath = Common::getSysModelPath() + "/" + model->getTableName() + ".xml"; QString filePath = Common::getSysModelPath() + "/" + model->getTableName() + ".xml";
if(model->exportFile(filePath)) if(model->exportFile(filePath))
QMessageBox::information(this,tr("消息"),tr("导出配置成功!\n导出路径:")+filePath); N_MessageBox::information(this,tr("消息"),tr("导出配置成功!\n导出路径:")+filePath);
else else
QMessageBox::information(this,tr("消息"),tr("导出失败")); N_MessageBox::information(this,tr("消息"),tr("导出失败"));
*/ */
} }
@ -434,7 +446,7 @@ void CommonWidget::onImport()
QFile file(filePath); QFile file(filePath);
if(!file.open(QIODevice::ReadOnly)) if(!file.open(QIODevice::ReadOnly))
{ {
QMessageBox::information(this,tr("消息"),tr("文件打开不成功")); N_MessageBox::information(this,tr("消息"),tr("文件打开不成功"));
return ; return ;
} }
QXlsx::Document xlsx(&file); QXlsx::Document xlsx(&file);

View File

@ -2,7 +2,7 @@
#include <QVBoxLayout> #include <QVBoxLayout>
#include "kbdtable.h" #include "kbdtable.h"
#include "../model_common/common.h" #include "../model_common/common.h"
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include "kbdtabledatamgr.h" #include "kbdtabledatamgr.h"
#include <QDebug> #include <QDebug>
#include "kbdpropertypanel.h" #include "kbdpropertypanel.h"
@ -23,9 +23,11 @@ void KbdApcAnaWidget::initLayout()
{ {
QToolBar *bar = new QToolBar(this); QToolBar *bar = new QToolBar(this);
bar->setIconSize(QSize(24,24)); QAction* act = nullptr;
bar->addAction(QIcon(":/icons/icons/new.png"),tr("添加记录"),this,SLOT(onAddRow())); act = bar->addAction(tr("添加记录"),this,SLOT(onAddRow()));
bar->addAction(QIcon(":/icons/icons/delete.png"),tr("删除记录"),this,SLOT(onRemoveRow())); bar->widgetForAction(act)->setObjectName("icon_add");
act = bar->addAction(tr("删除记录"),this,SLOT(onRemoveRow()));
bar->widgetForAction(act)->setObjectName("icon_delete");
m_table = new KbdTable(this,EXTERN_COMMIT); m_table = new KbdTable(this,EXTERN_COMMIT);
m_table->setModel(KbdTableDataMgr::getInstance()->createModel("APC_ANALOG.xml")); m_table->setModel(KbdTableDataMgr::getInstance()->createModel("APC_ANALOG.xml"));
@ -53,7 +55,7 @@ void KbdApcAnaWidget::changeProperty(KbdPropertyDlg &dlg, const QString &sqlName
QStringList keyIdTagList = text.split("."); QStringList keyIdTagList = text.split(".");
if(keyIdTagList.size() != 5) if(keyIdTagList.size() != 5)
{ {
QMessageBox::information(NULL,tr("消息"),tr("输出测点 %1 格式不正确,请重新输入").arg(keyIdTagList.join("."))); N_MessageBox::information(NULL,tr("消息"),tr("输出测点 %1 格式不正确,请重新输入").arg(keyIdTagList.join(".")));
return; return;
} }
QString tagName, tableName; QString tagName, tableName;
@ -68,12 +70,12 @@ void KbdApcAnaWidget::changeProperty(KbdPropertyDlg &dlg, const QString &sqlName
KbdDbDesign ds; KbdDbDesign ds;
if(!ds.getThreeColumnResult(sql.arg(tableName).arg(tagName),locationIdList,subSystemList,descList)) if(!ds.getThreeColumnResult(sql.arg(tableName).arg(tagName),locationIdList,subSystemList,descList))
{ {
QMessageBox::information(NULL,tr("消息"),tr("数据库查询错误")); N_MessageBox::information(NULL,tr("消息"),tr("数据库查询错误"));
return; return;
} }
if(locationIdList.size() != 1 || subSystemList.size() != 1) if(locationIdList.size() != 1 || subSystemList.size() != 1)
{ {
QMessageBox::information(NULL,tr("消息"),tr("输出测点%1 不存在对应的车站和专业信息").arg(tagName)); N_MessageBox::information(NULL,tr("消息"),tr("输出测点%1 不存在对应的车站和专业信息").arg(tagName));
return; return;
} }
@ -89,7 +91,7 @@ void KbdApcAnaWidget::changeProperty(KbdPropertyDlg &dlg, const QString &sqlName
QStringList keyIdTagList = text.split("."); QStringList keyIdTagList = text.split(".");
if(keyIdTagList.size() != 5) if(keyIdTagList.size() != 5)
{ {
QMessageBox::information(NULL,tr("消息"),tr("超时输出测点 %1 格式不正确").arg(keyIdTagList.join("."))); N_MessageBox::information(NULL,tr("消息"),tr("超时输出测点 %1 格式不正确").arg(keyIdTagList.join(".")));
return; return;
} }
QString tagName, tableName; QString tagName, tableName;
@ -103,12 +105,12 @@ void KbdApcAnaWidget::changeProperty(KbdPropertyDlg &dlg, const QString &sqlName
KbdDbDesign ds; KbdDbDesign ds;
if(!ds.getTwoColumnResult(sql.arg(tableName).arg(tagName),locationIdList,subSystemList)) if(!ds.getTwoColumnResult(sql.arg(tableName).arg(tagName),locationIdList,subSystemList))
{ {
QMessageBox::information(NULL,tr("消息"),tr("数据库查询错误")); N_MessageBox::information(NULL,tr("消息"),tr("数据库查询错误"));
return; return;
} }
if(locationIdList.size() != 1 || subSystemList.size() != 1) if(locationIdList.size() != 1 || subSystemList.size() != 1)
{ {
QMessageBox::information(NULL,tr("消息"),tr("超时输出测点%1 不存在对应的车站和专业信息").arg(tagName)); N_MessageBox::information(NULL,tr("消息"),tr("超时输出测点%1 不存在对应的车站和专业信息").arg(tagName));
return; return;
} }
const ColMgrDataList& modelCols = dlg.panel()->currentModel()->getHeadCols(); const ColMgrDataList& modelCols = dlg.panel()->currentModel()->getHeadCols();
@ -120,7 +122,7 @@ void KbdApcAnaWidget::changeProperty(KbdPropertyDlg &dlg, const QString &sqlName
if(oldLocation != locationIdList.first() || oldSubSystem != subSystemList.first()) if(oldLocation != locationIdList.first() || oldSubSystem != subSystemList.first())
{ {
QMessageBox::information(NULL,tr("消息"),tr("超时输出测点与输出测点不是同一个车站和专业")); N_MessageBox::information(NULL,tr("消息"),tr("超时输出测点与输出测点不是同一个车站和专业"));
return; return;
} }
@ -239,9 +241,9 @@ void KbdApcAnaWidget::onAddRow()
void KbdApcAnaWidget::onRemoveRow() void KbdApcAnaWidget::onRemoveRow()
{ {
if(QMessageBox::No == QMessageBox::information(this,tr("消息"), if(N_MessageBox::No == N_MessageBox::information(this,tr("消息"),
tr("是否删除?"), tr("是否删除?"),
QMessageBox::Yes,QMessageBox::No)) N_MessageBox::Yes,N_MessageBox::No))
return; return;
KbdTableModel *model = qobject_cast<KbdTableModel *>(m_table->model()); KbdTableModel *model = qobject_cast<KbdTableModel *>(m_table->model());
@ -325,21 +327,21 @@ void KbdApcAnaWidget::onModifyRow()
void KbdApcAnaWidget::onStartTransactionError(const QString&erroStr) void KbdApcAnaWidget::onStartTransactionError(const QString&erroStr)
{ {
QMessageBox::information(this,tr("消息"),erroStr); N_MessageBox::information(this,tr("消息"),erroStr);
} }
void KbdApcAnaWidget::onMsg(const QString &text) void KbdApcAnaWidget::onMsg(const QString &text)
{ {
QMessageBox::information(this,tr("消息"),text); N_MessageBox::information(this,tr("消息"),text);
} }
void KbdApcAnaWidget::onCommitError() void KbdApcAnaWidget::onCommitError()
{ {
QMessageBox::information(this,tr("消息"),tr("此次修改失败,已启动回滚!")); N_MessageBox::information(this,tr("消息"),tr("此次修改失败,已启动回滚!"));
} }
void KbdApcAnaWidget::onRollbackError() void KbdApcAnaWidget::onRollbackError()
{ {
QMessageBox::information(this,tr("消息"),tr("回滚事务失败!")); N_MessageBox::information(this,tr("消息"),tr("回滚事务失败!"));
} }

View File

@ -2,7 +2,7 @@
#include <QVBoxLayout> #include <QVBoxLayout>
#include "kbdtable.h" #include "kbdtable.h"
#include "../model_common/common.h" #include "../model_common/common.h"
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include "kbdtabledatamgr.h" #include "kbdtabledatamgr.h"
#include <QDebug> #include <QDebug>
#include "kbdpropertypanel.h" #include "kbdpropertypanel.h"
@ -22,9 +22,11 @@ KbdApcDigWidget::~KbdApcDigWidget()
void KbdApcDigWidget::initLayout() void KbdApcDigWidget::initLayout()
{ {
QToolBar *bar = new QToolBar(this); QToolBar *bar = new QToolBar(this);
bar->setIconSize(QSize(24,24)); QAction* act = nullptr;
bar->addAction(QIcon(":/icons/icons/new.png"),tr("添加记录"),this,SLOT(onAddRow())); act = bar->addAction(tr("添加记录"),this,SLOT(onAddRow()));
bar->addAction(QIcon(":/icons/icons/delete.png"),tr("删除记录"),this,SLOT(onRemoveRow())); bar->widgetForAction(act)->setObjectName("icon_add");
act = bar->addAction(tr("删除记录"),this,SLOT(onRemoveRow()));
bar->widgetForAction(act)->setObjectName("icon_delete");
m_table = new KbdTable(this,EXTERN_COMMIT); m_table = new KbdTable(this,EXTERN_COMMIT);
m_table->setModel(KbdTableDataMgr::getInstance()->createModel("APC_DIGITAL.xml")); m_table->setModel(KbdTableDataMgr::getInstance()->createModel("APC_DIGITAL.xml"));
@ -48,7 +50,7 @@ void KbdApcDigWidget::changeProperty(KbdPropertyDlg &dlg, const QString &sqlName
QStringList keyIdTagList = text.split("."); QStringList keyIdTagList = text.split(".");
if(keyIdTagList.size() != 5) if(keyIdTagList.size() != 5)
{ {
QMessageBox::information(NULL,tr("消息"),tr("输出测点 %1 格式不正确,请重新输入").arg(keyIdTagList.join("."))); N_MessageBox::information(NULL,tr("消息"),tr("输出测点 %1 格式不正确,请重新输入").arg(keyIdTagList.join(".")));
return; return;
} }
QString tagName, tableName; QString tagName, tableName;
@ -63,12 +65,12 @@ void KbdApcDigWidget::changeProperty(KbdPropertyDlg &dlg, const QString &sqlName
KbdDbDesign ds; KbdDbDesign ds;
if(!ds.getThreeColumnResult(sql.arg(tableName).arg(tagName),locationIdList,subSystemList,descList)) if(!ds.getThreeColumnResult(sql.arg(tableName).arg(tagName),locationIdList,subSystemList,descList))
{ {
QMessageBox::information(NULL,tr("消息"),tr("数据库查询错误")); N_MessageBox::information(NULL,tr("消息"),tr("数据库查询错误"));
return; return;
} }
if(locationIdList.size() != 1 || subSystemList.size() != 1) if(locationIdList.size() != 1 || subSystemList.size() != 1)
{ {
QMessageBox::information(NULL,tr("消息"),tr("输出测点%1 不存在对应的车站和专业信息").arg(tagName)); N_MessageBox::information(NULL,tr("消息"),tr("输出测点%1 不存在对应的车站和专业信息").arg(tagName));
return; return;
} }
@ -120,9 +122,9 @@ void KbdApcDigWidget::onAddRow()
void KbdApcDigWidget::onRemoveRow() void KbdApcDigWidget::onRemoveRow()
{ {
if(QMessageBox::No == QMessageBox::information(this,tr("消息"), if(N_MessageBox::No == N_MessageBox::information(this,tr("消息"),
tr("是否删除?"), tr("是否删除?"),
QMessageBox::Yes,QMessageBox::No)) N_MessageBox::Yes,N_MessageBox::No))
return; return;
KbdTableModel *model = qobject_cast<KbdTableModel *>(m_table->model()); KbdTableModel *model = qobject_cast<KbdTableModel *>(m_table->model());
@ -202,21 +204,21 @@ void KbdApcDigWidget::onModifyRow()
void KbdApcDigWidget::onStartTransactionError(const QString&erroStr) void KbdApcDigWidget::onStartTransactionError(const QString&erroStr)
{ {
QMessageBox::information(this,tr("消息"),erroStr); N_MessageBox::information(this,tr("消息"),erroStr);
} }
void KbdApcDigWidget::onMsg(const QString &text) void KbdApcDigWidget::onMsg(const QString &text)
{ {
QMessageBox::information(this,tr("消息"),text); N_MessageBox::information(this,tr("消息"),text);
} }
void KbdApcDigWidget::onCommitError() void KbdApcDigWidget::onCommitError()
{ {
QMessageBox::information(this,tr("消息"),tr("此次修改失败,已启动回滚!")); N_MessageBox::information(this,tr("消息"),tr("此次修改失败,已启动回滚!"));
} }
void KbdApcDigWidget::onRollbackError() void KbdApcDigWidget::onRollbackError()
{ {
QMessageBox::information(this,tr("消息"),tr("回滚事务失败!")); N_MessageBox::information(this,tr("消息"),tr("回滚事务失败!"));
} }

View File

@ -9,7 +9,7 @@
#include "model_common/common.h" #include "model_common/common.h"
#include "kbdtable.h" #include "kbdtable.h"
#include "kbdtabledatamgr.h" #include "kbdtabledatamgr.h"
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include "kbdpropertydlg.h" #include "kbdpropertydlg.h"
#include "kbdpropertypanel.h" #include "kbdpropertypanel.h"
#include "kbdmsgcontrl.h" #include "kbdmsgcontrl.h"
@ -67,16 +67,22 @@ void KbdCtrlActWidget::initLayout()
mainLayout->addWidget(hSplitter); mainLayout->addWidget(hSplitter);
setLayout(mainLayout); setLayout(mainLayout);
bar1->setIconSize(QSize(24,24)); QAction* act = nullptr;
bar1->addAction(QIcon(":/icons/icons/new.png"),tr("添加记录"),this,SLOT(onAddTree())); act = bar1->addAction(tr("添加记录"),this,SLOT(onAddTree()));
bar1->addAction(QIcon(":/icons/icons/modify.png"),tr("修改记录"),this,SLOT(onModifyTree())); bar1->widgetForAction(act)->setObjectName("icon_add");
bar1->addAction(QIcon(":/icons/icons/delete.png"),tr("删除记录"),this,SLOT(onRemoveTree())); act = bar1->addAction(tr("修改记录"),this,SLOT(onModifyTree()));
bar1->widgetForAction(act)->setObjectName("icon_edit");
act = bar1->addAction(tr("删除记录"),this,SLOT(onRemoveTree()));
bar1->widgetForAction(act)->setObjectName("icon_delete");
bar2->setIconSize(QSize(24,24)); act = bar2->addAction(tr("添加记录"),this,SLOT(onAddTable()));
bar2->addAction(QIcon(":/icons/icons/new.png"),tr("添加记录"),this,SLOT(onAddTable())); bar2->widgetForAction(act)->setObjectName("icon_add");
bar2->addAction(QIcon(":/icons/icons/delete.png"),tr("删除记录"),m_table,SLOT(onRemoveRowNotCommit())); act = bar2->addAction(tr("删除记录"),m_table,SLOT(onRemoveRowNotCommit()));
bar2->addAction(QIcon(":/icons/icons/undo.png"),tr("撤销更改"),m_table,SLOT(onUndo())); bar2->widgetForAction(act)->setObjectName("icon_delete");
bar2->addAction(QIcon(":/icons/icons/save.png"),tr("保存"),this,SLOT(onSaveTable())); act = bar2->addAction(tr("撤销更改"),m_table,SLOT(onUndo()));
bar2->widgetForAction(act)->setObjectName("icon_undo");
act = bar2->addAction(tr("保存"),this,SLOT(onSaveTable()));
bar2->widgetForAction(act)->setObjectName("icon_save");
connect(m_tree,SIGNAL(clicked(const QModelIndex &)),this,SLOT(onTreeClick(const QModelIndex &))); connect(m_tree,SIGNAL(clicked(const QModelIndex &)),this,SLOT(onTreeClick(const QModelIndex &)));
connect(m_tree,SIGNAL(doubleClicked(const QModelIndex &)),this,SLOT(onModifyTree())); connect(m_tree,SIGNAL(doubleClicked(const QModelIndex &)),this,SLOT(onModifyTree()));
@ -348,18 +354,18 @@ void KbdCtrlActWidget::onSaveTable()
void KbdCtrlActWidget::onMsg(const QString &msg) void KbdCtrlActWidget::onMsg(const QString &msg)
{ {
QMessageBox::information(this,tr("消息"),msg); N_MessageBox::information(this,tr("消息"),msg);
} }
void KbdCtrlActWidget::onCommitError() void KbdCtrlActWidget::onCommitError()
{ {
QMessageBox::information(this,tr("消息"),tr("此次修改失败,已启动回滚!")); N_MessageBox::information(this,tr("消息"),tr("此次修改失败,已启动回滚!"));
} }
void KbdCtrlActWidget::onStartTransactionError(const QString&erroStr) void KbdCtrlActWidget::onStartTransactionError(const QString&erroStr)
{ {
QMessageBox::information(this,tr("消息"),erroStr); N_MessageBox::information(this,tr("消息"),erroStr);
} }

View File

@ -10,7 +10,7 @@
#include <QTextEdit> #include <QTextEdit>
#include <QPushButton> #include <QPushButton>
#include <QGroupBox> #include <QGroupBox>
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include "kbdtabledatamgr.h" #include "kbdtabledatamgr.h"
#include "kbdcheckrole.h" #include "kbdcheckrole.h"
#include "kbdmsgcontrl.h" #include "kbdmsgcontrl.h"
@ -50,10 +50,10 @@ void KbdLockDefineWidget::hideEvent(QHideEvent *event)
// QStringList oldDatas = model->getRowData(m_panel->currentRow()); // QStringList oldDatas = model->getRowData(m_panel->currentRow());
// if(!stringListEqual(panelDatas,oldDatas)) // if(!stringListEqual(panelDatas,oldDatas))
// { // {
// int ret = QMessageBox::information(this,tr("消息"), // int ret = N_MessageBox::information(this,tr("消息"),
// tr("闭锁函数修改未提交,是否提交到数据库?"), // tr("闭锁函数修改未提交,是否提交到数据库?"),
// QMessageBox::Yes,QMessageBox::No); // N_MessageBox::Yes,N_MessageBox::No);
// if(ret == QMessageBox::Yes) // if(ret == N_MessageBox::Yes)
// { // {
// onSave(); // onSave();
// } // }
@ -71,10 +71,13 @@ void KbdLockDefineWidget::initLayout()
QVBoxLayout *vLayoutTree = new QVBoxLayout; QVBoxLayout *vLayoutTree = new QVBoxLayout;
QToolBar *bar = new QToolBar(widgetTree); QToolBar *bar = new QToolBar(widgetTree);
bar->setIconSize(QSize(24,24)); QAction* act = nullptr;
bar->addAction(QIcon(":/icons/icons/new.png"),tr("添加"),this,SLOT(onAdd())); act = bar->addAction(tr("添加"),this,SLOT(onAdd()));
bar->addAction(QIcon(":/icons/icons/delete.png"),tr("删除"),this,SLOT(onRemove())); bar->widgetForAction(act)->setObjectName("icon_add");
bar->addAction(QIcon(":/icons/icons/modify.png"), tr("修改"), this, SLOT(onModify())); act = bar->addAction(tr("删除"),this,SLOT(onRemove()));
bar->widgetForAction(act)->setObjectName("icon_delete");
act = bar->addAction(tr("修改"), this, SLOT(onModify()));
bar->widgetForAction(act)->setObjectName("icon_edit");
m_tree = new KbdTreeView(widgetTree); m_tree = new KbdTreeView(widgetTree);
KbdSqlTreeModel *treeModel = new KbdSqlTreeModel(Common::getTreePath("lockDefineTree.xml"),this); KbdSqlTreeModel *treeModel = new KbdSqlTreeModel(Common::getTreePath("lockDefineTree.xml"),this);
@ -92,7 +95,8 @@ void KbdLockDefineWidget::initLayout()
QGroupBox *box = new QGroupBox(tr("闭锁函数定义"),widgetDetail); QGroupBox *box = new QGroupBox(tr("闭锁函数定义"),widgetDetail);
QHBoxLayout *boxLayout = new QHBoxLayout; QHBoxLayout *boxLayout = new QHBoxLayout;
m_te = new ScriptFormWidget(box); using namespace ScriptForm_lua;
m_te = new ScriptForm_lua::ScriptFormWidget(box);
boxLayout->addWidget(m_te); boxLayout->addWidget(m_te);
boxLayout->setMargin(0); boxLayout->setMargin(0);
box->setLayout(boxLayout); box->setLayout(boxLayout);
@ -307,10 +311,10 @@ void KbdLockDefineWidget::onTreeClicked(const QModelIndex &index)
QStringList oldDatas = model1->getRowData(m_panel->panel()->currentRow()); QStringList oldDatas = model1->getRowData(m_panel->panel()->currentRow());
if(!stringListEqual(panelDatas,oldDatas)) if(!stringListEqual(panelDatas,oldDatas))
{ {
int ret = QMessageBox::information(this,tr("消息"), int ret = N_MessageBox::information(this,tr("消息"),
tr("闭锁函数修改未提交,是否提交到数据库?"), tr("闭锁函数修改未提交,是否提交到数据库?"),
QMessageBox::Yes,QMessageBox::No); N_MessageBox::Yes,N_MessageBox::No);
if(ret == QMessageBox::Yes) if(ret == N_MessageBox::Yes)
{ {
onSave(); onSave();
} }
@ -345,18 +349,18 @@ void KbdLockDefineWidget::onTreeClicked(const QModelIndex &index)
void KbdLockDefineWidget::onMsg(const QString &msg) void KbdLockDefineWidget::onMsg(const QString &msg)
{ {
QMessageBox::information(this,tr("消息"),msg); N_MessageBox::information(this,tr("消息"),msg);
} }
void KbdLockDefineWidget::onCommitError() void KbdLockDefineWidget::onCommitError()
{ {
QMessageBox::information(this,tr("消息"),tr("此次修改失败,已启动回滚!")); N_MessageBox::information(this,tr("消息"),tr("此次修改失败,已启动回滚!"));
} }
void KbdLockDefineWidget::onStartTransactionError(const QString&erroStr) void KbdLockDefineWidget::onStartTransactionError(const QString&erroStr)
{ {
QMessageBox::information(this,tr("消息"),erroStr); N_MessageBox::information(this,tr("消息"),erroStr);
} }

View File

@ -2,11 +2,13 @@
#define KBDLOCKDEFINEWIDGET_H #define KBDLOCKDEFINEWIDGET_H
#include <QWidget> #include <QWidget>
#include "ScriptForm/ScriptForm.h"
class KbdPropertyDlg; class KbdPropertyDlg;
class QTextEdit; class QTextEdit;
class KbdTreeView; class KbdTreeView;
using namespace ScriptForm_lua;
class ScriptFormWidget; class ScriptFormWidget;
/** /**
@ -26,7 +28,7 @@ private:
private: private:
KbdTreeView *m_tree; KbdTreeView *m_tree;
KbdPropertyDlg *m_panel; KbdPropertyDlg *m_panel;
ScriptFormWidget* m_te; ScriptForm_lua::ScriptFormWidget* m_te;
private slots: private slots:
void onAdd(); void onAdd();

View File

@ -10,7 +10,7 @@
#include <QToolBar> #include <QToolBar>
#include "kbdselctlockparadlg.h" #include "kbdselctlockparadlg.h"
#include <QListWidget> #include <QListWidget>
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QGroupBox> #include <QGroupBox>
#include <QComboBox> #include <QComboBox>
@ -20,6 +20,7 @@
#include "CustomWidget/kbddevinstwidget.h" #include "CustomWidget/kbddevinstwidget.h"
#include "kbdtableproperty.h" #include "kbdtableproperty.h"
#include "CustomWidget/kbdsearchwidget.h" #include "CustomWidget/kbdsearchwidget.h"
#include "pub_widget/CustomDialog.h"
KbdLockParaWidget::KbdLockParaWidget(QWidget *parent) : QSplitter(parent) KbdLockParaWidget::KbdLockParaWidget(QWidget *parent) : QSplitter(parent)
{ {
@ -45,13 +46,18 @@ void KbdLockParaWidget::initLayout()
search->setPlaceholderText(tr("请输入DO描述关键字")); search->setPlaceholderText(tr("请输入DO描述关键字"));
search->setMaximumWidth(350); search->setMaximumWidth(350);
bar2->setIconSize(QSize(24,24)); QAction* act = nullptr;
bar2->addAction(QIcon(":/icons/icons/new.png"),tr("添加记录"),this,SLOT(onAddTable())); act = bar2->addAction(tr("添加记录"),this,SLOT(onAddTable()));
bar2->addAction(QIcon(":/icons/icons/modify.png"),tr("修改记录"),this,SLOT(onModifyTable())); bar2->widgetForAction(act)->setObjectName("icon_add");
bar2->addAction(QIcon(":/icons/icons/delete.png"),tr("删除记录"),this,SLOT(onRemoveTable())); act = bar2->addAction(tr("修改记录"),this,SLOT(onModifyTable()));
bar2->widgetForAction(act)->setObjectName("icon_edit");
act = bar2->addAction(tr("删除记录"),this,SLOT(onRemoveTable()));
bar2->widgetForAction(act)->setObjectName("icon_delete");
bar2->addSeparator(); bar2->addSeparator();
bar2->addAction(QIcon(":/icons/icons/Excel-export.png"),tr("Excel导出"),m_table->getTable(),SLOT(onExcelExport())); act = bar2->addAction(tr("Excel导出"),m_table->getTable(),SLOT(onExcelExport()));
bar2->addAction(QIcon(":/icons/icons/Excel-Impor.png"),tr("Excel导入"),m_table->getTable(),SLOT(onImportExcel())); bar2->widgetForAction(act)->setObjectName("icon_excel_export");
act = bar2->addAction(tr("Excel导入"),m_table->getTable(),SLOT(onImportExcel()));
bar2->widgetForAction(act)->setObjectName("icon_excel_import");
bar2->addSeparator(); bar2->addSeparator();
bar2->addWidget(search); bar2->addWidget(search);
@ -121,7 +127,8 @@ void KbdLockParaWidget::onAddTable()
wig->setPointTypeHide(0); wig->setPointTypeHide(0);
wig->setPointValueEnable(false); wig->setPointValueEnable(false);
QDialog dlg; CustomDialog dlg;
dlg.setWindowTitle(tr("添加闭锁参数配置"));
QHBoxLayout* hLayout = new QHBoxLayout; QHBoxLayout* hLayout = new QHBoxLayout;
hLayout->addWidget(wig); hLayout->addWidget(wig);
hLayout->setMargin(0); hLayout->setMargin(0);
@ -300,17 +307,17 @@ void KbdLockParaWidget::onTableSearch(QString text)
void KbdLockParaWidget::onMsg(const QString &msg) void KbdLockParaWidget::onMsg(const QString &msg)
{ {
QMessageBox::information(this,tr("消息"),msg); N_MessageBox::information(this,tr("消息"),msg);
} }
void KbdLockParaWidget::onCommitError() void KbdLockParaWidget::onCommitError()
{ {
QMessageBox::information(this,tr("消息"),tr("此次修改失败,已启动回滚!")); N_MessageBox::information(this,tr("消息"),tr("此次修改失败,已启动回滚!"));
} }
void KbdLockParaWidget::onStartTransactionError(const QString&erroStr) void KbdLockParaWidget::onStartTransactionError(const QString&erroStr)
{ {
QMessageBox::information(this,tr("消息"),erroStr); N_MessageBox::information(this,tr("消息"),erroStr);
} }

View File

@ -7,7 +7,7 @@
#include "model_common/common.h" #include "model_common/common.h"
#include "kbdtable.h" #include "kbdtable.h"
#include "kbdtabledatamgr.h" #include "kbdtabledatamgr.h"
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include "kbdpropertydlg.h" #include "kbdpropertydlg.h"
#include "kbdpropertypanel.h" #include "kbdpropertypanel.h"
#include <QJsonDocument> #include <QJsonDocument>
@ -50,9 +50,11 @@ void KbdOutLineWidget::initLayout()
QWidget *widgetTree = new QWidget(hSplitter); QWidget *widgetTree = new QWidget(hSplitter);
QVBoxLayout *vLayout1 = new QVBoxLayout; QVBoxLayout *vLayout1 = new QVBoxLayout;
QToolBar *bar1 = new QToolBar(widgetTree); QToolBar *bar1 = new QToolBar(widgetTree);
bar1->setIconSize(QSize(24,24)); QAction* act = nullptr;
bar1->addAction(QIcon(":/icons/icons/new.png"),tr("添加记录"),this,SLOT(onAddTree())); act = bar1->addAction(tr("添加记录"),this,SLOT(onAddTree()));
bar1->addAction(QIcon(":/icons/icons/delete.png"),tr("删除记录"),this,SLOT(onRemoveTree())); bar1->widgetForAction(act)->setObjectName("icon_add");
act = bar1->addAction(tr("删除记录"),this,SLOT(onRemoveTree()));
bar1->widgetForAction(act)->setObjectName("icon_delete");
m_tree = new KbdTreeView(widgetTree); m_tree = new KbdTreeView(widgetTree);
m_treeModel = new KbdSqlTreeModel("",this); m_treeModel = new KbdSqlTreeModel("",this);
@ -66,11 +68,14 @@ void KbdOutLineWidget::initLayout()
QVBoxLayout *vlayout2 = new QVBoxLayout; QVBoxLayout *vlayout2 = new QVBoxLayout;
QToolBar *bar2 = new QToolBar(widgetDetail); QToolBar *bar2 = new QToolBar(widgetDetail);
m_table = new KbdTable(widgetDetail,REWRITE_COMMIT); m_table = new KbdTable(widgetDetail,REWRITE_COMMIT);
bar2->setIconSize(QSize(24,24)); act = bar2->addAction(tr("添加记录"),this,SLOT(onAddTable()));
bar2->addAction(QIcon(":/icons/icons/new.png"),tr("添加记录"),this,SLOT(onAddTable())); bar2->widgetForAction(act)->setObjectName("icon_add");
bar2->addAction(QIcon(":/icons/icons/delete.png"),tr("删除记录"),m_table,SLOT(onRemoveRowNotCommit())); act = bar2->addAction(tr("删除记录"),m_table,SLOT(onRemoveRowNotCommit()));
bar2->addAction(QIcon(":/icons/icons/undo.png"),tr("撤销更改"),m_table,SLOT(onUndo())); bar2->widgetForAction(act)->setObjectName("icon_delete");
bar2->addAction(QIcon(":/icons/icons/save.png"),tr("保存"),this,SLOT(onSaveTable())); act = bar2->addAction(tr("撤销更改"),m_table,SLOT(onUndo()));
bar2->widgetForAction(act)->setObjectName("icon_undo");
act = bar2->addAction(tr("保存"),this,SLOT(onSaveTable()));
bar2->widgetForAction(act)->setObjectName("icon_save");
vlayout2->addWidget(bar2); vlayout2->addWidget(bar2);
vlayout2->addWidget(m_table); vlayout2->addWidget(m_table);
@ -208,16 +213,16 @@ void KbdOutLineWidget::onSaveTable()
void KbdOutLineWidget::onMsg(const QString &msg) void KbdOutLineWidget::onMsg(const QString &msg)
{ {
QMessageBox::information(this,tr("消息"),msg); N_MessageBox::information(this,tr("消息"),msg);
} }
void KbdOutLineWidget::onCommitError() void KbdOutLineWidget::onCommitError()
{ {
QMessageBox::information(this,tr("消息"),tr("此次修改失败,已启动回滚!")); N_MessageBox::information(this,tr("消息"),tr("此次修改失败,已启动回滚!"));
} }
void KbdOutLineWidget::onStartTransactionError(const QString&erroStr) void KbdOutLineWidget::onStartTransactionError(const QString&erroStr)
{ {
QMessageBox::information(this,tr("消息"),erroStr); N_MessageBox::information(this,tr("消息"),erroStr);
} }

View File

@ -9,10 +9,10 @@
#include <QLabel> #include <QLabel>
#include <QTimer> #include <QTimer>
#include <QRadioButton> #include <QRadioButton>
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include "kbddbdesign.h" #include "kbddbdesign.h"
KbdSelctLockParaDlg::KbdSelctLockParaDlg(QWidget *parent) : QDialog(parent) KbdSelctLockParaDlg::KbdSelctLockParaDlg(QWidget *parent) : CustomDialog(parent)
{ {
QStringList strList; QStringList strList;
strList << QString("sql@SELECT * FROM SYS_MODEL_LOCATION_INFO;%1:%2").arg(CN_LOCATION_ID).arg(CN_DESC) strList << QString("sql@SELECT * FROM SYS_MODEL_LOCATION_INFO;%1:%2").arg(CN_LOCATION_ID).arg(CN_DESC)
@ -131,7 +131,7 @@ void KbdSelctLockParaDlg::onSelectByLocationAndSubSystem()
QString pointDesc = m_findPointWidget->getSelectDescByIndex(6); QString pointDesc = m_findPointWidget->getSelectDescByIndex(6);
if(pointDesc.isEmpty()) if(pointDesc.isEmpty())
{ {
QMessageBox::information(this,tr("消息"),tr("请先选中测点")); N_MessageBox::information(this,tr("消息"),tr("请先选中测点"));
return; return;
} }

View File

@ -2,13 +2,14 @@
#define KBDSELCTLOCKPARADLG_H #define KBDSELCTLOCKPARADLG_H
#include <QDialog> #include <QDialog>
#include "pub_widget/CustomDialog.h"
class KbdFindPointWidget; class KbdFindPointWidget;
class QListWidget; class QListWidget;
class QLabel; class QLabel;
class QRadioButton; class QRadioButton;
class KbdSelctLockParaDlg : public QDialog class KbdSelctLockParaDlg : public CustomDialog
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -7,7 +7,7 @@
#include "model_common/common.h" #include "model_common/common.h"
#include "kbdtable.h" #include "kbdtable.h"
#include "kbdtabledatamgr.h" #include "kbdtabledatamgr.h"
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include "kbdpropertydlg.h" #include "kbdpropertydlg.h"
#include "kbdpropertypanel.h" #include "kbdpropertypanel.h"
#include "kbdmsgcontrl.h" #include "kbdmsgcontrl.h"
@ -64,15 +64,20 @@ void KbdStateTextWidget::initLayout()
mainLayout->addWidget(hSplitter); mainLayout->addWidget(hSplitter);
setLayout(mainLayout); setLayout(mainLayout);
bar1->setIconSize(QSize(24,24)); QAction* act = nullptr;
bar1->addAction(QIcon(":/icons/icons/new.png"),tr("添加记录"),this,SLOT(onAddTree())); act = bar1->addAction(QIcon(":/icons/icons/new.png"),tr("添加记录"),this,SLOT(onAddTree()));
bar1->addAction(QIcon(":/icons/icons/delete.png"),tr("删除记录"),this,SLOT(onRemoveTree())); bar1->widgetForAction(act)->setObjectName("icon_add");
act = bar1->addAction(QIcon(":/icons/icons/delete.png"),tr("删除记录"),this,SLOT(onRemoveTree()));
bar1->widgetForAction(act)->setObjectName("icon_delete");
bar2->setIconSize(QSize(24,24)); act = bar2->addAction(QIcon(":/icons/icons/new.png"),tr("添加记录"),this,SLOT(onAddTable()));
bar2->addAction(QIcon(":/icons/icons/new.png"),tr("添加记录"),this,SLOT(onAddTable())); bar2->widgetForAction(act)->setObjectName("icon_add");
bar2->addAction(QIcon(":/icons/icons/delete.png"),tr("删除记录"),m_table,SLOT(onRemoveRowNotCommit())); act = bar2->addAction(QIcon(":/icons/icons/delete.png"),tr("删除记录"),m_table,SLOT(onRemoveRowNotCommit()));
bar2->addAction(QIcon(":/icons/icons/undo.png"),tr("撤销更改"),m_table,SLOT(onUndo())); bar2->widgetForAction(act)->setObjectName("icon_delete");
bar2->addAction(QIcon(":/icons/icons/save.png"),tr("保存"),this,SLOT(onSaveTable())); act = bar2->addAction(QIcon(":/icons/icons/undo.png"),tr("撤销更改"),m_table,SLOT(onUndo()));
bar2->widgetForAction(act)->setObjectName("icon_undo");
act = bar2->addAction(QIcon(":/icons/icons/save.png"),tr("保存"),this,SLOT(onSaveTable()));
bar2->widgetForAction(act)->setObjectName("icon_save");
connect(m_tree,SIGNAL(clicked(const QModelIndex &)),this,SLOT(onTreeClick(const QModelIndex &))); connect(m_tree,SIGNAL(clicked(const QModelIndex &)),this,SLOT(onTreeClick(const QModelIndex &)));
@ -240,18 +245,18 @@ void KbdStateTextWidget::onSaveTable()
void KbdStateTextWidget::onMsg(const QString &msg) void KbdStateTextWidget::onMsg(const QString &msg)
{ {
QMessageBox::information(this,tr("消息"),msg); N_MessageBox::information(this,tr("消息"),msg);
} }
void KbdStateTextWidget::onCommitError() void KbdStateTextWidget::onCommitError()
{ {
QMessageBox::information(this,tr("消息"),tr("此次修改失败,已启动回滚!")); N_MessageBox::information(this,tr("消息"),tr("此次修改失败,已启动回滚!"));
} }
void KbdStateTextWidget::onStartTransactionError(const QString&erroStr) void KbdStateTextWidget::onStartTransactionError(const QString&erroStr)
{ {
QMessageBox::information(this,tr("消息"),erroStr); N_MessageBox::information(this,tr("消息"),erroStr);
} }

View File

@ -36,11 +36,11 @@ PLATFORM_INCLUDE_PATH = $$SRC_ROOT_PATH/../../platform/src/include/
INCLUDEPATH += $$PWD\ INCLUDEPATH += $$PWD\
$$PLATFORM_INCLUDE_PATH/tools/model_common \ $$PLATFORM_INCLUDE_PATH/tools/model_common \
$$PLATFORM_INCLUDE_PATH/tools/model_table \ $$PLATFORM_INCLUDE_PATH/tools/model_table \
$$PLATFORM_INCLUDE_PATH/tools/model_excel/xlsx $$PLATFORM_INCLUDE_PATH/public/pub_excel/xlsx
LIBS += -lmodel_common -lmodel_excel LIBS += -lmodel_common -lpub_excel -lpub_widget
LIBS += -lmodel_table -lScriptForm_lua -lcalc_lua_api LIBS += -lmodel_table -lScriptForm_lua -lcalc_lua_api
HEADERS += \ HEADERS += \
@ -51,5 +51,5 @@ SOURCES += \
expressionpluginwidget.cpp \ expressionpluginwidget.cpp \
expressionwidget.cpp expressionwidget.cpp
TRANSLATIONS += expression_plugin_EN.ts

View File

@ -1,6 +1,12 @@
#include "expressionpluginwidget.h" #include "expressionpluginwidget.h"
#include "expressionwidget.h" #include "expressionwidget.h"
#include <QTranslator>
#include <QWidget>
#include <QApplication>
#include "../model_common/common.h"
#include "pub_widget/PubWidgetInit.h"
ExpressionPluginWidget::ExpressionPluginWidget(QObject *parent) : QObject(parent) ExpressionPluginWidget::ExpressionPluginWidget(QObject *parent) : QObject(parent)
{ {
@ -15,6 +21,12 @@ bool ExpressionPluginWidget::createWidget(QWidget *parent, bool editMode, QWidge
{ {
Q_UNUSED(ptrVec) Q_UNUSED(ptrVec)
Q_UNUSED(editMode) Q_UNUSED(editMode)
QTranslator * qtTranslator = new QTranslator;
qtTranslator->load(Common::getTranslatePath("expression_plugin_EN.qm"));
qApp->installTranslator(qtTranslator);
iot_public::installTranslator(Common::getLanguage().toStdString());
ExpressionWidget *pWidget = new ExpressionWidget(parent); ExpressionWidget *pWidget = new ExpressionWidget(parent);
*widget = (QWidget *)pWidget; *widget = (QWidget *)pWidget;
*pTrendWindow = (IPluginWidget *)pWidget; *pTrendWindow = (IPluginWidget *)pWidget;

View File

@ -7,7 +7,7 @@
class ExpressionPluginWidget : public QObject, public CPluginWidgetInterface class ExpressionPluginWidget : public QObject, public CPluginWidgetInterface
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "kbd.PluginWidgetInterface/1.0") Q_PLUGIN_METADATA(IID HMI_WidgetPlugin_IID)
Q_INTERFACES(CPluginWidgetInterface) Q_INTERFACES(CPluginWidgetInterface)
public: public:

View File

@ -17,7 +17,7 @@
#include <QComboBox> #include <QComboBox>
#include "kbddbdesign.h" #include "kbddbdesign.h"
#include "kbdpropertydlg.h" #include "kbdpropertydlg.h"
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include "kbdmsgcontrl.h" #include "kbdmsgcontrl.h"
#include "../../../include/tools/calc_lua_api/CCalcLua.h" #include "../../../include/tools/calc_lua_api/CCalcLua.h"
#include "ScriptForm/ScriptForm.h" #include "ScriptForm/ScriptForm.h"
@ -30,6 +30,8 @@ ExpressionWidget::ExpressionWidget(QWidget *parent) : KbdWidget(parent)
void ExpressionWidget::initLayout() void ExpressionWidget::initLayout()
{ {
QVBoxLayout *mainLayout = new QVBoxLayout;
QHBoxLayout *hLayout = new QHBoxLayout; QHBoxLayout *hLayout = new QHBoxLayout;
QSplitter *splitter = new QSplitter(Qt::Horizontal,this); QSplitter *splitter = new QSplitter(Qt::Horizontal,this);
@ -37,17 +39,25 @@ void ExpressionWidget::initLayout()
m_tree = new KbdTreeView(splitter); m_tree = new KbdTreeView(splitter);
m_tree->setModel(m_treeModel); m_tree->setModel(m_treeModel);
m_tree->setHeaderVisible(false); m_tree->setHeaderVisible(false);
m_tree->hide(); //把树隐藏使用tabbar代替
splitter->addWidget(m_tree); splitter->addWidget(m_tree);
//因为借用了m_treeModel的解析数据所以tabbar初始化必须放在m_treeModel后面
m_mainTabBar = initMainTabBar(m_treeModel);
mainLayout->addWidget(m_mainTabBar);
m_stack = new QStackedWidget(splitter); m_stack = new QStackedWidget(splitter);
initStack(); initStack();
splitter->addWidget(m_stack); splitter->addWidget(m_stack);
splitter->setSizes(QList<int>()<<100<<800); splitter->setSizes(QList<int>()<<100<<800);
hLayout->addWidget(splitter); hLayout->addWidget(splitter);
this->setLayout(hLayout);
mainLayout->addLayout(hLayout);
this->setLayout(mainLayout);
connect(m_tree,SIGNAL(clicked(const QModelIndex &)),this,SLOT(onLeftTreeClick(const QModelIndex &))); connect(m_tree,SIGNAL(clicked(const QModelIndex &)),this,SLOT(onLeftTreeClick(const QModelIndex &)));
connect(m_mainTabBar,SIGNAL(currentChanged(int)),this,SLOT(onMainTabBarCurrentChanged(int)));
} }
void ExpressionWidget::initStack() void ExpressionWidget::initStack()
@ -65,12 +75,16 @@ QWidget *ExpressionWidget::initGroupWidget()
QVBoxLayout *vLayout1 = new QVBoxLayout; QVBoxLayout *vLayout1 = new QVBoxLayout;
QToolBar *bar = new QToolBar(widget); QToolBar *bar = new QToolBar(widget);
m_tableGroup = new KbdTable(widget,REWRITE_COMMIT); m_tableGroup = new KbdTable(widget,REWRITE_COMMIT);
bar->setIconSize(QSize(24,24)); QAction* act = nullptr;
act = bar->addAction(tr("添加记录"),this,SLOT(onAddGroup()));
bar->widgetForAction(act)->setObjectName("icon_add");
act = bar->addAction(tr("删除记录"),this,SLOT(onRemoveGroup()));
bar->widgetForAction(act)->setObjectName("icon_delete");
act = bar->addAction(tr("撤销更改"),m_tableGroup,SLOT(onUndo()));
bar->widgetForAction(act)->setObjectName("icon_undo");
act = bar->addAction(tr("保存"),this,SLOT(onSaveGroup()));
bar->widgetForAction(act)->setObjectName("icon_save");
bar->addAction(QIcon(":/icons/icons/new.png"),tr("添加记录"),this,SLOT(onAddGroup()));
bar->addAction(QIcon(":/icons/icons/delete.png"),tr("删除记录"),this,SLOT(onRemoveGroup()));
bar->addAction(QIcon(":/icons/icons/undo.png"),tr("撤销更改"),m_tableGroup,SLOT(onUndo()));
bar->addAction(QIcon(":/icons/icons/save.png"),tr("保存"),this,SLOT(onSaveGroup()));
vLayout1->addWidget(bar); vLayout1->addWidget(bar);
vLayout1->addWidget(m_tableGroup); vLayout1->addWidget(m_tableGroup);
vLayout1->setMargin(0); vLayout1->setMargin(0);
@ -89,9 +103,11 @@ QWidget *ExpressionWidget::initFuncWidget()
QVBoxLayout *vLayoutTree = new QVBoxLayout; QVBoxLayout *vLayoutTree = new QVBoxLayout;
QToolBar *bar = new QToolBar(widgetTree); QToolBar *bar = new QToolBar(widgetTree);
bar->setIconSize(QSize(24,24)); QAction* act = nullptr;
bar->addAction(QIcon(":/icons/icons/new.png"),tr("添加"),this,SLOT(onAddFunc())); act = bar->addAction(tr("添加"),this,SLOT(onAddFunc()));
bar->addAction(QIcon(":/icons/icons/delete.png"),tr("删除"),this,SLOT(onRemoveFunc())); bar->widgetForAction(act)->setObjectName("icon_add");
act = bar->addAction(tr("删除"),this,SLOT(onRemoveFunc()));
bar->widgetForAction(act)->setObjectName("icon_delete");
m_treeFunc = new KbdTreeView(widgetTree); m_treeFunc = new KbdTreeView(widgetTree);
KbdSqlTreeModel *treeModel = new KbdSqlTreeModel(Common::getTreePath("calcFunc.xml"),this); KbdSqlTreeModel *treeModel = new KbdSqlTreeModel(Common::getTreePath("calcFunc.xml"),this);
@ -110,7 +126,7 @@ QWidget *ExpressionWidget::initFuncWidget()
QGroupBox *box = new QGroupBox(tr("函数定义"),widgetDetail); QGroupBox *box = new QGroupBox(tr("函数定义"),widgetDetail);
QHBoxLayout *boxLayout = new QHBoxLayout; QHBoxLayout *boxLayout = new QHBoxLayout;
m_teFunc = new ScriptFormWidget(box); m_teFunc = new ScriptForm_lua::ScriptFormWidget(box);
boxLayout->addWidget(m_teFunc); boxLayout->addWidget(m_teFunc);
box->setLayout(boxLayout); box->setLayout(boxLayout);
@ -146,10 +162,13 @@ QWidget *ExpressionWidget::initParamWidget()
m_cbSubSystem = new QComboBox(widgetLeft); m_cbSubSystem = new QComboBox(widgetLeft);
m_cbSubSystem->setView(new QListView); m_cbSubSystem->setView(new QListView);
QToolBar *barleft = new QToolBar(widgetLeft); QToolBar *barleft = new QToolBar(widgetLeft);
barleft->setIconSize(QSize(24,24)); QAction* act = nullptr;
barleft->addAction(QIcon(":/icons/icons/new.png"),tr("添加记录"),this,SLOT(onAddOutPut())); act = barleft->addAction(tr("添加记录"),this,SLOT(onAddOutPut()));
barleft->addAction(QIcon(":/icons/icons/modify.png"),tr("修改记录"),this,SLOT(onModifyOutPut())); barleft->widgetForAction(act)->setObjectName("icon_add");
barleft->addAction(QIcon(":/icons/icons/delete.png"),tr("删除记录"),this,SLOT(onRemoveOutPut())); act = barleft->addAction(tr("修改记录"),this,SLOT(onModifyOutPut()));
barleft->widgetForAction(act)->setObjectName("icon_edit");
act = barleft->addAction(tr("删除记录"),this,SLOT(onRemoveOutPut()));
barleft->widgetForAction(act)->setObjectName("icon_delete");
QGroupBox *box = new QGroupBox(tr("计算输出点列表"),widgetLeft); QGroupBox *box = new QGroupBox(tr("计算输出点列表"),widgetLeft);
QVBoxLayout *vl = new QVBoxLayout; QVBoxLayout *vl = new QVBoxLayout;
@ -174,11 +193,14 @@ QWidget *ExpressionWidget::initParamWidget()
QVBoxLayout *vLayoutRight = new QVBoxLayout; QVBoxLayout *vLayoutRight = new QVBoxLayout;
QToolBar *barRight = new QToolBar(widgetRight); QToolBar *barRight = new QToolBar(widgetRight);
m_tableInput = new KbdTable(box,REWRITE_COMMIT); m_tableInput = new KbdTable(box,REWRITE_COMMIT);
barRight->setIconSize(QSize(24,24)); act = barRight->addAction(tr("添加记录"),this,SLOT(onAddInput()));
barRight->addAction(QIcon(":/icons/icons/new.png"),tr("添加记录"),this,SLOT(onAddInput())); barRight->widgetForAction(act)->setObjectName("icon_add");
barRight->addAction(QIcon(":/icons/icons/delete.png"),tr("删除记录"),m_tableInput,SLOT(onRemoveRowNotCommit())); act = barRight->addAction(tr("删除记录"),m_tableInput,SLOT(onRemoveRowNotCommit()));
barRight->addAction(QIcon(":/icons/icons/undo.png"),tr("撤销更改"),m_tableInput,SLOT(onUndo())); barRight->widgetForAction(act)->setObjectName("icon_delete");
barRight->addAction(QIcon(":/icons/icons/save.png"),tr("保存"),this,SLOT(onSaveInput())); act = barRight->addAction(tr("撤销更改"),m_tableInput,SLOT(onUndo()));
barRight->widgetForAction(act)->setObjectName("icon_undo");
act = barRight->addAction(tr("保存更改"),this,SLOT(onSaveInput()));
barRight->widgetForAction(act)->setObjectName("icon_save");
box = new QGroupBox(tr("输入变量列表"),widgetLeft); box = new QGroupBox(tr("输入变量列表"),widgetLeft);
vl = new QVBoxLayout; vl = new QVBoxLayout;
@ -234,6 +256,9 @@ void ExpressionWidget::initData()
} }
} }
//默认展示第一个tab
m_mainTabBar->setCurrentIndex(0);
onMainTabBarCurrentChanged(0);
} }
void ExpressionWidget::reloadListWidget(QListWidget *listWidget, const QList<QListWidgetItem *> &items) void ExpressionWidget::reloadListWidget(QListWidget *listWidget, const QList<QListWidgetItem *> &items)
@ -271,6 +296,23 @@ bool ExpressionWidget::getLocationInfo(const QString &keyIdTag, QString &locatio
return false; return false;
} }
QTabBar *ExpressionWidget::initMainTabBar(const KbdSqlTreeModel *pModel)
{
QTabBar *mainTabBar = new QTabBar;
mainTabBar->setObjectName("expressionMainTabBar");
mainTabBar->setExpanding(false);
for(int i = 0;i < pModel->rowCount();i++)
{
QStandardItem *item = pModel->item(i,0);
mainTabBar->addTab(item->icon(),item->text());
mainTabBar->setTabData(i,item->data(Common::ClickRole));
}
return mainTabBar;
}
void ExpressionWidget::onLeftTreeClick(const QModelIndex &index) void ExpressionWidget::onLeftTreeClick(const QModelIndex &index)
{ {
if(!index.isValid()) if(!index.isValid())
@ -302,6 +344,11 @@ void ExpressionWidget::onLeftTreeClick(const QModelIndex &index)
m_stack->setCurrentIndex(m_stack->count() - 1); m_stack->setCurrentIndex(m_stack->count() - 1);
} }
void ExpressionWidget::onMainTabBarCurrentChanged(int index)
{
onLeftTreeClick(m_treeModel->index(index,0));
}
void ExpressionWidget::onAddGroup() void ExpressionWidget::onAddGroup()
{ {
KbdTableModel *model = qobject_cast<KbdTableModel *>(m_tableGroup->model()); KbdTableModel *model = qobject_cast<KbdTableModel *>(m_tableGroup->model());
@ -547,6 +594,7 @@ void ExpressionWidget::onAddOutPut()
return; return;
KbdPropertyDlg dlg(false, this); KbdPropertyDlg dlg(false, this);
dlg.setWindowTitle(tr("新增计算输出点"));
dlg.panel()->setDisplayRow(model,model->rowCount()); dlg.panel()->setDisplayRow(model,model->rowCount());
if(dlg.exec() == QDialog::Rejected) if(dlg.exec() == QDialog::Rejected)
@ -607,6 +655,7 @@ void ExpressionWidget::onModifyOutPut()
} }
KbdPropertyDlg dlg(false, this); KbdPropertyDlg dlg(false, this);
dlg.setWindowTitle(tr("修改计算输出点"));
dlg.panel()->setDisplayRow(model,0); dlg.panel()->setDisplayRow(model,0);
if(dlg.exec() == QDialog::Rejected) if(dlg.exec() == QDialog::Rejected)

View File

@ -6,6 +6,7 @@
#endif #endif
#include "kbdwidget.h" #include "kbdwidget.h"
#include "ScriptForm/ScriptForm.h"
class KbdSqlTreeModel; class KbdSqlTreeModel;
class KbdTreeView; class KbdTreeView;
@ -16,6 +17,9 @@ class QTextEdit;
class QComboBox; class QComboBox;
class QListWidget; class QListWidget;
class QListWidgetItem; class QListWidgetItem;
class QTabBar;
using namespace ScriptForm_lua;
class ScriptFormWidget; class ScriptFormWidget;
class ExpressionWidget : public KbdWidget class ExpressionWidget : public KbdWidget
@ -40,18 +44,22 @@ private:
KbdTreeView *m_treeFunc; KbdTreeView *m_treeFunc;
KbdPropertyPanel *m_panelFunc; KbdPropertyPanel *m_panelFunc;
ScriptFormWidget* m_teFunc; ScriptForm_lua::ScriptFormWidget* m_teFunc;
QComboBox *m_cbLocation; QComboBox *m_cbLocation;
QComboBox *m_cbSubSystem; QComboBox *m_cbSubSystem;
QListWidget * m_listOutPut; QListWidget * m_listOutPut;
KbdTable *m_tableInput; KbdTable *m_tableInput;
QTabBar *m_mainTabBar;
void reloadListWidget(QListWidget *listWidget, const QList<QListWidgetItem *> &items); void reloadListWidget(QListWidget *listWidget, const QList<QListWidgetItem *> &items);
bool getLocationInfo(const QString &keyIdTag,QString &locationId,QString &subSystem); bool getLocationInfo(const QString &keyIdTag,QString &locationId,QString &subSystem);
QTabBar* initMainTabBar(const KbdSqlTreeModel *pModel);
private slots: private slots:
void onLeftTreeClick(const QModelIndex &index); void onLeftTreeClick(const QModelIndex &index);
void onMainTabBarCurrentChanged(int index);
void onAddGroup(); void onAddGroup();
void onRemoveGroup(); void onRemoveGroup();

View File

@ -10,7 +10,7 @@
#include <QGroupBox> #include <QGroupBox>
#include <QDateEdit> #include <QDateEdit>
#include <QTimeEdit> #include <QTimeEdit>
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include <QTimer> #include <QTimer>
#include <QProgressDialog> #include <QProgressDialog>
#include <QFile> #include <QFile>
@ -238,7 +238,7 @@ void IPSettingWidget::onShowModifyResult(QString result)
} }
if(result.contains("Network")) if(result.contains("Network"))
{ {
QMessageBox::information(this,tr("消息"),tr("修改网口参数成功")); N_MessageBox::information(this,tr("消息"),tr("修改网口参数成功"));
m_timer->start(3000); m_timer->start(3000);
if(!m_progressBar) if(!m_progressBar)
@ -262,7 +262,7 @@ void IPSettingWidget::onShowModifyResult(QString result)
} }
if(result.contains("Time")) if(result.contains("Time"))
{ {
QMessageBox::information(this,tr("消息"),tr("修改管理机时间成功")); N_MessageBox::information(this,tr("消息"),tr("修改管理机时间成功"));
setOptEnable(true); setOptEnable(true);
} }
} }
@ -277,7 +277,7 @@ void IPSettingWidget::onUpdateProgress()
{ {
m_timer->stop(); m_timer->stop();
m_progressBar->hide(); m_progressBar->hide();
QMessageBox::information(this,tr("消息"),tr("重启超时,请检查设备")); N_MessageBox::information(this,tr("消息"),tr("重启超时,请检查设备"));
} }
} }
m_Pcs->findPcsDevice(m_strRebootDev); m_Pcs->findPcsDevice(m_strRebootDev);

View File

@ -7,7 +7,7 @@
class IPSettingPluginWidget : public QObject, public CPluginWidgetInterface class IPSettingPluginWidget : public QObject, public CPluginWidgetInterface
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "kbd.PluginWidgetInterface/1.0") Q_PLUGIN_METADATA(IID HMI_WidgetPlugin_IID)
Q_INTERFACES(CPluginWidgetInterface) Q_INTERFACES(CPluginWidgetInterface)
public: public:

View File

@ -48,3 +48,4 @@ LIBS += \
-lpub_utility_api \ -lpub_utility_api \
-llog4cplus \ -llog4cplus \
-lpub_logger_api -lpub_logger_api
LIBS += -lpub_widget

View File

@ -7,7 +7,7 @@
class ScreenBrightnessSettingPluginWidget : public QObject, public CPluginWidgetInterface class ScreenBrightnessSettingPluginWidget : public QObject, public CPluginWidgetInterface
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "kbd.PluginWidgetInterface/1.0") Q_PLUGIN_METADATA(IID HMI_WidgetPlugin_IID)
Q_INTERFACES(CPluginWidgetInterface) Q_INTERFACES(CPluginWidgetInterface)
public: public:

View File

@ -42,6 +42,7 @@ INCLUDEPATH += $$PWD\
LIBS += -lmodel_common -lmodel_excel LIBS += -lmodel_common -lmodel_excel
LIBS += -lmodel_table -ldb_base_api LIBS += -lmodel_table -ldb_base_api
LIBS += -lpub_widget
HEADERS += \ HEADERS += \
kbdpointdlg.h \ kbdpointdlg.h \
@ -57,5 +58,7 @@ SOURCES += \
staticswidget.cpp \ staticswidget.cpp \
statlinkinstdlg.cpp statlinkinstdlg.cpp
TRANSLATIONS += statics_analysis_EN.ts

View File

@ -8,8 +8,9 @@
#include "kbddbdesign.h" #include "kbddbdesign.h"
#include <QMimeData> #include <QMimeData>
KbdPointDlg::KbdPointDlg(QWidget *parent) : QDialog(parent) KbdPointDlg::KbdPointDlg(QWidget *parent) : CustomDialog(parent)
{ {
setWindowTitle(tr("选择测点"));
initLayout(); initLayout();
initData(); initData();
} }

View File

@ -3,12 +3,13 @@
#include <QDialog> #include <QDialog>
#include <QListWidget> #include <QListWidget>
#include "pub_widget/CustomDialog.h"
class QComboBox; class QComboBox;
class QLineEdit; class QLineEdit;
class MyPointListWidget; class MyPointListWidget;
class MyDevListWidget; class MyDevListWidget;
class KbdPointDlg : public QDialog class KbdPointDlg : public CustomDialog
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -7,7 +7,7 @@
class StaticsPluginWidget : public QObject, public CPluginWidgetInterface class StaticsPluginWidget : public QObject, public CPluginWidgetInterface
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "kbd.PluginWidgetInterface/1.0") Q_PLUGIN_METADATA(IID HMI_WidgetPlugin_IID)
Q_INTERFACES(CPluginWidgetInterface) Q_INTERFACES(CPluginWidgetInterface)
public: public:

View File

@ -16,7 +16,7 @@
#include <QToolBar> #include <QToolBar>
#include "kbdtabledatamgr.h" #include "kbdtabledatamgr.h"
#include "kbddbdesign.h" #include "kbddbdesign.h"
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include <QMenu> #include <QMenu>
#include "kbdcheckrole.h" #include "kbdcheckrole.h"
#include <QComboBox> #include <QComboBox>
@ -28,6 +28,8 @@
#include "statlinkinstdlg.h" #include "statlinkinstdlg.h"
#include <QMimeData> #include <QMimeData>
#include "kbdtable.h" #include "kbdtable.h"
#include <QTranslator>
#include "pub_widget/PubWidgetInit.h"
#define CLK_STATICS_TEMP "CLK_STATICS_TEMP" #define CLK_STATICS_TEMP "CLK_STATICS_TEMP"
#define CLK_STATICS_INST "CLK_STATICS_INST" #define CLK_STATICS_INST "CLK_STATICS_INST"
@ -41,6 +43,7 @@
StaticsWidget::StaticsWidget(QWidget *parent) : KbdWidget(parent) StaticsWidget::StaticsWidget(QWidget *parent) : KbdWidget(parent)
{ {
loadTranslate();
initLayout(); initLayout();
initMenu(); initMenu();
initData(); initData();
@ -53,21 +56,47 @@ StaticsWidget::~StaticsWidget()
void StaticsWidget::initLayout() void StaticsWidget::initLayout()
{ {
QVBoxLayout *mainLayout = new QVBoxLayout;
QHBoxLayout *hLayout = new QHBoxLayout; QHBoxLayout *hLayout = new QHBoxLayout;
QSplitter *hSplitter = new QSplitter(Qt::Horizontal,this); QSplitter *hSplitter = new QSplitter(Qt::Horizontal,this);
m_tree = new KbdTreeView(hSplitter); m_tree = new KbdTreeView(hSplitter);
m_tree->setHeaderVisible(false); m_tree->setHeaderVisible(false);
m_treeModel = new KbdSqlTreeModel(Common::getTreePath("staticsTree.xml"),this); m_treeModel = new KbdSqlTreeModel(Common::getTreePath("staticsTree.xml"),this);
m_tree->setModel(m_treeModel); m_tree->setModel(m_treeModel);
m_tree->hide(); //把树隐藏使用tabbar代替
hSplitter->addWidget(m_tree); hSplitter->addWidget(m_tree);
//因为借用了m_treeModel的解析数据所以tabbar初始化必须放在m_treeModel后面
m_mainTabBar = initMainTabBar(m_treeModel);
mainLayout->addWidget(m_mainTabBar);
m_stackForTree = new QStackedWidget(hSplitter); m_stackForTree = new QStackedWidget(hSplitter);
initStackWidget(); initStackWidget();
hSplitter->addWidget(m_stackForTree); hSplitter->addWidget(m_stackForTree);
hSplitter->setSizes(QList<int>()<<100<<1000); hSplitter->setSizes(QList<int>()<<100<<1000);
hLayout->addWidget(hSplitter); hLayout->addWidget(hSplitter);
this->setLayout(hLayout);
mainLayout->addLayout(hLayout);
this->setLayout(mainLayout);
}
QTabBar *StaticsWidget::initMainTabBar(const KbdSqlTreeModel *pModel)
{
QTabBar *mainTabBar = new QTabBar;
mainTabBar->setObjectName("staticsMainTabBar");
mainTabBar->setExpanding(false);
for(int i = 0;i < pModel->rowCount();i++)
{
QStandardItem *item = pModel->item(i,0);
mainTabBar->addTab(item->icon(),item->text());
mainTabBar->setTabData(i,item->data(Common::ClickRole));
}
return mainTabBar;
} }
void StaticsWidget::initStackWidget() void StaticsWidget::initStackWidget()
@ -84,11 +113,14 @@ QWidget *StaticsWidget::initFuncTempWidget()
QWidget *widgetLeft = new QWidget(hSplitter); QWidget *widgetLeft = new QWidget(hSplitter);
QToolBar *bar = new QToolBar(widgetLeft); QToolBar *bar = new QToolBar(widgetLeft);
bar->setIconSize(QSize(24,24)); QAction* act = nullptr;
bar->addAction(QIcon(":/icons/icons/new.png"),tr("添加记录"),this,SLOT(onAddFuncTemp())); act = bar->addAction(tr("添加记录"),this,SLOT(onAddFuncTemp()));
bar->addAction(QIcon(":/icons/icons/modify.png"),tr("修改记录"),this,SLOT(onModifyFuncTemp())); bar->widgetForAction(act)->setObjectName("icon_add");
act = bar->addAction(tr("修改记录"),this,SLOT(onModifyFuncTemp()));
bar->widgetForAction(act)->setObjectName("icon_edit");
bar->addSeparator(); bar->addSeparator();
bar->addAction(QIcon(":/icons/icons/delete.png"),tr("删除记录"),this,SLOT(onRemoveFuncTemp())); act = bar->addAction(tr("删除记录"),this,SLOT(onRemoveFuncTemp()));
bar->widgetForAction(act)->setObjectName("icon_delete");
m_listFuncTemp = new QListWidget(widgetLeft); m_listFuncTemp = new QListWidget(widgetLeft);
@ -191,12 +223,15 @@ QWidget *StaticsWidget::initInstWidget()
QToolBar *bar = new QToolBar(widgetLeft); QToolBar *bar = new QToolBar(widgetLeft);
bar->setIconSize(QSize(24,24)); QAction* act = nullptr;
bar->addAction(QIcon(":/icons/icons/new.png"),tr("添加记录"),this,SLOT(onAddFuncInst())); act = bar->addAction(tr("添加记录"),this,SLOT(onAddFuncInst()));
bar->addAction(QIcon(":/icons/icons/modify.png"),tr("修改记录"),this,SLOT(onModifyFuncInst())); bar->widgetForAction(act)->setObjectName("icon_add");
act = bar->addAction(tr("修改记录"),this,SLOT(onModifyFuncInst()));
bar->widgetForAction(act)->setObjectName("icon_edit");
bar->addSeparator(); bar->addSeparator();
bar->addAction(QIcon(":/icons/icons/delete.png"),tr("删除记录"),this,SLOT(onRemoveFuncInst())); act = bar->addAction(tr("删除记录"),this,SLOT(onRemoveFuncInst()));
bar->addAction(tr("禁用所有统计实例"),this,SLOT(onForbiddenInsts())); bar->widgetForAction(act)->setObjectName("icon_delete");
act = bar->addAction(tr("禁用所有统计实例"),this,SLOT(onForbiddenInsts()));
m_listFuncInst = new MyStatInstListWidget(widgetLeft); m_listFuncInst = new MyStatInstListWidget(widgetLeft);
m_listFuncInst->setAcceptDrops(true); m_listFuncInst->setAcceptDrops(true);
@ -266,11 +301,14 @@ QWidget *StaticsWidget::initLinkWidget()
QWidget *widgetLeft = new QWidget(hSplitter); QWidget *widgetLeft = new QWidget(hSplitter);
QToolBar *bar = new QToolBar(widgetLeft); QToolBar *bar = new QToolBar(widgetLeft);
bar->setIconSize(QSize(24,24)); QAction* act = nullptr;
bar->addAction(QIcon(":/icons/icons/new.png"),tr("添加记录"),this,SLOT(onAddLinkTemp())); act = bar->addAction(tr("添加记录"),this,SLOT(onAddLinkTemp()));
bar->addAction(QIcon(":/icons/icons/modify.png"),tr("修改记录"),this,SLOT(onModifyLinkTemp())); bar->widgetForAction(act)->setObjectName("icon_add");
act = bar->addAction(tr("修改记录"),this,SLOT(onModifyLinkTemp()));
bar->widgetForAction(act)->setObjectName("icon_edit");
bar->addSeparator(); bar->addSeparator();
bar->addAction(QIcon(":/icons/icons/delete.png"),tr("删除记录"),this,SLOT(onRemoveLinkTemp())); act = bar->addAction(tr("删除记录"),this,SLOT(onRemoveLinkTemp()));
bar->widgetForAction(act)->setObjectName("icon_delete");
m_listLinkTemp = new QListWidget(widgetLeft); m_listLinkTemp = new QListWidget(widgetLeft);
@ -287,11 +325,13 @@ QWidget *StaticsWidget::initLinkWidget()
QGroupBox* box = new QGroupBox(tr("输入参数关联"),widgetRight); QGroupBox* box = new QGroupBox(tr("输入参数关联"),widgetRight);
bar = new QToolBar(this); bar = new QToolBar(this);
bar->setIconSize(QSize(24,24)); act = bar->addAction(tr("添加记录"),this,SLOT(onAddLinkInputTable()));
bar->addAction(QIcon(":/icons/icons/new.png"),tr("添加记录"),this,SLOT(onAddLinkInputTable())); bar->widgetForAction(act)->setObjectName("icon_add");
bar->addAction(QIcon(":/icons/icons/modify.png"),tr("修改记录"),this,SLOT(onModifyLinkInputTable())); act = bar->addAction(tr("修改记录"),this,SLOT(onModifyLinkInputTable()));
bar->widgetForAction(act)->setObjectName("icon_edit");
bar->addSeparator(); bar->addSeparator();
bar->addAction(QIcon(":/icons/icons/delete.png"),tr("删除记录"),this,SLOT(onRemoveLinkInputTable())); act = bar->addAction(tr("删除记录"),this,SLOT(onRemoveLinkInputTable()));
bar->widgetForAction(act)->setObjectName("icon_delete");
m_TableLinkInput = new KbdTable(this); m_TableLinkInput = new KbdTable(this);
QVBoxLayout *vLayout = new QVBoxLayout; QVBoxLayout *vLayout = new QVBoxLayout;
@ -302,11 +342,13 @@ QWidget *StaticsWidget::initLinkWidget()
box = new QGroupBox(tr("输出参数关联"),widgetRight); box = new QGroupBox(tr("输出参数关联"),widgetRight);
bar = new QToolBar(this); bar = new QToolBar(this);
bar->setIconSize(QSize(24,24)); act = bar->addAction(tr("添加记录"),this,SLOT(onAddLinkOutputTable()));
bar->addAction(QIcon(":/icons/icons/new.png"),tr("添加记录"),this,SLOT(onAddLinkOutputTable())); bar->widgetForAction(act)->setObjectName("icon_add");
bar->addAction(QIcon(":/icons/icons/modify.png"),tr("修改记录"),this,SLOT(onModifyLinkOutputTable())); act = bar->addAction(tr("修改记录"),this,SLOT(onModifyLinkOutputTable()));
bar->widgetForAction(act)->setObjectName("icon_edit");
bar->addSeparator(); bar->addSeparator();
bar->addAction(QIcon(":/icons/icons/delete.png"),tr("删除记录"),this,SLOT(onRemoveLinkOutputTable())); act = bar->addAction(tr("删除记录"),this,SLOT(onRemoveLinkOutputTable()));
bar->widgetForAction(act)->setObjectName("icon_delete");
m_TableLinkOutput = new KbdTable(this); m_TableLinkOutput = new KbdTable(this);
vLayout = new QVBoxLayout; vLayout = new QVBoxLayout;
@ -423,6 +465,7 @@ void StaticsWidget::initData()
connect(m_teFuncOutputTemp,&QTextEdit::customContextMenuRequested,[&]{m_menuFuncReturn->exec(QCursor::pos());}); connect(m_teFuncOutputTemp,&QTextEdit::customContextMenuRequested,[&]{m_menuFuncReturn->exec(QCursor::pos());});
connect(m_teFuncInputTemp,&QTextEdit::customContextMenuRequested,[&]{m_menuFuncHead->exec(QCursor::pos());}); connect(m_teFuncInputTemp,&QTextEdit::customContextMenuRequested,[&]{m_menuFuncHead->exec(QCursor::pos());});
connect(m_tree,SIGNAL(clicked(const QModelIndex &)),this,SLOT(onLeftTreeClick(const QModelIndex &))); connect(m_tree,SIGNAL(clicked(const QModelIndex &)),this,SLOT(onLeftTreeClick(const QModelIndex &)));
connect(m_mainTabBar,SIGNAL(currentChanged(int)),this,SLOT(onMainTabBarCurrentChanged(int)));
connect(m_listFuncTemp,SIGNAL(doubleClicked(const QModelIndex &)),this,SLOT(onModifyFuncTemp())); connect(m_listFuncTemp,SIGNAL(doubleClicked(const QModelIndex &)),this,SLOT(onModifyFuncTemp()));
connect(m_listFuncInst,SIGNAL(doubleClicked(const QModelIndex &)),this,SLOT(onModifyFuncInst())); connect(m_listFuncInst,SIGNAL(doubleClicked(const QModelIndex &)),this,SLOT(onModifyFuncInst()));
connect(m_listFuncTemp,SIGNAL(clicked(const QModelIndex &)),this,SLOT(onListFuncTempClicked())); connect(m_listFuncTemp,SIGNAL(clicked(const QModelIndex &)),this,SLOT(onListFuncTempClicked()));
@ -453,6 +496,17 @@ void StaticsWidget::initData()
connect(m_TableLinkOutput->model(), SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), m_TableLinkOutput, SLOT(resizeColumnsToContents())); connect(m_TableLinkOutput->model(), SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), m_TableLinkOutput, SLOT(resizeColumnsToContents()));
//默认展示第一个tab
m_mainTabBar->setCurrentIndex(0);
onMainTabBarCurrentChanged(0);
}
void StaticsWidget::loadTranslate()
{
QTranslator * qtTranslator = new QTranslator;
qtTranslator->load(Common::getTranslatePath("statics_analysis_EN.qm"));
qApp->installTranslator(qtTranslator);
iot_public::installTranslator(Common::getLanguage().toStdString());
} }
void StaticsWidget::addListItem(QListWidget *list, const QString &tag, const QString &desc) void StaticsWidget::addListItem(QListWidget *list, const QString &tag, const QString &desc)
@ -970,6 +1024,11 @@ void StaticsWidget::onLeftTreeClick(const QModelIndex &index)
m_stackForTree->setCurrentIndex(m_stackForTree->count() - 1); m_stackForTree->setCurrentIndex(m_stackForTree->count() - 1);
} }
void StaticsWidget::onMainTabBarCurrentChanged(int index)
{
onLeftTreeClick(m_treeModel->index(index,0));
}
void StaticsWidget::onAddFuncTemp() void StaticsWidget::onAddFuncTemp()
{ {
KbdTableModel *modelFuncTemp = KbdTableDataMgr::getInstance()->createModel(TBL_STAT_TEMPLATE_DEF); KbdTableModel *modelFuncTemp = KbdTableDataMgr::getInstance()->createModel(TBL_STAT_TEMPLATE_DEF);
@ -977,6 +1036,7 @@ void StaticsWidget::onAddFuncTemp()
return; return;
KbdPropertyDlg dlg(false, this); KbdPropertyDlg dlg(false, this);
dlg.setWindowTitle(tr("新增统计模板"));
dlg.panel()->setDisplayRow(modelFuncTemp,modelFuncTemp->rowCount()); dlg.panel()->setDisplayRow(modelFuncTemp,modelFuncTemp->rowCount());
if(dlg.exec() == QDialog::Rejected) if(dlg.exec() == QDialog::Rejected)
@ -1031,6 +1091,7 @@ void StaticsWidget::onModifyFuncTemp()
if(retStr.isEmpty()) if(retStr.isEmpty())
{ {
KbdPropertyDlg dlg(true, this); KbdPropertyDlg dlg(true, this);
dlg.setWindowTitle(tr("修改统计模板"));
dlg.panel()->setDisplayRow(modelFuncTemp,0); dlg.panel()->setDisplayRow(modelFuncTemp,0);
if(dlg.exec()) if(dlg.exec())
{ {
@ -1327,6 +1388,7 @@ void StaticsWidget::onAddLinkTemp()
return; return;
KbdPropertyDlg dlg(false, this); KbdPropertyDlg dlg(false, this);
dlg.setWindowTitle(tr("新增统计关联"));
dlg.panel()->setDisplayRow(modelLinkTemp,0); dlg.panel()->setDisplayRow(modelLinkTemp,0);
if(dlg.exec() == QDialog::Rejected) if(dlg.exec() == QDialog::Rejected)
return; return;
@ -1380,6 +1442,7 @@ void StaticsWidget::onModifyLinkTemp()
if(retStr.isEmpty()) if(retStr.isEmpty())
{ {
KbdPropertyDlg dlg(true, this); KbdPropertyDlg dlg(true, this);
dlg.setWindowTitle(tr("修改统计关联"));
dlg.panel()->setDisplayRow(modelLinkTemp,0); dlg.panel()->setDisplayRow(modelLinkTemp,0);
//不允许切换模板 //不允许切换模板
@ -1763,6 +1826,7 @@ void StaticsWidget::onAddFuncInst()
return; return;
KbdPropertyDlg dlg(false, this); KbdPropertyDlg dlg(false, this);
dlg.setWindowTitle(tr("新增统计实例"));
connect(dlg.panel(),&KbdPropertyPanel::signalPropertyChanged, connect(dlg.panel(),&KbdPropertyPanel::signalPropertyChanged,
[&dlg](const QString &sqlName, const QString &text) [&dlg](const QString &sqlName, const QString &text)
{ {
@ -1844,6 +1908,7 @@ void StaticsWidget::onModifyFuncInst()
} }
KbdPropertyDlg dlg(false, this); KbdPropertyDlg dlg(false, this);
dlg.setWindowTitle(tr("修改统计实例"));
connect(dlg.panel(),&KbdPropertyPanel::signalPropertyChanged, connect(dlg.panel(),&KbdPropertyPanel::signalPropertyChanged,
[&dlg](const QString &sqlName, const QString &text) [&dlg](const QString &sqlName, const QString &text)
{ {
@ -1999,6 +2064,7 @@ void StaticsWidget::onAddLinkInputTable()
if(retStr.isEmpty()) if(retStr.isEmpty())
{ {
KbdPropertyDlg dlg(false, this); KbdPropertyDlg dlg(false, this);
dlg.setWindowTitle(tr("新增输入参数"));
dlg.panel()->setDisplayRow(model,model->rowCount()); dlg.panel()->setDisplayRow(model,model->rowCount());
dlg.panel()->setPropertyValue(CN_LINK_TAG,devTag); dlg.panel()->setPropertyValue(CN_LINK_TAG,devTag);
dlg.panel()->setDotStringPrefix(CN_TAG_NAME,item->data(Qt::UserRole).toString()); dlg.panel()->setDotStringPrefix(CN_TAG_NAME,item->data(Qt::UserRole).toString());
@ -2038,6 +2104,7 @@ void StaticsWidget::onModifyLinkInputTable()
if(retStr.isEmpty()) if(retStr.isEmpty())
{ {
KbdPropertyDlg dlg(false, this); KbdPropertyDlg dlg(false, this);
dlg.setWindowTitle(tr("修改输入参数"));
dlg.panel()->setDisplayRow(model,index.row()); dlg.panel()->setDisplayRow(model,index.row());
if(dlg.exec()) if(dlg.exec())
@ -2115,6 +2182,7 @@ void StaticsWidget::onAddLinkOutputTable()
if(retStr.isEmpty()) if(retStr.isEmpty())
{ {
KbdPropertyDlg dlg(false, this); KbdPropertyDlg dlg(false, this);
dlg.setWindowTitle(tr("新增输出参数"));
dlg.panel()->setDisplayRow(model,model->rowCount()); dlg.panel()->setDisplayRow(model,model->rowCount());
dlg.panel()->setPropertyValue(CN_LINK_TAG,devTag); dlg.panel()->setPropertyValue(CN_LINK_TAG,devTag);
dlg.panel()->setDotStringPrefix(CN_TAG_NAME,item->data(Qt::UserRole).toString()); dlg.panel()->setDotStringPrefix(CN_TAG_NAME,item->data(Qt::UserRole).toString());
@ -2154,6 +2222,7 @@ void StaticsWidget::onModifyLinkOutputTable()
if(retStr.isEmpty()) if(retStr.isEmpty())
{ {
KbdPropertyDlg dlg(false, this); KbdPropertyDlg dlg(false, this);
dlg.setWindowTitle(tr("修改输出参数"));
dlg.panel()->setDisplayRow(model,index.row()); dlg.panel()->setDisplayRow(model,index.row());
if(dlg.exec()) if(dlg.exec())
@ -4517,10 +4586,10 @@ void StaticsWidget::onDropDevToInst(int index, const QStringList &itemDevs)
qDebug()<<"strSrc:"<<strDevTag; qDebug()<<"strSrc:"<<strDevTag;
qDebug()<<"strDst:"<<strInstTag; qDebug()<<"strDst:"<<strInstTag;
if(QMessageBox::No == QMessageBox::information(this,tr("消息"), if(N_MessageBox::No == N_MessageBox::information(this,tr("消息"),
tr("%1 与 %2 进行绑定?").arg(item->text()).arg(list.at(2)), tr("%1 与 %2 进行绑定?").arg(item->text()).arg(list.at(2)),
QMessageBox::Yes, N_MessageBox::Yes,
QMessageBox::No)) N_MessageBox::No))
return; return;

View File

@ -20,7 +20,7 @@ class QTreeView;
class KbdTableModel; class KbdTableModel;
class MyStatInstListWidget; class MyStatInstListWidget;
class KbdTable; class KbdTable;
class QTabBar;
class StaticsWidget : public KbdWidget class StaticsWidget : public KbdWidget
{ {
@ -31,12 +31,14 @@ public:
private: private:
void initLayout(); void initLayout();
QTabBar* initMainTabBar(const KbdSqlTreeModel *pModel);
void initStackWidget(); void initStackWidget();
QWidget *initFuncTempWidget();//模板控件 QWidget *initFuncTempWidget();//模板控件
QWidget *initInstWidget();//实例控件 QWidget *initInstWidget();//实例控件
QWidget *initLinkWidget();//关联控件 QWidget *initLinkWidget();//关联控件
void initMenu(); void initMenu();
void initData(); void initData();
void loadTranslate();
void addListItem(QListWidget *list, const QString &tag,const QString &desc); void addListItem(QListWidget *list, const QString &tag,const QString &desc);
void reloadListItem(QListWidget *list, const QList<QListWidgetItem *> &items); void reloadListItem(QListWidget *list, const QList<QListWidgetItem *> &items);
@ -67,6 +69,7 @@ private:
bool isExistLinkInst(const QString &linkTag); bool isExistLinkInst(const QString &linkTag);
private slots: private slots:
void onLeftTreeClick(const QModelIndex &index); void onLeftTreeClick(const QModelIndex &index);
void onMainTabBarCurrentChanged(int index);
void onAddFuncTemp(); void onAddFuncTemp();
void onModifyFuncTemp(); void onModifyFuncTemp();
@ -161,6 +164,8 @@ private:
//树形控件 //树形控件
KbdTreeView *m_tree; KbdTreeView *m_tree;
KbdSqlTreeModel* m_treeModel; KbdSqlTreeModel* m_treeModel;
QTabBar *m_mainTabBar;
//堆栈控件 //堆栈控件
QStackedWidget *m_stackForTree; QStackedWidget *m_stackForTree;

View File

@ -7,7 +7,7 @@
#include <QGridLayout> #include <QGridLayout>
#include <QSplitter> #include <QSplitter>
#include "kbddbdesign.h" #include "kbddbdesign.h"
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include <QTimer> #include <QTimer>
#include <QDesktopWidget> #include <QDesktopWidget>
#include <QPushButton> #include <QPushButton>
@ -31,12 +31,12 @@
StatLinkInstDlg::StatLinkInstDlg(QWidget *parent, QString strInstTag, QString strInstDesc): StatLinkInstDlg::StatLinkInstDlg(QWidget *parent, QString strInstTag, QString strInstDesc):
QDialog(parent), CustomDialog(parent),
m_strDestInstTag(strInstTag), m_strDestInstTag(strInstTag),
m_strDestInstDesc(strInstDesc), m_strDestInstDesc(strInstDesc),
m_emCurDevDest(EmNone) m_emCurDevDest(EmNone)
{ {
setWindowTitle(tr("统计关联"));
this->setMinimumWidth(900); this->setMinimumWidth(900);
this->setMinimumHeight(500); this->setMinimumHeight(500);
initLayout(); initLayout();
@ -68,10 +68,10 @@ void StatLinkInstDlg::onClose()
void StatLinkInstDlg::onStartLink() void StatLinkInstDlg::onStartLink()
{ {
if(QMessageBox::No == QMessageBox::information(this,tr("消息"), if(N_MessageBox::No == N_MessageBox::information(this,tr("消息"),
tr("是否开始关联统计实例[ %1 ]\n这将清空现有的参数组的子参数以及参数的测点绑定").arg(m_strDestInstDesc), tr("是否开始关联统计实例[ %1 ]\n这将清空现有的参数组的子参数以及参数的测点绑定").arg(m_strDestInstDesc),
QMessageBox::Yes, N_MessageBox::Yes,
QMessageBox::No)) N_MessageBox::No))
{ {
return; return;
} }
@ -338,20 +338,20 @@ void StatLinkInstDlg::onLinkPara()
QTreeWidgetItem* item = paraTree->currentItem(); QTreeWidgetItem* item = paraTree->currentItem();
if(isItemGrp(item)) if(isItemGrp(item))
{ {
if(QMessageBox::No == QMessageBox::information(this,tr("消息"), if(N_MessageBox::No == N_MessageBox::information(this,tr("消息"),
tr("开始关联统计实例[ %1 ]\n这将清空与[ %2 ]有关的参数组下的子参数和关联\n是否继续").arg(m_strDestInstDesc).arg(item->text(0)), tr("开始关联统计实例[ %1 ]\n这将清空与[ %2 ]有关的参数组下的子参数和关联\n是否继续").arg(m_strDestInstDesc).arg(item->text(0)),
QMessageBox::Yes, N_MessageBox::Yes,
QMessageBox::No)) N_MessageBox::No))
{ {
return; return;
} }
} }
else else
{ {
if(QMessageBox::No == QMessageBox::information(this,tr("消息"), if(N_MessageBox::No == N_MessageBox::information(this,tr("消息"),
tr("开始关联统计实例[ %1 ]\n这将清空[ %2 ]有关的关联和\n是否继续").arg(m_strDestInstDesc).arg(item->text(0)), tr("开始关联统计实例[ %1 ]\n这将清空[ %2 ]有关的关联和\n是否继续").arg(m_strDestInstDesc).arg(item->text(0)),
QMessageBox::Yes, N_MessageBox::Yes,
QMessageBox::No)) N_MessageBox::No))
{ {
return; return;
} }
@ -387,20 +387,20 @@ void StatLinkInstDlg::onLinkRet()
QTreeWidgetItem* item = retTree->currentItem(); QTreeWidgetItem* item = retTree->currentItem();
if(isItemGrp(item)) if(isItemGrp(item))
{ {
if(QMessageBox::No == QMessageBox::information(this,tr("消息"), if(N_MessageBox::No == N_MessageBox::information(this,tr("消息"),
tr("开始关联统计实例[ %1 ]\n这将清空与[ %2 ]有关的参数组下的子参数和关联\n是否继续").arg(m_strDestInstDesc).arg(item->text(0)), tr("开始关联统计实例[ %1 ]\n这将清空与[ %2 ]有关的参数组下的子参数和关联\n是否继续").arg(m_strDestInstDesc).arg(item->text(0)),
QMessageBox::Yes, N_MessageBox::Yes,
QMessageBox::No)) N_MessageBox::No))
{ {
return; return;
} }
} }
else else
{ {
if(QMessageBox::No == QMessageBox::information(this,tr("消息"), if(N_MessageBox::No == N_MessageBox::information(this,tr("消息"),
tr("开始关联统计实例[ %1 ]\n这将清空[ %2 ]有关的关联和\n是否继续").arg(m_strDestInstDesc).arg(item->text(0)), tr("开始关联统计实例[ %1 ]\n这将清空[ %2 ]有关的关联和\n是否继续").arg(m_strDestInstDesc).arg(item->text(0)),
QMessageBox::Yes, N_MessageBox::Yes,
QMessageBox::No)) N_MessageBox::No))
{ {
return; return;
} }
@ -793,29 +793,17 @@ void StatLinkInstDlg::addRow2RetMap(int row, QWidget *retTree)
void StatLinkInstDlg::onMsg(const QString &text) void StatLinkInstDlg::onMsg(const QString &text)
{ {
QMessageBox m( QMessageBox::Information, tr("消息"),text, QMessageBox::NoButton, this ); N_MessageBox::information(this,tr("消息"),text );
if(isInit == true)
m.exec();
else
{
QSize mSize = m.sizeHint(); // here's what you want, not m.width()/height()
QRect screenRect = QDesktopWidget().screen()->rect();
m.move( QPoint( screenRect.width()/2 - mSize.width()/2,
screenRect.height()/2 - mSize.height()/2 ) );
m.exec();
}
} }
void StatLinkInstDlg::onCommitError() void StatLinkInstDlg::onCommitError()
{ {
QMessageBox::information(this,tr("消息"),tr("此次修改失败,已启动回滚!")); N_MessageBox::information(this,tr("消息"),tr("此次修改失败,已启动回滚!"));
} }
void StatLinkInstDlg::onStartTransactionError(const QString &erroStr) void StatLinkInstDlg::onStartTransactionError(const QString &erroStr)
{ {
QMessageBox::information(this,tr("消息"),erroStr); N_MessageBox::information(this,tr("消息"),erroStr);
} }
QString StatLinkInstDlg::getFirstTag(const QString &str, const QString &separater) QString StatLinkInstDlg::getFirstTag(const QString &str, const QString &separater)

View File

@ -9,10 +9,10 @@
#include <QGroupBox> #include <QGroupBox>
#include <QLabel> #include <QLabel>
#include "kbdwidget.h" #include "kbdwidget.h"
#include "pub_widget/CustomDialog.h"
class StatLinkInstDlg : public CustomDialog
class StatLinkInstDlg : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -7,7 +7,7 @@
class SystemConfigPluginWidget : public QObject, public CPluginWidgetInterface class SystemConfigPluginWidget : public QObject, public CPluginWidgetInterface
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "kbd.PluginWidgetInterface/1.0") Q_PLUGIN_METADATA(IID HMI_WidgetPlugin_IID)
Q_INTERFACES(CPluginWidgetInterface) Q_INTERFACES(CPluginWidgetInterface)
public: public:

View File

@ -40,6 +40,8 @@ INCLUDEPATH += $$PWD\
LIBS += -lmodel_common -lmodel_excel -lboost_system -lpub_utility_api LIBS += -lmodel_common -lmodel_excel -lboost_system -lpub_utility_api
LIBS += -lmodel_table -llibcfgtool -llog4cplus -lpub_logger_api LIBS += -lmodel_table -llibcfgtool -llog4cplus -lpub_logger_api
LIBS += -lpub_widget
HEADERS += \ HEADERS += \
iec61850InstPluginWidget.h \ iec61850InstPluginWidget.h \

View File

@ -24,7 +24,7 @@
#include <QFile> #include <QFile>
#include <QDesktopServices> #include <QDesktopServices>
#include <QDebug> #include <QDebug>
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include <QHeaderView> #include <QHeaderView>
#include <QCheckBox> #include <QCheckBox>
#include <QDialogButtonBox> #include <QDialogButtonBox>
@ -50,7 +50,7 @@ kbdInst61850DevWizard::kbdInst61850DevWizard(QWidget *parent) : QWizard(parent)
connect(m_SecondInstWizardPage,&kbdSecondInstWizardPage::sigMsg,this,&kbdInst61850DevWizard::onMsg); connect(m_SecondInstWizardPage,&kbdSecondInstWizardPage::sigMsg,this,&kbdInst61850DevWizard::onMsg);
connect(m_ThirdInstWizardPage,&kbdThirdInstWizardPage::sigMsg,this,&kbdInst61850DevWizard::onMsg); connect(m_ThirdInstWizardPage,&kbdThirdInstWizardPage::sigMsg,this,&kbdInst61850DevWizard::onMsg);
connect(m_firstInstWizardPage->m_LinEdit,&QLineEdit::textChanged,this,&kbdInst61850DevWizard::onCfgFilePathChange); connect(m_firstInstWizardPage->m_LinEdit,&QLineEdit::textChanged,this,&kbdInst61850DevWizard::onCfgFilePathChange);
resize(1000,610); resize(1080,610);
} }
void kbdInst61850DevWizard::onCurrentIdChanged(int id) void kbdInst61850DevWizard::onCurrentIdChanged(int id)
@ -86,6 +86,17 @@ bool kbdInst61850DevWizard::validateCurrentPage()
addPage(m_ThirdInstWizardPage); addPage(m_ThirdInstWizardPage);
} }
if(m_SecondInstWizardPage->m_InstType == Update)
{
m_SecondInstWizardPage->m_pOnlyUpdate61850->show();
m_SecondInstWizardPage->m_bOnlyUpdate61850 = m_SecondInstWizardPage->m_pOnlyUpdate61850->isChecked();
}
else
{
m_SecondInstWizardPage->m_pOnlyUpdate61850->hide();
m_SecondInstWizardPage->m_bOnlyUpdate61850 = false;
}
return m_SecondInstWizardPage->onUpdataTable(); return m_SecondInstWizardPage->onUpdataTable();
} }
else if(currentId() == 2) else if(currentId() == 2)
@ -154,10 +165,13 @@ void kbdInst61850DevWizard::accept()
break; break;
} }
if(!creatDevGrp()) if(!m_SecondInstWizardPage->m_bOnlyUpdate61850)
{ {
m_errorMsg = tr("创建设备组失败!"); if(!creatDevGrp())//todo:caodingfa更新时前面将设备组都删除了
break; {
m_errorMsg = tr("创建设备组失败!");
break;
}
} }
//开启实例化 //开启实例化
@ -520,6 +534,12 @@ bool kbdInst61850DevWizard::creatDevGrp()
for(auto iterGrp = m_listGrpInfo.begin();iterGrp!=m_listGrpInfo.end();iterGrp++) for(auto iterGrp = m_listGrpInfo.begin();iterGrp!=m_listGrpInfo.end();iterGrp++)
{ {
QString strTagName = locationTag + "." + iterGrp->at(0); QString strTagName = locationTag + "." + iterGrp->at(0);
//如果已经存在设备组,跳过,用来实现不同套件创建到同一个设备组下
if(m_SecondInstWizardPage->m_mapExistDevGrp2PluginName.contains(strTagName))
{
continue;
}
QString strDesCol = iterGrp->at(1); QString strDesCol = iterGrp->at(1);
QString rtuTag = iterGrp->at(2); QString rtuTag = iterGrp->at(2);
@ -584,7 +604,12 @@ void kbdInst61850DevWizard::inst61850Dev()
FesDevDesList << iter.value().at(i).at(4); FesDevDesList << iter.value().at(i).at(4);
rtuTagList << iter.value().at(i).at(6); rtuTagList << iter.value().at(i).at(6);
} }
w.instPluginByFesDev(pluginName,rtuTagList,devGrpList,FesDevTagList,FesDevDesList);
if(!m_SecondInstWizardPage->m_bOnlyUpdate61850)
{
w.instPluginByFesDev(pluginName,rtuTagList,devGrpList,FesDevTagList,FesDevDesList);
}
sigInst61850DevProcess(process++); sigInst61850DevProcess(process++);
} }
@ -635,7 +660,7 @@ bool kbdInst61850DevWizard::set61850Cfg()
void kbdInst61850DevWizard::onMsg(const QString &text) void kbdInst61850DevWizard::onMsg(const QString &text)
{ {
QMessageBox::information(this,tr("消息"),text); N_MessageBox::information(this,tr("消息"),text);
} }
void kbdInst61850DevWizard::onCfgFilePathChange() void kbdInst61850DevWizard::onCfgFilePathChange()
@ -787,6 +812,11 @@ void kbdSecondInstWizardPage::initLayout()
HLayout->addWidget(m_cbRegion); HLayout->addWidget(m_cbRegion);
HLayout->addSpacing(50); HLayout->addSpacing(50);
m_pOnlyUpdate61850 = new QCheckBox(tr("只更新61850"),this);
m_pOnlyUpdate61850->setChecked(true);
HLayout->addWidget(m_pOnlyUpdate61850);
m_bOnlyUpdate61850 = m_pOnlyUpdate61850->isChecked();
QPushButton* btnSelectAll = new QPushButton(tr("全选"),this); QPushButton* btnSelectAll = new QPushButton(tr("全选"),this);
HLayout->addWidget(btnSelectAll); HLayout->addWidget(btnSelectAll);
@ -829,6 +859,10 @@ void kbdSecondInstWizardPage::initLayout()
connect(btnSelectOver,&QPushButton::clicked,this,&kbdSecondInstWizardPage::onSelectOver); connect(btnSelectOver,&QPushButton::clicked,this,&kbdSecondInstWizardPage::onSelectOver);
connect(m_refresh,&QPushButton::clicked,this,&kbdSecondInstWizardPage::onUpdataTable); connect(m_refresh,&QPushButton::clicked,this,&kbdSecondInstWizardPage::onUpdataTable);
connect(m_tableCfgInfo,&QTableWidget::itemChanged,this,&kbdSecondInstWizardPage::onUpdateIP); connect(m_tableCfgInfo,&QTableWidget::itemChanged,this,&kbdSecondInstWizardPage::onUpdateIP);
// QCheckBox 在状态改变时会发送一个 stateChanged 信号,该信号有一个参数 state
connect(m_pOnlyUpdate61850, &QCheckBox::stateChanged, [=](int state){
m_bOnlyUpdate61850 = m_pOnlyUpdate61850->isChecked();
});
} }
void kbdSecondInstWizardPage::initData() void kbdSecondInstWizardPage::initData()
@ -1431,7 +1465,17 @@ void kbdSecondInstWizardPage::delete61850Device(EM_INST_TYPE type)
QStringList listError; QStringList listError;
for(int i = 0;i < m_listFesTag.size();i++) for(int i = 0;i < m_listFesTag.size();i++)
{ {
listSql << QString("delete from dev_group where TAG_NAME = '%1';").arg(m_listFesTag.at(i).first()); //在map中存在表示原来的设备组已经存在所以删除时只删除设备组下对应的设备原来的保持不动
if(m_mapExistDevGrp2PluginName.contains(m_listFesTag.at(i).first()))
{
QString strDevGrp = m_listFesTag.at(i).first();
QString strPluginName = m_mapExistDevGrp2PluginName[m_listFesTag.at(i).first()];
listSql << QString("delete from dev_info where TAG_NAME in (SELECT concat('%1_',temp_name) FROM temp_plugin_fes_dev_map WHERE plugin_name='%2');").arg(strDevGrp).arg(strPluginName);
}
else
{
listSql << QString("delete from dev_group where TAG_NAME = '%1';").arg(m_listFesTag.at(i).first());
}
if(type == Delele) if(type == Delele)
{ {
@ -1454,7 +1498,11 @@ void kbdSecondInstWizardPage::delete61850Device(EM_INST_TYPE type)
} }
} }
KbdTableDataMgr::getInstance()->executeOnly(listSql); if(!m_bOnlyUpdate61850)
{
KbdTableDataMgr::getInstance()->executeOnly(listSql);
}
m_CfgModel->delete61850Device(listFesTag,listError); m_CfgModel->delete61850Device(listFesTag,listError);
} }
@ -1476,13 +1524,14 @@ bool kbdSecondInstWizardPage::checkDevGrp()
return false; return false;
} }
m_mapExistDevGrp2PluginName.clear();
m_listFesTag.clear(); m_listFesTag.clear();
m_listIedName.clear(); m_listIedName.clear();
QStringList listFesDevGrp; QStringList listFesDevGrp;
for(int i = 0;i < m_tableCfgInfo->rowCount();i++) for(int i = 0;i < m_tableCfgInfo->rowCount();i++)
{ {
QString devGrpTag,fesGrpTag, chanTag, RTUTag; QString pluginLable,devGrpTag,fesGrpTag, chanTag, RTUTag;
QTableWidgetItem* item = m_tableCfgInfo->item(i,0); QTableWidgetItem* item = m_tableCfgInfo->item(i,0);
if(item->checkState() == Qt::Unchecked) if(item->checkState() == Qt::Unchecked)
@ -1490,6 +1539,9 @@ bool kbdSecondInstWizardPage::checkDevGrp()
item = m_tableCfgInfo->item(i,1); item = m_tableCfgInfo->item(i,1);
m_listIedName << item->text(); m_listIedName << item->text();
item = m_tableCfgInfo->item(i,2);
pluginLable = item->data(Qt::UserRole).toString();
item = m_tableCfgInfo->item(i,3); item = m_tableCfgInfo->item(i,3);
devGrpTag = item->text(); devGrpTag = item->text();
@ -1506,6 +1558,9 @@ bool kbdSecondInstWizardPage::checkDevGrp()
<< locationTagName + "." + subSystemTag + "." + chanTag + "." + RTUTag << locationTagName + "." + subSystemTag + "." + chanTag << locationTagName + "." + subSystemTag + "." + chanTag + "." + RTUTag << locationTagName + "." + subSystemTag + "." + chanTag
<< locationTagName + "." + subSystemTag + "." + chanTag + "." + RTUTag + "." + fesGrpTag); << locationTagName + "." + subSystemTag + "." + chanTag + "." + RTUTag + "." + fesGrpTag);
listFesDevGrp << locationTagName + "." + subSystemTag + "." + chanTag + "." + RTUTag + "." + fesGrpTag; listFesDevGrp << locationTagName + "." + subSystemTag + "." + chanTag + "." + RTUTag + "." + fesGrpTag;
//存储设备组名与套件名的映射
m_mapExistDevGrp2PluginName[locationTagName + "." + devGrpTag] = pluginLable;
} }
bool bResult = true; bool bResult = true;
@ -1542,8 +1597,22 @@ bool kbdSecondInstWizardPage::checkDevGrp()
ds.isExist(sql.arg(m_listFesTag.at(i).first()),bExist); ds.isExist(sql.arg(m_listFesTag.at(i).first()),bExist);
if(bExist) if(bExist)
{ {
m_textError->append(QString(tr("错误:后台设备%1 已经存在")).arg(m_listFesTag.at(i).first())); QString strTempDevGrp = m_listFesTag.at(i).first();
bResult = false; QString strTempPluginName = m_mapExistDevGrp2PluginName[strTempDevGrp];
m_textError->append(QString(tr("提示:后台设备组%1 已经存在")).arg(strTempDevGrp));
sql = "SELECT * FROM dev_info WHERE tag_name in(SELECT concat('%1_',temp_name) FROM temp_plugin_fes_dev_map WHERE plugin_name='%2')";
ds.isExist(sql.arg(strTempDevGrp).arg(strTempPluginName),bExist);
if(bExist)
{
m_textError->append(QString(tr("错误:后台设备组%1 中已经存在 %2套件中设备")).arg(strTempDevGrp).arg(strTempPluginName));
bResult = false;
}
}
else
{
//只保留已经存在的设备组名,用于后面不同套件创建在同一个设备组失败时,单独删除对应的设备,而不删除整个用户组
m_mapExistDevGrp2PluginName.remove(m_listFesTag.at(i).first());
} }
sql = "select* from fes_dev_info where TAG_NAME = '%1';"; sql = "select* from fes_dev_info where TAG_NAME = '%1';";
@ -1555,6 +1624,26 @@ bool kbdSecondInstWizardPage::checkDevGrp()
} }
} }
} }
else if (m_InstType == Delele)
{
//记录不同套件创建到同一个设备组下的设备组信息用于勾选删除61850设备时区分是删除整个设备组还是单独删除设备
for(int nIdx = 0;nIdx < m_listFesTag.size();nIdx++)
{
QString sql = "SELECT * FROM dev_info WHERE group_tag_name = '%1' and tag_name not in"
"(SELECT concat('%2_',temp_name) FROM temp_plugin_fes_dev_map WHERE plugin_name='%3');";
QString strTempDevGrp = m_listFesTag.at(nIdx).first();
QString strTempPluginName = m_mapExistDevGrp2PluginName[strTempDevGrp];
KbdDbDesign ds;
bool bExist = false;
ds.isExist(sql.arg(strTempDevGrp).arg(strTempDevGrp).arg(strTempPluginName),bExist);
if(!bExist)
{
//只保留包含不同套件的设备组名用于执行删除61850设备的操作
m_mapExistDevGrp2PluginName.remove(m_listFesTag.at(nIdx).first());
}
}
}
return bResult; return bResult;
} }
@ -2193,7 +2282,7 @@ void CboxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, cons
model->setData(index,cb->currentData(),Qt::UserRole); model->setData(index,cb->currentData(),Qt::UserRole);
} }
kbdRcbDialog::kbdRcbDialog(ST_Rcb* stRcb, QWidget *parent): QDialog(parent) kbdRcbDialog::kbdRcbDialog(ST_Rcb* stRcb, QWidget *parent): CustomDialog(parent)
{ {
m_stRCB = stRcb; m_stRCB = stRcb;
inItLayout(); inItLayout();

View File

@ -10,6 +10,7 @@
#include "kbd61850CfgModel.h" #include "kbd61850CfgModel.h"
#include "xlsxdocument.h" #include "xlsxdocument.h"
#include "pub_logger_api/logger.h" #include "pub_logger_api/logger.h"
#include "pub_widget/CustomDialog.h"
class QComboBox; class QComboBox;
class QTextEdit; class QTextEdit;
@ -150,7 +151,11 @@ public:
QString m_strFilePath; QString m_strFilePath;
QMap<QString,QString> m_tempPlugin; QMap<QString,QString> m_tempPlugin;
QList<QStringList> m_listFesTag; QList<QStringList> m_listFesTag;
//已经存在的设备组标签名,用于实现不同套件创建在同一个设备组下,key:设备组标签,value:套件标签
QMap<QString,QString> m_mapExistDevGrp2PluginName;
kbd61850CfgModel* m_CfgModel; kbd61850CfgModel* m_CfgModel;
bool m_bOnlyUpdate61850;
QCheckBox *m_pOnlyUpdate61850;
friend class kbdThirdInstWizardPage; friend class kbdThirdInstWizardPage;
}; };
@ -260,7 +265,7 @@ public:
class kbdRcbDialog : public QDialog class kbdRcbDialog : public CustomDialog
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -12,7 +12,7 @@
#include <QStandardItemModel> #include <QStandardItemModel>
#include <QSqlQuery> #include <QSqlQuery>
#include "kbdtabledatamgr.h" #include "kbdtabledatamgr.h"
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include "kbdmsgcontrl.h" #include "kbdmsgcontrl.h"
#include "linkage.h" #include "linkage.h"
#include <QTableWidget> #include <QTableWidget>
@ -20,7 +20,7 @@
#include <QListView> #include <QListView>
//用于添加 //用于添加
CctvActDlg::CctvActDlg(KbdTableModel* modelAct,QWidget *parent) : QDialog(parent) CctvActDlg::CctvActDlg(KbdTableModel* modelAct,QWidget *parent) : CustomDialog(parent)
{ {
m_modelAct = modelAct; m_modelAct = modelAct;
initLayout(); initLayout();
@ -29,7 +29,7 @@ CctvActDlg::CctvActDlg(KbdTableModel* modelAct,QWidget *parent) : QDialog(parent
} }
//用于修改 //用于修改
CctvActDlg::CctvActDlg(KbdTableModel* modelAct,const QStringList& oldDatas,QWidget *parent) : QDialog(parent) CctvActDlg::CctvActDlg(KbdTableModel* modelAct,const QStringList& oldDatas,QWidget *parent) : CustomDialog(parent)
{ {
m_modelAct = modelAct; m_modelAct = modelAct;
m_oldDatas << oldDatas; m_oldDatas << oldDatas;
@ -41,6 +41,7 @@ CctvActDlg::CctvActDlg(KbdTableModel* modelAct,const QStringList& oldDatas,QWidg
void CctvActDlg::initLayout() void CctvActDlg::initLayout()
{ {
setWindowTitle("CCTV配置");
QHBoxLayout *hLayout = new QHBoxLayout; QHBoxLayout *hLayout = new QHBoxLayout;
QGridLayout *grid = new QGridLayout; QGridLayout *grid = new QGridLayout;
m_stackWidget = new QStackedWidget(this); m_stackWidget = new QStackedWidget(this);
@ -281,7 +282,7 @@ bool CctvActDlg::check()
//已经存在,不准添加 //已经存在,不准添加
if(ifExisted() == false ) if(ifExisted() == false )
{ {
QMessageBox::information(this,tr("消息"),tr("已经存在,无法添加!")); N_MessageBox::information(this,tr("消息"),tr("已经存在,无法添加!"));
return false; return false;
} }
@ -578,10 +579,10 @@ void CctvActDlg::onOk()
} }
if(KbdTableDataMgr::getInstance()->commit()?false:((success=false)||true)) if(KbdTableDataMgr::getInstance()->commit()?false:((success=false)||true))
QMessageBox::information(this,tr("消息"),tr("提交事务失败,已回滚")); N_MessageBox::information(this,tr("消息"),tr("提交事务失败,已回滚"));
} }
else else
QMessageBox::information(this,tr("消息"),tr("开启事务失败")); N_MessageBox::information(this,tr("消息"),tr("开启事务失败"));
if(!success) if(!success)
return; return;

View File

@ -2,6 +2,7 @@
#define CCTVACTDLG_H #define CCTVACTDLG_H
#include <QDialog> #include <QDialog>
#include "pub_widget/CustomDialog.h"
class QStackedWidget; class QStackedWidget;
class QComboBox; class QComboBox;
@ -11,7 +12,7 @@ class QStandardItemModel;
class QDialogButtonBox; class QDialogButtonBox;
class KbdTableModel; class KbdTableModel;
class CctvActDlg : public QDialog class CctvActDlg : public CustomDialog
{ {
Q_OBJECT Q_OBJECT

View File

@ -11,13 +11,13 @@
#include "kbdtable.h" #include "kbdtable.h"
#include "kbdtabledatamgr.h" #include "kbdtabledatamgr.h"
#include "../model_common/common.h" #include "../model_common/common.h"
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include "kbdcheckrole.h" #include "kbdcheckrole.h"
#include <QRegExp> #include <QRegExp>
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QListView> #include <QListView>
KbdPeriodDlg::KbdPeriodDlg(QWidget *parent) : QDialog(parent) KbdPeriodDlg::KbdPeriodDlg(QWidget *parent) : CustomDialog(parent)
{ {
initLayout(); initLayout();
connect(m_cbType,SIGNAL(currentIndexChanged(int)),this,SLOT(onTypeChanged(int))); connect(m_cbType,SIGNAL(currentIndexChanged(int)),this,SLOT(onTypeChanged(int)));
@ -252,13 +252,13 @@ void KbdPeriodDlg::onOk()
{ {
if(m_leName->text().isEmpty()) if(m_leName->text().isEmpty())
{ {
QMessageBox::information(this,tr("消息"),tr("名称为空")); N_MessageBox::information(this,tr("消息"),tr("名称为空"));
return; return;
} }
if(m_leDesc->text().isEmpty()) if(m_leDesc->text().isEmpty())
{ {
QMessageBox::information(this,tr("消息"),tr("描述为空")); N_MessageBox::information(this,tr("消息"),tr("描述为空"));
return; return;
} }

View File

@ -2,13 +2,13 @@
#define KBDPERIODDLG_H #define KBDPERIODDLG_H
#include <QDialog> #include <QDialog>
#include "pub_widget/CustomDialog.h"
class QLineEdit; class QLineEdit;
class QDateTimeEdit; class QDateTimeEdit;
class QComboBox; class QComboBox;
class QSpinBox; class QSpinBox;
class KbdPeriodDlg : public QDialog class KbdPeriodDlg : public CustomDialog
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -19,7 +19,8 @@
#include <QLineEdit> #include <QLineEdit>
#include "kbdpropertydlg.h" #include "kbdpropertydlg.h"
#include "kbdpropertypanel.h" #include "kbdpropertypanel.h"
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include "pub_widget/PubWidgetInit.h"
#include "kbddbdesign.h" #include "kbddbdesign.h"
#include <QDateTime> #include <QDateTime>
#include "periodwidget.h" #include "periodwidget.h"
@ -95,10 +96,10 @@ public:
}; };
void LinkagePrivate::initTableModule(){ void LinkagePrivate::initTableModule(){
// QSettings settings("KbdSoft.ZHJK","ISCS6000.tools"); // QSettings settings("IOT","ISCS6000.tools");
// KbdTableDataMgr::getInstance()->initDBLink(DataBaseInterface::DirectLink, // KbdTableDataMgr::getInstance()->initDBLink(DataBaseInterface::DirectLink,
// settings.value("login/user","root").toString(), // settings.value("login/user","root").toString(),
// settings.value("login/psw","kbdct@0755").toString(), // settings.value("login/psw","ems@byd23").toString(),
// settings.value("login/ip","192.168.190.128").toString(), // settings.value("login/ip","192.168.190.128").toString(),
// settings.value("login/port","3306").toInt(), // settings.value("login/port","3306").toInt(),
// settings.value("login/dbname","ISCS6000").toString(), // settings.value("login/dbname","ISCS6000").toString(),
@ -173,6 +174,7 @@ void LinkagePrivate::loadTranslate()
m_translates = new QTranslator; m_translates = new QTranslator;
m_translates->load(Common::getTranslatePath("model_linkage_EN.qm")); m_translates->load(Common::getTranslatePath("model_linkage_EN.qm"));
qApp->installTranslator(m_translates); qApp->installTranslator(m_translates);
iot_public::installTranslator(Common::getLanguage().toStdString());
} }
void LinkagePrivate::removeTranslate() void LinkagePrivate::removeTranslate()
@ -211,26 +213,25 @@ QWidget *LinkagePrivate::initActWidget(){
QHBoxLayout *hLayout2 = new QHBoxLayout; QHBoxLayout *hLayout2 = new QHBoxLayout;
QHBoxLayout *hLayoutSearch = new QHBoxLayout; QHBoxLayout *hLayoutSearch = new QHBoxLayout;
QToolBar *topBar = new QToolBar(boxActList); //动作列表中的工具栏
QAction* act = nullptr;
act = topBar->addAction(QObject::tr("添加记录"),q,SLOT(onAddAction()));
topBar->widgetForAction(act)->setObjectName("icon_add");
act = topBar->addAction(QObject::tr("修改记录"),q,SLOT(onModifyAction()));
topBar->widgetForAction(act)->setObjectName("icon_edit");
act = topBar->addAction(QObject::tr("删除记录"),q,SLOT(onRemoveAction()));
topBar->widgetForAction(act)->setObjectName("icon_delete");
leSearchAct = new QLineEdit(boxActList); leSearchAct = new QLineEdit(boxActList);
leSearchAct->setPlaceholderText(QObject::tr("搜索动作描述")); leSearchAct->setPlaceholderText(QObject::tr("搜索动作描述"));
hLayoutSearch->addWidget(topBar);
hLayoutSearch->addWidget(leSearchAct); hLayoutSearch->addWidget(leSearchAct);
tableActList = new KbdTable(boxActList); tableActList = new KbdTable(boxActList);
QVBoxLayout *vLayoutTable = new QVBoxLayout; QVBoxLayout *vLayoutTable = new QVBoxLayout;
vLayoutTable->addLayout(hLayoutSearch); vLayoutTable->addLayout(hLayoutSearch);
vLayoutTable->addWidget(tableActList); vLayoutTable->addWidget(tableActList);
QVBoxLayout *vLayoutBts = new QVBoxLayout;
QPushButton *btAdd = new QPushButton(QObject::tr("添加"),boxActList);
QPushButton *btModify = new QPushButton(QObject::tr("修改"),boxActList);
QPushButton *btRemove = new QPushButton(QObject::tr("删除"),boxActList);
vLayoutBts->addStretch();
vLayoutBts->addWidget(btAdd);
vLayoutBts->addWidget(btModify);
vLayoutBts->addWidget(btRemove);
vLayoutBts->addStretch();
hLayout2->addLayout(vLayoutTable); hLayout2->addLayout(vLayoutTable);
hLayout2->addLayout(vLayoutBts);
boxActList->setLayout(hLayout2); boxActList->setLayout(hLayout2);
//右下角动作定义 //右下角动作定义
@ -240,9 +241,6 @@ QWidget *LinkagePrivate::initActWidget(){
hSplitter->setSizes(QList<int>()<<150<<1150); hSplitter->setSizes(QList<int>()<<150<<1150);
hSplitter->setContentsMargins(0,10,0,0); hSplitter->setContentsMargins(0,10,0,0);
QObject::connect(btAdd,SIGNAL(clicked(bool)),q,SLOT(onAddAction()));
QObject::connect(btRemove,SIGNAL(clicked(bool)),q,SLOT(onRemoveAction()));
QObject::connect(btModify,SIGNAL(clicked(bool)),q,SLOT(onModifyAction()));
QObject::connect(leSearchAct,SIGNAL(textChanged(const QString &)),q,SLOT(onSearchAct())); QObject::connect(leSearchAct,SIGNAL(textChanged(const QString &)),q,SLOT(onSearchAct()));
QObject::connect(tableActList,SIGNAL(doubleClicked(const QModelIndex &)), QObject::connect(tableActList,SIGNAL(doubleClicked(const QModelIndex &)),
q,SLOT(onModifyAction())); q,SLOT(onModifyAction()));
@ -282,8 +280,19 @@ QWidget *LinkagePrivate::initFuncWidget(){
QHBoxLayout *hLayout2 = new QHBoxLayout; QHBoxLayout *hLayout2 = new QHBoxLayout;
QHBoxLayout *hLayoutSearch = new QHBoxLayout; QHBoxLayout *hLayoutSearch = new QHBoxLayout;
QToolBar *topBar = new QToolBar(boxFuncList); //功能列表中的工具栏
QAction* act = nullptr;
act = topBar->addAction(QObject::tr("添加记录"),q,SLOT(onAddFunc()));
topBar->widgetForAction(act)->setObjectName("icon_add");
act = topBar->addAction(QObject::tr("修改记录"),q,SLOT(onModifyFunc()));
topBar->widgetForAction(act)->setObjectName("icon_edit");
act = topBar->addAction(QObject::tr("删除记录"),q,SLOT(onRemoveFunc()));
topBar->widgetForAction(act)->setObjectName("icon_delete");
leSearchFunc = new QLineEdit(boxFuncList); leSearchFunc = new QLineEdit(boxFuncList);
leSearchFunc->setPlaceholderText(QObject::tr("搜索功能描述")); leSearchFunc->setPlaceholderText(QObject::tr("搜索功能描述"));
hLayoutSearch->addWidget(topBar);
hLayoutSearch->addWidget(leSearchFunc); hLayoutSearch->addWidget(leSearchFunc);
tableFuncList = new KbdTable(boxFuncList); tableFuncList = new KbdTable(boxFuncList);
@ -291,28 +300,19 @@ QWidget *LinkagePrivate::initFuncWidget(){
vLayoutTable->addLayout(hLayoutSearch); vLayoutTable->addLayout(hLayoutSearch);
vLayoutTable->addWidget(tableFuncList); vLayoutTable->addWidget(tableFuncList);
QVBoxLayout *vLayoutBts = new QVBoxLayout;
QPushButton *btAdd = new QPushButton(QObject::tr("添加"),boxFuncList);
QPushButton *btModify = new QPushButton(QObject::tr("修改"),boxFuncList);
QPushButton *btRemove = new QPushButton(QObject::tr("删除"),boxFuncList);
vLayoutBts->addStretch();
vLayoutBts->addWidget(btAdd);
vLayoutBts->addWidget(btModify);
vLayoutBts->addWidget(btRemove);
vLayoutBts->addStretch();
hLayout2->addLayout(vLayoutTable); hLayout2->addLayout(vLayoutTable);
hLayout2->addLayout(vLayoutBts);
boxFuncList->setLayout(hLayout2); boxFuncList->setLayout(hLayout2);
//右下角功能列表 //右下角功能列表
QVBoxLayout *vLayoutBox = new QVBoxLayout; QVBoxLayout *vLayoutBox = new QVBoxLayout;
QToolBar *toolbar = new QToolBar(boxActsOfFunc); QToolBar *toolbar = new QToolBar(boxActsOfFunc);
tableActsOfFunc = new KbdTable(boxActsOfFunc); tableActsOfFunc = new KbdTable(boxActsOfFunc);
toolbar->setIconSize(QSize(24,24)); act = toolbar->addAction(QObject::tr("添加记录"),q,SLOT(onAddActOfFunc()));
toolbar->addAction(QIcon(":/icons/icons/new.png"),QObject::tr("添加记录"),q,SLOT(onAddActOfFunc())); toolbar->widgetForAction(act)->setObjectName("icon_add");
toolbar->addAction(QIcon(":/icons/icons/modify.png"),QObject::tr("修改记录"),q,SLOT(onModifyActOfFunc())); act = toolbar->addAction(QObject::tr("修改记录"),q,SLOT(onModifyActOfFunc()));
toolbar->addAction(QIcon(":/icons/icons/delete.png"),QObject::tr("删除记录"),q,SLOT(onRemoveActOfFunc())); toolbar->widgetForAction(act)->setObjectName("icon_edit");
act = toolbar->addAction(QObject::tr("删除记录"),q,SLOT(onRemoveActOfFunc()));
toolbar->widgetForAction(act)->setObjectName("icon_delete");
vLayoutBox->addWidget(toolbar); vLayoutBox->addWidget(toolbar);
vLayoutBox->addWidget(tableActsOfFunc); vLayoutBox->addWidget(tableActsOfFunc);
@ -328,10 +328,6 @@ QWidget *LinkagePrivate::initFuncWidget(){
vSplitter->setSizes(QList<int>()<<200<<200); vSplitter->setSizes(QList<int>()<<200<<200);
hSplitter->setContentsMargins(0,10,0,0); hSplitter->setContentsMargins(0,10,0,0);
QObject::connect(btAdd,SIGNAL(clicked(bool)),q,SLOT(onAddFunc()));
QObject::connect(btRemove,SIGNAL(clicked(bool)),q,SLOT(onRemoveFunc()));
QObject::connect(btModify,SIGNAL(clicked(bool)),q,SLOT(onModifyFunc()));
QObject::connect(leSearchFunc,SIGNAL(textChanged(const QString &)),q,SLOT(onSearchFunc())); QObject::connect(leSearchFunc,SIGNAL(textChanged(const QString &)),q,SLOT(onSearchFunc()));
QObject::connect(tableFuncList,SIGNAL(doubleClicked(const QModelIndex &)), QObject::connect(tableFuncList,SIGNAL(doubleClicked(const QModelIndex &)),
q,SLOT(onModifyFunc())); q,SLOT(onModifyFunc()));
@ -371,8 +367,19 @@ QWidget *LinkagePrivate::initLinkageWidget(){
QHBoxLayout *hLayout2 = new QHBoxLayout; QHBoxLayout *hLayout2 = new QHBoxLayout;
QHBoxLayout *hLayoutSearch = new QHBoxLayout; QHBoxLayout *hLayoutSearch = new QHBoxLayout;
QToolBar *topBar = new QToolBar(boxLinkageList); //联动列表中的工具栏
QAction* act = nullptr;
act = topBar->addAction(QObject::tr("添加记录"),q,SLOT(onAddLinkage()));
topBar->widgetForAction(act)->setObjectName("icon_add");
act = topBar->addAction(QObject::tr("修改记录"),q,SLOT(onModifyLinkage()));
topBar->widgetForAction(act)->setObjectName("icon_edit");
act = topBar->addAction(QObject::tr("删除记录"),q,SLOT(onRemoveLinkage()));
topBar->widgetForAction(act)->setObjectName("icon_delete");
leSearchLinkage = new QLineEdit(boxLinkageList); leSearchLinkage = new QLineEdit(boxLinkageList);
leSearchLinkage->setPlaceholderText(QObject::tr("搜索联动描述")); leSearchLinkage->setPlaceholderText(QObject::tr("搜索联动描述"));
hLayoutSearch->addWidget(topBar);
hLayoutSearch->addWidget(leSearchLinkage); hLayoutSearch->addWidget(leSearchLinkage);
tableLinkageList = new KbdTable(boxLinkageList); tableLinkageList = new KbdTable(boxLinkageList);
@ -380,28 +387,19 @@ QWidget *LinkagePrivate::initLinkageWidget(){
vLayoutTable->addLayout(hLayoutSearch); vLayoutTable->addLayout(hLayoutSearch);
vLayoutTable->addWidget(tableLinkageList); vLayoutTable->addWidget(tableLinkageList);
QVBoxLayout *vLayoutBts = new QVBoxLayout;
QPushButton *btAdd = new QPushButton(QObject::tr("添加"),boxLinkageList);
QPushButton *btModify = new QPushButton(QObject::tr("修改"),boxLinkageList);
QPushButton *btRemove = new QPushButton(QObject::tr("删除"),boxLinkageList);
vLayoutBts->addStretch();
vLayoutBts->addWidget(btAdd);
vLayoutBts->addWidget(btModify);
vLayoutBts->addWidget(btRemove);
vLayoutBts->addStretch();
hLayout2->addLayout(vLayoutTable); hLayout2->addLayout(vLayoutTable);
hLayout2->addLayout(vLayoutBts);
boxLinkageList->setLayout(hLayout2); boxLinkageList->setLayout(hLayout2);
//右下角功能列表 //右下角功能列表
QVBoxLayout *vLayoutBox = new QVBoxLayout; QVBoxLayout *vLayoutBox = new QVBoxLayout;
QToolBar *toolbar = new QToolBar(boxFuncOfLinkage); QToolBar *toolbar = new QToolBar(boxFuncOfLinkage);
tableFuncOfLinkage = new KbdTable(boxFuncOfLinkage); tableFuncOfLinkage = new KbdTable(boxFuncOfLinkage);
toolbar->setIconSize(QSize(24,24)); act = toolbar->addAction(QObject::tr("添加记录"),q,SLOT(onAddFuncOfLinkage()));
toolbar->addAction(QIcon(":/icons/icons/new.png"),QObject::tr("添加记录"),q,SLOT(onAddFuncOfLinkage())); toolbar->widgetForAction(act)->setObjectName("icon_add");
toolbar->addAction(QIcon(":/icons/icons/modify.png"),QObject::tr("修改记录"),q,SLOT(onModifyFuncOfLinkage())); act = toolbar->addAction(QObject::tr("修改记录"),q,SLOT(onModifyFuncOfLinkage()));
toolbar->addAction(QIcon(":/icons/icons/delete.png"),QObject::tr("删除记录"),q,SLOT(onRemoveFuncOfLinkage())); toolbar->widgetForAction(act)->setObjectName("icon_edit");
act = toolbar->addAction(QObject::tr("删除记录"),q,SLOT(onRemoveFuncOfLinkage()));
toolbar->widgetForAction(act)->setObjectName("icon_delete");
vLayoutBox->addWidget(toolbar); vLayoutBox->addWidget(toolbar);
vLayoutBox->addWidget(tableFuncOfLinkage); vLayoutBox->addWidget(tableFuncOfLinkage);
@ -417,9 +415,6 @@ QWidget *LinkagePrivate::initLinkageWidget(){
vSplitter->setSizes(QList<int>()<<200<<200); vSplitter->setSizes(QList<int>()<<200<<200);
hSplitter->setContentsMargins(0,10,0,0); hSplitter->setContentsMargins(0,10,0,0);
QObject::connect(btAdd,SIGNAL(clicked(bool)),q,SLOT(onAddLinkage()));
QObject::connect(btModify,SIGNAL(clicked(bool)),q,SLOT(onModifyLinkage()));
QObject::connect(btRemove,SIGNAL(clicked(bool)),q,SLOT(onRemoveLinkage()));
QObject::connect(tableLinkageList,SIGNAL(doubleClicked(const QModelIndex &)), QObject::connect(tableLinkageList,SIGNAL(doubleClicked(const QModelIndex &)),
q,SLOT(onModifyLinkage())); q,SLOT(onModifyLinkage()));
@ -468,26 +463,25 @@ QWidget *LinkagePrivate::timerWidget()
{ {
Q_Q(Linkage); Q_Q(Linkage);
QWidget *widget = new QWidget(stackTrigger); QWidget *widget = new QWidget(stackTrigger);
QHBoxLayout *hLayout = new QHBoxLayout; QVBoxLayout *vLayout = new QVBoxLayout;
tableTriggerTimer = new KbdTable(widget); tableTriggerTimer = new KbdTable(widget);
QVBoxLayout *vLayout = new QVBoxLayout; QToolBar *topBar = new QToolBar(widget); //触发器-定时触发列表中的工具栏
QPushButton *btAdd = new QPushButton(QObject::tr("添加"),widget); QAction* act = nullptr;
QPushButton *btModify = new QPushButton(QObject::tr("修改"),widget); act = topBar->addAction(QObject::tr("添加记录"),q,SLOT(onAddTimer()));
QPushButton *btRemove = new QPushButton(QObject::tr("删除"),widget); topBar->widgetForAction(act)->setObjectName("icon_add");
vLayout->addStretch(); act = topBar->addAction(QObject::tr("修改记录"),q,SLOT(onModifyTimer()));
vLayout->addWidget(btAdd); topBar->widgetForAction(act)->setObjectName("icon_edit");
vLayout->addWidget(btModify); act = topBar->addAction(QObject::tr("删除记录"),q,SLOT(onRemoveTimer()));
vLayout->addWidget(btRemove); topBar->widgetForAction(act)->setObjectName("icon_delete");
vLayout->addStretch();
hLayout->addWidget(tableTriggerTimer); QHBoxLayout *hLayoutSearch = new QHBoxLayout;
hLayout->addLayout(vLayout); hLayoutSearch->addWidget(topBar);
widget->setLayout(hLayout);
vLayout->addLayout(hLayoutSearch);
vLayout->addWidget(tableTriggerTimer);
widget->setLayout(vLayout);
QObject::connect(btAdd,SIGNAL(clicked(bool)),q,SLOT(onAddTimer()));
QObject::connect(btModify,SIGNAL(clicked(bool)),q,SLOT(onModifyTimer()));
QObject::connect(btRemove,SIGNAL(clicked(bool)),q,SLOT(onRemoveTimer()));
return widget; return widget;
} }
@ -578,6 +572,7 @@ void Linkage::addPscadaAction()
QStringList rowDatas; QStringList rowDatas;
KbdPropertyDlg dlg(false,this); KbdPropertyDlg dlg(false,this);
dlg.setWindowTitle(tr("新增联动动作"));
dlg.panel()->setDisplayRow(modelActPscada,modelActPscada->rowCount()); dlg.panel()->setDisplayRow(modelActPscada,modelActPscada->rowCount());
if(dlg.exec()) if(dlg.exec())
{ {
@ -626,6 +621,7 @@ void Linkage::addBasAction()
QStringList rowDatas; QStringList rowDatas;
KbdPropertyDlg dlg(false,this); KbdPropertyDlg dlg(false,this);
dlg.setWindowTitle(tr("新增联动动作"));
dlg.panel()->setDisplayRow(modelActBas,modelActBas->rowCount()); dlg.panel()->setDisplayRow(modelActBas,modelActBas->rowCount());
if(dlg.exec()) if(dlg.exec())
{ {
@ -672,6 +668,7 @@ void Linkage::addPaAction()
QStringList rowDatas; QStringList rowDatas;
KbdPropertyDlg dlg(false,this); KbdPropertyDlg dlg(false,this);
dlg.setWindowTitle(tr("新增联动动作"));
dlg.panel()->setDisplayRow(modelActPa,modelActPa->rowCount()); dlg.panel()->setDisplayRow(modelActPa,modelActPa->rowCount());
if(dlg.exec()) if(dlg.exec())
{ {
@ -728,6 +725,7 @@ void Linkage::addPisAction()
QStringList rowDatas; QStringList rowDatas;
KbdPropertyDlg dlg(false,this); KbdPropertyDlg dlg(false,this);
dlg.setWindowTitle(tr("新增联动动作"));
dlg.panel()->setDisplayRow(modelActPis,modelActPis->rowCount()); dlg.panel()->setDisplayRow(modelActPis,modelActPis->rowCount());
if(dlg.exec()) if(dlg.exec())
{ {
@ -774,6 +772,7 @@ void Linkage::addPicAction()
QStringList rowDatas; QStringList rowDatas;
KbdPropertyDlg dlg(false,this); KbdPropertyDlg dlg(false,this);
dlg.setWindowTitle(tr("新增联动动作"));
dlg.panel()->setDisplayRow(modelPushPic,modelPushPic->rowCount()); dlg.panel()->setDisplayRow(modelPushPic,modelPushPic->rowCount());
if(dlg.exec()) if(dlg.exec())
{ {
@ -820,6 +819,7 @@ void Linkage::addMsgAction()
QStringList rowDatas; QStringList rowDatas;
KbdPropertyDlg dlg(false,this); KbdPropertyDlg dlg(false,this);
dlg.setWindowTitle(tr("新增联动动作"));
dlg.panel()->setDisplayRow(modelMsg,modelMsg->rowCount()); dlg.panel()->setDisplayRow(modelMsg,modelMsg->rowCount());
if(dlg.exec()) if(dlg.exec())
{ {
@ -871,6 +871,7 @@ void Linkage::modifyPscadaAction()
QStringList newRowDatas; QStringList newRowDatas;
const ColMgrDataList& modelActCols = modelAct->getHeadCols(); const ColMgrDataList& modelActCols = modelAct->getHeadCols();
KbdPropertyDlg dlg(false,this); KbdPropertyDlg dlg(false,this);
dlg.setWindowTitle(tr("修改联动动作"));
dlg.panel()->setDisplayRow(modelActPscada,modelActPscada->rowCount()); dlg.panel()->setDisplayRow(modelActPscada,modelActPscada->rowCount());
dlg.panel()->setPropertyEditable(CN_NAME,false); dlg.panel()->setPropertyEditable(CN_NAME,false);
dlg.panel()->setPropertyValue(CN_NAME,oldRowDatas.at(modelActCols.findCol(CN_NAME))); dlg.panel()->setPropertyValue(CN_NAME,oldRowDatas.at(modelActCols.findCol(CN_NAME)));
@ -934,6 +935,7 @@ void Linkage::modifyBasAction()
QStringList newRowDatas; QStringList newRowDatas;
const ColMgrDataList& modelActCols = modelAct->getHeadCols(); const ColMgrDataList& modelActCols = modelAct->getHeadCols();
KbdPropertyDlg dlg(false,this); KbdPropertyDlg dlg(false,this);
dlg.setWindowTitle(tr("修改联动动作"));
dlg.panel()->setDisplayRow(modelActBas,modelActBas->rowCount()); dlg.panel()->setDisplayRow(modelActBas,modelActBas->rowCount());
dlg.panel()->setPropertyEditable(CN_NAME,false); dlg.panel()->setPropertyEditable(CN_NAME,false);
dlg.panel()->setPropertyValue(CN_NAME,oldRowDatas.at(modelActCols.findCol(CN_NAME))); dlg.panel()->setPropertyValue(CN_NAME,oldRowDatas.at(modelActCols.findCol(CN_NAME)));
@ -1003,6 +1005,7 @@ void Linkage::modifyPaAction()
return; return;
} }
KbdPropertyDlg dlg(false,this); KbdPropertyDlg dlg(false,this);
dlg.setWindowTitle(tr("修改联动动作"));
dlg.panel()->setDisplayRow(modelActPa,modelActPa->rowCount()); dlg.panel()->setDisplayRow(modelActPa,modelActPa->rowCount());
dlg.panel()->setPropertyEditable(CN_NAME,false); dlg.panel()->setPropertyEditable(CN_NAME,false);
dlg.panel()->setPropertyValue(CN_NAME,oldRowDatas.at(modelActCols.findCol(CN_NAME))); dlg.panel()->setPropertyValue(CN_NAME,oldRowDatas.at(modelActCols.findCol(CN_NAME)));
@ -1092,6 +1095,7 @@ void Linkage::modifyPisAction()
return; return;
} }
KbdPropertyDlg dlg(false,this); KbdPropertyDlg dlg(false,this);
dlg.setWindowTitle(tr("修改联动动作"));
dlg.panel()->setDisplayRow(modelActPis,modelActPis->rowCount()); dlg.panel()->setDisplayRow(modelActPis,modelActPis->rowCount());
dlg.panel()->setPropertyEditable(CN_NAME,false); dlg.panel()->setPropertyEditable(CN_NAME,false);
dlg.panel()->setPropertyValue(CN_NAME,oldRowDatas.at(modelActCols.findCol(CN_NAME))); dlg.panel()->setPropertyValue(CN_NAME,oldRowDatas.at(modelActCols.findCol(CN_NAME)));
@ -1161,6 +1165,7 @@ void Linkage::modifyPicAction()
const ColMgrDataList& modelActCols = modelAct->getHeadCols(); const ColMgrDataList& modelActCols = modelAct->getHeadCols();
KbdPropertyDlg dlg(false,this); KbdPropertyDlg dlg(false,this);
dlg.setWindowTitle(tr("修改联动动作"));
dlg.panel()->setDisplayRow(modelPushPic,modelPushPic->rowCount()); dlg.panel()->setDisplayRow(modelPushPic,modelPushPic->rowCount());
dlg.panel()->setPropertyEditable(CN_NAME,false); dlg.panel()->setPropertyEditable(CN_NAME,false);
dlg.panel()->setPropertyValue(CN_NAME,oldRowDatas.at(modelActCols.findCol(CN_NAME))); dlg.panel()->setPropertyValue(CN_NAME,oldRowDatas.at(modelActCols.findCol(CN_NAME)));
@ -1224,6 +1229,7 @@ void Linkage::modifyMsgAction()
QStringList newRowDatas; QStringList newRowDatas;
const ColMgrDataList& modelActCols = modelAct->getHeadCols(); const ColMgrDataList& modelActCols = modelAct->getHeadCols();
KbdPropertyDlg dlg(false,this); KbdPropertyDlg dlg(false,this);
dlg.setWindowTitle(tr("修改联动动作"));
dlg.panel()->setDisplayRow(modelMsg,modelMsg->rowCount()); dlg.panel()->setDisplayRow(modelMsg,modelMsg->rowCount());
dlg.panel()->setPropertyEditable(CN_NAME,false); dlg.panel()->setPropertyEditable(CN_NAME,false);
dlg.panel()->setPropertyValue(CN_NAME,oldRowDatas.at(modelActCols.findCol(CN_NAME))); dlg.panel()->setPropertyValue(CN_NAME,oldRowDatas.at(modelActCols.findCol(CN_NAME)));
@ -1325,6 +1331,10 @@ QStringList Linkage::pscadaDataToActData(const QStringList &pscadaData)
{ {
pointType = "do_ctrl"; pointType = "do_ctrl";
} }
else if(QString("MIX").compare(dotList.first(),Qt::CaseInsensitive) == 0)
{
pointType = "mo_ctrl";
}
else else
{ {
return temp; return temp;
@ -1395,6 +1405,10 @@ QStringList Linkage::basDataToActData(const QStringList &basData)
{ {
pointType = "do_ctrl"; pointType = "do_ctrl";
} }
else if(QString("MIX").compare(dotList.first(),Qt::CaseInsensitive) == 0)
{
pointType = "mo_ctrl";
}
else else
{ {
return temp; return temp;
@ -1651,7 +1665,7 @@ QString Linkage::convertTriggerTypeToStr(const QString &intTriggerType)
else if(intTriggerType.compare("3:周期触发",Qt::CaseInsensitive) == 0) else if(intTriggerType.compare("3:周期触发",Qt::CaseInsensitive) == 0)
return "TRIGGER_PERIOD_DEFINE:周期触发"; return "TRIGGER_PERIOD_DEFINE:周期触发";
else else
return "iot_debug_flag:不触发"; return "trigger_debug_flag:不触发";
} }
void Linkage::onActTypeChanged() void Linkage::onActTypeChanged()
@ -1710,7 +1724,7 @@ void Linkage::onAddAction()
else if(actData == 6) else if(actData == 6)
addMsgAction(); addMsgAction();
else else
QMessageBox::information(this,tr("消息"),tr("该动作未定义:")+d->actGroupOfActs->checkedAction()->text()); N_MessageBox::information(this,tr("消息"),tr("该动作未定义:")+d->actGroupOfActs->checkedAction()->text());
} }
@ -1733,7 +1747,7 @@ void Linkage::onModifyAction()
else if(actData == 6) else if(actData == 6)
modifyMsgAction(); modifyMsgAction();
else else
QMessageBox::information(this,tr("消息"),tr("该动作未定义:")+d->actGroupOfActs->checkedAction()->text()); N_MessageBox::information(this,tr("消息"),tr("该动作未定义:")+d->actGroupOfActs->checkedAction()->text());
} }
@ -1841,6 +1855,7 @@ void Linkage::onAddFunc()
QStringList rowDatas; QStringList rowDatas;
KbdPropertyDlg dlg(false,this); KbdPropertyDlg dlg(false,this);
dlg.setWindowTitle(tr("新增联动功能"));
dlg.panel()->setDisplayRow(modelFunc,modelFunc->rowCount()); dlg.panel()->setDisplayRow(modelFunc,modelFunc->rowCount());
dlg.panel()->setPropertyValue(CN_FUNC_TYPE,actType->data().toString()); dlg.panel()->setPropertyValue(CN_FUNC_TYPE,actType->data().toString());
dlg.panel()->setPropertyEditable(CN_NAME,true); dlg.panel()->setPropertyEditable(CN_NAME,true);
@ -1889,6 +1904,7 @@ void Linkage::onModifyFunc()
QStringList newDatas; QStringList newDatas;
QStringList oldDatas; QStringList oldDatas;
KbdPropertyDlg dlg(false,this); KbdPropertyDlg dlg(false,this);
dlg.setWindowTitle(tr("修改联动功能"));
QList<int> cols ; QList<int> cols ;
const ColMgrDataList& modelFuncCols = modelFunc->getHeadCols(); const ColMgrDataList& modelFuncCols = modelFunc->getHeadCols();
cols<<modelFuncCols.findCol(CN_NAME) << modelFuncCols.findCol(CN_DESC); cols<<modelFuncCols.findCol(CN_NAME) << modelFuncCols.findCol(CN_DESC);
@ -2026,6 +2042,7 @@ void Linkage::onAddActOfFunc()
QStringList rowDatas; QStringList rowDatas;
KbdPropertyDlg dlg(false,this); KbdPropertyDlg dlg(false,this);
dlg.setWindowTitle(tr("添加联动功能"));
const ColMgrDataList& modelActsOfFuncCols = modelActsOfFunc->getHeadCols(); const ColMgrDataList& modelActsOfFuncCols = modelActsOfFunc->getHeadCols();
QList<int> cols = modelActsOfFuncCols.getShowCol(); QList<int> cols = modelActsOfFuncCols.getShowCol();
int colFuncName = modelActsOfFuncCols.findCol(CN_NAME); int colFuncName = modelActsOfFuncCols.findCol(CN_NAME);
@ -2152,6 +2169,7 @@ void Linkage::onModifyActOfFunc()
showCols.removeAll(modelActsOfFuncCols.findCol(CN_DESC)); showCols.removeAll(modelActsOfFuncCols.findCol(CN_DESC));
showCols.removeAll(modelActsOfFuncCols.findCol(CN_TIMEFLAG)); showCols.removeAll(modelActsOfFuncCols.findCol(CN_TIMEFLAG));
KbdPropertyDlg dlg(true,this); KbdPropertyDlg dlg(true,this);
dlg.setWindowTitle(tr("修改联动功能"));
dlg.panel()->setDisplayRow(modelActsOfFunc,index.row(), modelActsOfFuncCols.getGroup(),showCols); dlg.panel()->setDisplayRow(modelActsOfFunc,index.row(), modelActsOfFuncCols.getGroup(),showCols);
if(dlg.exec()) if(dlg.exec())
{ {
@ -2241,6 +2259,7 @@ void Linkage::onAddLinkage()
QStringList rowDatas; QStringList rowDatas;
KbdPropertyDlg dlg(false,this); KbdPropertyDlg dlg(false,this);
dlg.setWindowTitle(tr("新增联动"));
dlg.panel()->setDisplayRow(modelAddAndModify,modelAddAndModify->rowCount()); dlg.panel()->setDisplayRow(modelAddAndModify,modelAddAndModify->rowCount());
dlg.panel()->setPropertyValue(CN_LINK_TYPE,actType->data().toString()); dlg.panel()->setPropertyValue(CN_LINK_TYPE,actType->data().toString());
if(dlg.exec()) if(dlg.exec())
@ -2300,7 +2319,7 @@ void Linkage::onModifyLinkage()
QStringList oldDatas = modelLinkageSetting->getRowData(index.row()); QStringList oldDatas = modelLinkageSetting->getRowData(index.row());
QStringList rowDatas; QStringList rowDatas;
KbdPropertyDlg dlg(false,this); KbdPropertyDlg dlg(false,this);
dlg.setWindowTitle(tr("修改联动"));
const ColMgrDataList& modelLinkageSettingCols = modelLinkageSetting->getHeadCols(); const ColMgrDataList& modelLinkageSettingCols = modelLinkageSetting->getHeadCols();
dlg.panel()->setDisplayRow(modelAddAndModify,modelAddAndModify->rowCount()); dlg.panel()->setDisplayRow(modelAddAndModify,modelAddAndModify->rowCount());
dlg.panel()->setPropertyEditable(CN_NAME,false); dlg.panel()->setPropertyEditable(CN_NAME,false);
@ -2369,10 +2388,10 @@ void Linkage::onRemoveLinkage()
if(list.isEmpty()) if(list.isEmpty())
return; return;
int ret = QMessageBox::No; int ret = N_MessageBox::No;
ret = QMessageBox::information(this,tr("消息"),tr("如果此联动正在执行或者已触发会导致联动终止,确定删除?"), ret = N_MessageBox::information(this,tr("消息"),tr("如果此联动正在执行或者已触发会导致联动终止,确定删除?"),
QMessageBox::Yes,QMessageBox::No); N_MessageBox::Yes,N_MessageBox::No);
if(ret != QMessageBox::Yes) if(ret != N_MessageBox::Yes)
{ {
return; return;
} }
@ -2420,6 +2439,7 @@ void Linkage::onAddFuncOfLinkage()
QStringList rowDatas; QStringList rowDatas;
KbdPropertyDlg dlg(false,this); KbdPropertyDlg dlg(false,this);
dlg.setWindowTitle(tr("添加联动功能"));
dlg.panel()->setDisplayRow(modelLinkageDefine,modelLinkageDefine->rowCount()); dlg.panel()->setDisplayRow(modelLinkageDefine,modelLinkageDefine->rowCount());
dlg.panel()->setPropertyEditable(CN_FUNC_NAME,true); dlg.panel()->setPropertyEditable(CN_FUNC_NAME,true);
dlg.panel()->setPropertyValue(CN_LINKAGE_NAME,modelLinkageSetting->item(index.row(), dlg.panel()->setPropertyValue(CN_LINKAGE_NAME,modelLinkageSetting->item(index.row(),
@ -2514,6 +2534,7 @@ void Linkage::onModifyFuncOfLinkage()
showCols.removeAll(modelFuncOfLinkageCols.findCol(CN_LINKAGE_NAME)); showCols.removeAll(modelFuncOfLinkageCols.findCol(CN_LINKAGE_NAME));
showCols.removeAll(modelFuncOfLinkageCols.findCol(CN_TIMEFLAG)); showCols.removeAll(modelFuncOfLinkageCols.findCol(CN_TIMEFLAG));
KbdPropertyDlg dlg(true,this); KbdPropertyDlg dlg(true,this);
dlg.setWindowTitle(tr("修改联动功能"));
dlg.panel()->setDisplayRow(modelFuncOfLinkage,index.row(), modelFuncOfLinkageCols.getGroup(),showCols); dlg.panel()->setDisplayRow(modelFuncOfLinkage,index.row(), modelFuncOfLinkageCols.getGroup(),showCols);
if(dlg.exec()) if(dlg.exec())
{ {
@ -2573,6 +2594,7 @@ void Linkage::onAddTimer()
if(retStr.isEmpty()) if(retStr.isEmpty())
{ {
KbdPropertyDlg dlg(true,this); KbdPropertyDlg dlg(true,this);
dlg.setWindowTitle(tr("新增触发器"));
dlg.panel()->setDisplayRow(model,model->rowCount()); dlg.panel()->setDisplayRow(model,model->rowCount());
if(dlg.exec()) if(dlg.exec())
{ {
@ -2647,6 +2669,7 @@ void Linkage::onModifyTimer()
if(retStr.isEmpty()) if(retStr.isEmpty())
{ {
KbdPropertyDlg dlg(true,this); KbdPropertyDlg dlg(true,this);
dlg.setWindowTitle(tr("修改触发器"));
dlg.panel()->setDisplayRow(model,index.row()); dlg.panel()->setDisplayRow(model,index.row());
if(dlg.exec()) if(dlg.exec())
{ {
@ -2667,17 +2690,17 @@ void Linkage::onModifyTimer()
void Linkage::onStartTransactionError(const QString&erroStr) void Linkage::onStartTransactionError(const QString&erroStr)
{ {
QMessageBox::information(this,tr("消息"),erroStr); N_MessageBox::information(this,tr("消息"),erroStr);
} }
void Linkage::onCommitError() void Linkage::onCommitError()
{ {
QMessageBox::information(this,tr("消息"),tr("提交事务失败,已回滚")); N_MessageBox::information(this,tr("消息"),tr("提交事务失败,已回滚"));
} }
void Linkage::onMsg(const QString &msg) void Linkage::onMsg(const QString &msg)
{ {
QMessageBox::information(this,tr("消息"),msg); N_MessageBox::information(this,tr("消息"),msg);
} }

View File

@ -36,12 +36,14 @@ PLATFORM_INCLUDE_PATH = $$SRC_ROOT_PATH/../../platform/src/include/
INCLUDEPATH += $$PWD\ INCLUDEPATH += $$PWD\
$$PLATFORM_INCLUDE_PATH/tools/model_common \ $$PLATFORM_INCLUDE_PATH/tools/model_common \
$$PLATFORM_INCLUDE_PATH/tools/model_table \ $$PLATFORM_INCLUDE_PATH/tools/model_table \
$$PLATFORM_INCLUDE_PATH/tools/model_excel/xlsx $$PLATFORM_INCLUDE_PATH/public/pub_excel/xlsx
LIBS += -lmodel_common -lmodel_excel LIBS += -lmodel_common -lpub_excel
LIBS += -lmodel_table -lScriptForm_lua LIBS += -lmodel_table -lScriptForm_lua
LIBS += -lpub_widget
DISTFILES += \ DISTFILES += \
model_linkage_EN.ts model_linkage_EN.ts
@ -65,4 +67,4 @@ SOURCES += \
triggerfuncwidget.cpp \ triggerfuncwidget.cpp \
triggerparawidget.cpp triggerparawidget.cpp
TRANSLATIONS = $$PWD/model_linkage_EN.ts

View File

@ -4,348 +4,351 @@
<context> <context>
<name>CctvActDlg</name> <name>CctvActDlg</name>
<message> <message>
<location filename="cctvactdlg.cpp" line="51"/> <location filename="cctvactdlg.cpp" line="52"/>
<source>:</source> <source>:</source>
<translation type="unfinished">Select monitor:</translation> <translation>Select monitor:</translation>
</message>
<message>
<location filename="cctvactdlg.cpp" line="56"/>
<source></source>
<translation type="unfinished">Single camera</translation>
</message> </message>
<message> <message>
<location filename="cctvactdlg.cpp" line="58"/> <location filename="cctvactdlg.cpp" line="58"/>
<source></source> <source></source>
<translation type="unfinished">Four Camera</translation> <translation>Single camera</translation>
</message> </message>
<message> <message>
<location filename="cctvactdlg.cpp" line="60"/> <location filename="cctvactdlg.cpp" line="60"/>
<source></source> <source></source>
<translation type="unfinished">Nine camera</translation> <translation>Four Camera</translation>
</message> </message>
<message> <message>
<location filename="cctvactdlg.cpp" line="62"/> <location filename="cctvactdlg.cpp" line="62"/>
<source></source>
<translation>Nine camera</translation>
</message>
<message>
<location filename="cctvactdlg.cpp" line="64"/>
<source></source> <source></source>
<translation type="unfinished">serial display</translation> <translation>serial display</translation>
</message> </message>
<message> <message>
<location filename="cctvactdlg.cpp" line="68"/> <location filename="cctvactdlg.cpp" line="70"/>
<source>:</source> <source>:</source>
<translation type="unfinished">select location:</translation> <translation>select location:</translation>
</message>
<message>
<location filename="cctvactdlg.cpp" line="71"/>
<source>:</source>
<translation type="unfinished">Select camera:</translation>
</message> </message>
<message> <message>
<location filename="cctvactdlg.cpp" line="74"/> <location filename="cctvactdlg.cpp" line="74"/>
<source>:</source>
<translation>Select camera:</translation>
</message>
<message>
<location filename="cctvactdlg.cpp" line="78"/>
<source>:</source> <source>:</source>
<translation type="unfinished">Select orient location:</translation> <translation>Select orient location:</translation>
</message> </message>
<message> <message>
<location filename="cctvactdlg.cpp" line="140"/> <location filename="cctvactdlg.cpp" line="145"/>
<source></source> <source></source>
<translation type="unfinished">Selece series</translation> <translation>Selece series</translation>
</message> </message>
<message> <message>
<location filename="cctvactdlg.cpp" line="148"/> <location filename="cctvactdlg.cpp" line="154"/>
<source></source> <source></source>
<translation type="unfinished">Sequence number</translation> <translation>Sequence number</translation>
</message> </message>
<message> <message>
<location filename="cctvactdlg.cpp" line="148"/> <location filename="cctvactdlg.cpp" line="154"/>
<source></source> <source></source>
<translation type="unfinished">Camera</translation> <translation>Camera</translation>
</message> </message>
<message> <message>
<location filename="cctvactdlg.cpp" line="278"/> <location filename="cctvactdlg.cpp" line="284"/>
<location filename="cctvactdlg.cpp" line="573"/> <location filename="cctvactdlg.cpp" line="581"/>
<location filename="cctvactdlg.cpp" line="576"/> <location filename="cctvactdlg.cpp" line="584"/>
<source></source> <source></source>
<translation type="unfinished">Message</translation> <translation>Message</translation>
</message> </message>
<message> <message>
<location filename="cctvactdlg.cpp" line="278"/> <location filename="cctvactdlg.cpp" line="284"/>
<source>,!</source> <source>,!</source>
<translation type="unfinished">Can&apos;t be added,alreay existed!</translation> <translation>Can&apos;t be added,alreay existed!</translation>
</message> </message>
<message> <message>
<location filename="cctvactdlg.cpp" line="573"/> <location filename="cctvactdlg.cpp" line="581"/>
<source>,</source> <source>,</source>
<translation type="unfinished">Commit transaction failed,rolled back</translation> <translation>Commit transaction failed,rolled back</translation>
</message> </message>
<message> <message>
<location filename="cctvactdlg.cpp" line="576"/> <location filename="cctvactdlg.cpp" line="584"/>
<source></source> <source></source>
<translation type="unfinished">Start transaction failed</translation> <translation>Start transaction failed</translation>
</message> </message>
<message> <message>
<location filename="cctvactdlg.cpp" line="582"/> <location filename="cctvactdlg.cpp" line="590"/>
<source></source> <source></source>
<translation type="unfinished">Add succcess</translation> <translation>Add succcess</translation>
</message> </message>
<message> <message>
<location filename="cctvactdlg.cpp" line="586"/> <location filename="cctvactdlg.cpp" line="594"/>
<source></source> <source></source>
<translation type="unfinished">modify success</translation> <translation>modify success</translation>
</message> </message>
</context> </context>
<context> <context>
<name>KbdPeriodDlg</name> <name>KbdPeriodDlg</name>
<message>
<location filename="kbdperioddlg.cpp" line="29"/>
<source></source>
<translation type="unfinished">Name</translation>
</message>
<message> <message>
<location filename="kbdperioddlg.cpp" line="30"/> <location filename="kbdperioddlg.cpp" line="30"/>
<source></source> <source></source>
<translation type="unfinished">Description</translation> <translation>Name</translation>
</message> </message>
<message> <message>
<location filename="kbdperioddlg.cpp" line="31"/> <location filename="kbdperioddlg.cpp" line="31"/>
<source></source> <source></source>
<translation type="unfinished">Start time</translation> <translation>Description</translation>
</message> </message>
<message> <message>
<location filename="kbdperioddlg.cpp" line="32"/> <location filename="kbdperioddlg.cpp" line="32"/>
<source></source>
<translation>Start time</translation>
</message>
<message>
<location filename="kbdperioddlg.cpp" line="33"/>
<source></source> <source></source>
<translation type="unfinished">End time</translation> <translation>End time</translation>
</message> </message>
<message> <message>
<location filename="kbdperioddlg.cpp" line="64"/> <location filename="kbdperioddlg.cpp" line="67"/>
<source></source> <source></source>
<translation type="unfinished">Month</translation> <translation>Month</translation>
</message> </message>
<message> <message>
<location filename="kbdperioddlg.cpp" line="66"/> <location filename="kbdperioddlg.cpp" line="70"/>
<source>1:星期一/2:星期二/3:星期三/4:星期四/5:星期五/6:星期六/0:星期天</source> <source>1:星期一/2:星期二/3:星期三/4:星期四/5:星期五/6:星期六/0:星期天</source>
<translation type="unfinished">1:Monday/2:Tuesday/3:Wednesday/4:Thursday/5:Friday/6:Saturday/0:Sunday</translation> <translation>1:Monday/2:Tuesday/3:Wednesday/4:Thursday/5:Friday/6:Saturday/0:Sunday</translation>
</message> </message>
<message> <message>
<location filename="kbdperioddlg.cpp" line="69"/> <location filename="kbdperioddlg.cpp" line="73"/>
<source></source> <source></source>
<translation type="unfinished">Day</translation> <translation>Day</translation>
</message> </message>
<message> <message>
<location filename="kbdperioddlg.cpp" line="72"/> <location filename="kbdperioddlg.cpp" line="76"/>
<source></source> <source></source>
<translation type="unfinished">Hour</translation> <translation>Hour</translation>
</message> </message>
<message> <message>
<location filename="kbdperioddlg.cpp" line="75"/> <location filename="kbdperioddlg.cpp" line="79"/>
<source></source> <source></source>
<translation type="unfinished">Minute</translation> <translation>Minute</translation>
</message> </message>
<message> <message>
<location filename="kbdperioddlg.cpp" line="78"/> <location filename="kbdperioddlg.cpp" line="82"/>
<source></source> <source></source>
<translation type="unfinished">Second</translation> <translation>Second</translation>
</message> </message>
<message> <message>
<location filename="kbdperioddlg.cpp" line="251"/> <location filename="kbdperioddlg.cpp" line="255"/>
<location filename="kbdperioddlg.cpp" line="257"/> <location filename="kbdperioddlg.cpp" line="261"/>
<source></source> <source></source>
<translation type="unfinished">Message</translation> <translation>Message</translation>
</message> </message>
<message> <message>
<location filename="kbdperioddlg.cpp" line="251"/> <location filename="kbdperioddlg.cpp" line="255"/>
<source></source> <source></source>
<translation type="unfinished">Name is null</translation> <translation>Name is null</translation>
</message> </message>
<message> <message>
<location filename="kbdperioddlg.cpp" line="257"/> <location filename="kbdperioddlg.cpp" line="261"/>
<source></source> <source></source>
<translation type="unfinished">Description is null</translation> <translation>Description is null</translation>
</message> </message>
</context> </context>
<context> <context>
<name>Linkage</name> <name>Linkage</name>
<message> <message>
<location filename="linkage.cpp" line="604"/> <location filename="linkage.cpp" line="594"/>
<location filename="linkage.cpp" line="652"/> <location filename="linkage.cpp" line="642"/>
<location filename="linkage.cpp" line="698"/> <location filename="linkage.cpp" line="688"/>
<location filename="linkage.cpp" line="754"/> <location filename="linkage.cpp" line="744"/>
<location filename="linkage.cpp" line="800"/> <location filename="linkage.cpp" line="790"/>
<location filename="linkage.cpp" line="846"/> <location filename="linkage.cpp" line="836"/>
<location filename="linkage.cpp" line="908"/> <location filename="linkage.cpp" line="898"/>
<location filename="linkage.cpp" line="971"/> <location filename="linkage.cpp" line="961"/>
<location filename="linkage.cpp" line="1042"/> <location filename="linkage.cpp" line="1034"/>
<location filename="linkage.cpp" line="1130"/> <location filename="linkage.cpp" line="1123"/>
<location filename="linkage.cpp" line="1193"/> <location filename="linkage.cpp" line="1188"/>
<location filename="linkage.cpp" line="1256"/> <location filename="linkage.cpp" line="1251"/>
<source></source> <source></source>
<translation type="unfinished">Linkage action define error</translation> <translation>Linkage action define error</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="630"/> <location filename="linkage.cpp" line="620"/>
<location filename="linkage.cpp" line="676"/> <location filename="linkage.cpp" line="666"/>
<location filename="linkage.cpp" line="722"/> <location filename="linkage.cpp" line="712"/>
<location filename="linkage.cpp" line="778"/> <location filename="linkage.cpp" line="768"/>
<location filename="linkage.cpp" line="824"/> <location filename="linkage.cpp" line="814"/>
<location filename="linkage.cpp" line="870"/> <location filename="linkage.cpp" line="860"/>
<location filename="linkage.cpp" line="1869"/> <location filename="linkage.cpp" line="1890"/>
<location filename="linkage.cpp" line="2056"/> <location filename="linkage.cpp" line="2080"/>
<location filename="linkage.cpp" line="2267"/> <location filename="linkage.cpp" line="2298"/>
<location filename="linkage.cpp" line="2430"/> <location filename="linkage.cpp" line="2468"/>
<location filename="linkage.cpp" line="2564"/> <location filename="linkage.cpp" line="2605"/>
<source></source> <source></source>
<translation type="unfinished">Add success</translation> <translation>Add success</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="933"/> <location filename="linkage.cpp" line="923"/>
<location filename="linkage.cpp" line="996"/> <location filename="linkage.cpp" line="986"/>
<location filename="linkage.cpp" line="1067"/> <location filename="linkage.cpp" line="1059"/>
<location filename="linkage.cpp" line="1155"/> <location filename="linkage.cpp" line="1148"/>
<location filename="linkage.cpp" line="1218"/> <location filename="linkage.cpp" line="1213"/>
<location filename="linkage.cpp" line="1281"/> <location filename="linkage.cpp" line="1276"/>
<location filename="linkage.cpp" line="1932"/> <location filename="linkage.cpp" line="1954"/>
<location filename="linkage.cpp" line="2157"/> <location filename="linkage.cpp" line="2184"/>
<location filename="linkage.cpp" line="2332"/> <location filename="linkage.cpp" line="2368"/>
<location filename="linkage.cpp" line="2507"/> <location filename="linkage.cpp" line="2546"/>
<location filename="linkage.cpp" line="2638"/> <location filename="linkage.cpp" line="2679"/>
<source></source> <source></source>
<translation type="unfinished">Modify success</translation> <translation>Modify success</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="1018"/> <location filename="linkage.cpp" line="1008"/>
<location filename="linkage.cpp" line="1105"/> <location filename="linkage.cpp" line="1097"/>
<source></source> <source></source>
<translation type="unfinished">Action content error</translation> <translation>Action content error</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="1605"/> <location filename="linkage.cpp" line="1619"/>
<source>*,*</source> <source>*,*</source>
<translation type="unfinished">Content posting contains illegal characters*, please replace * characters</translation> <translation>Content posting contains illegal characters*, please replace * characters</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="1710"/> <location filename="linkage.cpp" line="1727"/>
<location filename="linkage.cpp" line="1733"/> <location filename="linkage.cpp" line="1750"/>
<location filename="linkage.cpp" line="2351"/> <location filename="linkage.cpp" line="2387"/>
<location filename="linkage.cpp" line="2643"/> <location filename="linkage.cpp" line="2684"/>
<location filename="linkage.cpp" line="2648"/> <location filename="linkage.cpp" line="2689"/>
<location filename="linkage.cpp" line="2653"/> <location filename="linkage.cpp" line="2694"/>
<source></source> <source></source>
<translation type="unfinished">Message</translation> <translation>Message</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="1710"/> <location filename="linkage.cpp" line="1727"/>
<location filename="linkage.cpp" line="1733"/> <location filename="linkage.cpp" line="1750"/>
<source>:</source> <source>:</source>
<translation type="unfinished">Not define the action:</translation> <translation>Not define the action:</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="1763"/> <location filename="linkage.cpp" line="1780"/>
<source>使,! <source>使,!
</source> </source>
<translation type="unfinished">The following functions use this action,please modify the corresponding function settings first!</translation> <translatorcomment>file:///D:/work/gitProject/project/ems/product/src/tools/model_plugin/model_plan_curve/model_plan_curve_EN.ts</translatorcomment>
<translation>The following functions use this action,please modify the corresponding function settings first!
</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="1783"/> <location filename="linkage.cpp" line="1800"/>
<location filename="linkage.cpp" line="1992"/> <location filename="linkage.cpp" line="2015"/>
<location filename="linkage.cpp" line="2115"/> <location filename="linkage.cpp" line="2141"/>
<location filename="linkage.cpp" line="2376"/> <location filename="linkage.cpp" line="2412"/>
<location filename="linkage.cpp" line="2467"/> <location filename="linkage.cpp" line="2505"/>
<location filename="linkage.cpp" line="2601"/> <location filename="linkage.cpp" line="2642"/>
<source></source> <source></source>
<translation type="unfinished">Delete success</translation> <translation>Delete success</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="1905"/> <location filename="linkage.cpp" line="1927"/>
<source></source> <source></source>
<translation type="unfinished">Function name repeat</translation> <translation>Function name repeat</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="1961"/> <location filename="linkage.cpp" line="1984"/>
<location filename="linkage.cpp" line="2089"/> <location filename="linkage.cpp" line="2115"/>
<source>使,! <source>使,!
</source> </source>
<translation type="unfinished">The following linkage uses this function,please modify the corresponding linkage settings first!</translation> <translation>The following linkage uses this function,please modify the corresponding linkage settings first!
</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="2001"/> <location filename="linkage.cpp" line="2024"/>
<location filename="linkage.cpp" line="2065"/> <location filename="linkage.cpp" line="2089"/>
<location filename="linkage.cpp" line="2384"/> <location filename="linkage.cpp" line="2420"/>
<location filename="linkage.cpp" line="2439"/> <location filename="linkage.cpp" line="2477"/>
<source></source> <source></source>
<translation type="unfinished">Please save modify first</translation> <translation>Please save modify first</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="2008"/> <location filename="linkage.cpp" line="2031"/>
<source></source> <source></source>
<translation type="unfinished">Please select the function want to add</translation> <translation>Please select the function want to add</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="2129"/> <location filename="linkage.cpp" line="2155"/>
<location filename="linkage.cpp" line="2480"/> <location filename="linkage.cpp" line="2518"/>
<source></source> <source></source>
<translation type="unfinished">Please select the line to modify</translation> <translation>Please select the line to modify</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="2351"/> <location filename="linkage.cpp" line="2387"/>
<source>,?</source> <source>,?</source>
<translation type="unfinished">If this linkage is being executed or triggered, the linkage will be terminated and the deletion will be confirmed?</translation> <translation>If this linkage is being executed or triggered, the linkage will be terminated and the deletion will be confirmed?</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="2590"/> <location filename="linkage.cpp" line="2631"/>
<source>!</source> <source>!</source>
<translation type="unfinished">Delete failed!</translation> <translation>Delete failed!</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="2614"/> <location filename="linkage.cpp" line="2655"/>
<source></source> <source></source>
<translation type="unfinished">Please select items to modify</translation> <translation>Please select items to modify</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="2648"/> <location filename="linkage.cpp" line="2689"/>
<source>,</source> <source>,</source>
<translation type="unfinished">Transaction submit failed,rollback has started</translation> <translation>Transaction submit failed,rollback has started</translation>
</message> </message>
</context> </context>
<context> <context>
<name>PeriodWidget</name> <name>PeriodWidget</name>
<message> <message>
<location filename="periodwidget.cpp" line="100"/> <location filename="periodwidget.cpp" line="102"/>
<source></source> <source></source>
<translation type="unfinished">Add failed</translation> <translation>Add failed</translation>
</message> </message>
<message> <message>
<location filename="periodwidget.cpp" line="104"/> <location filename="periodwidget.cpp" line="106"/>
<source></source> <source></source>
<translation type="unfinished">Add success</translation> <translation>Add success</translation>
</message> </message>
<message> <message>
<location filename="periodwidget.cpp" line="160"/> <location filename="periodwidget.cpp" line="163"/>
<source></source> <source></source>
<translation type="unfinished">Modify failed</translation> <translation>Modify failed</translation>
</message> </message>
<message> <message>
<location filename="periodwidget.cpp" line="164"/> <location filename="periodwidget.cpp" line="167"/>
<source></source> <source></source>
<translation type="unfinished">Modify success</translation> <translation>Modify success</translation>
</message> </message>
<message> <message>
<location filename="periodwidget.cpp" line="197"/> <location filename="periodwidget.cpp" line="200"/>
<source>!</source> <source>!</source>
<translation type="unfinished">Delete failed!</translation> <translation>Delete failed!</translation>
</message> </message>
<message> <message>
<location filename="periodwidget.cpp" line="208"/> <location filename="periodwidget.cpp" line="211"/>
<source></source> <source></source>
<translation type="unfinished">Delete success</translation> <translation>Delete success</translation>
</message> </message>
<message> <message>
<location filename="periodwidget.cpp" line="214"/> <location filename="periodwidget.cpp" line="217"/>
<location filename="periodwidget.cpp" line="219"/> <location filename="periodwidget.cpp" line="222"/>
<location filename="periodwidget.cpp" line="224"/> <location filename="periodwidget.cpp" line="227"/>
<source></source> <source></source>
<translation type="unfinished">Message</translation> <translation>Message</translation>
</message> </message>
<message> <message>
<location filename="periodwidget.cpp" line="219"/> <location filename="periodwidget.cpp" line="222"/>
<source>,</source> <source>,</source>
<translation type="unfinished">Transaction submit failed,rollback has started</translation> <translation>Transaction submit failed,rollback has started</translation>
</message> </message>
</context> </context>
<context> <context>
@ -353,139 +356,139 @@
<message> <message>
<location filename="linkage.cpp" line="113"/> <location filename="linkage.cpp" line="113"/>
<source></source> <source></source>
<translation type="unfinished">Linkage action</translation> <translation>Linkage action</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="114"/> <location filename="linkage.cpp" line="114"/>
<source></source> <source></source>
<translation type="unfinished">Linkage function</translation> <translation>Linkage function</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="115"/> <location filename="linkage.cpp" line="115"/>
<source></source> <source></source>
<translation type="unfinished">Linkage define</translation> <translation>Linkage define</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="116"/> <location filename="linkage.cpp" line="116"/>
<source></source> <source></source>
<translation type="unfinished">Trigger define</translation> <translation>Trigger define</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="200"/> <location filename="linkage.cpp" line="186"/>
<source></source> <source></source>
<translation type="unfinished">Action type</translation> <translation>Action type</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="201"/> <location filename="linkage.cpp" line="187"/>
<source></source> <source></source>
<translation type="unfinished">Action list</translation> <translation>Action list</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="228"/> <location filename="linkage.cpp" line="215"/>
<source></source> <source></source>
<translation type="unfinished">Search action description</translation> <translation>Search action description</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="236"/> <location filename="linkage.cpp" line="223"/>
<location filename="linkage.cpp" line="307"/> <location filename="linkage.cpp" line="295"/>
<location filename="linkage.cpp" line="396"/> <location filename="linkage.cpp" line="387"/>
<location filename="linkage.cpp" line="488"/> <location filename="linkage.cpp" line="481"/>
<location filename="linkage.cpp" line="514"/> <location filename="linkage.cpp" line="507"/>
<location filename="periodwidget.cpp" line="31"/> <location filename="periodwidget.cpp" line="31"/>
<source></source> <source></source>
<translation type="unfinished">Add</translation> <translation>Add</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="237"/> <location filename="linkage.cpp" line="224"/>
<location filename="linkage.cpp" line="308"/> <location filename="linkage.cpp" line="296"/>
<location filename="linkage.cpp" line="397"/> <location filename="linkage.cpp" line="388"/>
<location filename="linkage.cpp" line="489"/> <location filename="linkage.cpp" line="482"/>
<location filename="periodwidget.cpp" line="32"/> <location filename="periodwidget.cpp" line="32"/>
<source></source> <source></source>
<translation type="unfinished">Modify</translation> <translation>Modify</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="238"/> <location filename="linkage.cpp" line="225"/>
<location filename="linkage.cpp" line="309"/> <location filename="linkage.cpp" line="297"/>
<location filename="linkage.cpp" line="398"/> <location filename="linkage.cpp" line="389"/>
<location filename="linkage.cpp" line="490"/> <location filename="linkage.cpp" line="483"/>
<location filename="linkage.cpp" line="515"/> <location filename="linkage.cpp" line="508"/>
<location filename="periodwidget.cpp" line="33"/> <location filename="periodwidget.cpp" line="33"/>
<source></source> <source></source>
<translation type="unfinished">Delete</translation> <translation>Delete</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="269"/> <location filename="linkage.cpp" line="256"/>
<source></source> <source></source>
<translation type="unfinished">Function type</translation> <translation>Function type</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="270"/> <location filename="linkage.cpp" line="257"/>
<source></source> <source></source>
<translation type="unfinished">Function list</translation> <translation>Function list</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="271"/> <location filename="linkage.cpp" line="258"/>
<source></source> <source></source>
<translation type="unfinished">List of actions included in the function</translation> <translation>List of actions included in the function</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="298"/> <location filename="linkage.cpp" line="286"/>
<source></source> <source></source>
<translation type="unfinished">Search function description</translation> <translation>Search function description</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="326"/> <location filename="linkage.cpp" line="313"/>
<location filename="linkage.cpp" line="415"/> <location filename="linkage.cpp" line="405"/>
<source></source> <source></source>
<translation type="unfinished">Add record</translation> <translation>Add record</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="327"/> <location filename="linkage.cpp" line="315"/>
<location filename="linkage.cpp" line="416"/> <location filename="linkage.cpp" line="407"/>
<source></source> <source></source>
<translation type="unfinished">Modify record</translation> <translation>Modify record</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="328"/> <location filename="linkage.cpp" line="317"/>
<location filename="linkage.cpp" line="417"/> <location filename="linkage.cpp" line="409"/>
<source></source> <source></source>
<translation type="unfinished">Delete record</translation> <translation>Delete record</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="358"/> <location filename="linkage.cpp" line="348"/>
<source></source> <source></source>
<translation type="unfinished">Linkage type</translation> <translation>Linkage type</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="359"/> <location filename="linkage.cpp" line="349"/>
<source></source> <source></source>
<translation type="unfinished">Linkage list</translation> <translation>Linkage list</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="360"/> <location filename="linkage.cpp" line="350"/>
<source></source> <source></source>
<translation type="unfinished">List of actions included in the linkage</translation> <translation>List of actions included in the linkage</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="387"/> <location filename="linkage.cpp" line="378"/>
<source></source> <source></source>
<translation type="unfinished">Search linkage description</translation> <translation>Search linkage description</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="448"/> <location filename="linkage.cpp" line="441"/>
<source></source> <source></source>
<translation type="unfinished">Trigger type</translation> <translation>Trigger type</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="454"/> <location filename="linkage.cpp" line="447"/>
<source>0:定时触发/1:周期触发/2:触发函数/3:触发器定义</source> <source>0:定时触发/1:周期触发/2:触发函数/3:触发器定义</source>
<translation type="unfinished">0:Timed trigger/1:Cycle trigger/2:Trigger function/3:Trigger definition</translation> <translation>0:Timed trigger/1:Cycle trigger/2:Trigger function/3:Trigger definition</translation>
</message> </message>
<message> <message>
<location filename="linkage.cpp" line="522"/> <location filename="linkage.cpp" line="515"/>
<source></source> <source></source>
<translation type="unfinished">Save</translation> <translation>Save</translation>
</message> </message>
</context> </context>
<context> <context>
@ -493,118 +496,118 @@
<message> <message>
<location filename="triggerfuncwidget.cpp" line="34"/> <location filename="triggerfuncwidget.cpp" line="34"/>
<source></source> <source></source>
<translation type="unfinished">Add</translation> <translation>Add</translation>
</message> </message>
<message> <message>
<location filename="triggerfuncwidget.cpp" line="35"/> <location filename="triggerfuncwidget.cpp" line="36"/>
<source></source> <source></source>
<translation type="unfinished">Delete</translation> <translation>Delete</translation>
</message> </message>
<message> <message>
<location filename="triggerfuncwidget.cpp" line="51"/> <location filename="triggerfuncwidget.cpp" line="54"/>
<source></source> <source></source>
<translation type="unfinished">Function define</translation> <translation>Function define</translation>
</message> </message>
<message> <message>
<location filename="triggerfuncwidget.cpp" line="59"/> <location filename="triggerfuncwidget.cpp" line="63"/>
<source></source> <source></source>
<translation type="unfinished">Save</translation> <translation>Save</translation>
</message> </message>
<message> <message>
<location filename="triggerfuncwidget.cpp" line="80"/> <location filename="triggerfuncwidget.cpp" line="90"/>
<source>!</source> <source>!</source>
<translation type="unfinished">Please select the subsystem to add!</translation> <translation>Please select the subsystem to add!</translation>
</message> </message>
<message> <message>
<location filename="triggerfuncwidget.cpp" line="102"/> <location filename="triggerfuncwidget.cpp" line="112"/>
<location filename="triggerfuncwidget.cpp" line="107"/> <location filename="triggerfuncwidget.cpp" line="117"/>
<source>!</source> <source>!</source>
<translation type="unfinished">Please select the trigger function you want to delete!</translation> <translation>Please select the trigger function you want to delete!</translation>
</message> </message>
<message> <message>
<location filename="triggerfuncwidget.cpp" line="125"/> <location filename="triggerfuncwidget.cpp" line="135"/>
<location filename="triggerfuncwidget.cpp" line="188"/> <location filename="triggerfuncwidget.cpp" line="198"/>
<source></source> <source></source>
<translation type="unfinished">Write into database failed</translation> <translation>Write into database failed</translation>
</message> </message>
<message> <message>
<location filename="triggerfuncwidget.cpp" line="140"/> <location filename="triggerfuncwidget.cpp" line="150"/>
<source></source> <source></source>
<translation type="unfinished">Delete success</translation> <translation>Delete success</translation>
</message> </message>
<message> <message>
<location filename="triggerfuncwidget.cpp" line="207"/> <location filename="triggerfuncwidget.cpp" line="217"/>
<source></source> <source></source>
<translation type="unfinished">Save success</translation> <translation>Save success</translation>
</message> </message>
<message> <message>
<location filename="triggerfuncwidget.cpp" line="242"/> <location filename="triggerfuncwidget.cpp" line="252"/>
<location filename="triggerfuncwidget.cpp" line="247"/> <location filename="triggerfuncwidget.cpp" line="257"/>
<location filename="triggerfuncwidget.cpp" line="253"/> <location filename="triggerfuncwidget.cpp" line="263"/>
<source></source> <source></source>
<translation type="unfinished">Message</translation> <translation>Message</translation>
</message> </message>
<message> <message>
<location filename="triggerfuncwidget.cpp" line="247"/> <location filename="triggerfuncwidget.cpp" line="257"/>
<source>,</source> <source>,</source>
<translation type="unfinished">This modification failed,rollback has started!</translation> <translation>This modification failed,rollback has started!</translation>
</message> </message>
</context> </context>
<context> <context>
<name>TriggerParaWidget</name> <name>TriggerParaWidget</name>
<message> <message>
<location filename="triggerparawidget.cpp" line="34"/> <location filename="triggerparawidget.cpp" line="33"/>
<source></source> <source></source>
<translation type="unfinished">Add</translation> <translation>Add</translation>
</message> </message>
<message> <message>
<location filename="triggerparawidget.cpp" line="35"/> <location filename="triggerparawidget.cpp" line="35"/>
<source></source> <source></source>
<translation type="unfinished">Delete</translation> <translation>Delete</translation>
</message> </message>
<message> <message>
<location filename="triggerparawidget.cpp" line="49"/> <location filename="triggerparawidget.cpp" line="51"/>
<source></source> <source></source>
<translation type="unfinished">Save</translation> <translation>Save</translation>
</message> </message>
<message> <message>
<location filename="triggerparawidget.cpp" line="70"/> <location filename="triggerparawidget.cpp" line="77"/>
<source>!</source> <source>!</source>
<translation type="unfinished">Please select the subSystem to add!</translation> <translation>Please select the subSystem to add!</translation>
</message> </message>
<message> <message>
<location filename="triggerparawidget.cpp" line="92"/> <location filename="triggerparawidget.cpp" line="99"/>
<location filename="triggerparawidget.cpp" line="97"/> <location filename="triggerparawidget.cpp" line="104"/>
<source>!</source> <source>!</source>
<translation type="unfinished">Please select the trigger you want to delete!</translation> <translation>Please select the trigger you want to delete!</translation>
</message> </message>
<message> <message>
<location filename="triggerparawidget.cpp" line="115"/> <location filename="triggerparawidget.cpp" line="122"/>
<location filename="triggerparawidget.cpp" line="171"/> <location filename="triggerparawidget.cpp" line="178"/>
<source></source> <source></source>
<translation type="unfinished">Write into database failed</translation> <translation>Write into database failed</translation>
</message> </message>
<message> <message>
<location filename="triggerparawidget.cpp" line="129"/> <location filename="triggerparawidget.cpp" line="136"/>
<source></source> <source></source>
<translation type="unfinished">Delete success</translation> <translation>Delete success</translation>
</message> </message>
<message> <message>
<location filename="triggerparawidget.cpp" line="189"/> <location filename="triggerparawidget.cpp" line="196"/>
<source></source> <source></source>
<translation type="unfinished">Save success</translation> <translation>Save success</translation>
</message> </message>
<message> <message>
<location filename="triggerparawidget.cpp" line="220"/> <location filename="triggerparawidget.cpp" line="227"/>
<location filename="triggerparawidget.cpp" line="225"/> <location filename="triggerparawidget.cpp" line="232"/>
<location filename="triggerparawidget.cpp" line="231"/> <location filename="triggerparawidget.cpp" line="238"/>
<source></source> <source></source>
<translation type="unfinished">Message</translation> <translation>Message</translation>
</message> </message>
<message> <message>
<location filename="triggerparawidget.cpp" line="225"/> <location filename="triggerparawidget.cpp" line="232"/>
<source>,</source> <source>,</source>
<translation type="unfinished">This modification failed,rollback has started!</translation> <translation>This modification failed,rollback has started!</translation>
</message> </message>
</context> </context>
</TS> </TS>

View File

@ -7,7 +7,7 @@
class ModelLinkagePluginWidget : public QObject, public CPluginWidgetInterface class ModelLinkagePluginWidget : public QObject, public CPluginWidgetInterface
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "kbd.PluginWidgetInterface/1.0") Q_PLUGIN_METADATA(IID HMI_WidgetPlugin_IID)
Q_INTERFACES(CPluginWidgetInterface) Q_INTERFACES(CPluginWidgetInterface)
public: public:

View File

@ -11,7 +11,7 @@
#include "kbdtable.h" #include "kbdtable.h"
#include "kbdtabledatamgr.h" #include "kbdtabledatamgr.h"
#include "../model_common/common.h" #include "../model_common/common.h"
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include "kbdcheckrole.h" #include "kbdcheckrole.h"
#include <QRegExp> #include <QRegExp>
#include "kbdperioddlg.h" #include "kbdperioddlg.h"
@ -25,30 +25,25 @@ PeriodWidget::PeriodWidget(QWidget *parent) : QWidget(parent)
void PeriodWidget::initLayout() void PeriodWidget::initLayout()
{ {
QHBoxLayout *hLayout = new QHBoxLayout;
m_table = new KbdTable(this);
QVBoxLayout *vLayout = new QVBoxLayout; QVBoxLayout *vLayout = new QVBoxLayout;
QPushButton *btAdd = new QPushButton(QObject::tr("添加"),this); m_table = new KbdTable(this);
QPushButton *btModify = new QPushButton(QObject::tr("修改"),this);
QPushButton *btRemove = new QPushButton(QObject::tr("删除"),this);
vLayout->addStretch();
vLayout->addWidget(btAdd);
vLayout->addWidget(btModify);
vLayout->addWidget(btRemove);
vLayout->addStretch();
hLayout->addWidget(m_table); QHBoxLayout *hLayoutSearch = new QHBoxLayout;
hLayout->addLayout(vLayout); QToolBar *topBar = new QToolBar(this); //触发器-定时触发列表中的工具栏
setLayout(hLayout); QAction* act = nullptr;
act = topBar->addAction(QObject::tr("添加记录"),this,SLOT(onAdd()));
topBar->widgetForAction(act)->setObjectName("icon_add");
act = topBar->addAction(QObject::tr("修改记录"),this,SLOT(onModify()));
topBar->widgetForAction(act)->setObjectName("icon_edit");
act = topBar->addAction(QObject::tr("删除记录"),this,SLOT(onRemove()));
topBar->widgetForAction(act)->setObjectName("icon_delete");
hLayoutSearch->addWidget(topBar);
vLayout->addLayout(hLayoutSearch);
vLayout->addWidget(m_table);
setLayout(vLayout);
connect(btAdd,SIGNAL(clicked(bool)),this,SLOT(onAdd()));
connect(btModify,SIGNAL(clicked(bool)),this,SLOT(onModify()));
connect(btRemove,SIGNAL(clicked(bool)),this,SLOT(onRemove()));
connect(m_table,SIGNAL(doubleClicked(const QModelIndex &)),this,SLOT(onModify())); connect(m_table,SIGNAL(doubleClicked(const QModelIndex &)),this,SLOT(onModify()));
} }
void PeriodWidget::initData() void PeriodWidget::initData()
@ -59,7 +54,8 @@ void PeriodWidget::initData()
void PeriodWidget::add() void PeriodWidget::add()
{ {
KbdPeriodDlg dlg; KbdPeriodDlg dlg(this);
dlg.setWindowTitle(tr("新增触发器"));
if(dlg.exec() != QDialog::Accepted) if(dlg.exec() != QDialog::Accepted)
return; return;
@ -108,7 +104,8 @@ void PeriodWidget::add()
void PeriodWidget::modify() void PeriodWidget::modify()
{ {
KbdPeriodDlg dlg; KbdPeriodDlg dlg(this);
dlg.setWindowTitle(tr("修改触发器"));
QModelIndex index = m_table->currentIndex(); QModelIndex index = m_table->currentIndex();
if(!index.isValid()) if(!index.isValid())
return; return;
@ -214,15 +211,15 @@ void PeriodWidget::onRemove()
void PeriodWidget::onStartTransactionError(const QString&erroStr) void PeriodWidget::onStartTransactionError(const QString&erroStr)
{ {
QMessageBox::information(this,tr("消息"),erroStr); N_MessageBox::information(this,tr("消息"),erroStr);
} }
void PeriodWidget::onCommitError() void PeriodWidget::onCommitError()
{ {
QMessageBox::information(this,tr("消息"),tr("提交事务失败,已回滚")); N_MessageBox::information(this,tr("消息"),tr("提交事务失败,已回滚"));
} }
void PeriodWidget::onMsg(const QString &msg) void PeriodWidget::onMsg(const QString &msg)
{ {
QMessageBox::information(this,tr("消息"),msg); N_MessageBox::information(this,tr("消息"),msg);
} }

View File

@ -10,7 +10,7 @@
#include <QTextEdit> #include <QTextEdit>
#include <QPushButton> #include <QPushButton>
#include <QGroupBox> #include <QGroupBox>
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include "kbdtabledatamgr.h" #include "kbdtabledatamgr.h"
#include "kbdcheckrole.h" #include "kbdcheckrole.h"
#include "kbdmsgcontrl.h" #include "kbdmsgcontrl.h"
@ -30,9 +30,11 @@ void TriggerFuncWidget::initLayout()
QVBoxLayout *vLayoutTree = new QVBoxLayout; QVBoxLayout *vLayoutTree = new QVBoxLayout;
QToolBar *bar = new QToolBar(widgetTree); QToolBar *bar = new QToolBar(widgetTree);
bar->setIconSize(QSize(24,24)); QAction* act = nullptr;
bar->addAction(QIcon(":/icons/icons/new.png"),tr("添加"),this,SLOT(onAdd())); act = bar->addAction(tr("添加"),this,SLOT(onAdd()));
bar->addAction(QIcon(":/icons/icons/delete.png"),tr("删除"),this,SLOT(onRemove())); bar->widgetForAction(act)->setObjectName("icon_add");
act = bar->addAction(tr("删除"),this,SLOT(onRemove()));
bar->widgetForAction(act)->setObjectName("icon_delete");
m_tree = new KbdTreeView(widgetTree); m_tree = new KbdTreeView(widgetTree);
KbdSqlTreeModel *treeModel = new KbdSqlTreeModel(Common::getTreePath("TriggerFuncTree.xml"),this); KbdSqlTreeModel *treeModel = new KbdSqlTreeModel(Common::getTreePath("TriggerFuncTree.xml"),this);
@ -51,7 +53,8 @@ void TriggerFuncWidget::initLayout()
QGroupBox *box = new QGroupBox(tr("函数定义"),widgetDetail); QGroupBox *box = new QGroupBox(tr("函数定义"),widgetDetail);
QHBoxLayout *boxLayout = new QHBoxLayout; QHBoxLayout *boxLayout = new QHBoxLayout;
m_te = new ScriptFormWidget(box); using namespace ScriptForm_lua;
m_te = new ScriptForm_lua::ScriptFormWidget(box);
boxLayout->addWidget(m_te); boxLayout->addWidget(m_te);
box->setLayout(boxLayout); box->setLayout(boxLayout);
@ -246,17 +249,17 @@ void TriggerFuncWidget::onTreeClicked(const QModelIndex &index)
void TriggerFuncWidget::onMsg(const QString &msg) void TriggerFuncWidget::onMsg(const QString &msg)
{ {
QMessageBox::information(this,tr("消息"),msg); N_MessageBox::information(this,tr("消息"),msg);
} }
void TriggerFuncWidget::onCommitError() void TriggerFuncWidget::onCommitError()
{ {
QMessageBox::information(this,tr("消息"),tr("此次修改失败,已启动回滚!")); N_MessageBox::information(this,tr("消息"),tr("此次修改失败,已启动回滚!"));
} }
void TriggerFuncWidget::onStartTransactionError(const QString& erroStr) void TriggerFuncWidget::onStartTransactionError(const QString& erroStr)
{ {
QMessageBox::information(this,tr("消息"),erroStr); N_MessageBox::information(this,tr("消息"),erroStr);
} }

View File

@ -2,14 +2,19 @@
#define TRIGGERFUNCWIDGET_H #define TRIGGERFUNCWIDGET_H
#include <QWidget> #include <QWidget>
#include "../../../tools/ScriptForm/ScriptForm.h"
class KbdPropertyPanel; class KbdPropertyPanel;
class QTextEdit; class QTextEdit;
class KbdTreeView; class KbdTreeView;
using namespace ScriptForm_lua;
class ScriptFormWidget; class ScriptFormWidget;
/** /**
* @brief The TriggerFuncWidget class * @brief The TriggerFuncWidget class
*/ */
class TriggerFuncWidget : public QWidget class TriggerFuncWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT
@ -21,7 +26,7 @@ private:
private: private:
KbdTreeView *m_tree; KbdTreeView *m_tree;
KbdPropertyPanel *m_panel; KbdPropertyPanel *m_panel;
ScriptFormWidget* m_te; ScriptForm_lua::ScriptFormWidget* m_te;
private slots: private slots:
void onAdd(); void onAdd();
void onRemove(); void onRemove();

View File

@ -10,7 +10,7 @@
#include <QTextEdit> #include <QTextEdit>
#include <QPushButton> #include <QPushButton>
#include <QGroupBox> #include <QGroupBox>
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include "kbdtabledatamgr.h" #include "kbdtabledatamgr.h"
#include "kbdcheckrole.h" #include "kbdcheckrole.h"
#include "kbdmsgcontrl.h" #include "kbdmsgcontrl.h"
@ -29,9 +29,11 @@ void TriggerParaWidget::initLayout()
QVBoxLayout *vLayoutTree = new QVBoxLayout; QVBoxLayout *vLayoutTree = new QVBoxLayout;
QToolBar *bar = new QToolBar(widgetTree); QToolBar *bar = new QToolBar(widgetTree);
bar->setIconSize(QSize(24,24)); QAction* act = nullptr;
bar->addAction(QIcon(":/icons/icons/new.png"),tr("添加"),this,SLOT(onAdd())); act = bar->addAction(tr("添加"),this,SLOT(onAdd()));
bar->addAction(QIcon(":/icons/icons/delete.png"),tr("删除"),this,SLOT(onRemove())); bar->widgetForAction(act)->setObjectName("icon_add");
act = bar->addAction(tr("删除"),this,SLOT(onRemove()));
bar->widgetForAction(act)->setObjectName("icon_delete");
m_tree = new KbdTreeView(widgetTree); m_tree = new KbdTreeView(widgetTree);
KbdSqlTreeModel *treeModel = new KbdSqlTreeModel(Common::getTreePath("TriggerParaTree.xml"),this); KbdSqlTreeModel *treeModel = new KbdSqlTreeModel(Common::getTreePath("TriggerParaTree.xml"),this);
@ -222,17 +224,17 @@ void TriggerParaWidget::onTreeClicked(const QModelIndex &index)
void TriggerParaWidget::onMsg(const QString &msg) void TriggerParaWidget::onMsg(const QString &msg)
{ {
QMessageBox::information(this,tr("消息"),msg); N_MessageBox::information(this,tr("消息"),msg);
} }
void TriggerParaWidget::onCommitError() void TriggerParaWidget::onCommitError()
{ {
QMessageBox::information(this,tr("消息"),tr("此次修改失败,已启动回滚!")); N_MessageBox::information(this,tr("消息"),tr("此次修改失败,已启动回滚!"));
} }
void TriggerParaWidget::onStartTransactionError(const QString&erroStr) void TriggerParaWidget::onStartTransactionError(const QString&erroStr)
{ {
QMessageBox::information(this,tr("消息"),erroStr); N_MessageBox::information(this,tr("消息"),erroStr);
} }

View File

@ -1,7 +1,7 @@
#include "CDbInterface.h" #include "CDbInterface.h"
#include "dbms/db_sysinfo_api/CDbSysInfo.h" #include "dbms/db_sysinfo_api/CDbSysInfo.h"
#include "pub_logger_api/logger.h" #include "pub_logger_api/logger.h"
#include <QMessageBox> #include "pub_widget/MessageBox.h"
using namespace iot_dbms; using namespace iot_dbms;
@ -20,12 +20,12 @@ CDbInterface::~CDbInterface()
void CDbInterface::onStartTransactionError(const QString&erroStr) void CDbInterface::onStartTransactionError(const QString&erroStr)
{ {
Q_UNUSED(erroStr); Q_UNUSED(erroStr);
// QMessageBox::information(NULL,tr("消息"),tr("开启事务失败"), QMessageBox::Ok); // N_MessageBox::information(NULL,tr("消息"),tr("开启事务失败"), N_MessageBox::Ok);
} }
void CDbInterface::onCommitError() void CDbInterface::onCommitError()
{ {
// QMessageBox::information(NULL,tr("消息"),tr("提交事务失败,已回滚"), QMessageBox::Ok); // N_MessageBox::information(NULL,tr("消息"),tr("提交事务失败,已回滚"), N_MessageBox::Ok);
} }
void CDbInterface::readUnit() void CDbInterface::readUnit()

View File

@ -6,9 +6,10 @@
#include "CDbInterface.h" #include "CDbInterface.h"
#include <QComboBox> #include <QComboBox>
#include <QLineEdit> #include <QLineEdit>
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include <QMenu> #include <QMenu>
#include "pub_utility_api/FileStyle.h" #include "pub_utility_api/FileStyle.h"
#include "../model_common/common.h"
CPlanCurvesConfigure::CPlanCurvesConfigure(QWidget *parent, bool hideNavBar, bool editMode) : CPlanCurvesConfigure::CPlanCurvesConfigure(QWidget *parent, bool hideNavBar, bool editMode) :
QWidget(parent), QWidget(parent),
@ -45,7 +46,10 @@ CPlanCurvesConfigure::CPlanCurvesConfigure(QWidget *parent, bool hideNavBar, boo
} }
else else
{ {
ui->planConfigType->setMinimumWidth(150); // ui->planConfigType->setMinimumWidth(150);
ui->planConfigType->hide();
initMainTabBar();
} }
m_dbInterface = NULL; m_dbInterface = NULL;
@ -279,8 +283,8 @@ void CPlanCurvesConfigure::initTable()
ui->tmplTableView->setItemDelegateForColumn(0, new CLineEditDelegate(this, E_MaxLength, 0, 0, 128)); ui->tmplTableView->setItemDelegateForColumn(0, new CLineEditDelegate(this, E_MaxLength, 0, 0, 128));
m_dayModel = new QStandardItemModel(this); m_dayModel = new QStandardItemModel(this);
m_dayModel->setColumnCount(4); m_dayModel->setColumnCount(5);
m_dayModel->setHorizontalHeaderLabels(QStringList()<< tr("日时段名称") << tr("开始时间") << tr("结束时间") << tr("")); m_dayModel->setHorizontalHeaderLabels(QStringList()<< tr("日时段名称") << tr("开始时间") << tr("结束时间") << tr("") << tr("单位"));
ui->dayTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); ui->dayTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
ui->dayTableView->setModel(m_dayModel); ui->dayTableView->setModel(m_dayModel);
connect(m_dayModel, SIGNAL(itemChanged(QStandardItem*)), this, SLOT(slot_DayTableItemChanged(QStandardItem*))); connect(m_dayModel, SIGNAL(itemChanged(QStandardItem*)), this, SLOT(slot_DayTableItemChanged(QStandardItem*)));
@ -288,11 +292,28 @@ void CPlanCurvesConfigure::initTable()
ui->dayTableView->setItemDelegateForColumn(1, new CTimeEditDelegate(this, true)); ui->dayTableView->setItemDelegateForColumn(1, new CTimeEditDelegate(this, true));
ui->dayTableView->setItemDelegateForColumn(2, new CTimeEditDelegate(this)); ui->dayTableView->setItemDelegateForColumn(2, new CTimeEditDelegate(this));
ui->dayTableView->setItemDelegateForColumn(3, new CLineEditDelegate(this, E_DoubleRange, -999999, 999999)); ui->dayTableView->setItemDelegateForColumn(3, new CLineEditDelegate(this, E_DoubleRange, -999999, 999999));
ui->dayTableView->setItemDelegateForColumn(4, new CLineEditDelegate(this, true));
ui->splitter->setStretchFactor(1,2); ui->splitter->setStretchFactor(1,2);
ui->splitter_2->setStretchFactor(0,2); ui->splitter_2->setStretchFactor(0,2);
ui->splitter_3->setStretchFactor(1,2); ui->splitter_3->setStretchFactor(1,2);
} }
void CPlanCurvesConfigure::initMainTabBar()
{
QTabBar *mainTabBar = new QTabBar;
mainTabBar->setObjectName("planCurveMainTabBar");
mainTabBar->setExpanding(false);
for(int i = 0; i < ui->planConfigType->count();i++)
{
mainTabBar->addTab(ui->planConfigType->item(i)->text());
}
ui->mainTabBarLayout->addWidget(mainTabBar);
connect(mainTabBar, SIGNAL(currentChanged(int)), this, SLOT(slot_stackWidgetChg(int)));
}
void CPlanCurvesConfigure::initPlanTypeComb(QComboBox* combox) void CPlanCurvesConfigure::initPlanTypeComb(QComboBox* combox)
{ {
combox->clear(); combox->clear();
@ -523,7 +544,7 @@ void CPlanCurvesConfigure::saveTypeData(QTableWidget *tableWidget, int table)
QString desc = tableWidget->item(i, 1)->text(); QString desc = tableWidget->item(i, 1)->text();
if(desc.isEmpty() && !tableWidget->isRowHidden(i)) if(desc.isEmpty() && !tableWidget->isRowHidden(i))
{ {
QMessageBox::information(this,tr("提示"),tr("名称不能为空!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("名称不能为空!"),N_MessageBox::Ok);
return; return;
} }
curveType type = curveType(tableWidget->item(i, 0)->data(Qt::UserRole).toInt()); curveType type = curveType(tableWidget->item(i, 0)->data(Qt::UserRole).toInt());
@ -538,11 +559,11 @@ void CPlanCurvesConfigure::saveTypeData(QTableWidget *tableWidget, int table)
} }
if(success) if(success)
{ {
QMessageBox::information(this,tr("提示"),tr("保存成功!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("保存成功!"),N_MessageBox::Ok);
emit ui->planConfigType->currentRowChanged(0); emit ui->planConfigType->currentRowChanged(0);
} }
else{ else{
QMessageBox::information(this,tr("提示"),tr("保存失败!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("保存失败!"),N_MessageBox::Ok);
} }
} }
@ -563,14 +584,14 @@ bool CPlanCurvesConfigure::checkDaysData(QStandardItemModel* stanModel, bool isI
int endSec = stanModel->data(endIndex, Qt::UserRole).toInt(); int endSec = stanModel->data(endIndex, Qt::UserRole).toInt();
if(isInterrupt && name.isEmpty()) if(isInterrupt && name.isEmpty())
{ {
QMessageBox::information(this,tr("提示"),tr("名称不能为空!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("名称不能为空!"),N_MessageBox::Ok);
return false; return false;
} }
if(endSec < startSec) if(endSec < startSec)
{ {
if(isInterrupt) if(isInterrupt)
{ {
QMessageBox::information(this,tr("提示"),tr("行: %1 结束时间不能小于开始时间!").arg(endIndex.row()+1),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("行: %1 结束时间不能小于开始时间!").arg(endIndex.row()+1),N_MessageBox::Ok);
return false; return false;
} }
endSec = startSec; endSec = startSec;
@ -579,8 +600,8 @@ bool CPlanCurvesConfigure::checkDaysData(QStandardItemModel* stanModel, bool isI
stanModel->item(row-1,2)->setData(endSec, Qt::UserRole); stanModel->item(row-1,2)->setData(endSec, Qt::UserRole);
if(isInterrupt && (stanModel->item(row,1)->data(Qt::UserRole).toInt() != endSec + 1)) if(isInterrupt && (stanModel->item(row,1)->data(Qt::UserRole).toInt() != endSec + 1))
{ {
QMessageBox::information(this,tr("提示"),tr("行: %1 与行:%2 时间段不连续!") N_MessageBox::information(this,tr("提示"),tr("行: %1 与行:%2 时间段不连续!")
.arg(endIndex.row()+1).arg(endIndex.row()+2),QMessageBox::Ok); .arg(endIndex.row()+1).arg(endIndex.row()+2),N_MessageBox::Ok);
return false; return false;
} }
@ -593,7 +614,7 @@ bool CPlanCurvesConfigure::checkDaysData(QStandardItemModel* stanModel, bool isI
} }
if(isInterrupt && (stanModel->item(0,0)->text().isEmpty() || stanModel->item(rowCount-1,0)->text().isEmpty())) if(isInterrupt && (stanModel->item(0,0)->text().isEmpty() || stanModel->item(rowCount-1,0)->text().isEmpty()))
{ {
QMessageBox::information(this,tr("提示"),tr("名称不能为空!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("名称不能为空!"),N_MessageBox::Ok);
return false; return false;
} }
stanModel->item(0,1)->setText(secToStr(0)); stanModel->item(0,1)->setText(secToStr(0));
@ -611,7 +632,7 @@ bool CPlanCurvesConfigure::checkWeekData()
{ {
if(m_dbInterface->readWeekIdUsed(ui->weekPlanTyleComb->currentData().toInt())) if(m_dbInterface->readWeekIdUsed(ui->weekPlanTyleComb->currentData().toInt()))
{ {
QMessageBox::information(this,tr("提示"),tr("周时段配置被使用,无法保存!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("周时段配置被使用,无法保存!"),N_MessageBox::Ok);
return false; return false;
} }
return true; return true;
@ -626,7 +647,7 @@ bool CPlanCurvesConfigure::checkWeekData()
int week = ui->weekTable->model()->data(index, Qt::UserRole).toInt(); int week = ui->weekTable->model()->data(index, Qt::UserRole).toInt();
if(name.isEmpty()) if(name.isEmpty())
{ {
QMessageBox::information(this,tr("提示"),tr("名称不能为空!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("名称不能为空!"),N_MessageBox::Ok);
return false; return false;
} }
if(weekList.indexOf(week) != -1) if(weekList.indexOf(week) != -1)
@ -637,7 +658,7 @@ bool CPlanCurvesConfigure::checkWeekData()
} }
if(weekList.length() != 7) if(weekList.length() != 7)
{ {
QMessageBox::information(this, tr("提示"), tr("周时段配置需覆盖一整周"), QMessageBox::Ok); N_MessageBox::information(this, tr("提示"), tr("周时段配置需覆盖一整周"), N_MessageBox::Ok);
return false; return false;
} }
return true; return true;
@ -674,19 +695,19 @@ bool CPlanCurvesConfigure::checkYearData()
QString name = item->data(desc).toString(); QString name = item->data(desc).toString();
if(name.isEmpty()) if(name.isEmpty())
{ {
QMessageBox::information(this,tr("提示"),tr("名称不能为空!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("名称不能为空!"),N_MessageBox::Ok);
return false; return false;
} }
if(monthBeg > monthEnd) if(monthBeg > monthEnd)
{ {
QMessageBox::information(this,tr("提示"),QString(tr("%1 : 开始月不能大于结束月!")).arg(name), QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),QString(tr("%1 : 开始月不能大于结束月!")).arg(name), N_MessageBox::Ok);
return false; return false;
} }
else if(monthBeg == monthEnd) else if(monthBeg == monthEnd)
{ {
if(daysBeg > daysEnd) if(daysBeg > daysEnd)
{ {
QMessageBox::information(this,tr("提示"),QString(tr("%1 : 开始日不能大于结束日!")).arg(name), QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),QString(tr("%1 : 开始日不能大于结束日!")).arg(name), N_MessageBox::Ok);
return false; return false;
} }
} }
@ -713,7 +734,7 @@ bool CPlanCurvesConfigure::checkIsAllYear(const QList<int>& noExcptList)
{ {
if(noExcptList.isEmpty()) if(noExcptList.isEmpty())
{ {
QMessageBox::information(this,tr("提示"),tr("年配置需要覆盖全年!"), QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("年配置需要覆盖全年!"), N_MessageBox::Ok);
return false; return false;
} }
int len = noExcptList.length(); int len = noExcptList.length();
@ -725,7 +746,7 @@ bool CPlanCurvesConfigure::checkIsAllYear(const QList<int>& noExcptList)
int oneDay = item->data(oneDayIndex).toInt(); int oneDay = item->data(oneDayIndex).toInt();
if(oneMonth!=1 || oneDay!=1) if(oneMonth!=1 || oneDay!=1)
{ {
QMessageBox::information(this,tr("提示"),tr("请从1月1日开始配置!"), QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("请从1月1日开始配置!"), N_MessageBox::Ok);
return false; return false;
} }
@ -744,7 +765,7 @@ bool CPlanCurvesConfigure::checkIsAllYear(const QList<int>& noExcptList)
getDateAddOne(monthEnd, daysEnd); getDateAddOne(monthEnd, daysEnd);
if(monthBeg!=monthEnd || daysBeg!=daysEnd) if(monthBeg!=monthEnd || daysBeg!=daysEnd)
{ {
QMessageBox::information(this,tr("提示"),tr("年配置需要覆盖全年!"), QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("年配置需要覆盖全年!"), N_MessageBox::Ok);
return false; return false;
} }
} }
@ -755,7 +776,7 @@ bool CPlanCurvesConfigure::checkIsAllYear(const QList<int>& noExcptList)
int lastDay = item->data(lastDayIndex).toInt(); int lastDay = item->data(lastDayIndex).toInt();
if(lastMonth!=12 || lastDay!=31) if(lastMonth!=12 || lastDay!=31)
{ {
QMessageBox::information(this,tr("提示"),tr("请配置到12月31日!"), QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("请配置到12月31日!"), N_MessageBox::Ok);
return false; return false;
} }
return true; return true;
@ -838,15 +859,19 @@ void CPlanCurvesConfigure::addDayData(const SApcCurveDayValue &day)
QStandardItem *end_minute = new QStandardItem(secToStr(day.end_sec)); QStandardItem *end_minute = new QStandardItem(secToStr(day.end_sec));
end_minute->setData(day.end_sec, Qt::UserRole); end_minute->setData(day.end_sec, Qt::UserRole);
QStandardItem *value = new QStandardItem(QString::number(day.value)); QStandardItem *value = new QStandardItem(QString::number(day.value));
QStandardItem *unit = new QStandardItem(day.unit);
QList<QStandardItem*> list; QList<QStandardItem*> list;
description->setTextAlignment(Qt::AlignCenter); description->setTextAlignment(Qt::AlignCenter);
start_minute->setTextAlignment(Qt::AlignCenter); start_minute->setTextAlignment(Qt::AlignCenter);
end_minute->setTextAlignment(Qt::AlignCenter); end_minute->setTextAlignment(Qt::AlignCenter);
value->setTextAlignment(Qt::AlignCenter); value->setTextAlignment(Qt::AlignCenter);
unit->setTextAlignment(Qt::AlignCenter);
list.append(description); list.append(description);
list.append(start_minute); list.append(start_minute);
list.append(end_minute); list.append(end_minute);
list.append(value); list.append(value);
list.append(unit);
m_dayModel->appendRow(list); m_dayModel->appendRow(list);
} }
@ -1011,6 +1036,7 @@ void CPlanCurvesConfigure::slot_newDaysValue()
QStandardItem *end = new QStandardItem(); QStandardItem *end = new QStandardItem();
QStandardItem *des = new QStandardItem(""); QStandardItem *des = new QStandardItem("");
QStandardItem *value = new QStandardItem("0"); QStandardItem *value = new QStandardItem("0");
QStandardItem *unit = new QStandardItem(getSeldCurveUnit());
des->setData(INSERT_CURVE, Qt::UserRole); des->setData(INSERT_CURVE, Qt::UserRole);
value->setData(0, Qt::UserRole); value->setData(0, Qt::UserRole);
@ -1032,10 +1058,12 @@ void CPlanCurvesConfigure::slot_newDaysValue()
start->setTextAlignment(Qt::AlignCenter); start->setTextAlignment(Qt::AlignCenter);
end->setTextAlignment(Qt::AlignCenter); end->setTextAlignment(Qt::AlignCenter);
value->setTextAlignment(Qt::AlignCenter); value->setTextAlignment(Qt::AlignCenter);
unit->setTextAlignment(Qt::AlignCenter);
list.append(des); list.append(des);
list.append(start); list.append(start);
list.append(end); list.append(end);
list.append(value); list.append(value);
list.append(unit);
if(insert) if(insert)
{ {
@ -1049,7 +1077,8 @@ void CPlanCurvesConfigure::slot_newDaysValue()
void CPlanCurvesConfigure::slot_newPlanCurve() void CPlanCurvesConfigure::slot_newPlanCurve()
{ {
KbdSelectPointDlg dlg; KbdSelectPointDlg dlg(this);
dlg.setWindowTitle(tr("新建计划曲线"));
QStringList list; QStringList list;
list << QString("sql@SELECT * FROM SYS_MODEL_LOCATION_INFO;LOCATION_ID:DESCRIPTION") list << QString("sql@SELECT * FROM SYS_MODEL_LOCATION_INFO;LOCATION_ID:DESCRIPTION")
<<QString("sql@SELECT * FROM SYS_MODEL_SUB_SYSTEM_INFO WHERE SUB_SYSTEM_ID not in (1,2,3);%1:%2").arg("SUB_SYSTEM_ID").arg("DESCRIPTION") <<QString("sql@SELECT * FROM SYS_MODEL_SUB_SYSTEM_INFO WHERE SUB_SYSTEM_ID not in (1,2,3);%1:%2").arg("SUB_SYSTEM_ID").arg("DESCRIPTION")
@ -1111,7 +1140,7 @@ void CPlanCurvesConfigure::slot_delTypeConfig()
QString desc = ui->typeTable->item(row, 1)->text(); QString desc = ui->typeTable->item(row, 1)->text();
if(m_dbInterface->readTypeIdUsed(id)) if(m_dbInterface->readTypeIdUsed(id))
{ {
QMessageBox::information(this, tr("提示"), QString("%1 被使用, 无法删除!").arg(desc), QMessageBox::Ok); N_MessageBox::information(this, tr("提示"), QString("%1 被使用, 无法删除!").arg(desc), N_MessageBox::Ok);
return; return;
} }
ui->typeTable->hideRow(row); ui->typeTable->hideRow(row);
@ -1144,7 +1173,7 @@ void CPlanCurvesConfigure::slot_delYearConfig()
{ {
if(m_dbInterface->readYearIdUsed(m_yearModel->data(idIndex).toInt(), ui->yearPlanTyleComb->currentData().toInt())) if(m_dbInterface->readYearIdUsed(m_yearModel->data(idIndex).toInt(), ui->yearPlanTyleComb->currentData().toInt()))
{ {
QMessageBox::information(this, tr("提示"), QString("%1 被使用, 无法删除!").arg(m_yearModel->data(descIndex).toString()), QMessageBox::Ok); N_MessageBox::information(this, tr("提示"), QString("%1 被使用, 无法删除!").arg(m_yearModel->data(descIndex).toString()), N_MessageBox::Ok);
return; return;
} }
} }
@ -1198,19 +1227,19 @@ void CPlanCurvesConfigure::slot_delPlanCurve()
return; return;
} }
int ret = QMessageBox::information(this, tr("提示"), QString(tr("是否删除曲线'%1'?")).arg(ui->planCurveTable->item(row,1)->text()), QMessageBox::Ok|QMessageBox::Cancel); int ret = N_MessageBox::information(this, tr("提示"), QString(tr("是否删除曲线'%1'?")).arg(ui->planCurveTable->item(row,1)->text()), N_MessageBox::Ok|N_MessageBox::Cancel);
if(ret == QMessageBox::Cancel) if(ret == N_MessageBox::Cancel)
return; return;
if(m_dbInterface->delApcCurve(ui->planCurveTable->item(row,0)->text())) if(m_dbInterface->delApcCurve(ui->planCurveTable->item(row,0)->text()))
{ {
ui->planCurveTable->removeRow(row); ui->planCurveTable->removeRow(row);
emit ui->planConfigType->currentRowChanged(4); emit ui->planConfigType->currentRowChanged(4);
QMessageBox::information(this, tr("提示"), tr("删除成功!"), QMessageBox::Ok); N_MessageBox::information(this, tr("提示"), tr("删除成功!"), N_MessageBox::Ok);
} }
else else
{ {
QMessageBox::information(this, tr("提示"), tr("删除失败!"), QMessageBox::Ok); N_MessageBox::information(this, tr("提示"), tr("删除失败!"), N_MessageBox::Ok);
} }
} }
@ -1228,7 +1257,7 @@ void CPlanCurvesConfigure::slot_saveYearConfg()
{ {
if(ui->yearPlanTyleComb->currentIndex() < 0) if(ui->yearPlanTyleComb->currentIndex() < 0)
{ {
QMessageBox::information(this,tr("提示"),tr("计划类型为空,请检查类型配置!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("计划类型为空,请检查类型配置!"),N_MessageBox::Ok);
return; return;
} }
@ -1276,18 +1305,18 @@ void CPlanCurvesConfigure::slot_saveYearConfg()
// else // else
// item->setData(typeIndex, NORMAL_CURVE, Qt::UserRole); // item->setData(typeIndex, NORMAL_CURVE, Qt::UserRole);
// } // }
QMessageBox::information(this,tr("提示"),tr("保存成功!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("保存成功!"),N_MessageBox::Ok);
emit ui->yearPlanTyleComb->currentIndexChanged(ui->yearPlanTyleComb->currentIndex()); emit ui->yearPlanTyleComb->currentIndexChanged(ui->yearPlanTyleComb->currentIndex());
} }
else else
QMessageBox::information(this,tr("提示"),tr("保存失败!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("保存失败!"),N_MessageBox::Ok);
} }
void CPlanCurvesConfigure::slot_saveWeekConfg() void CPlanCurvesConfigure::slot_saveWeekConfg()
{ {
if(ui->weekPlanTyleComb->currentIndex() < 0) if(ui->weekPlanTyleComb->currentIndex() < 0)
{ {
QMessageBox::information(this,tr("提示"),tr("计划类型为空,请检查类型配置!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("计划类型为空,请检查类型配置!"),N_MessageBox::Ok);
return; return;
} }
@ -1336,7 +1365,7 @@ void CPlanCurvesConfigure::slot_saveWeekConfg()
{ {
if(m_dbInterface->readWeekIdUsed(ui->weekPlanTyleComb->currentData().toInt())) if(m_dbInterface->readWeekIdUsed(ui->weekPlanTyleComb->currentData().toInt()))
{ {
QMessageBox::information(this,tr("提示"),tr("周时段配置被使用,无法保存!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("周时段配置被使用,无法保存!"),N_MessageBox::Ok);
return; return;
} }
success = m_dbInterface->updateApcCurveWeek(typeId, weekList); success = m_dbInterface->updateApcCurveWeek(typeId, weekList);
@ -1357,12 +1386,12 @@ void CPlanCurvesConfigure::slot_saveWeekConfg()
if(success) if(success)
{ {
QMessageBox::information(this,tr("提示"),tr("保存成功!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("保存成功!"),N_MessageBox::Ok);
emit ui->weekPlanTyleComb->currentIndexChanged(ui->weekPlanTyleComb->currentIndex()); emit ui->weekPlanTyleComb->currentIndexChanged(ui->weekPlanTyleComb->currentIndex());
} }
else else
{ {
QMessageBox::information(this,tr("提示"),tr("保存失败!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("保存失败!"),N_MessageBox::Ok);
} }
} }
@ -1370,7 +1399,7 @@ void CPlanCurvesConfigure::slot_saveDaysConfg()
{ {
if(ui->dayTmplTyleComb->currentIndex() < 0) if(ui->dayTmplTyleComb->currentIndex() < 0)
{ {
QMessageBox::information(this,tr("提示"),tr("日模板类型为空,请检查类型配置!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("日模板类型为空,请检查类型配置!"),N_MessageBox::Ok);
return; return;
} }
@ -1402,18 +1431,18 @@ void CPlanCurvesConfigure::slot_saveDaysConfg()
if(m_dbInterface->updateTmplSection(id, dayList, m_delDayList)) if(m_dbInterface->updateTmplSection(id, dayList, m_delDayList))
{ {
QMessageBox::information(this,tr("提示"),tr("保存成功!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("保存成功!"),N_MessageBox::Ok);
emit ui->dayTmplTyleComb->currentIndexChanged(ui->dayTmplTyleComb->currentIndex()); emit ui->dayTmplTyleComb->currentIndexChanged(ui->dayTmplTyleComb->currentIndex());
return; return;
} }
QMessageBox::information(this,tr("提示"),tr("保存失败!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("保存失败!"),N_MessageBox::Ok);
} }
void CPlanCurvesConfigure::slot_saveDaysValue() void CPlanCurvesConfigure::slot_saveDaysValue()
{ {
if(!ui->timeCofigTableView->currentIndex().isValid()) if(!ui->timeCofigTableView->currentIndex().isValid())
{ {
QMessageBox::information(this, tr("提示"), tr("请选择一条时段曲线!"), QMessageBox::Ok); N_MessageBox::information(this, tr("提示"), tr("请选择一条时段曲线!"), N_MessageBox::Ok);
return; return;
} }
if(!checkDaysData(m_dayModel,true)) if(!checkDaysData(m_dayModel,true))
@ -1426,18 +1455,18 @@ void CPlanCurvesConfigure::slot_saveDaysValue()
getDayValueList(dayList, m_valResult.valueId, false); getDayValueList(dayList, m_valResult.valueId, false);
if(m_dbInterface->updateDayValue(m_valResult.valueId, dayList, m_delDayList)) if(m_dbInterface->updateDayValue(m_valResult.valueId, dayList, m_delDayList))
{ {
QMessageBox::information(this,tr("提示"),tr("保存成功!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("保存成功!"),N_MessageBox::Ok);
emit ui->timeCofigTableView->clicked(ui->timeCofigTableView->currentIndex()); emit ui->timeCofigTableView->clicked(ui->timeCofigTableView->currentIndex());
return; return;
} }
QMessageBox::information(this,tr("提示"), tr("保存失败!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"), tr("保存失败!"),N_MessageBox::Ok);
} }
void CPlanCurvesConfigure::slot_savePlanCurve() void CPlanCurvesConfigure::slot_savePlanCurve()
{ {
if(ui->curvePlanTypeComb->currentIndex() < 0) if(ui->curvePlanTypeComb->currentIndex() < 0)
{ {
QMessageBox::information(this,tr("提示"),tr("计划类型为空,请检查类型配置!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("计划类型为空,请检查类型配置!"),N_MessageBox::Ok);
return; return;
} }
@ -1473,11 +1502,11 @@ void CPlanCurvesConfigure::slot_savePlanCurve()
{ {
ui->planCurveTable->item(row,1)->setData(Qt::UserRole, NORMAL_CURVE); ui->planCurveTable->item(row,1)->setData(Qt::UserRole, NORMAL_CURVE);
} }
QMessageBox::information(this,tr("提示"),tr("保存成功!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("保存成功!"),N_MessageBox::Ok);
} }
else else
{ {
QMessageBox::information(this,tr("提示"),tr("保存失败!"),QMessageBox::Ok); N_MessageBox::information(this,tr("提示"),tr("保存失败!"),N_MessageBox::Ok);
emit ui->planConfigType->currentRowChanged(4); emit ui->planConfigType->currentRowChanged(4);
} }
} }
@ -1638,9 +1667,11 @@ void CPlanCurvesConfigure::slot_updateDayTable(QModelIndex index)
m_valResult.keyIdTag = keyId; m_valResult.keyIdTag = keyId;
m_dayModel->setRowCount(0); m_dayModel->setRowCount(0);
QString strUnit = getSeldCurveUnit();
for(int i=0;i<dayValue.length();++i) for(int i=0;i<dayValue.length();++i)
{ {
const SApcCurveDayValue& day = dayValue.at(i); SApcCurveDayValue& day = dayValue[i];
day.unit = strUnit;
addDayData(day); addDayData(day);
} }
emit ui->daySetBtn->click(); emit ui->daySetBtn->click();
@ -1652,7 +1683,7 @@ void CPlanCurvesConfigure::slot_importTmplValue()
QModelIndexList indexList = ui->timeCofigTableView->selectionModel()->selectedIndexes(); QModelIndexList indexList = ui->timeCofigTableView->selectionModel()->selectedIndexes();
if(indexList.isEmpty()) if(indexList.isEmpty())
{ {
QMessageBox::information(this, tr("提示"), tr("请选择一条时段曲线!"), QMessageBox::Ok); N_MessageBox::information(this, tr("提示"), tr("请选择一条时段曲线!"), N_MessageBox::Ok);
return; return;
} }
@ -1665,11 +1696,11 @@ void CPlanCurvesConfigure::slot_importTmplValue()
} }
if(!m_dbInterface->updateDayValue(temp)) if(!m_dbInterface->updateDayValue(temp))
{ {
QMessageBox::information(this, tr("提示"), tr("导入失败"), QMessageBox::Ok); N_MessageBox::information(this, tr("提示"), tr("导入失败"), N_MessageBox::Ok);
} }
else else
{ {
QMessageBox::information(this, tr("提示"), tr("导入成功"), QMessageBox::Ok); N_MessageBox::information(this, tr("提示"), tr("导入成功"), N_MessageBox::Ok);
emit ui->timeCofigTableView->clicked(ui->timeCofigTableView->currentIndex()); emit ui->timeCofigTableView->clicked(ui->timeCofigTableView->currentIndex());
} }
} }

View File

@ -1,6 +1,9 @@
#include <QWidget> #include <QWidget>
#include "CPlanCurvesConfigurePluginWidget.h" #include "CPlanCurvesConfigurePluginWidget.h"
#include "CPlanCurvesConfigure.h" #include "CPlanCurvesConfigure.h"
#include "pub_widget/PubWidgetInit.h"
#include <QTranslator>
#include "../model_common/common.h"
CPlanCurvesConfigurePluginWidget::CPlanCurvesConfigurePluginWidget(QObject *parent): QObject(parent) CPlanCurvesConfigurePluginWidget::CPlanCurvesConfigurePluginWidget(QObject *parent): QObject(parent)
{ {
@ -17,6 +20,12 @@ bool CPlanCurvesConfigurePluginWidget::createWidget(QWidget *parent, bool editMo
bool hideNavBar = true; bool hideNavBar = true;
if(ptrVec.size() > 0) if(ptrVec.size() > 0)
hideNavBar = ((QVariant*)ptrVec.first())->toBool(); hideNavBar = ((QVariant*)ptrVec.first())->toBool();
QTranslator * qtTranslator = new QTranslator;
qtTranslator->load(Common::getTranslatePath("model_plan_curve_EN.qm"));
qApp->installTranslator(qtTranslator);
iot_public::installTranslator(Common::getLanguage().toStdString());
CPlanCurvesConfigure *pWidget = new CPlanCurvesConfigure(parent,hideNavBar,editMode); CPlanCurvesConfigure *pWidget = new CPlanCurvesConfigure(parent,hideNavBar,editMode);
*widget = (QWidget *)pWidget; *widget = (QWidget *)pWidget;
*reportWidget = (IPluginWidget *)pWidget; *reportWidget = (IPluginWidget *)pWidget;

View File

@ -7,7 +7,7 @@
class CPlanCurvesConfigurePluginWidget: public QObject, public CPluginWidgetInterface class CPlanCurvesConfigurePluginWidget: public QObject, public CPluginWidgetInterface
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "kbd.PluginWidgetInterface/1.0") Q_PLUGIN_METADATA(IID HMI_WidgetPlugin_IID)
Q_INTERFACES(CPluginWidgetInterface) Q_INTERFACES(CPluginWidgetInterface)
public: public:

View File

@ -65,4 +65,6 @@ RESOURCES += \
LIBS += -ldb_base_api -ldb_api_ex -ldb_sysinfo_api -lmodel_table -lmodel_common -lmodel_excel LIBS += -ldb_base_api -ldb_api_ex -ldb_sysinfo_api -lmodel_table -lmodel_common -lmodel_excel
LIBS += -lnet_msg_bus_api -lperm_mng_api -llog4cplus -lpub_logger_api -lpub_utility_api LIBS += -lnet_msg_bus_api -lperm_mng_api -llog4cplus -lpub_logger_api -lpub_utility_api
LIBS += -lpub_widget
TRANSLATIONS = $$PWD/model_plan_curve_EN.ts

View File

@ -9,7 +9,7 @@ SUBDIRS += \
model_plan_curve \ model_plan_curve \
ExpressionWidget \ ExpressionWidget \
StaticsWidget \ StaticsWidget \
iec61850InstWizard \ # iec61850InstWizard \
PCPMS_IP_Setting \ PCPMS_IP_Setting \
PCPMS_Screen_Brightness_Setting PCPMS_Screen_Brightness_Setting

View File

@ -30,6 +30,7 @@ LIBS += -lmodel_excel
LIBS += -lpub_logger_api LIBS += -lpub_logger_api
LIBS += -llog4cplus -lpub_utility_api LIBS += -llog4cplus -lpub_utility_api
LIBS += -lpub_widget
#DEFINES += SEQORDERCTRL_LIBRARY #DEFINES += SEQORDERCTRL_LIBRARY

View File

@ -4,221 +4,225 @@
<context> <context>
<name>QObject</name> <name>QObject</name>
<message> <message>
<location filename="seqorderctrl.cpp" line="107"/> <location filename="seqorderctrl.cpp" line="99"/>
<source></source> <source></source>
<translation type="unfinished">Sequential action</translation> <translation>Sequential action</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="108"/> <location filename="seqorderctrl.cpp" line="100"/>
<source></source> <source></source>
<translation type="unfinished">Sequence control function</translation> <translation>Sequence control function</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="109"/> <location filename="seqorderctrl.cpp" line="101"/>
<source></source> <source></source>
<translation type="unfinished">Sequence definition</translation> <translation>Sequence definition</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="119"/> <location filename="seqorderctrl.cpp" line="111"/>
<location filename="seqorderctrl.cpp" line="323"/>
<source></source>
<translation type="unfinished">Add</translation>
</message>
<message>
<location filename="seqorderctrl.cpp" line="120"/>
<location filename="seqorderctrl.cpp" line="324"/>
<source></source>
<translation type="unfinished">Modify</translation>
</message>
<message>
<location filename="seqorderctrl.cpp" line="122"/>
<location filename="seqorderctrl.cpp" line="325"/> <location filename="seqorderctrl.cpp" line="325"/>
<source></source>
<translation>Add</translation>
</message>
<message>
<location filename="seqorderctrl.cpp" line="112"/>
<location filename="seqorderctrl.cpp" line="326"/>
<source></source>
<translation>Modify</translation>
</message>
<message>
<location filename="seqorderctrl.cpp" line="114"/>
<location filename="seqorderctrl.cpp" line="327"/>
<source></source> <source></source>
<translation type="unfinished">Delete</translation> <translation>Delete</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="169"/> <location filename="seqorderctrl.cpp" line="161"/>
<source></source> <source></source>
<translation type="unfinished">Save</translation> <translation>Save</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="136"/> <location filename="seqorderctrl.cpp" line="128"/>
<source></source> <source></source>
<translation type="unfinished">All</translation> <translation>All</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="186"/> <location filename="seqorderctrl.cpp" line="178"/>
<source>:</source> <source>:</source>
<translation type="unfinished">Location:</translation> <translation>Location:</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="194"/> <location filename="seqorderctrl.cpp" line="286"/>
<location filename="seqorderctrl.cpp" line="284"/> <location filename="seqorderctrl.cpp" line="317"/>
<location filename="seqorderctrl.cpp" line="315"/>
<source></source> <source></source>
<translation type="unfinished">Search description</translation> <translation>Search description</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="224"/> <location filename="seqorderctrl.cpp" line="217"/>
<source>:</source> <source>:</source>
<translation type="unfinished">function name:</translation> <translation>function name:</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="225"/> <location filename="seqorderctrl.cpp" line="187"/>
<source></source>
<translation>Please enter a descriptive keyword</translation>
</message>
<message>
<location filename="seqorderctrl.cpp" line="218"/>
<source>:</source> <source>:</source>
<translation type="unfinished">Function description:</translation> <translation>Function description:</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="244"/> <location filename="seqorderctrl.cpp" line="243"/>
<source></source> <source></source>
<translation type="unfinished">List of actions included in this function</translation> <translation>List of actions included in this function</translation>
</message>
<message>
<location filename="seqorderctrl.cpp" line="250"/>
<location filename="seqorderctrl.cpp" line="343"/>
<source></source>
<translation>Add record</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="252"/> <location filename="seqorderctrl.cpp" line="252"/>
<location filename="seqorderctrl.cpp" line="342"/> <location filename="seqorderctrl.cpp" line="345"/>
<source></source>
<translation type="unfinished">Add record</translation>
</message>
<message>
<location filename="seqorderctrl.cpp" line="253"/>
<location filename="seqorderctrl.cpp" line="343"/>
<source></source> <source></source>
<translation type="unfinished">Modify record</translation> <translation>Modify record</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="254"/> <location filename="seqorderctrl.cpp" line="254"/>
<location filename="seqorderctrl.cpp" line="344"/> <location filename="seqorderctrl.cpp" line="347"/>
<source></source> <source></source>
<translation type="unfinished">Delete Record</translation> <translation>Delete Record</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="309"/> <location filename="seqorderctrl.cpp" line="311"/>
<source></source> <source></source>
<translation type="unfinished">Sequence List</translation> <translation>Sequence List</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="335"/> <location filename="seqorderctrl.cpp" line="337"/>
<source></source> <source></source>
<translation type="unfinished">List of actions included in this function</translation> <translation>List of actions included in this function</translation>
</message> </message>
</context> </context>
<context> <context>
<name>SeqOrderCtrl</name> <name>SeqOrderCtrl</name>
<message> <message>
<location filename="seqorderctrl.cpp" line="467"/> <location filename="seqorderctrl.cpp" line="453"/>
<source></source> <source></source>
<translation type="unfinished">Added successfully</translation> <translation>Added successfully</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="495"/> <location filename="seqorderctrl.cpp" line="481"/>
<source>使,! <source>使,!
</source> </source>
<translation type="unfinished">The following functions use this action,please modify the corresponding function settings first!</translation> <translation>The following functions use this action,please modify the corresponding function settings first!</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="521"/> <location filename="seqorderctrl.cpp" line="507"/>
<source>!</source> <source>!</source>
<translation type="unfinished">failed to delete!</translation> <translation>failed to delete!</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="526"/> <location filename="seqorderctrl.cpp" line="512"/>
<location filename="seqorderctrl.cpp" line="582"/> <location filename="seqorderctrl.cpp" line="568"/>
<location filename="seqorderctrl.cpp" line="1137"/> <location filename="seqorderctrl.cpp" line="1131"/>
<location filename="seqorderctrl.cpp" line="1287"/> <location filename="seqorderctrl.cpp" line="1281"/>
<location filename="seqorderctrl.cpp" line="1380"/> <location filename="seqorderctrl.cpp" line="1375"/>
<source>!</source> <source>!</source>
<translation type="unfinished">successfully deleted!</translation> <translation>successfully deleted!</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="551"/> <location filename="seqorderctrl.cpp" line="537"/>
<location filename="seqorderctrl.cpp" line="1107"/> <location filename="seqorderctrl.cpp" line="1101"/>
<source>使,! <source>使,!
</source> </source>
<translation type="unfinished">The following sequencer uses this function, please modify the corresponding sequencer setting first!</translation> <translation>The following sequencer uses this function, please modify the corresponding sequencer setting first!</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="592"/> <location filename="seqorderctrl.cpp" line="578"/>
<source></source> <source></source>
<translation type="unfinished">Please select the function to be modified</translation> <translation>Please select the function to be modified</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="616"/> <location filename="seqorderctrl.cpp" line="604"/>
<source></source> <source></source>
<translation type="unfinished">Neither the name nor the description is allowed to be empty</translation> <translation>Neither the name nor the description is allowed to be empty</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="629"/> <location filename="seqorderctrl.cpp" line="617"/>
<source></source> <source></source>
<translation type="unfinished">Duplicate feature name</translation> <translation>Duplicate feature name</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="659"/> <location filename="seqorderctrl.cpp" line="647"/>
<source></source> <source></source>
<translation type="unfinished">Successfully modified</translation> <translation>Successfully modified</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="865"/> <location filename="seqorderctrl.cpp" line="855"/>
<source></source> <source></source>
<translation type="unfinished">Failed to obtain station information</translation> <translation>Failed to obtain station information</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="895"/> <location filename="seqorderctrl.cpp" line="885"/>
<source></source> <source></source>
<translation type="unfinished">Save failed</translation> <translation>Save failed</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="903"/> <location filename="seqorderctrl.cpp" line="893"/>
<location filename="seqorderctrl.cpp" line="1071"/> <location filename="seqorderctrl.cpp" line="1065"/>
<location filename="seqorderctrl.cpp" line="1211"/> <location filename="seqorderctrl.cpp" line="1205"/>
<location filename="seqorderctrl.cpp" line="1339"/> <location filename="seqorderctrl.cpp" line="1334"/>
<source>!</source> <source>!</source>
<translation type="unfinished">Added successfully</translation> <translation>Added successfully</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="908"/> <location filename="seqorderctrl.cpp" line="898"/>
<location filename="seqorderctrl.cpp" line="1179"/> <location filename="seqorderctrl.cpp" line="1173"/>
<location filename="seqorderctrl.cpp" line="1249"/> <location filename="seqorderctrl.cpp" line="1243"/>
<location filename="seqorderctrl.cpp" line="1420"/> <location filename="seqorderctrl.cpp" line="1415"/>
<source>!</source> <source>!</source>
<translation type="unfinished">Successfully modified</translation> <translation>Successfully modified</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="1025"/> <location filename="seqorderctrl.cpp" line="1019"/>
<location filename="seqorderctrl.cpp" line="1081"/> <location filename="seqorderctrl.cpp" line="1074"/>
<location filename="seqorderctrl.cpp" line="1295"/> <location filename="seqorderctrl.cpp" line="1289"/>
<location filename="seqorderctrl.cpp" line="1349"/> <location filename="seqorderctrl.cpp" line="1344"/>
<source></source> <source></source>
<translation type="unfinished">Please save the changes first</translation> <translation>Please save the changes first</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="1032"/> <location filename="seqorderctrl.cpp" line="1026"/>
<location filename="seqorderctrl.cpp" line="1039"/> <location filename="seqorderctrl.cpp" line="1033"/>
<source></source> <source></source>
<translation type="unfinished">Please select the function you want to add on the left</translation> <translation>Please select the function you want to add on the left</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="1150"/> <location filename="seqorderctrl.cpp" line="1144"/>
<location filename="seqorderctrl.cpp" line="1220"/> <location filename="seqorderctrl.cpp" line="1214"/>
<location filename="seqorderctrl.cpp" line="1393"/> <location filename="seqorderctrl.cpp" line="1388"/>
<source></source> <source></source>
<translation type="unfinished">Please select the row to be modified</translation> <translation>Please select the row to be modified</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="1301"/> <location filename="seqorderctrl.cpp" line="1295"/>
<source></source> <source></source>
<translation type="unfinished">Please select the sequence to add</translation> <translation>Please select the sequence to add</translation>
</message>
<message>
<location filename="seqorderctrl.cpp" line="1420"/>
<location filename="seqorderctrl.cpp" line="1425"/>
<location filename="seqorderctrl.cpp" line="1430"/>
<source></source>
<translation>Message</translation>
</message> </message>
<message> <message>
<location filename="seqorderctrl.cpp" line="1425"/> <location filename="seqorderctrl.cpp" line="1425"/>
<location filename="seqorderctrl.cpp" line="1430"/>
<location filename="seqorderctrl.cpp" line="1435"/>
<source></source>
<translation type="unfinished">Message</translation>
</message>
<message>
<location filename="seqorderctrl.cpp" line="1430"/>
<source>,</source> <source>,</source>
<translation type="unfinished">Failed to commit transaction and rolled back</translation> <translation>Failed to commit transaction and rolled back</translation>
</message> </message>
</context> </context>
</TS> </TS>

View File

@ -14,7 +14,7 @@
#include "kbdtabledatamgr.h" #include "kbdtabledatamgr.h"
#include <QLabel> #include <QLabel>
#include <QComboBox> #include <QComboBox>
#include <QMessageBox> #include "pub_widget/MessageBox.h"
#include <QSqlQuery> #include <QSqlQuery>
#include "kbdpropertydlg.h" #include "kbdpropertydlg.h"
#include <QToolBar> #include <QToolBar>
@ -28,6 +28,7 @@
#include <QFileInfo> #include <QFileInfo>
#include <QTranslator> #include <QTranslator>
#include <QApplication> #include <QApplication>
#include "pub_widget/PubWidgetInit.h"
class SeqOrderCtrlPrivate class SeqOrderCtrlPrivate
{ {
@ -212,7 +213,7 @@ private:
hSplittter->addWidget(initFuncLeftList(hSplittter)); hSplittter->addWidget(initFuncLeftList(hSplittter));
QWidget *widget = new QWidget(hSplittter); QWidget *widget = new QWidget(hSplittter);
QGridLayout *grid = new QGridLayout; QHBoxLayout *funcLayout = new QHBoxLayout;
QLabel *label1 = new QLabel(QObject::tr("功能名称:"),widget); QLabel *label1 = new QLabel(QObject::tr("功能名称:"),widget);
QLabel *label2 = new QLabel(QObject::tr("功能描述:"),widget); QLabel *label2 = new QLabel(QObject::tr("功能描述:"),widget);
@ -222,16 +223,22 @@ private:
labelFuncDesc = new QLabel("xxxx",widget); labelFuncDesc = new QLabel("xxxx",widget);
labelFuncName->setObjectName("labelFuncName"); labelFuncName->setObjectName("labelFuncName");
labelFuncDesc->setObjectName("labelFuncDesc"); labelFuncDesc->setObjectName("labelFuncDesc");
grid->addWidget(label1,0,0);
grid->addWidget(label2,1,0);
grid->addWidget(labelFuncName,0,1);
grid->addWidget(labelFuncDesc,1,1);
labelFuncName->setFrameStyle(QFrame::Panel|QFrame::Sunken); labelFuncName->setFrameStyle(QFrame::Panel|QFrame::Sunken);
labelFuncDesc->setFrameStyle(QFrame::Panel|QFrame::Sunken); labelFuncDesc->setFrameStyle(QFrame::Panel|QFrame::Sunken);
grid->setAlignment(Qt::AlignCenter); funcLayout->addWidget(label1);
funcLayout->addSpacing(5);
funcLayout->addWidget(labelFuncName);
funcLayout->addSpacing(50);
funcLayout->addWidget(label2,0);
funcLayout->addSpacing(5);
funcLayout->addWidget(labelFuncDesc);
funcLayout->addStretch();
funcLayout->setSpacing(0);
QVBoxLayout *vLayout = new QVBoxLayout; QVBoxLayout *vLayout = new QVBoxLayout;
vLayout->addLayout(grid); vLayout->addLayout(funcLayout);
vLayout->setSpacing(20); vLayout->setSpacing(20);
QGroupBox * box = new QGroupBox(QObject::tr("此功能所包含的动作列表"),widget); QGroupBox * box = new QGroupBox(QObject::tr("此功能所包含的动作列表"),widget);
@ -240,10 +247,13 @@ private:
QToolBar *bar = new QToolBar(widget); QToolBar *bar = new QToolBar(widget);
tableFunc = new KbdTable(widget); tableFunc = new KbdTable(widget);
tableFunc->setObjectName("tableFunc"); tableFunc->setObjectName("tableFunc");
bar->setIconSize(QSize(24,24)); QAction* act = nullptr;
bar->addAction(QIcon(":/icons/icons/new.png"),QObject::tr("添加记录"),q,SLOT(onAddActionToFunc())); act = bar->addAction(QObject::tr("添加记录"),q,SLOT(onAddActionToFunc()));
bar->addAction(QIcon(":/icons/icons/modify.png"),QObject::tr("修改记录"),q,SLOT(onModifyActionOfFunc())); bar->widgetForAction(act)->setObjectName("icon_add");
bar->addAction(QIcon(":/icons/icons/delete.png"),QObject::tr("删除记录"),q,SLOT(onRemoveActionOfFunc())); act = bar->addAction(QObject::tr("修改记录"),q,SLOT(onModifyActionOfFunc()));
bar->widgetForAction(act)->setObjectName("icon_edit");
act = bar->addAction(QObject::tr("删除记录"),q,SLOT(onRemoveActionOfFunc()));
bar->widgetForAction(act)->setObjectName("icon_delete");
vLayoutBox->addWidget(bar); vLayoutBox->addWidget(bar);
vLayoutBox->addWidget(tableFunc); vLayoutBox->addWidget(tableFunc);
@ -306,23 +316,24 @@ private:
leSearchOrder = new QLineEdit(boxTop); leSearchOrder = new QLineEdit(boxTop);
leSearchOrder->setObjectName("leSearchOrder"); leSearchOrder->setObjectName("leSearchOrder");
leSearchOrder->setPlaceholderText(QObject::tr("搜索描述")); leSearchOrder->setPlaceholderText(QObject::tr("搜索描述"));
hLayoutSearch->addWidget(leSearchOrder);
vLayoutTopLeft->addLayout(hLayoutSearch); vLayoutTopLeft->addLayout(hLayoutSearch);
tableSetting = new KbdTable(boxTop); tableSetting = new KbdTable(boxTop);
vLayoutTopLeft->addWidget(tableSetting); vLayoutTopLeft->addWidget(tableSetting);
QVBoxLayout *vLayoutTopRight = new QVBoxLayout; QToolBar *topBar = new QToolBar(boxTop); //顺控列表中的工具栏
QPushButton *btAdd = new QPushButton(QObject::tr("添加"),boxTop); QAction* act = nullptr;
QPushButton *btModify = new QPushButton(QObject::tr("修改"),boxTop); act = topBar->addAction(QObject::tr("添加记录"),q,SLOT(onAddSeqSetting()));
QPushButton *btRemove = new QPushButton(QObject::tr("删除"),boxTop); topBar->widgetForAction(act)->setObjectName("icon_add");
vLayoutTopRight->addWidget(btAdd); act = topBar->addAction(QObject::tr("修改记录"),q,SLOT(onModifySeqSetting()));
vLayoutTopRight->addWidget(btModify); topBar->widgetForAction(act)->setObjectName("icon_edit");
vLayoutTopRight->addWidget(btRemove); act = topBar->addAction(QObject::tr("删除记录"),q,SLOT(onRemoveSeqSetting()));
topBar->widgetForAction(act)->setObjectName("icon_delete");
hLayoutSearch->addWidget(topBar);
hLayoutSearch->addWidget(leSearchOrder);
QHBoxLayout *hLayoutTop = new QHBoxLayout; QHBoxLayout *hLayoutTop = new QHBoxLayout;
hLayoutTop->addLayout(vLayoutTopLeft); hLayoutTop->addLayout(vLayoutTopLeft);
hLayoutTop->addLayout(vLayoutTopRight);
boxTop->setLayout(hLayoutTop); boxTop->setLayout(hLayoutTop);
QGroupBox * boxButtom = new QGroupBox(QObject::tr("此顺控所包含的功能列表"),vSplitter); QGroupBox * boxButtom = new QGroupBox(QObject::tr("此顺控所包含的功能列表"),vSplitter);
@ -330,10 +341,12 @@ private:
QVBoxLayout *vLayoutBoxButtom = new QVBoxLayout; QVBoxLayout *vLayoutBoxButtom = new QVBoxLayout;
QToolBar *bar = new QToolBar(boxButtom); QToolBar *bar = new QToolBar(boxButtom);
tableDefine = new KbdTable(boxButtom); tableDefine = new KbdTable(boxButtom);
bar->setIconSize(QSize(24,24)); act = bar->addAction(QObject::tr("添加记录"),q,SLOT(onAddFuncToSeq()));
bar->addAction(QIcon(":/icons/icons/new.png"),QObject::tr("添加记录"),q,SLOT(onAddFuncToSeq())); bar->widgetForAction(act)->setObjectName("icon_add");
bar->addAction(QIcon(":/icons/icons/modify.png"),QObject::tr("修改记录"),q,SLOT(onModifyFuncOfSeq())); act = bar->addAction(QObject::tr("修改记录"),q,SLOT(onModifyFuncOfSeq()));
bar->addAction(QIcon(":/icons/icons/delete.png"),QObject::tr("删除记录"),q,SLOT(onRemoveFuncOfSeq())); bar->widgetForAction(act)->setObjectName("icon_edit");
act = bar->addAction(QObject::tr("删除记录"),q,SLOT(onRemoveFuncOfSeq()));
bar->widgetForAction(act)->setObjectName("icon_delete");
vLayoutBoxButtom->addWidget(bar); vLayoutBoxButtom->addWidget(bar);
vLayoutBoxButtom->addWidget(tableDefine); vLayoutBoxButtom->addWidget(tableDefine);
@ -353,10 +366,6 @@ private:
tableDefine->setShowCol(showCols); tableDefine->setShowCol(showCols);
} }
QObject::connect(btAdd,SIGNAL(clicked(bool)),q,SLOT(onAddSeqSetting()));
QObject::connect(btModify,SIGNAL(clicked(bool)),q,SLOT(onModifySeqSetting()));
QObject::connect(btRemove,SIGNAL(clicked(bool)),q,SLOT(onRemoveSeqSetting()));
QObject::connect(tableSetting,SIGNAL(doubleClicked(const QModelIndex &)),q,SLOT(onModifySeqSetting())); QObject::connect(tableSetting,SIGNAL(doubleClicked(const QModelIndex &)),q,SLOT(onModifySeqSetting()));
QObject::connect(tableSetting,SIGNAL(clicked(const QModelIndex &)),q,SLOT(onClickedSetting(const QModelIndex &))); QObject::connect(tableSetting,SIGNAL(clicked(const QModelIndex &)),q,SLOT(onClickedSetting(const QModelIndex &)));
QObject::connect(leSearchOrder,SIGNAL(textChanged(const QString &)),q,SLOT(onSearchSeq())); QObject::connect(leSearchOrder,SIGNAL(textChanged(const QString &)),q,SLOT(onSearchSeq()));
@ -368,6 +377,7 @@ private:
m_translates = new QTranslator; m_translates = new QTranslator;
m_translates->load(Common::getTranslatePath("model_sequence_EN.qm")); m_translates->load(Common::getTranslatePath("model_sequence_EN.qm"));
qApp->installTranslator(m_translates); qApp->installTranslator(m_translates);
iot_public::installTranslator(Common::getLanguage().toStdString());
} }
void removeTranslate(){ void removeTranslate(){
qApp->removeTranslator(m_translates); qApp->removeTranslator(m_translates);
@ -415,6 +425,7 @@ void SeqOrderCtrl::addFunc()
if(retStr.isEmpty()) if(retStr.isEmpty())
{ {
KbdPropertyDlg dlg(true,this); KbdPropertyDlg dlg(true,this);
dlg.setWindowTitle(tr("新增顺控功能"));
dlg.panel()->setDisplayRow(model,model->rowCount()); dlg.panel()->setDisplayRow(model,model->rowCount());
dlg.panel()->setPropertyValue(CN_ACTION_NO,"1"); dlg.panel()->setPropertyValue(CN_ACTION_NO,"1");
dlg.panel()->setPropertyEditable(CN_ACTION_NAME,true); dlg.panel()->setPropertyEditable(CN_ACTION_NAME,true);
@ -575,6 +586,7 @@ void SeqOrderCtrl::modifyFunc()
QString newName; QString newName;
QString newDesc; QString newDesc;
KbdPropertyDlg dlg(false,this); KbdPropertyDlg dlg(false,this);
dlg.setWindowTitle(tr("修改顺控功能"));
QList<int> cols; QList<int> cols;
cols << modelFuncCols.findCol(CN_NAME) << modelFuncCols.findCol(CN_DESC); cols << modelFuncCols.findCol(CN_NAME) << modelFuncCols.findCol(CN_DESC);
dlg.panel()->setDisplayRow(modelFunc,modelFunc->rowCount(), modelFuncCols.getGroup(),cols); dlg.panel()->setDisplayRow(modelFunc,modelFunc->rowCount(), modelFuncCols.getGroup(),cols);
@ -1027,6 +1039,7 @@ void SeqOrderCtrl::onAddActionToFunc()
if(retStr.isEmpty()) if(retStr.isEmpty())
{ {
KbdPropertyDlg dlg(true,this); KbdPropertyDlg dlg(true,this);
dlg.setWindowTitle(tr("添加顺控动作"));
dlg.panel()->setDisplayRow(model,model->rowCount()); dlg.panel()->setDisplayRow(model,model->rowCount());
dlg.panel()->setPropertyValue(CN_NAME,index.data(Qt::UserRole).toString()); dlg.panel()->setPropertyValue(CN_NAME,index.data(Qt::UserRole).toString());
dlg.panel()->setPropertyValue(CN_DESC,index.data().toString()); dlg.panel()->setPropertyValue(CN_DESC,index.data().toString());
@ -1144,6 +1157,7 @@ void SeqOrderCtrl::onModifyActionOfFunc()
showCols.removeAll(modelFuncCols.findCol(CN_DESC)); showCols.removeAll(modelFuncCols.findCol(CN_DESC));
showCols.removeAll(modelFuncCols.findCol(CN_TIMEFLAG)); showCols.removeAll(modelFuncCols.findCol(CN_TIMEFLAG));
KbdPropertyDlg dlg(true,this); KbdPropertyDlg dlg(true,this);
dlg.setWindowTitle(tr("修改顺控动作"));
dlg.panel()->setDisplayRow(modelFunc,index.row(), modelFuncCols.getGroup(),showCols); dlg.panel()->setDisplayRow(modelFunc,index.row(), modelFuncCols.getGroup(),showCols);
if(dlg.exec()) if(dlg.exec())
{ {
@ -1173,6 +1187,7 @@ void SeqOrderCtrl::onAddSeqSetting()
if(retStr.isEmpty()) if(retStr.isEmpty())
{ {
KbdPropertyDlg dlg(true,this); KbdPropertyDlg dlg(true,this);
dlg.setWindowTitle(tr("新增顺控"));
dlg.panel()->setDisplayRow(modelSeqSetting,modelSeqSetting->rowCount()); dlg.panel()->setDisplayRow(modelSeqSetting,modelSeqSetting->rowCount());
if(dlg.exec()) if(dlg.exec())
{ {
@ -1211,6 +1226,7 @@ void SeqOrderCtrl::onModifySeqSetting()
if(retStr.isEmpty()) if(retStr.isEmpty())
{ {
KbdPropertyDlg dlg(true,this); KbdPropertyDlg dlg(true,this);
dlg.setWindowTitle(tr("修改顺控"));
dlg.panel()->setDisplayRow(modelSeqSetting,index.row()); dlg.panel()->setDisplayRow(modelSeqSetting,index.row());
if(dlg.exec()) if(dlg.exec())
{ {
@ -1296,6 +1312,7 @@ void SeqOrderCtrl::onAddFuncToSeq()
if(retStr.isEmpty()) if(retStr.isEmpty())
{ {
KbdPropertyDlg dlg(true,this); KbdPropertyDlg dlg(true,this);
dlg.setWindowTitle(tr("添加顺控功能"));
const ColMgrDataList& modelSettingCols = modelSetting->getHeadCols(); const ColMgrDataList& modelSettingCols = modelSetting->getHeadCols();
dlg.panel()->setDisplayRow(modelDefine,modelDefine->rowCount()); dlg.panel()->setDisplayRow(modelDefine,modelDefine->rowCount());
dlg.panel()->setPropertyEditable(CN_FUNC_NAME,true); dlg.panel()->setPropertyEditable(CN_FUNC_NAME,true);
@ -1386,6 +1403,7 @@ void SeqOrderCtrl::onModifyFuncOfSeq()
showCols.removeAll(modelDefineCols.findCol(CN_SEQ_NAME)); showCols.removeAll(modelDefineCols.findCol(CN_SEQ_NAME));
showCols.removeAll(modelDefineCols.findCol(CN_TIMEFLAG)); showCols.removeAll(modelDefineCols.findCol(CN_TIMEFLAG));
KbdPropertyDlg dlg(true,this); KbdPropertyDlg dlg(true,this);
dlg.setWindowTitle(tr("修改顺控功能"));
dlg.panel()->setDisplayRow(modelDefine,index.row(), modelDefineCols.getGroup(),showCols); dlg.panel()->setDisplayRow(modelDefine,index.row(), modelDefineCols.getGroup(),showCols);
if(dlg.exec()) if(dlg.exec())
{ {
@ -1405,17 +1423,17 @@ void SeqOrderCtrl::onModifyFuncOfSeq()
void SeqOrderCtrl::onStartTransactionError(const QString&erroStr) void SeqOrderCtrl::onStartTransactionError(const QString&erroStr)
{ {
QMessageBox::information(this,tr("消息"),erroStr); N_MessageBox::information(this,tr("消息"),erroStr);
} }
void SeqOrderCtrl::onCommitError() void SeqOrderCtrl::onCommitError()
{ {
QMessageBox::information(this,tr("消息"),tr("提交事务失败,已回滚")); N_MessageBox::information(this,tr("消息"),tr("提交事务失败,已回滚"));
} }
void SeqOrderCtrl::onMsg(const QString &msg) void SeqOrderCtrl::onMsg(const QString &msg)
{ {
QMessageBox::information(this,tr("消息"),msg); N_MessageBox::information(this,tr("消息"),msg);
} }

View File

@ -7,7 +7,7 @@
class SequencePluginWidget : public QObject, public CPluginWidgetInterface class SequencePluginWidget : public QObject, public CPluginWidgetInterface
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "kbd.PluginWidgetInterface/1.0") Q_PLUGIN_METADATA(IID HMI_WidgetPlugin_IID)
Q_INTERFACES(CPluginWidgetInterface) Q_INTERFACES(CPluginWidgetInterface)
public: public:

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

View File

@ -3,6 +3,7 @@
#include <QDomDocument> #include <QDomDocument>
#include <vector> #include <vector>
#include <QDir> #include <QDir>
#include <QThread>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
@ -11,6 +12,11 @@
#include <db_manager_api/db_manager_api.h> #include <db_manager_api/db_manager_api.h>
#include "installer_common.h" #include "installer_common.h"
#include "db_manager_api/db_opt_mysql.h"
#include "db_manager_api/db_opt_kingbase.h"
#include "db_manager_api/db_opt_opengauss.h"
#include "tsdb_api/TsdbApi.h"
#ifdef OS_WINDOWS #ifdef OS_WINDOWS
#include "windows.h" #include "windows.h"
@ -18,6 +24,9 @@
#pragma comment(lib,"user32.lib") #pragma comment(lib,"user32.lib")
#endif #endif
#define DB_TYPE_MYSQL "mysql"
#define DB_TYPE_OPENGAUSS "opengauss"
#define DB_TYPE_KINGBASE "kingbase"
bool isKylin() bool isKylin()
{ {
@ -162,9 +171,11 @@ void SetupWidget::install()
} }
} }
registerKeepalivedSrv(); if(m_isWebInstalled)
statusInstall(tr("注册keepalived服务完成")); {
registerKeepalivedSrv();
statusInstall(tr("注册keepalived服务完成"));
}
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
@ -353,7 +364,17 @@ bool SetupWidget::installRd()
return false; return false;
#endif #endif
if(!installRdService()) if(!installRdService())
{
return false; return false;
}
QThread::msleep(5000);
if(!modifyDBPassword()) //创建或者修改用户名密码
{
return false;
}
QThread::msleep(1000);
return true; return true;
} }
@ -404,6 +425,33 @@ bool SetupWidget::copyMySQL()
} }
#endif #endif
#ifdef OS_LINUX
bool SetupWidget::relpaceInfluxDBConfig(const QString &cfgFile)
{
if( !QFile::remove("/etc/influxdb/influxdb.conf") )
{
errorInstall(tr("安装InfluxDB过程中无法移除配置文件"));
return false;
}
if( !QFile::copy(this->m_mainProgramPath
+ QDir::separator() + "product"
+ QDir::separator() + "common"
+ QDir::separator() + "sysconfig"
+ QDir::separator() + "setup"
+ QDir::separator() + cfgFile
,"/etc/influxdb/influxdb.conf") )
{
errorInstall(tr("安装InfluxDB过程中无法更换配置文件"));
return false;
}
system("systemctl enable influxdb");
system("systemctl restart influxdb");
QThread::msleep(3000);
return true;
}
#endif
bool SetupWidget::installInfluxDBService() bool SetupWidget::installInfluxDBService()
{ {
#ifdef OS_WINDOWS #ifdef OS_WINDOWS
@ -426,27 +474,78 @@ bool SetupWidget::installInfluxDBService()
#endif #endif
#ifdef OS_LINUX #ifdef OS_LINUX
if( !QFile::remove("/etc/influxdb/influxdb.conf") ) //先禁用权限认证,用来创建用户
if(!relpaceInfluxDBConfig("influxdb_without_auth.conf"))
{ {
errorInstall(tr("安装InfluxDB过程中无法移除配置文件"));
return false;
}
if( !QFile::copy(this->m_mainProgramPath
+ QDir::separator() + "product"
+ QDir::separator() + "common"
+ QDir::separator() + "sysconfig"
+ QDir::separator() + "setup"
+ QDir::separator() + "influxdb.conf"
,"/etc/influxdb/influxdb.conf") )
{
errorInstall(tr("安装InfluxDB过程中无法更换配置文件"));
return false; return false;
} }
system("systemctl enable influxdb");
system("systemctl restart influxdb");
#endif #endif
return true;
// 创建用户
if (!iot_dbms::initTsdbApi())
{
errorInstall(tr("influxdb连接初始化失败"));
}
/* 为以后搜索方便,保留此注释 EMS_DEFAULT_DATABASE
* ,
*/
iot_dbms::CTsdbConnPtr ptrConn;
ptrConn.reset(new iot_dbms::CTsdbConn("127.0.0.1", -1, this->m_db_name.toStdString().c_str(),
this->m_db_name.toStdString().c_str(),
this->m_db_password.toStdString().c_str()));
bool bPingOk = false;
for(int i = 0;i < 3;++i)
{
if (!(bPingOk = ptrConn->pingServer(1000)))
{
errorInstall(tr("influxdb连接失败...重试"));
QThread::msleep(1000);
continue;
}
else {
break;
}
}
if(!bPingOk)
{
errorInstall(tr("influxdb连接失败"));
return false;
}
std::string strResult;
QString strUserSQL = QString("drop user \"%1\"").arg(this->m_db_name);
if ( !ptrConn->doQuery(strUserSQL.toStdString().c_str(), &strResult ))
{
errorInstall(tr("influxdb删除用户失败"));
return false;
}
strUserSQL = QString("create user \"%1\" with password '%2' with all privileges").arg(this->m_db_name).arg(this->m_db_password);
if ( !ptrConn->doQuery(strUserSQL.toStdString().c_str(), &strResult ))
{
errorInstall(tr("influxdb创建用户失败"));
return false;
}
ptrConn.reset();
if (!iot_dbms::releaseTsdbApi())
{
errorInstall(tr("influxdb环境退出失败"));
}
#ifdef OS_LINUX
//创建完用户后,启用权限认证
if(!relpaceInfluxDBConfig("influxdb.conf"))
{
return false;
}
#endif
return true;
} }
bool SetupWidget::installRdService() bool SetupWidget::installRdService()
@ -469,7 +568,6 @@ bool SetupWidget::installRdService()
errorInstall(tr("安装MySQL过程中不能切换工作目录")); errorInstall(tr("安装MySQL过程中不能切换工作目录"));
return false; return false;
} }
#endif #endif
#ifdef OS_LINUX #ifdef OS_LINUX
@ -513,6 +611,7 @@ bool SetupWidget::installWeb()
statusInstall(tr("开始安装jdk")); statusInstall(tr("开始安装jdk"));
if(isJdkExist()) if(isJdkExist())
{ {
statusInstall(tr("系统中已经安装JDK1.8,跳过"));
return true; return true;
} }
if(!installJdk()) if(!installJdk())
@ -646,7 +745,8 @@ bool SetupWidget::isJdkExist()
QStringList list_=list.at(0).split(" "); //取第一行 QStringList list_=list.at(0).split(" "); //取第一行
if(list_.size() == 2) if(list_.size() == 2)
{ {
if(list_.at(1) == "1.8.0_171") QString strJavaVersion = list_.at(1);
if(strJavaVersion.startsWith("1.8."))
{ {
return true; return true;
} }
@ -715,7 +815,161 @@ void SetupWidget::setDbPath(QString dbPath)
this->m_db_path = dbPath; this->m_db_path = dbPath;
} }
#endif #endif
bool SetupWidget::modifyDBPassword()
{
//根据安装界面输入的用户名和密码修改相应的用户名和密码
if(m_db_type == DB_TYPE_MYSQL)
{
return modifyMySQLPassword();
}
else if(m_db_type == DB_TYPE_KINGBASE || m_db_type== DB_TYPE_OPENGAUSS)
{
return modifyKingbasePassword();
}
return true;
}
bool SetupWidget::modifyMySQLPassword()
{
db_opt_mysql dbOpt;
QStringList listDefaultPassword = {EMS_DEFAULT_PASSWD,"ems@byd23",m_db_password};
bool bConnected = false;
for(int i = 0;i < listDefaultPassword.size();i++)
{
const QString &strPassword = listDefaultPassword.at(i);
bConnected = dbOpt.openDatabase(m_db_ip,m_db_port.toInt(),"root",strPassword,"");
if(bConnected)
{
break;
}
}
if(!bConnected)
{
errorInstall(tr("连接数据库失败"));
return false;
}
/*
create user 'root'@'%' identified by 'ems@byd23';
grant all privileges on *.* to 'root'@'%';
FLUSH PRIVILEGES;
*/
QString strError = "";
QString strSQL = QString("SELECT EXISTS(SELECT 1 FROM mysql.user WHERE user='%1');").arg(m_db_username);
QSqlQuery query;
if(!dbOpt.executeSql(strSQL,query,strError))
{
errorInstall(tr("查询数据库用户信息失败.原因:") + strError);
return false;
}
int nUserExist = 0;
if(query.isActive() && query.next())
{
nUserExist = query.value(0).toInt();
}
if(nUserExist == 0)
{
//0表示用户不存在,不存在则创建
statusInstall(tr("开始创建数据库用户"));
strSQL = QString("create user '%1'@'%' identified by '%2';create user '%1'@'localhost' identified by '%2';").arg(m_db_username).arg(m_db_password);
if(!dbOpt.executeSql(strSQL,strError))
{
errorInstall(tr("创建数据库用户失败.原因:") + strError);
return false;
}
strSQL = QString("grant all privileges on *.* to '%1'@'%';grant all privileges on *.* to '%1'@'localhost';").arg(m_db_username);
if(!dbOpt.executeSql(strSQL,strError))
{
errorInstall(tr("授予数据库用户权限失败.原因:") + strError);
return false;
}
}
else
{
strSQL = QString("update mysql.user set password=password('%1') where user='%2';").arg(m_db_password).arg(m_db_username);
if(!dbOpt.executeSql(strSQL,strError))
{
errorInstall(tr("修改数据库用户密码失败.原因:") + strError);
return false;
}
}
strSQL = QString("FLUSH PRIVILEGES;");
if(!dbOpt.executeSql(strSQL,strError))
{
errorInstall(tr("授予数据库用户权限失败.原因:") + strError);
return false;
}
statusInstall(tr("修改数据库用户名密码成功"));
return true;
}
bool SetupWidget::modifyKingbasePassword()
{
db_opt_kingbase dbOpt;
QStringList listDefaultPassword = {EMS_DEFAULT_PASSWD,"ems@byd23",m_db_password};
bool bConnected = false;
for(int i = 0;i < listDefaultPassword.size();i++)
{
const QString &strPassword = listDefaultPassword.at(i);
bConnected = dbOpt.openDatabase(m_db_ip,m_db_port.toInt(),"system",strPassword,"");
if(bConnected)
{
break;
}
}
if(!bConnected)
{
errorInstall(tr("连接数据库失败"));
return false;
}
QString strError = "";
QString strSQL = QString("SELECT 1 FROM pg_catalog.pg_user WHERE usename = '%1';").arg(m_db_username);
QSqlQuery query;
if(!dbOpt.executeSql(strSQL,query,strError))
{
errorInstall(tr("查询数据库用户信息失败.原因:") + strError);
return false;
}
int nUserExist = 0;
if(query.isActive() && query.next())
{
nUserExist = query.value(0).toInt();
}
if(nUserExist == 0)
{
statusInstall(tr("开始创建数据库用户"));
strSQL = QString("CREATE ROLE \"%1\" SUPERUSER CREATEDB CREATEROLE LOGIN REPLICATION BYPASSRLS PASSWORD '%2';").arg(m_db_username).arg(m_db_password);
if(!dbOpt.executeSql(strSQL,strError))
{
errorInstall(tr("创建数据库用户失败.原因:") + strError);
return false;
}
}
else
{
strSQL = QString("ALTER USER \"%1\" WITH PASSWORD '%2';").arg(m_db_username).arg(m_db_password);
if(!dbOpt.executeSql(strSQL,strError))
{
errorInstall(tr("修改数据库用户密码失败.原因:") + strError);
return false;
}
}
statusInstall(tr("修改数据库用户名密码成功"));
return true;
}

View File

@ -93,6 +93,13 @@ private:
int system_hidden(const char *cmdArgs); int system_hidden(const char *cmdArgs);
#endif #endif
#ifdef OS_LINUX
bool relpaceInfluxDBConfig(const QString &cfgFile);
#endif
bool modifyDBPassword();
bool modifyMySQLPassword();
bool modifyKingbasePassword();
}; };
#endif // SETUPWIDGET_H #endif // SETUPWIDGET_H

View File

@ -1,4 +1,4 @@
#ifndef INSTALLER_COMMON_H #ifndef INSTALLER_COMMON_H
#define LANG_CONFIG_NAME "language.xml" #define LANG_CONFIG_NAME "language.xml"
@ -15,11 +15,7 @@
#define MYSQL_REINSTALL_CMD "register-service.bat" #define MYSQL_REINSTALL_CMD "register-service.bat"
#define MYSQL_REMOVE_CMD "uninstall.bat" #define MYSQL_REMOVE_CMD "uninstall.bat"
#define MYSQL_ZIP_FILENAME "mysql.zip" #define MYSQL_ZIP_FILENAME "mysql.zip"
#define MYSQL_INIT_USER_SQL "sql.txt"
#define MYSQL_DEFAULT_PORT 3306
#define MYSQL_DEFAULT_DATABASE_NAME "iscs6000"
#define MYSQL_DEFAULT_USERNAME "root"
#ifdef OS_WINDOWS #ifdef OS_WINDOWS
#define WEB_INSTALL_SCRIPT_NAME "install.bat" #define WEB_INSTALL_SCRIPT_NAME "install.bat"

View File

@ -16,8 +16,8 @@
--ip=127.0.0.1 --ip=127.0.0.1
--port=3306 --port=3306
--username=root --username=root
--password=kbdct --password=ems
--dbname=iscs6000 --dbname=xxxx
--dbtype=mysql/opengauss/oracle --dbtype=mysql/opengauss/oracle
**/ **/
@ -58,12 +58,12 @@ CommandLineParseResult parseCommandline(QApplication& app,SetupWidget &w)
parser.addOption(project); parser.addOption(project);
// --dbpath(Windows版Linux无此项目) D:\iscs6000\database // --dbpath(Windows版Linux无此项目) D:\xxxx\database
// --ip=127.0.0.1 // --ip=127.0.0.1
// --port=3306 // --port=3306
// --username=root // --username=root
// --password=kbdct // --password=ems
// --dbname=iscs6000 // --dbname=xxxx
#ifdef OS_WINDOWS #ifdef OS_WINDOWS
QCommandLineOption dbpath(QStringList() << "dbpath","database path","dbpath"); QCommandLineOption dbpath(QStringList() << "dbpath","database path","dbpath");
parser.addOption(dbpath); parser.addOption(dbpath);

View File

@ -30,8 +30,12 @@ DEFINES += QT_DEPRECATED_WARNINGS
ISCS6000_OS = $$(ISCS6000_OS) ISCS6000_OS = $$(ISCS6000_OS)
isEmpty(ISCS6000_OS) { isEmpty(ISCS6000_OS) {
error("Error, ISCS6000_OS is empty!") ISCS6000_OS = $$(RQEH6000_OS)
isEmpty(ISCS6000_OS) {
error("Error, ISCS6000_OS is empty!")
}
} }
DEFINES += ISCS6000_OS=\\\"$$(ISCS6000_OS)\\\" DEFINES += ISCS6000_OS=\\\"$$(ISCS6000_OS)\\\"
SOURCES += \ SOURCES += \
@ -44,7 +48,7 @@ HEADERS += \
TRANSLATIONS = $$PWD/en.ts TRANSLATIONS = $$PWD/en.ts
LIBS += -lpub_utility_api -ldb_manager_api -lyaml-cpp LIBS += -lpub_utility_api -ldb_manager_api -ltsdb_api
win32-msvc* { win32-msvc* {
LIBS += -ladvapi32 LIBS += -ladvapi32

View File

@ -6,18 +6,24 @@ SUBDIRS += \
# kbd61850dbinterface \ #提至一级目录src.pro编译 # kbd61850dbinterface \ #提至一级目录src.pro编译
# calc_lua_api \ #提至一级目录src.pro编译 # calc_lua_api \ #提至一级目录src.pro编译
model_plugin \ model_plugin \
debug_tool \ #debug_tool \
debug_tool_v2 \
his_event_del \ his_event_del \
fbd_designer \ fbd_designer \
WaveAnalyze \ WaveAnalyze \
camera_statistics\ camera_statistics\
setup_install_helper \ setup_install_helper \
file_sync_tool \ file_sync_tool \
svn_file_sync_tool \ # svn_file_sync_tool \
opc_tool \ #opc_tool \
upgrade_install_helper \ upgrade_install_helper \
ReportEdit \ ReportEdit \
DevGroupLockWidget \ DevGroupLockWidget \
NetMonite \ NetMonite \
upgrade upgrade \
db_installer \
net_msg_tool \
workBench \
style_tool \
link_seq_tool\
mqtt_tool