增加中英翻译

增加权限管理 UI根据权限生效
master
bob.pan 4 years ago
parent 8295302742
commit 11a11a77db

37
.gitignore vendored

@ -39,3 +39,40 @@ tpvs17/QUserInfo/x64/
tpvs17/EDCircle_test/ tpvs17/EDCircle_test/
tpvs17/RasterSDG20/ tpvs17/RasterSDG20/
tpvs17/algorithm/x64/ tpvs17/algorithm/x64/
runner17/algorithmLib/caliCenterd.ilk
runner17/algorithmLib/valveDetectord.ilk
runner17/lpMaind.ilk
runner17/lpbengined.ilk
runner17/lpdesignerd.ilk
runner17/user/globalConfig.json
tpvs17/caliCenter/x64/Debug/algEg.obj
tpvs17/caliCenter/x64/Debug/caliCenter.obj
tpvs17/caliCenter/x64/Debug/caliCenter.tlog/caliCenter.write.1u.tlog
tpvs17/caliCenter/x64/Debug/caliCenter.tlog/link.read.1.tlog
tpvs17/caliValve/x64/Debug/algEg.obj
tpvs17/caliValve/x64/Debug/caliValve.obj
tpvs17/caliValve/x64/Debug/caliValve.tlog/caliValve.write.1u.tlog
tpvs17/caliValve/x64/Debug/caliValve.tlog/link.read.1.tlog
tpvs17/caliValve/x64/Debug/vc141.pdb
runner17/dbLog.db
tpvs17/caliCenter/x64/
release/runner17_twoStation/
runner17/DBFiles/
tpvs17/caliValve/x64/
tpvs17/lpCoreCtrl/x64/
tpvs17/tpCamVirtual/x64/
runner17/lpdesigner.ilk
runner17/tpAlgorithm.ilk
runner17/tpCam_100.ilk
runner17/tpCam_120.ilk
runner17/tpCam_140.ilk
runner17/tpCam_160.ilk
runner17/user/StandImage_1.jpg
runner17/QUserInfod.ilk
runner17/lpMain.ilk
runner17/lpbengine.ilk
runner17/lpCoreCtrl.ilk
runner17/algorithmLib/valveDetector.map
tpvs17/Report/x64/
tpvs17/Report/GeneratedFiles/
runner17/Reportd.ilk

@ -12,3 +12,17 @@
2021-10-18 3 2021-10-18 3
1、修复串口不能正常打开问题 1、修复串口不能正常打开问题
2021-10-18 4
1、修复图像在没有标定的情况下不能保存的问题
2、模板管理UI页面增加图像显示
3、算法结构图中增加圆心坐标打印
4、修复查询结果工具不显示图片问题
2021-10-18 5
1、优化主界面图像显示逻辑支持缩放
2021-10-19
1、增加中英翻译切换
2、增加权限管理 只对系统参数设置和测试菜单进行保护
3、增加翻译文件

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -3,3 +3,5 @@ Scale_Stand=0.28294005293337054
Scale_Standard=0.2663824433072367 Scale_Standard=0.2663824433072367
Scale_Standard_1=0.1829515775204701 Scale_Standard_1=0.1829515775204701
Scale_Standard_2=0.2032795305783001 Scale_Standard_2=0.2032795305783001
ScaleA=0.22807097164814868
ScaleB=0.23141863221833192

@ -16,7 +16,7 @@ Enable_SrcImg=true
FilterTime=10 FilterTime=10
[Image] [Image]
SrcImgSave_st1=true SrcImgSave_st1=false
SrcImgSave_st2=true SrcImgSave_st2=false
RltImgSave_st1=true RltImgSave_st1=false
RltImgSave_st2=true RltImgSave_st2=false

@ -18,7 +18,7 @@ int main(int argc, char *argv[])
dlg.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint); dlg.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
dlg.setDbPtr(m_db); dlg.setDbPtr(m_db);
QStringList strList; QStringList strList;
strList<< "¹¤Î»1" << "¹¤Î»2"; strList<< "Station_1" << "Station_2";
dlg.setStationNames(strList); dlg.setStationNames(strList);
dlg.show(); dlg.show();
int ret = a.exec(); int ret = a.exec();

