修复一些bug

This commit is contained in:
CHINAMI-TV221UM\Administrator 2024-04-24 14:41:13 +08:00
parent 77b7e2c846
commit 86c69992d5
14 changed files with 727 additions and 459 deletions

View File

@ -467,6 +467,7 @@ void CBoardSetting::PushData()
g_FtpClient->SetUserInfo("root","@#cidw!@123456"); g_FtpClient->SetUserInfo("root","@#cidw!@123456");
g_FtpClient->UpLoadFile(fileName,"UnitWorkConditionsInfo.json"); g_FtpClient->UpLoadFile(fileName,"UnitWorkConditionsInfo.json");
QJsonDocument jsonDocUnit; QJsonDocument jsonDocUnit;
QJsonObject UnitObj; QJsonObject UnitObj;
UnitObj["NULL"] = ""; UnitObj["NULL"] = "";
@ -482,6 +483,17 @@ void CBoardSetting::PushData()
g_FtpClient->SetUserInfo("root","@#cidw!@123456"); g_FtpClient->SetUserInfo("root","@#cidw!@123456");
g_FtpClient->UpLoadFile(fileNameUnit,"UnitConfigurations.json"); g_FtpClient->UpLoadFile(fileNameUnit,"UnitConfigurations.json");
QString fileNameUnit2 = QCoreApplication::applicationDirPath() + "\\config\\UnitConfigurations2.json";
QFile fileUnit2(fileNameUnit2);
fileUnit2.open(QIODevice::WriteOnly);
fileUnit2.write(jsonDocUnit.toJson());
fileUnit2.close();
QString str22 = QString("ftp://%1/CIDW/qtconfig/%2").arg(IP).arg("UnitConfigurations2.json");
g_FtpClient->SetServerInfo(str22);
g_FtpClient->SetUserInfo("root","@#cidw!@123456");
g_FtpClient->UpLoadFile(fileNameUnit2,"UnitConfigurations2.json");
g_channelSetting = g_SqliteDB->GetDataMultiLine("t_ChannelSetting"); g_channelSetting = g_SqliteDB->GetDataMultiLine("t_ChannelSetting");
for (int i = 0; i < g_channelSetting.size(); i++) for (int i = 0; i < g_channelSetting.size(); i++)
{ {
@ -532,6 +544,17 @@ void CBoardSetting::PushData()
g_FtpClient->SetUserInfo("root","@#cidw!@123456"); g_FtpClient->SetUserInfo("root","@#cidw!@123456");
g_FtpClient->UpLoadFile(fileNameTri,"TriggerSettings.json"); g_FtpClient->UpLoadFile(fileNameTri,"TriggerSettings.json");
QString fileNameTri2 = QCoreApplication::applicationDirPath() + "\\config\\TriggerSettings2.json";
QFile fileTri2(fileNameTri2);
fileTri2.open(QIODevice::WriteOnly);
fileTri2.write(jsonDocTri.toJson());
fileTri2.close();
QString strTri2 = QString("ftp://%1/CIDW/qtconfig/%2").arg(IP).arg("TriggerSettings2.json");
g_FtpClient->SetServerInfo(strTri2);
g_FtpClient->SetUserInfo("root","@#cidw!@123456");
g_FtpClient->UpLoadFile(fileNameTri2,"TriggerSettings2.json");
QString str = QString("ftp://%1/CIDW/qtconfig/%2").arg(IP).arg("UnitBoardsInfo.json"); QString str = QString("ftp://%1/CIDW/qtconfig/%2").arg(IP).arg("UnitBoardsInfo.json");
g_FtpClient->SetServerInfo(str); g_FtpClient->SetServerInfo(str);
g_FtpClient->SetUserInfo("root","@#cidw!@123456"); g_FtpClient->SetUserInfo("root","@#cidw!@123456");
@ -737,14 +760,12 @@ void CBoardSetting::on_pushButton_Init_clicked()
'%68','%69','%70',%71,%72,%73,'%74','%75','%76','%77','%78','%79','%80','%81','%82','%83','%84',%85,'%86','%87','%88','%89','%90','%91','%92','%93','%94','%95','',98,1,'','');").\ '%68','%69','%70',%71,%72,%73,'%74','%75','%76','%77','%78','%79','%80','%81','%82','%83','%84',%85,'%86','%87','%88','%89','%90','%91','%92','%93','%94','%95','',98,1,'','');").\
arg("NULL").arg(0).arg("true").arg("ACCELEROMETER").arg("0").arg("Bottom").arg("false").arg(0).arg("false").arg(0).arg("false").arg(0).arg("false").arg(0).arg("false").arg(0).arg("false").arg(0).arg(0).arg(0).arg("false"). arg("NULL").arg(0).arg("true").arg("ACCELEROMETER").arg("0").arg("Bottom").arg("false").arg(0).arg("false").arg(0).arg("false").arg(0).arg("false").arg(0).arg("false").arg(0).arg("false").arg(0).arg(0).arg(0).arg("false").
arg(0).arg("false").arg(0).arg("false").arg(0).arg(strChannelID).arg("NONE").arg(strChannelName).arg("false").arg(0).arg("false").arg(0).arg("RMSValue").arg("").arg(0).arg("false").arg(0).arg("CTC-AC102").arg("false").arg(0).arg("false").arg(0).arg("").\ arg(0).arg("false").arg(0).arg("false").arg(0).arg(strChannelID).arg("NONE").arg(strChannelName).arg("false").arg(0).arg("false").arg(0).arg("RMSValue").arg("").arg(0).arg("false").arg(0).arg("CTC-AC102").arg("false").arg(0).arg("false").arg(0).arg("").\
arg("true").arg(strMAC).arg(0).arg(1000).arg(0).arg("Hamming").arg("15000").arg("0.5").arg(10).arg("5000").arg("").arg(0).arg(0).arg("0").arg("60000").arg(0).arg("NONE").arg("").arg("0").arg(1024).arg("").arg("").arg(timeStamp).\ arg("true").arg(strMAC).arg(0).arg(1000).arg(0).arg("Hamming").arg("15000").arg("0.5").arg(10).arg("5000").arg("").arg(1).arg(1).arg("0").arg("60000").arg(0).arg("NONE").arg("").arg("0").arg(1024).arg("").arg("").arg(timeStamp).\
arg("m/s^2").arg("").arg("").arg(0).arg(BoardNo).arg(i+1).arg("2032").arg("1").arg("-2").arg("-20").arg("10.2").arg("").arg("").arg("").arg("").arg("true").arg("").arg(0).arg("").arg("").arg("").arg("").arg("").arg("").arg("").arg(tempOptions.at(ii)["BoardTypeNo"].toInt()).arg("").arg("峰峰值"); arg("m/s^2").arg("").arg("").arg(0).arg(BoardNo).arg(i+1).arg("2032").arg("1").arg("-2").arg("-20").arg("10.2").arg("").arg("").arg("").arg("").arg("true").arg("").arg(0).arg("").arg("").arg("").arg("").arg("").arg("").arg("").arg(tempOptions.at(ii)["BoardTypeNo"].toInt()).arg("").arg("峰峰值");
qDebug() << "str" << str << endl; qDebug() << "str" << str << endl;
g_SqliteDB->InsertData(taleName,str); g_SqliteDB->InsertData(taleName,str);
} }
}else if(tempOptions.at(ii)["BoardTypeNo"].toInt() == 1){ }else if(tempOptions.at(ii)["BoardTypeNo"].toInt() == 1){
int BoardNo = tempOptions.at(ii)["BoardNo"].toInt(); int BoardNo = tempOptions.at(ii)["BoardNo"].toInt();
int BoardTypeNo = tempOptions.at(ii)["BoardTypeNo"].toInt(); int BoardTypeNo = tempOptions.at(ii)["BoardTypeNo"].toInt();
@ -758,7 +779,7 @@ void CBoardSetting::on_pushButton_Init_clicked()
'%68','%69','%70',%71,%72,%73,'%74','%75','%76','%77','%78','%79','%80','%81','%82','%83','%84',%85,'%86','%87','%88','%89','%90','%91','%92','%93','%94','%95','',98,1,'','');").\ '%68','%69','%70',%71,%72,%73,'%74','%75','%76','%77','%78','%79','%80','%81','%82','%83','%84',%85,'%86','%87','%88','%89','%90','%91','%92','%93','%94','%95','',98,1,'','');").\
arg("NULL").arg(0).arg("true").arg("PULSE_CURRENT").arg("0").arg("Bottom").arg("false").arg(0).arg("false").arg(0).arg("false").arg(0).arg("false").arg(0).arg("false").arg(0).arg("false").arg(0).arg(0).arg(0).arg("false"). arg("NULL").arg(0).arg("true").arg("PULSE_CURRENT").arg("0").arg("Bottom").arg("false").arg(0).arg("false").arg(0).arg("false").arg(0).arg("false").arg(0).arg("false").arg(0).arg("false").arg(0).arg(0).arg(0).arg("false").
arg(0).arg("false").arg(0).arg("false").arg(0).arg(strChannelID).arg("NONE").arg(strChannelName).arg("false").arg(0).arg("false").arg(0).arg("RMSValue").arg("").arg(0).arg("false").arg(0).arg("电流变送器").arg("false").arg(0).arg("false").arg(0).arg("").\ arg(0).arg("false").arg(0).arg("false").arg(0).arg(strChannelID).arg("NONE").arg(strChannelName).arg("false").arg(0).arg("false").arg(0).arg("RMSValue").arg("").arg(0).arg("false").arg(0).arg("电流变送器").arg("false").arg(0).arg("false").arg(0).arg("").\
arg("true").arg(MAC).arg(0).arg(1000).arg(0).arg("Hamming").arg("").arg("").arg(20).arg("5000").arg("").arg(0).arg(0).arg("0").arg("60000").arg(0).arg("NONE").arg("").arg("0").arg(1024).arg("").arg("").arg(timeStamp).\ arg("true").arg(MAC).arg(0).arg(1000).arg(0).arg("Hamming").arg("").arg("").arg(20).arg("5000").arg("").arg(1).arg(1).arg("0").arg("60000").arg(0).arg("NONE").arg("").arg("0").arg(1024).arg("").arg("").arg(timeStamp).\
arg("mA").arg("").arg("").arg(0).arg(BoardNo).arg(i+1).arg("").arg("1").arg("-2").arg("-20").arg("0").arg("").arg("").arg("").arg("").arg("true").arg("").arg(0).arg("").arg("").arg("").arg("20").arg("").arg("4").arg("4").arg(tempOptions.at(ii)["BoardTypeNo"].toInt()).arg("").arg("平均值"); arg("mA").arg("").arg("").arg(0).arg(BoardNo).arg(i+1).arg("").arg("1").arg("-2").arg("-20").arg("0").arg("").arg("").arg("").arg("").arg("true").arg("").arg(0).arg("").arg("").arg("").arg("20").arg("").arg("4").arg("4").arg(tempOptions.at(ii)["BoardTypeNo"].toInt()).arg("").arg("平均值");
qDebug() << "str" << str << endl; qDebug() << "str" << str << endl;