@ -73,6 +73,7 @@ void QCheckDataDlg::updateModelShowLog(QSqlQuery &sql)
m_tableModel->clear(); m_tableModel->clear();
m_strMap.clear(); m_strMap.clear();
createHeader(); createHeader();
tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
tableView->setEditTriggers(QAbstractItemView::NoEditTriggers); tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
tableView->setSelectionBehavior(QAbstractItemView::SelectRows); tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);//自适应行宽 tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);//自适应行宽
@ -307,7 +308,7 @@ Q_SLOT void QCheckDataDlg::onTBUI_ItemClick(const QModelIndex & index)
{ {
QPixmap npixmap; QPixmap npixmap;
QString appPath = QApplication::applicationDirPath(); QString appPath = QApplication::applicationDirPath();
npixmap.load(appPath+strFileName); npixmap.load(strFileName);
m_ViewImg->setImg(npixmap); m_ViewImg->setImg(npixmap);
if (!npixmap.isNull()){ if (!npixmap.isNull()){
if (pShowName_label) if (pShowName_label)

@ -299,6 +299,15 @@
<property name="text"> <property name="text">
<string>TextLabel</string> <string>TextLabel</string>
</property> </property>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="margin">
<number>0</number>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>

@ -87,13 +87,14 @@ CMainWin::CMainWin(QWidget *parent)
lpSysConfig::instance()->writeConfig(); lpSysConfig::instance()->writeConfig();
lpGlobalConfig::instance()->readConfig(); lpGlobalConfig::instance()->readConfig();
SetLanguage(lpSysConfig::instance()->m_CurLanguage);//语言设置
setWindowIcon(QIcon(LEAPER_LOGO)); setWindowIcon(QIcon(LEAPER_LOGO));
onInitCoreCtrl(); onInitCoreCtrl();//核心模块
onInitSerial(); onInitSerial();//串口通讯模块
onInitUser(); onInitUser();//用户登录模块
onInitUI(); onInitUI();//其他UI
onInitStatus(); onInitStatus();//状态栏
onInitDiskClean(); onInitDiskClean();//定期删除任务
SYSLOG_STATUS << "系统启动"; SYSLOG_STATUS << "系统启动";
{ {
@ -108,7 +109,6 @@ CMainWin::CMainWin(QWidget *parent)
m_pCameraTrig = new AutoTrigger; m_pCameraTrig = new AutoTrigger;
connect(m_pCameraTrig, SIGNAL(sgTrig()), this, SLOT(onTrigImage())); connect(m_pCameraTrig, SIGNAL(sgTrig()), this, SLOT(onTrigImage()));
connect(&m_devMgrWid, SIGNAL(sgChangeLanguage(QString)), this, SLOT(onLanguageChange(QString))); connect(&m_devMgrWid, SIGNAL(sgChangeLanguage(QString)), this, SLOT(onLanguageChange(QString)));
connect(&m_testWid, SIGNAL(sgTestMode(int)), this, SLOT(onTestMode(int))); connect(&m_testWid, SIGNAL(sgTestMode(int)), this, SLOT(onTestMode(int)));
@ -122,26 +122,20 @@ CMainWin::CMainWin(QWidget *parent)
connect(pS, SIGNAL(sgShowModeName(QString, QString)), this, SLOT(onShowName(QString, QString))); connect(pS, SIGNAL(sgShowModeName(QString, QString)), this, SLOT(onShowName(QString, QString)));
} }
{
// if (m_pDetectorEngine)
// {
// QStringList Names = m_pDetectorEngine->getSolutionMgr()->GetAllSolutions().keys();
//
// }
}
m_pWfCtrl->ISelModel(lpGlobalConfig::instance()->m_StationSolution_1, lpGlobalConfig::instance()->m_StationRunModel_1); m_pWfCtrl->ISelModel(lpGlobalConfig::instance()->m_StationSolution_1, lpGlobalConfig::instance()->m_StationRunModel_1);
m_pWfCtrl->ISelModel(lpGlobalConfig::instance()->m_StationSolution_2, lpGlobalConfig::instance()->m_StationRunModel_2); m_pWfCtrl->ISelModel(lpGlobalConfig::instance()->m_StationSolution_2, lpGlobalConfig::instance()->m_StationRunModel_2);
m_pImageCaliUI = new lpImageCaliUI();//图像标定页面 m_pImageCaliUI = new lpImageCaliUI();//图像标定页面
lpGlobalData::instance()->m_bCheckLinese = lpCheckKey::instance()->checkLinese(); lpGlobalData::instance()->m_bCheckLinese = lpCheckKey::instance()->checkLinese();
m_pCheckLineseUI = new QCryptokeyUI(); m_pCheckLineseUI = new QCryptokeyUI();
connect(m_pCheckLineseUI, SIGNAL(sgRegisterFinish(bool)), this, SLOT(onLineseCheck(bool))); connect(m_pCheckLineseUI, SIGNAL(sgRegisterFinish(bool)), this, SLOT(onLineseCheck(bool)));
onLineseCheck(lpGlobalData::instance()->m_bCheckLinese); onLineseCheck(lpGlobalData::instance()->m_bCheckLinese);
m_TimerID_Status = startTimer(1000); m_TimerID_Status = startTimer(1000);
ui.actionSystem->setDisabled(true);
ui.actionTest->setDisabled(true);
ui.actionStandard->setDisabled(true);
} }
CMainWin::~CMainWin() CMainWin::~CMainWin()
@ -189,6 +183,18 @@ CMainWin::~CMainWin()
delete m_pWfCtrl; delete m_pWfCtrl;
m_pWfCtrl = nullptr; m_pWfCtrl = nullptr;
} }
{
if (m_ImgViewer_A)
{
delete m_ImgViewer_A;
m_ImgViewer_A = nullptr;
}
if (m_ImgViewer_B)
{
delete m_ImgViewer_B;
m_ImgViewer_B = nullptr;
}
}
if (m_pLabelInfo) if (m_pLabelInfo)
{ {
delete m_pLabelInfo; delete m_pLabelInfo;
@ -570,8 +576,8 @@ Q_SLOT void CMainWin::onActionClicked()
else if ("actionTest" == strObj) {//测试 else if ("actionTest" == strObj) {//测试
m_testWid.setParent(this); m_testWid.setParent(this);
m_testWid.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint); m_testWid.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
m_testWid.setWindowModality(Qt::ApplicationModal); //m_testWid.setWindowModality(Qt::ApplicationModal);
m_testWid.setAttribute(Qt::WA_ShowModal, true); //m_testWid.setAttribute(Qt::WA_ShowModal, true);
m_testWid.show(); m_testWid.show();
} }
else if ("actionHelp" == strObj) {//帮助 else if ("actionHelp" == strObj) {//帮助
@ -596,14 +602,12 @@ Q_SLOT void CMainWin::onActionClicked()
m_devMgrWid.setParent(this); m_devMgrWid.setParent(this);
m_devMgrWid.setWindowIcon(QIcon(LEAPER_LOGO)); m_devMgrWid.setWindowIcon(QIcon(LEAPER_LOGO));
m_devMgrWid.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint); m_devMgrWid.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
m_devMgrWid.setWindowModality(Qt::ApplicationModal); //m_devMgrWid.setWindowModality(Qt::ApplicationModal);
m_devMgrWid.setAttribute(Qt::WA_ShowModal, true); //m_devMgrWid.setAttribute(Qt::WA_ShowModal, true);
QStringList camkeys = m_pCoreCtrl->ICameraKeys(); QStringList camkeys = m_pCoreCtrl->ICameraKeys();
QStringList solutions = m_pDetectorEngine->getSolutionMgr()->GetAllSolutions().keys(); QStringList solutions = m_pDetectorEngine->getSolutionMgr()->GetAllSolutions().keys();
m_devMgrWid.setSystemConfig(camkeys, solutions); m_devMgrWid.setSystemConfig(camkeys, solutions);
m_devMgrWid.show(); m_devMgrWid.show();
} }
else if ("main_Login_action" == strObj) {//用户登陆 else if ("main_Login_action" == strObj) {//用户登陆
@ -904,6 +908,36 @@ void CMainWin::onInitSerial()
void CMainWin::onInitUI() void CMainWin::onInitUI()
{ {
//检测结果图展示 UI初始化
{
QGridLayout *pLayout_A = new QGridLayout(ui.widget_A);//A侧相机结果图展示UI
m_ImgViewer_A = new RoiImgViewer(ui.widget_A);
m_ImgViewer_A->setObjectName("m_ImgViewer_A");
connect(m_ImgViewer_A, SIGNAL(sgImageScale(qreal)), this, SLOT(onImageScale(qreal)));
pLayout_A->addWidget(m_ImgViewer_A);
ui.widget_A->setLayout(pLayout_A);
QGridLayout *pLayout_B = new QGridLayout(ui.widget_B);//B侧相机结果图展示UI
m_ImgViewer_B = new RoiImgViewer(ui.widget_A);
m_ImgViewer_B->setObjectName("m_ImgViewer_B");
connect(m_ImgViewer_B, SIGNAL(sgImageScale(qreal)), this, SLOT(onImageScale(qreal)));
pLayout_B->addWidget(m_ImgViewer_B);
ui.widget_B->setLayout(pLayout_B);
QString strPath = QApplication::applicationDirPath() + "/showImg.ini";//图像展示比例的参数
QSettings setting(strPath, QSettings::IniFormat);
double nScale_A = setting.value("ShowImg/ScaleA", 0.53).toDouble();
double nScale_B = setting.value("ShowImg/ScaleB", 0.53).toDouble();
m_ImgViewer_A->setInitScale(nScale_A);
m_ImgViewer_B->setInitScale(nScale_B);
m_ImgViewer_A->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_ImgViewer_A, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(onPopMenu(const QPoint&)));
m_ImgViewer_B->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_ImgViewer_B, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(onPopMenu(const QPoint&)));
}
QFont font; QFont font;
//工具栏菜单 //工具栏菜单
QMenu *pToolMenu = new QMenu(this); QMenu *pToolMenu = new QMenu(this);
@ -964,11 +998,11 @@ void CMainWin::onInitUI()
pDoc = ui.wf_text_edit_result_2->document(); pDoc = ui.wf_text_edit_result_2->document();
pDoc->setMaximumBlockCount(200); pDoc->setMaximumBlockCount(200);
ui.wf_lb_image_show_1->setContextMenuPolicy(Qt::CustomContextMenu); // ui.wf_lb_image_show_1->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui.wf_lb_image_show_1, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(onPopMenu(const QPoint&))); // connect(ui.wf_lb_image_show_1, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(onPopMenu(const QPoint&)));
ui.wf_lb_image_show_2->setContextMenuPolicy(Qt::CustomContextMenu); // ui.wf_lb_image_show_2->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui.wf_lb_image_show_2, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(onPopMenu(const QPoint&))); // connect(ui.wf_lb_image_show_2, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(onPopMenu(const QPoint&)));
connect(this, SIGNAL(sgShowSrcImg(QString, QImage)), &m_camSetWid, SLOT(onShowImage(QString, QImage))); connect(this, SIGNAL(sgShowSrcImg(QString, QImage)), &m_camSetWid, SLOT(onShowImage(QString, QImage)));
} }
@ -1032,6 +1066,10 @@ Q_SLOT void CMainWin::onLanguageChange(QString strLanguage)
{ {
// QSettings languageSetting(lpSysConfig::instance()->getCfgPath(), QSettings::IniFormat); // QSettings languageSetting(lpSysConfig::instance()->getCfgPath(), QSettings::IniFormat);
// languageSetting.value("language/select", "Chinese").toString(); // languageSetting.value("language/select", "Chinese").toString();
if (strLanguage == lpSysConfig::instance()->m_CurLanguage)
return;
lpSysConfig::instance()->m_CurLanguage = strLanguage;
lpSysConfig::instance()->writeConfig();
SetLanguage(strLanguage); SetLanguage(strLanguage);
} }
@ -1092,13 +1130,15 @@ Q_SLOT void CMainWin::onChangeUI(QString strUsr, int nLevel)
case 7: case 7:
case 6: case 6:
ui.main_action_userManager->setVisible(true); ui.main_action_userManager->setVisible(true);
ui.actionSystem->setEnabled(true); ui.actionSystem->setDisabled(false);
ui.actionTest->setEnabled(true); ui.actionTest->setDisabled(false);
ui.actionStandard->setDisabled(false);
break; break;
case 5: case 5:
ui.main_action_userManager->setVisible(true); ui.main_action_userManager->setVisible(true);
ui.actionSystem->setEnabled(true); ui.actionSystem->setDisabled(false);
ui.actionTest->setEnabled(true); ui.actionTest->setDisabled(false);
ui.actionStandard->setDisabled(false);
break; break;
case 4: case 4:
case 3: case 3:
@ -1106,8 +1146,9 @@ Q_SLOT void CMainWin::onChangeUI(QString strUsr, int nLevel)
case 1: case 1:
case 0: case 0:
ui.main_action_userManager->setVisible(false); ui.main_action_userManager->setVisible(false);
ui.actionSystem->setEnabled(false); ui.actionSystem->setDisabled(true);
ui.actionTest->setEnabled(false); ui.actionTest->setDisabled(true);
ui.actionStandard->setDisabled(true);
break; break;
default: default:
break; break;
@ -1171,11 +1212,15 @@ Q_SLOT void CMainWin::onShowImage(int ID, QImage img)
}; };
if (ID == 1) if (ID == 1)
{ {
ShowImg(ui.wf_lb_image_show_1,img); if(m_ImgViewer_A)
m_ImgViewer_A->setImg(img);
//ShowImg(ui.wf_lb_image_show_1,img);
} }
else if (ID == 2) else if (ID == 2)
{ {
ShowImg(ui.wf_lb_image_show_2, img); if (m_ImgViewer_B)
m_ImgViewer_B->setImg(img);
//ShowImg(ui.wf_lb_image_show_2, img);
} }
} }
//展示正在检测的型号名 //展示正在检测的型号名
@ -1207,12 +1252,14 @@ Q_SLOT void CMainWin::onPopMenu(const QPoint& pt)
{ {
/*根据UI名判断是哪个工位需要设置相机*/ /*根据UI名判断是哪个工位需要设置相机*/
QString strCamKey; QString strCamKey;
QString strObj = sender()->objectName(); //QString strObj = sender()->objectName();
if ("wf_lb_image_show_1" == strObj) //if ("wf_lb_image_show_1" == strObj)
if(m_ImgViewer_A == sender())
{ {
strCamKey = lpGlobalConfig::instance()->m_StationCamKey_1; strCamKey = lpGlobalConfig::instance()->m_StationCamKey_1;
} }
else if ("wf_lb_image_show_2" == strObj) //else if ("wf_lb_image_show_2" == strObj)
else if (m_ImgViewer_B == sender())
{ {
strCamKey = lpGlobalConfig::instance()->m_StationCamKey_2; strCamKey = lpGlobalConfig::instance()->m_StationCamKey_2;
} }
@ -1389,7 +1436,7 @@ void CMainWin::IEngineResult(QVariantMap vMap)
/********打印检测结果到ui上*********/ /********打印检测结果到ui上*********/
QString strResult = QTime::currentTime().toString("hh:mm:ss zzz:") + taskName; QString strResult = QTime::currentTime().toString("hh:mm:ss zzz:") + taskName;
strResult += " angle result : " + QString::number(dAngle, 'f', 3); strResult += " angle : " + QString::number(dAngle, 'f', 3);
if (dAngle >= 361) if (dAngle >= 361)
{ {
@ -1547,3 +1594,18 @@ void CMainWin::onInitDiskClean()
} }
} }
Q_SLOT void CMainWin::onImageScale(qreal value)
{
QString strPath = QApplication::applicationDirPath() + "/showImg.ini";
QSettings setting(strPath, QSettings::IniFormat);
QObject *obj = sender();
if (m_ImgViewer_A == obj)
{
setting.setValue("ShowImg/ScaleA", value);
}
else if (m_ImgViewer_B == obj)
{
setting.setValue("ShowImg/ScaleB", value);
}
}

@ -23,6 +23,7 @@
#include "QCryptokeyUI.h" #include "QCryptokeyUI.h"
#include "lpImageCaliUI.h" #include "lpImageCaliUI.h"
#include "QDiskCleanThread.h" #include "QDiskCleanThread.h"
#include "RoiImgViewer.h"
struct StationInfo struct StationInfo
{ {
@ -60,6 +61,8 @@ public:
Q_SLOT void onActionClicked(); Q_SLOT void onActionClicked();
QString genSavePath(int stationID, QString modelName, QImage &img); QString genSavePath(int stationID, QString modelName, QImage &img);
QString genSaveSrcImgPath(int stationID, QString modelName, QImage &img); QString genSaveSrcImgPath(int stationID, QString modelName, QImage &img);
Q_SLOT void onImageScale(qreal value);
protected: protected:
virtual void timerEvent(QTimerEvent *event); virtual void timerEvent(QTimerEvent *event);
virtual void closeEvent(QCloseEvent *event); virtual void closeEvent(QCloseEvent *event);
@ -75,6 +78,7 @@ protected:
void onInitUI(); void onInitUI();
void onInitDiskClean(); void onInitDiskClean();
QString SecondTimeString(quint64 value); QString SecondTimeString(quint64 value);
Q_SLOT void onLineseCheck(bool bFlag); Q_SLOT void onLineseCheck(bool bFlag);
void saveImage(const QImage& m_pixmap, QString m_path, QString filename); void saveImage(const QImage& m_pixmap, QString m_path, QString filename);
@ -121,6 +125,9 @@ private:
ISerialPortTool *m_pSerialPort{ nullptr };//串口通讯模块 ISerialPortTool *m_pSerialPort{ nullptr };//串口通讯模块
QLabel* m_pLabelInfo{ nullptr }; QLabel* m_pLabelInfo{ nullptr };
RoiImgViewer *m_ImgViewer_A{ nullptr };//չʾ¼ì²âͼÏñ
RoiImgViewer *m_ImgViewer_B{ nullptr };//չʾ¼ì²âͼÏñ
private: private:
//相机图像核心模块 //相机图像核心模块
CDllCoreCtrl* m_pDllCoreCtrl{nullptr}; CDllCoreCtrl* m_pDllCoreCtrl{nullptr};
@ -156,6 +163,9 @@ private:
lpImageCaliUI* m_pImageCaliUI{ nullptr }; lpImageCaliUI* m_pImageCaliUI{ nullptr };
QList<QDiskCleanThread*> m_pDCThreadList; QList<QDiskCleanThread*> m_pDCThreadList;
}; };
#endif #endif

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1022</width> <width>1115</width>
<height>723</height> <height>781</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -101,22 +101,89 @@
<item row="1" column="0"> <item row="1" column="0">
<widget class="QFrame" name="frame_2"> <widget class="QFrame" name="frame_2">
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::Box</enum> <enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string/>
</property>
<property name="flat">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item row="0" column="0">
<widget class="QFrame" name="frame_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>5</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property> </property>
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin"> <property name="leftMargin">
<number>3</number> <number>3</number>
</property> </property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin"> <property name="rightMargin">
<number>3</number> <number>3</number>
</property> </property>
<item> <property name="bottomMargin">
<layout class="QVBoxLayout" name="verticalLayout"> <number>3</number>
<item> </property>
<property name="spacing">
<number>3</number>
</property>
<item row="0" column="1">
<widget class="QLabel" name="wf_lb_station_name_1"> <widget class="QLabel" name="wf_lb_station_name_1">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
@ -135,48 +202,121 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:11pt; color:#ff0000;&quot;&gt;工位1&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="0" column="0">
<widget class="QLabel" name="wf_lb_image_show_1"> <widget class="QLabel" name="label">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>工位1 </string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QWidget" name="widget_A" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>5</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="styleSheet">
<size> <string notr="true"/>
<width>492</width>
<height>372</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Panel</enum>
</property>
<property name="text">
<string>image</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item> </layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QTextEdit" name="wf_text_edit_result_1"> <widget class="QTextEdit" name="wf_text_edit_result_1">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>2</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="readOnly"> <property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget>
</item> </item>
<item> <item row="0" column="1">
<layout class="QVBoxLayout" name="verticalLayout_2"> <widget class="QGroupBox" name="groupBox_2">
<item> <property name="title">
<string/>
</property>
<property name="flat">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item row="0" column="0">
<widget class="QFrame" name="frame_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>5</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<property name="spacing">
<number>3</number>
</property>
<item row="1" column="1">
<widget class="QLabel" name="wf_lb_station_name_2"> <widget class="QLabel" name="wf_lb_station_name_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
@ -195,43 +335,58 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:11pt; color:#ff0000;&quot;&gt;工位2&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="1" column="0">
<widget class="QLabel" name="wf_lb_image_show_2"> <widget class="QLabel" name="label_2">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>工位2 </string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QWidget" name="widget_B" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>5</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="styleSheet">
<size> <string notr="true"/>
<width>492</width>
<height>372</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Panel</enum>
</property>
<property name="text">
<string>image</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item> </layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QTextEdit" name="wf_text_edit_result_2"> <widget class="QTextEdit" name="wf_text_edit_result_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>2</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="readOnly"> <property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>