View File

@ -5,8 +5,9 @@
#include <QLabel> #include <QLabel>
#include <QDateTime> #include <QDateTime>
#include <QDate> #include <QDate>
#include <QTime>
#include <QInputDialog> #include <QInputDialog>
#include "NetMgr.h"
CChannelList::CChannelList(QWidget *parent) : CChannelList::CChannelList(QWidget *parent) :
QWidget(parent), QWidget(parent),
@ -633,3 +634,38 @@ void CChannelList::on_pushButton_refresh_clicked()
initReadConfig(); initReadConfig();
} }
void CChannelList::slotNetMgr(QString sAddr, const QVariant &msg)
{
QJsonObject objec = msg.value<QJsonObject>();
if(objec.contains("cmd"))
{
QJsonValue arrays_value = objec.take("cmd");
//qDebug()<<"cmd ="<<arrays_value.toString();
if(arrays_value.toString() == "08"){
bool Status = objec.take("success").toBool();
QString strMessage = objec.take("message").toString();
if(Status){
QMessageBox::information(NULL, QStringLiteral("提示"), strMessage);
}
}
}
}
void CChannelList::on_pushButton_restart_clicked()
{
QMessageBox::StandardButton reply;
reply = QMessageBox::question(NULL, "提示", "确认后将重启服务",
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
if (reply == QMessageBox::Yes)
{
connect(g_NetMgr,SIGNAL(sigNetMgr(QString, const QVariant&)), this, SLOT(slotNetMgr(QString,const QVariant&)));
QJsonObject allObj,cmdBody;
allObj.insert("cmd", "08");
allObj["cmdBody"] = cmdBody;
QNetworkRequest req;
QString sUrl = QString("http://%1/cgi-bin/General.cgi/").arg(IP);
req.setUrl(sUrl);
g_NetMgr->PostJson(req,allObj);
}
}

View File

@ -3,6 +3,7 @@
#include <QWidget> #include <QWidget>
#include <QStandardItemModel> //数据模型类 #include <QStandardItemModel> //数据模型类
#include <QMessageBox>
#include "HeaderView.h" #include "HeaderView.h"
#include "TableHeaderView.h" #include "TableHeaderView.h"
#include "global.h" #include "global.h"
@ -10,6 +11,7 @@
#include "SlowSpeedChannelSetting.h" #include "SlowSpeedChannelSetting.h"
#include "ChannelSetting.h" #include "ChannelSetting.h"
namespace Ui { namespace Ui {
class CChannelList; class CChannelList;
} }
@ -60,7 +62,10 @@ private slots:
void on_pushButton_close_clicked(); void on_pushButton_close_clicked();
void on_pushButton_open_clicked(); void on_pushButton_open_clicked();
void on_pushButton_restart_clicked();
void on_pushButton_refresh_clicked(); void on_pushButton_refresh_clicked();
void slotNetMgr(QString sAddr,const QVariant& msg);
}; };
#endif // CHANNELLIST_H #endif // CHANNELLIST_H