@ -10,3 +10,11 @@ QAboutUI::QAboutUI(QWidget *parent)
QAboutUI::~QAboutUI() QAboutUI::~QAboutUI()
{ {
} }
void QAboutUI::changeEvent(QEvent *event)
{
if (event->type() == QEvent::LanguageChange)
{
ui.retranslateUi(this);
}
}

@ -11,7 +11,8 @@ class QAboutUI : public QWidget
public: public:
QAboutUI(QWidget *parent = Q_NULLPTR); QAboutUI(QWidget *parent = Q_NULLPTR);
~QAboutUI(); ~QAboutUI();
protected:
virtual void changeEvent(QEvent *event);
private: private:
Ui::QAboutUI ui; Ui::QAboutUI ui;
}; };

@ -22,7 +22,7 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Main Version: 1.5.0228&lt;/p&gt;&lt;p&gt;Tadpole Version: 2.0.99&lt;/p&gt;&lt;p&gt;Final update date:20211018 11:00:00&lt;/p&gt;&lt;p&gt;Final Test data:20211018 11:00:00&lt;/p&gt;&lt;p&gt;单工位汽轮定位型号判别&lt;/p&gt;&lt;p&gt;CopyRight (C) 2016-2025 HangZhou Leaper &lt;/p&gt;&lt;p&gt;摩汽配件产品部&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Main Version: 1.6.1019&lt;/p&gt;&lt;p&gt;Tadpole Version: 3.0.00&lt;/p&gt;&lt;p&gt;Final update date:20211019 11:00:00&lt;/p&gt;&lt;p&gt;Final Test data:20211019 11:00:00&lt;/p&gt;&lt;p&gt;单工位汽轮定位型号判别&lt;/p&gt;&lt;p&gt;CopyRight (C) 2016-2025 HangZhou Leaper &lt;/p&gt;&lt;p&gt;摩汽配件产品部&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
</widget> </widget>
</item> </item>

@ -33,3 +33,11 @@ QString QAddModeUI::getInputName() {
QString strName = ui.lineEdit->text(); QString strName = ui.lineEdit->text();
return strName; return strName;
} }
void QAddModeUI::changeEvent(QEvent *event)
{
if (event->type() == QEvent::LanguageChange)
{
ui.retranslateUi(this);
}
}

@ -13,6 +13,8 @@ public:
~QAddModeUI(); ~QAddModeUI();
Q_SLOT void onButtonClicked(); Q_SLOT void onButtonClicked();
QString getInputName(); QString getInputName();
protected:
virtual void changeEvent(QEvent *event);
private: private:
Ui::QAddModeUI ui; Ui::QAddModeUI ui;
}; };

@ -81,3 +81,11 @@ void QCamSetDlg::closeEvent(QCloseEvent *event)
m_pCorl->IRunAlg(m_curCamKey, true); m_pCorl->IRunAlg(m_curCamKey, true);
} }
} }
void QCamSetDlg::changeEvent(QEvent *event)
{
if (event->type() == QEvent::LanguageChange)
{
ui.retranslateUi(this);
}
}

@ -20,6 +20,7 @@ public:
Q_SLOT void onButtonClicked(); Q_SLOT void onButtonClicked();
protected: protected:
virtual void closeEvent(QCloseEvent *event); virtual void closeEvent(QCloseEvent *event);
virtual void changeEvent(QEvent *event);
private: private:
Ui::QCamSetDlg ui; Ui::QCamSetDlg ui;
QTpGraphView *m_ViewImg{ nullptr }; QTpGraphView *m_ViewImg{ nullptr };

@ -283,3 +283,11 @@ void QCamSettingDlg::EnableUI(bool b)
// ui.m_ImgHeight->setDisabled(!b); // ui.m_ImgHeight->setDisabled(!b);
} }
void QCamSettingDlg::changeEvent(QEvent *event)
{
if (event->type() == QEvent::LanguageChange)
{
ui.retranslateUi(this);
}
}

@ -24,6 +24,8 @@ public:
void onShowVirtualDir(bool bShow); void onShowVirtualDir(bool bShow);
void EnableUI(bool b); void EnableUI(bool b);
protected:
virtual void changeEvent(QEvent *event);
private: private:
Ui::QCamSettingDlg ui; Ui::QCamSettingDlg ui;
ICoreCtrl* m_pCoreCtl{ nullptr }; ICoreCtrl* m_pCoreCtl{ nullptr };

@ -55,3 +55,11 @@ tagCamInfo QCameraConfigUI::getNewCamInfo()
camInfo.loadPath = filePath; camInfo.loadPath = filePath;
return camInfo; return camInfo;
} }
void QCameraConfigUI::changeEvent(QEvent *event)
{
if (event->type() == QEvent::LanguageChange)
{
ui.retranslateUi(this);
}
}

@ -28,6 +28,8 @@ public:
Q_SLOT void onButtonClicked(); Q_SLOT void onButtonClicked();
tagCamInfo getNewCamInfo(); tagCamInfo getNewCamInfo();
protected:
virtual void changeEvent(QEvent *event);
private: private:
Ui::QCameraConfigUI ui; Ui::QCameraConfigUI ui;
}; };