View File

@ -32,7 +32,7 @@ CConfiguration::CConfiguration(QWidget *parent) :
pHeader2->setStretchLastSection(false); pHeader2->setStretchLastSection(false);
connect(ui->comboBox_WC,SIGNAL(currentTextChanged(const QString &)),this,SLOT(on_comboBox_WC_currentTextChanged2(const QString&))); connect(ui->comboBox_WC,SIGNAL(currentTextChanged(const QString &)),this,SLOT(on_comboBox_WC_currentTextChanged2(const QString&)));
connect(g_NetMgr,SIGNAL(sigNetMgr(QString, const QVariant&)), this, SLOT(slotNetMgr(QString,const QVariant&)));
} }
CConfiguration::~CConfiguration() CConfiguration::~CConfiguration()
@ -124,30 +124,57 @@ void CConfiguration::Init()
item2->appendRow(itemChannel); item2->appendRow(itemChannel);
for (int k = 0; k < arrayConfig.size(); k++){ for (int k = 0; k < arrayConfig.size(); k++){
QString str = arrayConfig.at(k)["triggerEventName"].toString(); QStringList strList = arrayConfig.at(k)["triggerEventName"].toString().split('-');
QString strStaticData;
QStandardItem *item = NULL; QStandardItem *item = NULL;
int xAlertOverEnabled = arrayConfig.at(k)["xAlertOverEnabled"].toInt(); int xAlertOverEnabled = arrayConfig.at(k)["xAlertOverEnabled"].toInt();
int xAlertUnderEnabled = arrayConfig.at(k)["xAlertUnderEnabled"].toInt(); int xAlertUnderEnabled = arrayConfig.at(k)["xAlertUnderEnabled"].toInt();
int xDangerOverEnabled = arrayConfig.at(k)["xDangerOverEnabled"].toInt(); int xDangerOverEnabled = arrayConfig.at(k)["xDangerOverEnabled"].toInt();
int xDangerUnderEnabled = arrayConfig.at(k)["xDangerUnderEnabled"].toInt(); int xDangerUnderEnabled = arrayConfig.at(k)["xDangerUnderEnabled"].toInt();
if(strList[0] == "MinValues")
strStaticData = "最小值";
else if(strList[0] == "MaxValues")
strStaticData = "最大值";
else if( strList[0] == "DCValues")
strStaticData = "平均值";
else if(strList[0] == "RMSValues")
strStaticData = "有效值";
else if(strList[0] == "DiagnosisPk2Pk")
strStaticData = "诊断峰峰值";
else if(strList[0] == "IntegratRMS")//积分
strStaticData = "积分有效值";
else if(strList[0] == "IntegratPk2Pk")
strStaticData = "积分峰峰值";
else if(strList[0] == "SpeedProfileSpeed")
strStaticData = "转速";
else if(strList[0] == "IntegratPk2Pk/2")//积分
strStaticData = "积分峰值";
else if(strList[0] == "DiagnosisPeak")
strStaticData = "峰值";
else if(strList[0] == "MonitorPk2Pk")
strStaticData = "监测保护峰峰值";
if(xAlertOverEnabled == 1){ if(xAlertOverEnabled == 1){
item = new QStandardItem(QString(channelName + "-" + "高于警报值"));
item = new QStandardItem(QString(channelName + "-" + strStaticData + "-" + "高于警报值"));
//item = new QStandardItem(QString(channelName + "-" + str + "-Over-"+"警报"));
itemChannel->appendRow(item); itemChannel->appendRow(item);
} }
if(xAlertUnderEnabled == 1){ if(xAlertUnderEnabled == 1){
item = new QStandardItem(QString(channelName + "-" + "低于警报值")); item = new QStandardItem(QString(channelName + "-" + strStaticData + "-"+ "低于警报值"));
//item = new QStandardItem(QString(channelName + "-" + str + "-Under-"+"警报"));
itemChannel->appendRow(item); itemChannel->appendRow(item);
} }
if(xDangerOverEnabled == 1){ if(xDangerOverEnabled == 1){
item = new QStandardItem(QString(channelName + "-" + strStaticData + "-" + "高于危险值"));
//item = new QStandardItem(QString(channelName + "-" + str + "-Over-"+"危险")); //item = new QStandardItem(QString(channelName + "-" + str + "-Over-"+"危险"));
item = new QStandardItem(QString(channelName + "-" + "高于危险值"));
itemChannel->appendRow(item); itemChannel->appendRow(item);
} }
if(xDangerUnderEnabled == 1){ if(xDangerUnderEnabled == 1){
item = new QStandardItem(QString(channelName + "-" + "低于危险值")); item = new QStandardItem(QString(channelName + "-" + strStaticData + "-" + "低于危险值"));
//item = new QStandardItem(QString(channelName + "-" + str + "-Under-"+"危险")); //item = new QStandardItem(QString(channelName + "-" + str + "-Under-"+"危险"));
itemChannel->appendRow(item); itemChannel->appendRow(item);
} }
itemChannel->setData(strStaticData);
} }
} }
} }
@ -444,6 +471,7 @@ void CConfiguration::slotNetMgr(QString sAddr, const QVariant &msg)
bool Status = objec.take("success").toBool(); bool Status = objec.take("success").toBool();
if(Status){ if(Status){
PushData(); PushData();
disconnect(g_NetMgr,SIGNAL(sigNetMgr(QString, const QVariant&)), this, SLOT(slotNetMgr(QString,const QVariant&)));
} }
} }
} }
@ -451,6 +479,7 @@ void CConfiguration::slotNetMgr(QString sAddr, const QVariant &msg)
void CConfiguration::on_pushButton_save_clicked() void CConfiguration::on_pushButton_save_clicked()
{ {
connect(g_NetMgr,SIGNAL(sigNetMgr(QString, const QVariant&)), this, SLOT(slotNetMgr(QString,const QVariant&)));
g_NetMgr->DetectNet(); g_NetMgr->DetectNet();
} }
@ -671,34 +700,57 @@ void CConfiguration::on_comboBox_WC_currentTextChanged2(const QString &arg1)
if(arrayConfig.size() > 0){ if(arrayConfig.size() > 0){
item2->appendRow(itemChannel); item2->appendRow(itemChannel);
for (int k = 0; k < arrayConfig.size(); k++){ for (int k = 0; k < arrayConfig.size(); k++){
QString str = arrayConfig.at(k)["triggerEventName"].toString(); QStringList strList = arrayConfig.at(k)["triggerEventName"].toString().split('-');
QString strStaticData;
QStandardItem *item = NULL; QStandardItem *item = NULL;
int xAlertOverEnabled = arrayConfig.at(k)["xAlertOverEnabled"].toInt(); int xAlertOverEnabled = arrayConfig.at(k)["xAlertOverEnabled"].toInt();
int xAlertUnderEnabled = arrayConfig.at(k)["xAlertUnderEnabled"].toInt(); int xAlertUnderEnabled = arrayConfig.at(k)["xAlertUnderEnabled"].toInt();
int xDangerOverEnabled = arrayConfig.at(k)["xDangerOverEnabled"].toInt(); int xDangerOverEnabled = arrayConfig.at(k)["xDangerOverEnabled"].toInt();
int xDangerUnderEnabled = arrayConfig.at(k)["xDangerUnderEnabled"].toInt(); int xDangerUnderEnabled = arrayConfig.at(k)["xDangerUnderEnabled"].toInt();
if(strList[0] == "MinValues")
strStaticData = "最小值";
else if(strList[0] == "MaxValues")
strStaticData = "最大值";
else if( strList[0] == "DCValues")
strStaticData = "平均值";
else if(strList[0] == "RMSValues")
strStaticData = "有效值";
else if(strList[0] == "DiagnosisPk2Pk")
strStaticData = "诊断峰峰值";
else if(strList[0] == "IntegratRMS")//积分
strStaticData = "积分有效值";
else if(strList[0] == "IntegratPk2Pk")
strStaticData = "积分峰峰值";
else if(strList[0] == "SpeedProfileSpeed")
strStaticData = "转速";
else if(strList[0] == "IntegratPk2Pk/2")//积分
strStaticData = "积分峰值";
else if(strList[0] == "DiagnosisPeak")
strStaticData = "峰值";
else if(strList[0] == "MonitorPk2Pk")
strStaticData = "监测保护峰峰值";
if(xAlertOverEnabled == 1){ if(xAlertOverEnabled == 1){
item = new QStandardItem(QString(channelName + "-" + "高于警报值")); item = new QStandardItem(QString(channelName + "-" + strStaticData + "-" + "高于警报值"));
//item = new QStandardItem(QString(channelName + "-" + str + "-Over-"+"警报")); //item = new QStandardItem(QString(channelName + "-" + str + "-Over-"+"警报"));
itemChannel->appendRow(item); itemChannel->appendRow(item);
} }
if(xAlertUnderEnabled == 1){ if(xAlertUnderEnabled == 1){
item = new QStandardItem(QString(channelName + "-" + "低于警报值")); item = new QStandardItem(QString(channelName + "-" + strStaticData + "-"+ "低于警报值"));
//item = new QStandardItem(QString(channelName + "-" + str + "-Under-"+"警报")); //item = new QStandardItem(QString(channelName + "-" + str + "-Under-"+"警报"));
itemChannel->appendRow(item); itemChannel->appendRow(item);
} }
if(xDangerOverEnabled == 1){ if(xDangerOverEnabled == 1){
item = new QStandardItem(QString(channelName + "-" + "高于危险值")); item = new QStandardItem(QString(channelName + "-" + strStaticData + "-" + "高于危险值"));
//item = new QStandardItem(QString(channelName + "-" + str + "-Over-"+"危险")); //item = new QStandardItem(QString(channelName + "-" + str + "-Over-"+"危险"));
itemChannel->appendRow(item); itemChannel->appendRow(item);
} }
if(xDangerUnderEnabled == 1){ if(xDangerUnderEnabled == 1){
item = new QStandardItem(QString(channelName + "-" + "低于危险值")); item = new QStandardItem(QString(channelName + "-" + strStaticData + "-" + "低于危险值"));
//item = new QStandardItem(QString(channelName + "-" + str + "-Under-"+"危险")); //item = new QStandardItem(QString(channelName + "-" + str + "-Under-"+"危险"));
itemChannel->appendRow(item); itemChannel->appendRow(item);
} }
itemChannel->setData(str); itemChannel->setData(strStaticData);
} }
} }
} }

View File

@ -38,6 +38,7 @@ SOURCES += \
FileServerConfig.cpp \ FileServerConfig.cpp \
HistoryAlarm.cpp \ HistoryAlarm.cpp \
Mqttclient.cpp \ Mqttclient.cpp \
MyTreeView.cpp \
NTPServerConfig.cpp \ NTPServerConfig.cpp \
NetMgr.cpp \ NetMgr.cpp \
OtherConfig.cpp \ OtherConfig.cpp \
@ -87,6 +88,7 @@ HEADERS += \
FileServerConfig.h \ FileServerConfig.h \
HistoryAlarm.h \ HistoryAlarm.h \
Mqttclient.h \ Mqttclient.h \
MyTreeView.h \
NTPServerConfig.h \ NTPServerConfig.h \
NetMgr.h \ NetMgr.h \
OtherConfig.h \ OtherConfig.h \

72
MyTreeView.cpp Normal file
View File

@ -0,0 +1,72 @@
#include "MyTreeView.h"
#include <QMouseEvent>
#include <QDebug>
MyTreeView::MyTreeView(QWidget *parent)
: QTreeView(parent)
{
}
void MyTreeView::mousePressEvent(QMouseEvent *event)
{
qDebug()<<"mousePressEvent";
//实现点空白处取消选择
QPoint p = event->pos();
QModelIndex index = indexAt(p);
if(!index.isValid())
{
setCurrentIndex(QModelIndex());
return;
}
QModelIndex index2 = indexAt(event->pos());
int clickedColumn = index2.row();
qDebug() << "clickedColumn" << clickedColumn << endl;
//调用基类的点击处理,不然点击的原有响应也失效了
//但如果就想禁用tree控件单击不调用即可
QTreeView::mousePressEvent(event);
}
void MyTreeView::mouseReleaseEvent(QMouseEvent *event)
{
qDebug()<<"mouseReleaseEvent";
QTreeView::mouseReleaseEvent(event);
}
void MyTreeView::mouseDoubleClickEvent(QMouseEvent *event)
{
qDebug()<<"mouseDoubleClickEvent";
QTreeView::mouseDoubleClickEvent(event);
}
void MyTreeView::mouseMoveEvent(QMouseEvent *event)
{
qDebug()<<"mouseMoveEvent";
QTreeView::mouseMoveEvent(event);
}
void MyTreeView::keyPressEvent(QKeyEvent *event)
{
qDebug()<<"keyPressEvent";
QTreeView::keyPressEvent(event);
}
void MyTreeView::dragEnterEvent(QDragEnterEvent *event)
{
qDebug()<<"dragEnterEvent";
}
void MyTreeView::dropEvent(QDropEvent *event)
{
qDebug()<<"dropEvent";
}