@ -1,4 +1,4 @@
#include "QCameraMgrUI.h" #include "QCameraMgrUI.h"
#include <QMessageBox> #include <QMessageBox>
#pragma execution_character_set("utf-8") #pragma execution_character_set("utf-8")
QCameraMgrUI::QCameraMgrUI(QWidget *parent) QCameraMgrUI::QCameraMgrUI(QWidget *parent)
@ -12,7 +12,7 @@ QCameraMgrUI::QCameraMgrUI(QWidget *parent)
connect(ui.m_pbClose, SIGNAL(clicked()), this, SLOT(onButtonClicked())); connect(ui.m_pbClose, SIGNAL(clicked()), this, SLOT(onButtonClicked()));
QStringList strHeaders; QStringList strHeaders;
strHeaders << "ID" << "显示名" << "序列号" << "类型" << "状态"; strHeaders << "ID" << "显示名" << "序列号" << "类型" << "状态";
m_tableModel.setHorizontalHeaderLabels(strHeaders); m_tableModel.setHorizontalHeaderLabels(strHeaders);
ui.tableView->setModel(&m_tableModel); ui.tableView->setModel(&m_tableModel);
//ui.tableView->hideColumn(4); //ui.tableView->hideColumn(4);
@ -25,8 +25,8 @@ QCameraMgrUI::QCameraMgrUI(QWidget *parent)
connect(ui.tableView, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(onDoubleClicked(const QModelIndex &))); connect(ui.tableView, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(onDoubleClicked(const QModelIndex &)));
m_pCamSetUI = new QCamSettingDlg();//相机预览 m_pCamSetUI = new QCamSettingDlg();//相机预览
m_pCamConfigUI = new QCameraConfigUI();//相机配置 m_pCamConfigUI = new QCameraConfigUI();//相机配置
} }
@ -85,10 +85,10 @@ Q_SLOT void QCameraMgrUI::onButtonClicked()
int row = ui.tableView->currentIndex().row(); int row = ui.tableView->currentIndex().row();
if (row < 0) if (row < 0)
{ {
QMessageBox::information(this, tr("提示"), "请选择要修改的相机"); QMessageBox::information(this, tr("提示"), "请选择要修改的相机");
return; return;
} }
QModelIndex index = m_tableModel.index(row, 2);//选中行第一列的内容 QModelIndex index = m_tableModel.index(row, 2);//选中行第一列的内容
QVariant data = m_tableModel.data(index); QVariant data = m_tableModel.data(index);
QString strSerial = data.toString(); QString strSerial = data.toString();
@ -108,24 +108,24 @@ Q_SLOT void QCameraMgrUI::onButtonClicked()
int row = ui.tableView->currentIndex().row(); int row = ui.tableView->currentIndex().row();
if (row < 0) if (row < 0)
{ {
QMessageBox::information(this, tr("提示"), "请选择要移除的相机"); QMessageBox::information(this, tr("提示"), "请选择要移除的相机");
return; return;
} }
QModelIndex index = m_tableModel.index(row, 2);//选中行第一列的内容 QModelIndex index = m_tableModel.index(row, 2);//选中行第一列的内容
QVariant data = m_tableModel.data(index); QVariant data = m_tableModel.data(index);
QString key = data.toString(); QString key = data.toString();
if (key.isEmpty()) if (key.isEmpty())
{ {
QMessageBox::information(this, tr("提示"), "请选择要移除的相机"); QMessageBox::information(this, tr("提示"), "请选择要移除的相机");
return; return;
} }
QMessageBox info(this); QMessageBox info(this);
//info.setWindowIcon(QIcon(LEAPER_LOGO)); //info.setWindowIcon(QIcon(LEAPER_LOGO));
info.setWindowTitle(QObject::tr("警告")); info.setWindowTitle(QObject::tr("警告"));
info.setText(QObject::tr("你确定要移除相机 %1").arg(key)); info.setText(QObject::tr("你确定要移除相机 %1").arg(key));
info.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel); info.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
info.setButtonText(QMessageBox::Ok, QObject::tr("确定")); info.setButtonText(QMessageBox::Ok, QObject::tr("确定"));
info.setButtonText(QMessageBox::Cancel, QObject::tr("取消")); info.setButtonText(QMessageBox::Cancel, QObject::tr("取消"));
if (info.exec() == QMessageBox::Ok) if (info.exec() == QMessageBox::Ok)
{ {
m_pCorctl->IDelCamera(key); m_pCorctl->IDelCamera(key);
@ -140,7 +140,7 @@ Q_SLOT void QCameraMgrUI::onButtonClicked()
void QCameraMgrUI::onUpdateTableView() void QCameraMgrUI::onUpdateTableView()
{ {
//移除所有 //移除所有
while (m_tableModel.rowCount()) while (m_tableModel.rowCount())
{ {
m_tableModel.removeRow(0); m_tableModel.removeRow(0);
@ -176,7 +176,7 @@ void QCameraMgrUI::onUpdateTableView()
// listItem.append(new QStandardItem((*it).hostMac)); // listItem.append(new QStandardItem((*it).hostMac));
// QString strVersion = lpGlobalData::instance()->m_CamVersionMap[strKey]; // QString strVersion = lpGlobalData::instance()->m_CamVersionMap[strKey];
// listItem.append(new QStandardItem(strVersion)); // listItem.append(new QStandardItem(strVersion));
// // QStandardItem *pStateItem = new QStandardItem((*it).bConnect == false ? "未连接" : "已连接"); // // QStandardItem *pStateItem = new QStandardItem((*it).bConnect == false ? "未连接" : "已连接");
// // listItem.append(pStateItem); // // listItem.append(pStateItem);
// // if ((*it).bConnect == true) { // // if ((*it).bConnect == true) {
// // pStateItem->setBackground(QBrush(Qt::red, Qt::NoBrush)); // // pStateItem->setBackground(QBrush(Qt::red, Qt::NoBrush));

@ -1,4 +1,4 @@
#include "QDeviceMgrUI.h" #include "QDeviceMgrUI.h"
#include "lpSysConfig.h" #include "lpSysConfig.h"
#include "QTipWidget.h" #include "QTipWidget.h"
#include "lpGlobalConfig.h" #include "lpGlobalConfig.h"
@ -10,6 +10,10 @@ QDeviceMgrUI::QDeviceMgrUI(QWidget *parent)
ui.setupUi(this); ui.setupUi(this);
connect(ui.m_pbOK, SIGNAL(clicked()), this, SLOT(onButtonClicked())); connect(ui.m_pbOK, SIGNAL(clicked()), this, SLOT(onButtonClicked()));
connect(ui.pushButton, SIGNAL(clicked()), this, SLOT(onButtonClicked())); connect(ui.pushButton, SIGNAL(clicked()), this, SLOT(onButtonClicked()));
ui.comboBox->clear();
ui.comboBox->addItem("Chinese");
ui.comboBox->addItem("English");
} }
QDeviceMgrUI::~QDeviceMgrUI() QDeviceMgrUI::~QDeviceMgrUI()
@ -23,7 +27,7 @@ Q_SLOT void QDeviceMgrUI::onButtonClicked()
if (strObj == "m_pbOK") { if (strObj == "m_pbOK") {
getParam(); getParam();
lpSysConfig::instance()->writeConfig(); lpSysConfig::instance()->writeConfig();
ShowMessage(QObject::tr("参数已保存")); ShowMessage(QObject::tr("参数已保存"));
} }
else if (strObj == "pushButton") else if (strObj == "pushButton")
{ {
@ -48,6 +52,7 @@ void QDeviceMgrUI::setParam()
ui.checkBox_SaveSrcImg_st2->setChecked(lpSysConfig::instance()->m_bSaveSrcImg_st2); ui.checkBox_SaveSrcImg_st2->setChecked(lpSysConfig::instance()->m_bSaveSrcImg_st2);
ui.spinBox->setValue(lpSysConfig::instance()->m_MinSpaceSizeG); ui.spinBox->setValue(lpSysConfig::instance()->m_MinSpaceSizeG);
ui.spinBox_2->setValue(lpSysConfig::instance()->m_CheckFileDays); ui.spinBox_2->setValue(lpSysConfig::instance()->m_CheckFileDays);
ui.comboBox->setCurrentText(lpSysConfig::instance()->m_CurLanguage);
} }
@ -64,6 +69,9 @@ void QDeviceMgrUI::getParam()
lpSysConfig::instance()->m_bSaveRltImg_st2 = ui.checkBox_SaveRltImg_st2->isChecked(); lpSysConfig::instance()->m_bSaveRltImg_st2 = ui.checkBox_SaveRltImg_st2->isChecked();
lpSysConfig::instance()->m_bSaveSrcImg_st1 = ui.checkBox_SaveSrcImg_st1->isChecked(); lpSysConfig::instance()->m_bSaveSrcImg_st1 = ui.checkBox_SaveSrcImg_st1->isChecked();
lpSysConfig::instance()->m_bSaveSrcImg_st2 = ui.checkBox_SaveSrcImg_st2->isChecked(); lpSysConfig::instance()->m_bSaveSrcImg_st2 = ui.checkBox_SaveSrcImg_st2->isChecked();
QString curText = ui.comboBox->currentText();
emit sgChangeLanguage(curText);
} }
void QDeviceMgrUI::showEvent(QShowEvent *event) void QDeviceMgrUI::showEvent(QShowEvent *event)
@ -71,6 +79,14 @@ void QDeviceMgrUI::showEvent(QShowEvent *event)
setParam(); setParam();
} }
void QDeviceMgrUI::changeEvent(QEvent *event)
{
if (event->type() == QEvent::LanguageChange)
{
ui.retranslateUi(this);
}
}
void QDeviceMgrUI::setSystemConfig(QStringList camkeys, QStringList solutions) void QDeviceMgrUI::setSystemConfig(QStringList camkeys, QStringList solutions)
{ {
ui.comboBox_cam1->clear(); ui.comboBox_cam1->clear();

@ -15,10 +15,14 @@ public:
Q_SLOT void onButtonClicked(); Q_SLOT void onButtonClicked();
void setParam(); void setParam();
void getParam(); void getParam();
virtual void showEvent(QShowEvent *event);
void setSystemConfig(QStringList camkeys, QStringList solutions);
void setSystemConfig(QStringList camkeys, QStringList solutions);
protected:
virtual void showEvent(QShowEvent *event);
virtual void changeEvent(QEvent *event);
signals:
void sgChangeLanguage(QString);
private: private:
Ui::QDeviceMgrUI ui; Ui::QDeviceMgrUI ui;
}; };

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>531</width> <width>531</width>
<height>337</height> <height>360</height>
</rect> </rect>
</property> </property>
<property name="font"> <property name="font">
@ -336,7 +336,19 @@
<string>维护相关:</string> <string>维护相关:</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="1"> <item row="0" column="0">
<widget class="QCheckBox" name="checkBox_RltImg">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>是否启用结果图定期删除功能</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkBox_SrcImg"> <widget class="QCheckBox" name="checkBox_SrcImg">
<property name="font"> <property name="font">
<font> <font>
@ -348,17 +360,17 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="label_2">
<property name="font"> <property name="font">
<font> <font>
<pointsize>12</pointsize> <pointsize>12</pointsize>
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>超期天数</string> <string>预留磁盘大小</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
@ -366,36 +378,36 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QSpinBox" name="spinBox_2"> <widget class="QSpinBox" name="spinBox">
<property name="font"> <property name="font">
<font> <font>
<pointsize>12</pointsize> <pointsize>12</pointsize>
</font> </font>
</property> </property>
<property name="suffix"> <property name="suffix">
<string></string> <string>G</string>
</property> </property>
<property name="minimum"> <property name="minimum">
<number>1</number> <number>1</number>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>360</number> <number>10000</number>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item row="2" column="1"> <item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_6">
<property name="font"> <property name="font">
<font> <font>
<pointsize>12</pointsize> <pointsize>12</pointsize>
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>预留磁盘大小</string> <string>超期天数</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
@ -403,49 +415,52 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QSpinBox" name="spinBox"> <widget class="QSpinBox" name="spinBox_2">
<property name="font"> <property name="font">
<font> <font>
<pointsize>12</pointsize> <pointsize>12</pointsize>
</font> </font>
</property> </property>
<property name="suffix"> <property name="suffix">
<string>G</string> <string></string>
</property> </property>
<property name="minimum"> <property name="minimum">
<number>1</number> <number>1</number>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>10000</number> <number>360</number>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item row="0" column="1"> <item row="4" column="0">
<widget class="QCheckBox" name="checkBox_RltImg"> <layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_7">
<property name="font"> <property name="font">
<font> <font>
<pointsize>12</pointsize> <pointsize>12</pointsize>
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>是否启用结果图定期删除功能</string> <string>语言:</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item>
<spacer name="verticalSpacer_2"> <widget class="QComboBox" name="comboBox">
<property name="orientation"> <property name="font">
<enum>Qt::Vertical</enum> <font>
</property> <pointsize>12</pointsize>
<property name="sizeHint" stdset="0"> </font>
<size>
<width>20</width>
<height>40</height>
</size>
</property> </property>
</spacer> </widget>
</item>
</layout>
</item> </item>
</layout> </layout>
</widget> </widget>

@ -1,4 +1,4 @@
#include "QModelMangerUI.h" #include "QModelMangerUI.h"
#include <QSharedPointer> #include <QSharedPointer>
#include <QTableView> #include <QTableView>
#include <QMessageBox> #include <QMessageBox>
@ -96,9 +96,9 @@ Q_SLOT void QModelMangerUI::onButtonClicked()
m_pCtrl->ISaveModel(nStaionID, strName); m_pCtrl->ISaveModel(nStaionID, strName);
} }
else { else {
QMessageBox msgWarning(QMessageBox::Warning, QObject::tr("错误警告"), strName + QObject::tr(" 添加失败,可能名字重复"), QMessageBox::Yes); QMessageBox msgWarning(QMessageBox::Warning, QObject::tr("错误警告"), strName + QObject::tr(" 添加失败,可能名字重复"), QMessageBox::Yes);
msgWarning.setWindowIcon(QIcon(":/leaper/Resource/app.png")); msgWarning.setWindowIcon(QIcon(":/leaper/Resource/app.png"));
msgWarning.setButtonText(QMessageBox::Yes, QObject::tr("确认")); msgWarning.setButtonText(QMessageBox::Yes, QObject::tr("确认"));
msgWarning.exec(); msgWarning.exec();
} }
} }
@ -119,13 +119,13 @@ Q_SLOT void QModelMangerUI::onButtonClicked()
QString strName = m_pCtrl->IGetCurrentRuningModel(currentTab()); QString strName = m_pCtrl->IGetCurrentRuningModel(currentTab());
if (strModel == strName) if (strModel == strName)
{ {
QMessageBox msgWarning(QMessageBox::Warning, QObject::tr("错误警告"), strModel + QObject::tr(" 正在使用,不能被删除"), QMessageBox::Yes); QMessageBox msgWarning(QMessageBox::Warning, QObject::tr("错误警告"), strModel + QObject::tr(" 正在使用,不能被删除"), QMessageBox::Yes);
msgWarning.setWindowIcon(QIcon(":/leaper/Resource/app.png")); msgWarning.setWindowIcon(QIcon(":/leaper/Resource/app.png"));
msgWarning.setButtonText(QMessageBox::Yes, QObject::tr("确认")); msgWarning.setButtonText(QMessageBox::Yes, QObject::tr("确认"));
msgWarning.exec(); msgWarning.exec();
return ; return ;
} }
QMessageBox msgBox(QMessageBox::Warning, QObject::tr("型号删除"), QObject::tr("删除") + strModel + "?", QMessageBox::Yes | QMessageBox::No); QMessageBox msgBox(QMessageBox::Warning, QObject::tr("型号删除"), QObject::tr("删除") + strModel + "?", QMessageBox::Yes | QMessageBox::No);
msgBox.setWindowIcon(QIcon(":/leaper/Resource/app.png")); msgBox.setWindowIcon(QIcon(":/leaper/Resource/app.png"));
if (QMessageBox::Yes == msgBox.exec()) { if (QMessageBox::Yes == msgBox.exec()) {
bool b = m_pCtrl->IDeleteModel(currentTab(), strModel); bool b = m_pCtrl->IDeleteModel(currentTab(), strModel);
@ -157,7 +157,7 @@ Q_SLOT bool QModelMangerUI::OnCellClicked(const QModelIndex &index)
IStation *pStation = m_pCtrl->IGetStationByKey(key); IStation *pStation = m_pCtrl->IGetStationByKey(key);
if (pStation) { if (pStation) {
QString strModel = pStation->model(index.row()); QString strModel = pStation->model(index.row());
QString strName = QObject::tr("模型号:") + strModel; QString strName = QObject::tr("模型号:") + strModel;
int plcIndex = m_pCtrl->IGetPLCIndex(key, strModel); int plcIndex = m_pCtrl->IGetPLCIndex(key, strModel);
ui.label_Name->setText(strModel); ui.label_Name->setText(strModel);
@ -196,7 +196,7 @@ Q_SLOT bool QModelMangerUI::OnCellDoubleClicked(const QModelIndex &index)
IStation *pStation = m_pCtrl->IGetStationByKey(key); IStation *pStation = m_pCtrl->IGetStationByKey(key);
if (pStation) { if (pStation) {
QString strModel = pStation->model(index.row()); QString strModel = pStation->model(index.row());
QString strName = QObject::tr("模型号:") + strModel; QString strName = QObject::tr("模型号:") + strModel;
int plcIndex = m_pCtrl->IGetPLCIndex(key, strModel); int plcIndex = m_pCtrl->IGetPLCIndex(key, strModel);
QPLCIndexUI dlg(this); QPLCIndexUI dlg(this);
dlg.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint); dlg.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
@ -220,19 +220,19 @@ Q_SLOT bool QModelMangerUI::OnCellDoubleClicked(const QModelIndex &index)
} }
if (bExist == true) if (bExist == true)
{ {
QMessageBox msgWarning(QMessageBox::Warning, QObject::tr("警告"), strName + QObject::tr("索引修改失败,与%1索引值冲突").arg(strExistModel), QMessageBox::Yes); QMessageBox msgWarning(QMessageBox::Warning, QObject::tr("警告"), strName + QObject::tr("索引修改失败,与%1索引值冲突").arg(strExistModel), QMessageBox::Yes);
msgWarning.setWindowIcon(QIcon(":/leaper/Resource/app.png")); msgWarning.setWindowIcon(QIcon(":/leaper/Resource/app.png"));
msgWarning.setButtonText(QMessageBox::Yes, QObject::tr("确认")); msgWarning.setButtonText(QMessageBox::Yes, QObject::tr("确认"));
msgWarning.exec(); msgWarning.exec();
ui.mLblModelState->setText(QObject::tr(" %1 的 PLC索引值修改失败").arg(strModel)); ui.mLblModelState->setText(QObject::tr(" %1 的 PLC索引值修改失败").arg(strModel));
return false; return false;
} }
m_pCtrl->ISetPLCIndex(key, strModel, nIndex); m_pCtrl->ISetPLCIndex(key, strModel, nIndex);
if (m_pCtrl) if (m_pCtrl)
m_pCtrl->ISaveModel(key, strModel); m_pCtrl->ISaveModel(key, strModel);
ui.mLblModelState->setText(QObject::tr(" %1 的 PLC索引值修改成功").arg(strModel)); ui.mLblModelState->setText(QObject::tr(" %1 的 PLC索引值修改成功").arg(strModel));
} }
} }
return true; return true;