28
MyTreeView.h Normal file
View File

@ -0,0 +1,28 @@
#ifndef MYTREEVIEW_H
#define MYTREEVIEW_H
#include <QTreeView>
#include <QStandardItemModel> //数据模型类
//继承QTreeView重写点击消息实现点空白处取消选择
class MyTreeView : public QTreeView
{
Q_OBJECT
public:
MyTreeView(QWidget *parent = Q_NULLPTR);
protected:
void mousePressEvent ( QMouseEvent * event )override ;
void mouseReleaseEvent(QMouseEvent *event)override ;
void mouseDoubleClickEvent(QMouseEvent *event)override ;
void mouseMoveEvent(QMouseEvent *event)override ;
void keyPressEvent(QKeyEvent *event)override ;
void dragEnterEvent(QDragEnterEvent *event)override;
void dropEvent(QDropEvent *event)override;
};
#endif // MYTREEVIEW_H

View File

@ -4,7 +4,7 @@
#include "QMyTableViewBtnDelegate.h" #include "QMyTableViewBtnDelegate.h"
#include "AlarmDetails.h" #include "AlarmDetails.h"
#include "sqlitedb.h" #include "sqlitedb.h"
#include <QTimeZone>
#include "ftpclient.h" #include "ftpclient.h"
@ -71,7 +71,10 @@ void CRealTimeAlarm::initTable()
if(m_vecTriggerAlarmStatusInfo.size() > 0){ if(m_vecTriggerAlarmStatusInfo.size() > 0){
for (int i = 0; i < m_vecTriggerAlarmStatusInfo.size(); i++) { for (int i = 0; i < m_vecTriggerAlarmStatusInfo.size(); i++) {
QVariantList strRowItem ; QVariantList strRowItem ;
QString TStr = QDateTime::fromSecsSinceEpoch(m_vecTriggerAlarmStatusInfo[i].timestamp).toString("yyyy-MM-dd hh:mm:ss"); QDateTime dateTime = QDateTime::fromSecsSinceEpoch(m_vecTriggerAlarmStatusInfo[i].timestamp);
QTimeZone timeZone("Asia/Shanghai");
dateTime = dateTime.toTimeZone(timeZone);
QString TStr = dateTime.toString("yyyy-MM-dd hh:mm:ss");
QString triggerLevel = "",triggerEventName = ""; QString triggerLevel = "",triggerEventName = "";
if(m_vecTriggerAlarmStatusInfo[i].triggerLevel == "1"){ if(m_vecTriggerAlarmStatusInfo[i].triggerLevel == "1"){
triggerLevel = "警报"; triggerLevel = "警报";

View File

@ -103,185 +103,217 @@
<property name="title"> <property name="title">
<string>终端信息</string> <string>终端信息</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_7">
<property name="spacing">
<number>1</number>
</property>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<widget class="QLabel" name="label"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="minimumSize"> <item>
<size> <widget class="QLabel" name="label">
<width>80</width> <property name="minimumSize">
<height>0</height> <size>
</size> <width>80</width>
</property> <height>0</height>
<property name="maximumSize"> </size>
<size> </property>
<width>80</width> <property name="maximumSize">
<height>16777215</height> <size>
</size> <width>80</width>
</property> <height>16777215</height>
<property name="text"> </size>
<string>在线状态:</string> </property>
</property> <property name="text">
<property name="alignment"> <string>在线状态:</string>
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> </property>
</property> <property name="alignment">
</widget> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="styleSheet">
<string notr="true">color: rgb(0, 170, 0);</string>
</property>
<property name="text">
<string>在线</string>
</property>
</widget>
</item>
</layout>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_2"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="styleSheet"> <item>
<string notr="true">color: rgb(0, 170, 0);</string> <widget class="QLabel" name="label_3">
</property> <property name="minimumSize">
<property name="text"> <size>
<string>在线</string> <width>80</width>
</property> <height>0</height>
</widget> </size>
</item> </property>
</layout> <property name="maximumSize">
</item> <size>
<item> <width>80</width>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <height>16777215</height>
<item> </size>
<widget class="QLabel" name="label_3"> </property>
<property name="minimumSize"> <property name="text">
<size> <string>终端号:</string>
<width>80</width> </property>
<height>0</height> <property name="alignment">
</size> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
<property name="maximumSize"> </widget>
<size> </item>
<width>80</width> <item>
<height>16777215</height> <widget class="QLabel" name="label_DatawatchNo">
</size> <property name="text">
</property> <string>- -</string>
<property name="text"> </property>
<string>终端号:</string> </widget>
</property> </item>
<property name="alignment"> </layout>
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_DatawatchNo"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="text"> <item>
<string>- -</string> <widget class="QLabel" name="label_5">
</property> <property name="minimumSize">
</widget> <size>
</item> <width>80</width>
</layout> <height>0</height>
</item> </size>
<item> </property>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <property name="maximumSize">
<item> <size>
<widget class="QLabel" name="label_5"> <width>80</width>
<property name="minimumSize"> <height>16777215</height>
<size> </size>
<width>80</width> </property>
<height>0</height> <property name="text">
</size> <string>终端名称:</string>
</property> </property>
<property name="maximumSize"> <property name="alignment">
<size> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<width>80</width> </property>
<height>16777215</height> </widget>
</size> </item>
</property> <item>
<property name="text"> <widget class="QLabel" name="label_DatawatchName">
<string>终端名称:</string> <property name="text">
</property> <string>- -</string>
<property name="alignment"> </property>
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> </widget>
</property> </item>
</widget> </layout>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_DatawatchName"> <layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="text"> <item>
<string>- -</string> <widget class="QLabel" name="label_7">
</property> <property name="minimumSize">
</widget> <size>
</item> <width>80</width>
</layout> <height>0</height>
</item> </size>
<item> </property>
<layout class="QHBoxLayout" name="horizontalLayout_5"> <property name="maximumSize">
<item> <size>
<widget class="QLabel" name="label_7"> <width>80</width>
<property name="minimumSize"> <height>16777215</height>
<size> </size>
<width>80</width> </property>
<height>0</height> <property name="text">
</size> <string>版本:</string>
</property> </property>
<property name="maximumSize"> <property name="alignment">
<size> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<width>80</width> </property>
<height>16777215</height> </widget>
</size> </item>
</property> <item>
<property name="text"> <widget class="QLabel" name="label_Version">
<string>版本:</string> <property name="text">
</property> <string>- -</string>
<property name="alignment"> </property>
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> </widget>
</property> </item>
</widget> </layout>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_Version"> <layout class="QHBoxLayout" name="horizontalLayout_17">
<property name="text"> <item>
<string>- -</string> <widget class="QLabel" name="label_8">
</property> <property name="minimumSize">
</widget> <size>
</item> <width>80</width>
</layout> <height>0</height>
</item> </size>
<item> </property>
<layout class="QHBoxLayout" name="horizontalLayout_6"> <property name="maximumSize">
<item> <size>
<widget class="QLabel" name="label_9"> <width>80</width>
<property name="minimumSize"> <height>16777215</height>
<size> </size>
<width>80</width> </property>
<height>0</height> <property name="text">
</size> <string>GUI版本</string>
</property> </property>
<property name="maximumSize"> <property name="alignment">
<size> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<width>80</width> </property>
<height>16777215</height> </widget>
</size> </item>
</property> <item>
<property name="text"> <widget class="QLabel" name="label_Version_GUI">
<string>固件升级:</string> <property name="text">
</property> <string>- -</string>
<property name="alignment"> </property>
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> </widget>
</property> </item>
</widget> </layout>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButton_Update"> <layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="minimumSize"> <item>
<size> <widget class="QLabel" name="label_9">
<width>96</width> <property name="minimumSize">
<height>28</height> <size>
</size> <width>80</width>
</property> <height>0</height>
<property name="maximumSize"> </size>
<size> </property>
<width>96</width> <property name="maximumSize">
<height>28</height> <size>
</size> <width>80</width>
</property> <height>16777215</height>
<property name="styleSheet"> </size>
<string notr="true">#pushButton_Update { border-image: url(:/image/Btn/normal_Btn.png); </property>
<property name="text">
<string>固件升级:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_Update">
<property name="minimumSize">
<size>
<width>96</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>96</width>
<height>28</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">#pushButton_Update { border-image: url(:/image/Btn/normal_Btn.png);
color:#1f5188 } color:#1f5188 }
#pushButton_Update:hover { border-image: url(:/image/Btn/normal_Btn_p.png); #pushButton_Update:hover { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff} color:#ffffff}
@ -289,265 +321,265 @@
color:#ffffff} color:#ffffff}
#pushButton_Update:checked { border-image: url(:/image/Btn/normal_Btn_p.png); #pushButton_Update:checked { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}</string> color:#ffffff}</string>
</property> </property>
<property name="text"> <property name="text">
<string>升级</string> <string>升级</string>
</property> </property>
</widget> </widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_3"> <layout class="QHBoxLayout" name="horizontalLayout_7">
<property name="orientation"> <item>
<enum>Qt::Horizontal</enum> <widget class="QLabel" name="label_10">
</property> <property name="minimumSize">
<property name="sizeHint" stdset="0"> <size>
<size> <width>80</width>
<width>40</width> <height>0</height>
<height>20</height> </size>
</size> </property>
</property> <property name="maximumSize">
</spacer> <size>
</item> <width>80</width>
</layout> <height>16777215</height>
</item> </size>
<item> </property>
<layout class="QHBoxLayout" name="horizontalLayout_7"> <property name="text">
<item> <string>城市:</string>
<widget class="QLabel" name="label_10"> </property>
<property name="minimumSize"> <property name="alignment">
<size> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<width>80</width> </property>
<height>0</height> </widget>
</size> </item>
</property> <item>
<property name="maximumSize"> <widget class="QLabel" name="label_City">
<size> <property name="text">
<width>80</width> <string>- -</string>
<height>16777215</height> </property>
</size> </widget>
</property> </item>
<property name="text"> </layout>
<string>城市:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_City"> <layout class="QHBoxLayout" name="horizontalLayout_8">
<property name="text"> <item>
<string>- -</string> <widget class="QLabel" name="label_12">
</property> <property name="minimumSize">
</widget> <size>
</item> <width>80</width>
</layout> <height>0</height>
</item> </size>
<item> </property>
<layout class="QHBoxLayout" name="horizontalLayout_8"> <property name="maximumSize">
<item> <size>
<widget class="QLabel" name="label_12"> <width>80</width>
<property name="minimumSize"> <height>16777215</height>
<size> </size>
<width>80</width> </property>
<height>0</height> <property name="text">
</size> <string>安装时间:</string>
</property> </property>
<property name="maximumSize"> <property name="alignment">
<size> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<width>80</width> </property>
<height>16777215</height> </widget>
</size> </item>
</property> <item>
<property name="text"> <widget class="QLabel" name="label_Time">
<string>安装时间:</string> <property name="text">
</property> <string>- -</string>
<property name="alignment"> </property>
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> </widget>
</property> </item>
</widget> </layout>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_Time"> <layout class="QHBoxLayout" name="horizontalLayout_9">
<property name="text"> <item>
<string>- -</string> <widget class="QLabel" name="label_14">
</property> <property name="minimumSize">
</widget> <size>
</item> <width>80</width>
</layout> <height>0</height>
</item> </size>
<item> </property>
<layout class="QHBoxLayout" name="horizontalLayout_9"> <property name="maximumSize">
<item> <size>
<widget class="QLabel" name="label_14"> <width>80</width>
<property name="minimumSize"> <height>16777215</height>
<size> </size>
<width>80</width> </property>
<height>0</height> <property name="text">
</size> <string>添加人:</string>
</property> </property>
<property name="maximumSize"> <property name="alignment">
<size> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<width>80</width> </property>
<height>16777215</height> </widget>
</size> </item>
</property> <item>
<property name="text"> <widget class="QLabel" name="label_User">
<string>添加人:</string> <property name="text">
</property> <string>- -</string>
<property name="alignment"> </property>
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> </widget>
</property> </item>
</widget> </layout>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_User"> <layout class="QHBoxLayout" name="horizontalLayout_10">
<property name="text"> <item>
<string>- -</string> <widget class="QLabel" name="label_16">
</property> <property name="minimumSize">
</widget> <size>
</item> <width>80</width>
</layout> <height>0</height>
</item> </size>
<item> </property>
<layout class="QHBoxLayout" name="horizontalLayout_10"> <property name="maximumSize">
<item> <size>
<widget class="QLabel" name="label_16"> <width>80</width>
<property name="minimumSize"> <height>16777215</height>
<size> </size>
<width>80</width> </property>
<height>0</height> <property name="text">
</size> <string>终端类型:</string>
</property> </property>
<property name="maximumSize"> <property name="alignment">
<size> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<width>80</width> </property>
<height>16777215</height> </widget>
</size> </item>
</property> <item>
<property name="text"> <widget class="QLabel" name="label_Type">
<string>终端类型:</string> <property name="text">
</property> <string>- -</string>
<property name="alignment"> </property>
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> </widget>
</property> </item>
</widget> </layout>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_Type"> <layout class="QHBoxLayout" name="horizontalLayout_11">
<property name="text"> <item>
<string>- -</string> <widget class="QLabel" name="label_18">
</property> <property name="minimumSize">
</widget> <size>
</item> <width>80</width>
</layout> <height>0</height>
</item> </size>
<item> </property>
<layout class="QHBoxLayout" name="horizontalLayout_11"> <property name="maximumSize">
<item> <size>
<widget class="QLabel" name="label_18"> <width>80</width>
<property name="minimumSize"> <height>16777215</height>
<size> </size>
<width>80</width> </property>
<height>0</height> <property name="text">
</size> <string>序列号:</string>
</property> </property>
<property name="maximumSize"> <property name="alignment">
<size> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<width>80</width> </property>
<height>16777215</height> </widget>
</size> </item>
</property> <item>
<property name="text"> <widget class="QLabel" name="label_SerialNo">
<string>序列号:</string> <property name="text">
</property> <string>- -</string>
<property name="alignment"> </property>
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> </widget>
</property> </item>
</widget> </layout>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_SerialNo"> <layout class="QHBoxLayout" name="horizontalLayout_12">
<property name="text"> <item>
<string>- -</string> <widget class="QLabel" name="label_20">
</property> <property name="minimumSize">
</widget> <size>
</item> <width>80</width>
</layout> <height>0</height>
</item> </size>
<item> </property>
<layout class="QHBoxLayout" name="horizontalLayout_12"> <property name="maximumSize">
<item> <size>
<widget class="QLabel" name="label_20"> <width>80</width>
<property name="minimumSize"> <height>16777215</height>
<size> </size>
<width>80</width> </property>
<height>0</height> <property name="text">
</size> <string>终端地址:</string>
</property> </property>
<property name="maximumSize"> <property name="alignment">
<size> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<width>80</width> </property>
<height>16777215</height> </widget>
</size> </item>
</property> <item>
<property name="text"> <widget class="QLabel" name="label_Address">
<string>终端地址:</string> <property name="text">
</property> <string>- -</string>
<property name="alignment"> </property>
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> </widget>
</property> </item>
</widget> </layout>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_Address"> <layout class="QHBoxLayout" name="horizontalLayout_16">
<property name="text"> <item>
<string>- -</string> <widget class="QLabel" name="label_21">
</property> <property name="minimumSize">
</widget> <size>
</item> <width>80</width>
</layout> <height>0</height>
</item> </size>
<item> </property>
<layout class="QHBoxLayout" name="horizontalLayout_16"> <property name="maximumSize">
<item> <size>
<widget class="QLabel" name="label_21"> <width>80</width>
<property name="minimumSize"> <height>16777215</height>
<size> </size>
<width>80</width> </property>
<height>0</height> <property name="text">
</size> <string>数据拷贝:</string>
</property> </property>
<property name="maximumSize"> <property name="alignment">
<size> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<width>80</width> </property>
<height>16777215</height> </widget>
</size> </item>
</property> <item>
<property name="text"> <widget class="QPushButton" name="pushButtonCopy">
<string>数据拷贝:</string> <property name="minimumSize">
</property> <size>
<property name="alignment"> <width>96</width>
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <height>28</height>
</property> </size>
</widget> </property>
</item> <property name="maximumSize">
<item> <size>
<widget class="QPushButton" name="pushButtonCopy"> <width>96</width>
<property name="minimumSize"> <height>28</height>
<size> </size>
<width>96</width> </property>
<height>28</height> <property name="styleSheet">
</size> <string notr="true">#pushButtonCopy { border-image: url(:/image/Btn/normal_Btn.png);
</property>
<property name="maximumSize">
<size>
<width>96</width>
<height>28</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">#pushButtonCopy { border-image: url(:/image/Btn/normal_Btn.png);
color:#1f5188 } color:#1f5188 }
#pushButtonCopy:hover { border-image: url(:/image/Btn/normal_Btn_p.png); #pushButtonCopy:hover { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff} color:#ffffff}
@ -555,24 +587,26 @@
color:#ffffff} color:#ffffff}
#pushButtonCopy:checked { border-image: url(:/image/Btn/normal_Btn_p.png); #pushButtonCopy:checked { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}</string> color:#ffffff}</string>
</property> </property>
<property name="text"> <property name="text">
<string>拷贝</string> <string>拷贝</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_4"> <spacer name="horizontalSpacer_4">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item>
</layout>
</item> </item>
</layout> </layout>
</item> </item>

View File

@ -178,7 +178,7 @@ QTableView::item {
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButton_line"> <widget class="QPushButton" name="pushButton_restart">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>96</width> <width>96</width>
@ -192,17 +192,17 @@ QTableView::item {
</size> </size>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">#pushButton_line { border-image: url(:/image/Btn/normal_Btn.png); <string notr="true">#pushButton_restart { border-image: url(:/image/Btn/normal_Btn.png);
color:#1f5188 } color:#1f5188 }
#pushButton_line:hover { border-image: url(:/image/Btn/normal_Btn_p.png); #pushButton_restart:hover { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff} color:#ffffff}
#pushButton_line:pressed { border-image: url(:/image/Btn/normal_Btn_p.png); #pushButton_restart:pressed { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff} color:#ffffff}
#pushButton_line:checked { border-image: url(:/image/Btn/normal_Btn_p.png); #pushButton_restart:checked { border-image: url(:/image/Btn/normal_Btn_p.png);
color:#ffffff}</string> color:#ffffff}</string>
</property> </property>
<property name="text"> <property name="text">
<string>查看线路图</string> <string>重启服务</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -635,7 +635,7 @@ color: rgb(27, 30, 35);
<item> <item>
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="tab"> <widget class="QWidget" name="tab">
<attribute name="title"> <attribute name="title">
@ -844,6 +844,9 @@ color: rgb(27, 30, 35);
</item> </item>
<item> <item>
<widget class="QComboBox" name="comboBox_sensorICP"> <widget class="QComboBox" name="comboBox_sensorICP">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
@ -1808,6 +1811,9 @@ color: rgb(27, 30, 35);
</item> </item>
<item> <item>
<widget class="QComboBox" name="comboBox_sensorICP_2"> <widget class="QComboBox" name="comboBox_sensorICP_2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>

View File

@ -188,6 +188,15 @@ void MainWindow::initWindow()
g_MapChannelType.insert("DI","开入"); g_MapChannelType.insert("DI","开入");
g_MapChannelType.insert("DO","开出"); g_MapChannelType.insert("DO","开出");
g_MapChannelType.insert("AIRGAP","气隙"); g_MapChannelType.insert("AIRGAP","气隙");
//返回与应用程序所连接的窗口系统相关联的所有屏幕的列表。
QList<QScreen *> screen_list= QGuiApplication::screens();
for(int i=0;i<screen_list.count();i++)
{
qDebug()<<screen_list.at(0)->size(); //此属性保存屏幕的像素分辨率
}
} }
void MainWindow::initStyle() void MainWindow::initStyle()

View File

@ -762,11 +762,11 @@ QMessageBox {
} }
QMessageBox QLabel#qt_msgbox_label { /* textLabel */ QMessageBox QLabel#qt_msgbox_label { /* textLabel */
color: #298DFF; color: #245d9b;
background-color: transparent; background-color: transparent;
min-width: 340px; /* textLabel设置最小宽度可以相应的改变QMessageBox的最小宽度 */ min-width: 340px; /* textLabel设置最小宽度可以相应的改变QMessageBox的最小宽度 */
min-height: 40px; /* textLabel和iconLabel高度保持一致 */ min-height: 40px; /* textLabel和iconLabel高度保持一致 */
font-size: 24pt; font-size: 18pt;
} }
QMessageBox QLabel#qt_msgboxex_icon_label { /* iconLabel */ QMessageBox QLabel#qt_msgboxex_icon_label { /* iconLabel */

View File

@ -425,7 +425,7 @@ void CRealTimeForm::on_addchannel(channelBaseInfo channelbaseInfo,QString str)
pTextUnits->setDefaultTextColor(QColor(27, 30, 35)); pTextUnits->setDefaultTextColor(QColor(27, 30, 35));
pTextChannel->setFont(font); pTextChannel->setFont(font);
pTextValue->setFont(font2); pTextValue->setFont(font2);
pTextValue->setPos(150,0); pTextValue->setPos(160,-2);
pTextValue->setDefaultTextColor(QColor(31, 81, 136)); pTextValue->setDefaultTextColor(QColor(31, 81, 136));
pTextChannel->setPos(0,2); pTextChannel->setPos(0,2);
pTextChannel->setDefaultTextColor(QColor(27, 30, 35)); pTextChannel->setDefaultTextColor(QColor(27, 30, 35));