@ -38,3 +38,11 @@ Q_SLOT void QPLCIndexUI::onButtonClicked()
QDialog::reject(); QDialog::reject();
} }
} }
void QPLCIndexUI::changeEvent(QEvent *event)
{
if (event->type() == QEvent::LanguageChange)
{
ui.retranslateUi(this);
}
}

@ -16,6 +16,8 @@ public:
void setModelIndex(int val); void setModelIndex(int val);
int getModelIndex(); int getModelIndex();
Q_SLOT void onButtonClicked(); Q_SLOT void onButtonClicked();
protected:
virtual void changeEvent(QEvent *event);
private: private:
Ui::QPLCIndexUI ui; Ui::QPLCIndexUI ui;
}; };

@ -31,3 +31,11 @@ Q_SLOT void QTestModeWid::onButtonClicked()
emit sgTestMode(EM_CAM2_Trig); emit sgTestMode(EM_CAM2_Trig);
} }
} }
void QTestModeWid::changeEvent(QEvent *event)
{
if (event->type() == QEvent::LanguageChange)
{
ui.retranslateUi(this);
}
}

@ -18,6 +18,8 @@ public:
~QTestModeWid(); ~QTestModeWid();
Q_SLOT void onButtonClicked(); Q_SLOT void onButtonClicked();
protected:
virtual void changeEvent(QEvent *event);
signals: signals:
void sgTestMode(int); void sgTestMode(int);
private: private:

@ -254,7 +254,6 @@
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\GeneratedFiles;.;$(QTDIR)\include;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtSql;.\GeneratedFiles\$(ConfigurationName);.\..\..\3part\SerialPortTool\include;.\..\..\src\lpMain;.\..\..\src\lpMain\algela;.\..\..\src\lpMain\QDiskCleanThread;.\..\..\src\lpMain\sqliteDB;.\..\..\src\lpMain\UI;.\..\..\3part\opencv3.4.1\include;.\..\..\3part\opencv3.4.1\include\opencv;.\..\..\3part\opencv3.4.1\include\opencv2;.\..\..\3part\libzkq\include;.\..\..\3part\lpSyslog\inc;.\..\..\src\userCtrl;.\..\..\src\lpMain\CoreCtrl;.\..\..\3part\tadpole\include\tpBase;.\..\..\src\lpMain\view;.\..\..\src\lpMain\cryptokey;.\..\..\3part\RsaCrypto\include;F:\ValueProject\newValve\3part\openssl-1.0.2n\vs13\include</IncludePath> <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\GeneratedFiles;.;$(QTDIR)\include;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtSql;.\GeneratedFiles\$(ConfigurationName);.\..\..\3part\SerialPortTool\include;.\..\..\src\lpMain;.\..\..\src\lpMain\algela;.\..\..\src\lpMain\QDiskCleanThread;.\..\..\src\lpMain\sqliteDB;.\..\..\src\lpMain\UI;.\..\..\3part\opencv3.4.1\include;.\..\..\3part\opencv3.4.1\include\opencv;.\..\..\3part\opencv3.4.1\include\opencv2;.\..\..\3part\libzkq\include;.\..\..\3part\lpSyslog\inc;.\..\..\src\userCtrl;.\..\..\src\lpMain\CoreCtrl;.\..\..\3part\tadpole\include\tpBase;.\..\..\src\lpMain\view;.\..\..\src\lpMain\cryptokey;.\..\..\3part\RsaCrypto\include;F:\ValueProject\newValve\3part\openssl-1.0.2n\vs13\include</IncludePath>
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles;.;$(QTDIR)\include;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtSql;.\GeneratedFiles\$(ConfigurationName);.\..\..\3part\SerialPortTool\include;.\..\..\src\lpMain;.\..\..\src\lpMain\algela;.\..\..\src\lpMain\QDiskCleanThread;.\..\..\src\lpMain\sqliteDB;.\..\..\src\lpMain\UI;.\..\..\3part\opencv3.4.1\include;.\..\..\3part\opencv3.4.1\include\opencv;.\..\..\3part\opencv3.4.1\include\opencv2;.\..\..\3part\libzkq\include;.\..\..\3part\lpSyslog\inc;.\..\..\src\userCtrl;.\..\..\src\lpMain\CoreCtrl;.\..\..\3part\tadpole\include\tpBase;.\..\..\src\lpMain\view</IncludePath> <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles;.;$(QTDIR)\include;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtSql;.\GeneratedFiles\$(ConfigurationName);.\..\..\3part\SerialPortTool\include;.\..\..\src\lpMain;.\..\..\src\lpMain\algela;.\..\..\src\lpMain\QDiskCleanThread;.\..\..\src\lpMain\sqliteDB;.\..\..\src\lpMain\UI;.\..\..\3part\opencv3.4.1\include;.\..\..\3part\opencv3.4.1\include\opencv;.\..\..\3part\opencv3.4.1\include\opencv2;.\..\..\3part\libzkq\include;.\..\..\3part\lpSyslog\inc;.\..\..\src\userCtrl;.\..\..\src\lpMain\CoreCtrl;.\..\..\3part\tadpole\include\tpBase;.\..\..\src\lpMain\view</IncludePath>
</QtMoc> </QtMoc>
<ClInclude Include="..\..\src\lpMain\lp_singleton_base.h" />
<QtMoc Include="..\..\src\lpMain\view\cunstomgraphview.h" /> <QtMoc Include="..\..\src\lpMain\view\cunstomgraphview.h" />
<QtMoc Include="..\..\src\lpMain\view\qstylelabel.h" /> <QtMoc Include="..\..\src\lpMain\view\qstylelabel.h" />
<QtMoc Include="..\..\src\lpMain\view\stytlegraphview.h" /> <QtMoc Include="..\..\src\lpMain\view\stytlegraphview.h" />
@ -341,7 +340,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="lpmain_en.ts" /> <None Include="lpmain_en.ts" />
<None Include="lpmain_zh.ts" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')"> <ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">

@ -396,9 +396,6 @@
<ClInclude Include="..\..\src\lpMain\sqliteDB\QSqliteWheelHubWf.h"> <ClInclude Include="..\..\src\lpMain\sqliteDB\QSqliteWheelHubWf.h">
<Filter>lpMain\db</Filter> <Filter>lpMain\db</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\lpMain\lp_singleton_base.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\lpMain\cryptokey\lpCryptokey.h"> <ClInclude Include="..\..\src\lpMain\cryptokey\lpCryptokey.h">
<Filter>cryptokey</Filter> <Filter>cryptokey</Filter>
</ClInclude> </ClInclude>
@ -462,8 +459,5 @@
<None Include="lpmain_en.ts"> <None Include="lpmain_en.ts">
<Filter>Translation Files</Filter> <Filter>Translation Files</Filter>
</None> </None>
<None Include="lpmain_zh.ts">
<Filter>Translation Files</Filter>
</None>
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -1,4 +1,4 @@
#include "lpStationMgr.h" #include "lpStationMgr.h"
lpStationMgr::lpStationMgr(QObject *parent) lpStationMgr::lpStationMgr(QObject *parent)
: QObject(parent) : QObject(parent)

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save