diff --git a/BoardSetting.cpp b/BoardSetting.cpp index 1415563..d7afd46 100644 --- a/BoardSetting.cpp +++ b/BoardSetting.cpp @@ -467,6 +467,7 @@ void CBoardSetting::PushData() g_FtpClient->SetUserInfo("root","@#cidw!@123456"); g_FtpClient->UpLoadFile(fileName,"UnitWorkConditionsInfo.json"); + QJsonDocument jsonDocUnit; QJsonObject UnitObj; UnitObj["NULL"] = ""; @@ -482,6 +483,17 @@ void CBoardSetting::PushData() g_FtpClient->SetUserInfo("root","@#cidw!@123456"); 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"); for (int i = 0; i < g_channelSetting.size(); i++) { @@ -532,6 +544,17 @@ void CBoardSetting::PushData() g_FtpClient->SetUserInfo("root","@#cidw!@123456"); 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"); g_FtpClient->SetServerInfo(str); 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,'','');").\ 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("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("峰峰值"); qDebug() << "str" << str << endl; g_SqliteDB->InsertData(taleName,str); } - - }else if(tempOptions.at(ii)["BoardTypeNo"].toInt() == 1){ int BoardNo = tempOptions.at(ii)["BoardNo"].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,'','');").\ 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("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("平均值"); qDebug() << "str" << str << endl; diff --git a/ChannelList.cpp b/ChannelList.cpp index 0f57359..2098303 100644 --- a/ChannelList.cpp +++ b/ChannelList.cpp @@ -5,8 +5,9 @@ #include #include #include +#include #include - +#include "NetMgr.h" CChannelList::CChannelList(QWidget *parent) : QWidget(parent), @@ -633,3 +634,38 @@ void CChannelList::on_pushButton_refresh_clicked() initReadConfig(); } +void CChannelList::slotNetMgr(QString sAddr, const QVariant &msg) +{ + QJsonObject objec = msg.value(); + if(objec.contains("cmd")) + { + QJsonValue arrays_value = objec.take("cmd"); + //qDebug()<<"cmd ="<PostJson(req,allObj); + } + +} + diff --git a/ChannelList.h b/ChannelList.h index b31c00f..c8fd449 100644 --- a/ChannelList.h +++ b/ChannelList.h @@ -3,6 +3,7 @@ #include #include //数据模型类 +#include #include "HeaderView.h" #include "TableHeaderView.h" #include "global.h" @@ -10,6 +11,7 @@ #include "SlowSpeedChannelSetting.h" #include "ChannelSetting.h" + namespace Ui { class CChannelList; } @@ -60,7 +62,10 @@ private slots: void on_pushButton_close_clicked(); void on_pushButton_open_clicked(); + void on_pushButton_restart_clicked(); void on_pushButton_refresh_clicked(); + + void slotNetMgr(QString sAddr,const QVariant& msg); }; #endif // CHANNELLIST_H diff --git a/Configuration.cpp b/Configuration.cpp index a56669c..4f7dc6a 100644 --- a/Configuration.cpp +++ b/Configuration.cpp @@ -32,7 +32,7 @@ CConfiguration::CConfiguration(QWidget *parent) : pHeader2->setStretchLastSection(false); 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() @@ -124,30 +124,57 @@ void CConfiguration::Init() item2->appendRow(itemChannel); 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; int xAlertOverEnabled = arrayConfig.at(k)["xAlertOverEnabled"].toInt(); int xAlertUnderEnabled = arrayConfig.at(k)["xAlertUnderEnabled"].toInt(); int xDangerOverEnabled = arrayConfig.at(k)["xDangerOverEnabled"].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){ - item = new QStandardItem(QString(channelName + "-" + "高于警报值")); + + item = new QStandardItem(QString(channelName + "-" + strStaticData + "-" + "高于警报值")); + //item = new QStandardItem(QString(channelName + "-" + str + "-Over-"+"警报")); itemChannel->appendRow(item); } if(xAlertUnderEnabled == 1){ - item = new QStandardItem(QString(channelName + "-" + "低于警报值")); + item = new QStandardItem(QString(channelName + "-" + strStaticData + "-"+ "低于警报值")); + //item = new QStandardItem(QString(channelName + "-" + str + "-Under-"+"警报")); itemChannel->appendRow(item); } if(xDangerOverEnabled == 1){ + item = new QStandardItem(QString(channelName + "-" + strStaticData + "-" + "高于危险值")); //item = new QStandardItem(QString(channelName + "-" + str + "-Over-"+"危险")); - item = new QStandardItem(QString(channelName + "-" + "高于危险值")); itemChannel->appendRow(item); } if(xDangerUnderEnabled == 1){ - item = new QStandardItem(QString(channelName + "-" + "低于危险值")); + item = new QStandardItem(QString(channelName + "-" + strStaticData + "-" + "低于危险值")); //item = new QStandardItem(QString(channelName + "-" + str + "-Under-"+"危险")); itemChannel->appendRow(item); } + itemChannel->setData(strStaticData); } } } @@ -444,6 +471,7 @@ void CConfiguration::slotNetMgr(QString sAddr, const QVariant &msg) bool Status = objec.take("success").toBool(); if(Status){ 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() { + connect(g_NetMgr,SIGNAL(sigNetMgr(QString, const QVariant&)), this, SLOT(slotNetMgr(QString,const QVariant&))); g_NetMgr->DetectNet(); } @@ -671,34 +700,57 @@ void CConfiguration::on_comboBox_WC_currentTextChanged2(const QString &arg1) if(arrayConfig.size() > 0){ item2->appendRow(itemChannel); 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; int xAlertOverEnabled = arrayConfig.at(k)["xAlertOverEnabled"].toInt(); int xAlertUnderEnabled = arrayConfig.at(k)["xAlertUnderEnabled"].toInt(); int xDangerOverEnabled = arrayConfig.at(k)["xDangerOverEnabled"].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){ - item = new QStandardItem(QString(channelName + "-" + "高于警报值")); + item = new QStandardItem(QString(channelName + "-" + strStaticData + "-" + "高于警报值")); //item = new QStandardItem(QString(channelName + "-" + str + "-Over-"+"警报")); itemChannel->appendRow(item); } if(xAlertUnderEnabled == 1){ - item = new QStandardItem(QString(channelName + "-" + "低于警报值")); + item = new QStandardItem(QString(channelName + "-" + strStaticData + "-"+ "低于警报值")); //item = new QStandardItem(QString(channelName + "-" + str + "-Under-"+"警报")); itemChannel->appendRow(item); } if(xDangerOverEnabled == 1){ - item = new QStandardItem(QString(channelName + "-" + "高于危险值")); + item = new QStandardItem(QString(channelName + "-" + strStaticData + "-" + "高于危险值")); //item = new QStandardItem(QString(channelName + "-" + str + "-Over-"+"危险")); itemChannel->appendRow(item); } if(xDangerUnderEnabled == 1){ - item = new QStandardItem(QString(channelName + "-" + "低于危险值")); + item = new QStandardItem(QString(channelName + "-" + strStaticData + "-" + "低于危险值")); //item = new QStandardItem(QString(channelName + "-" + str + "-Under-"+"危险")); itemChannel->appendRow(item); } - itemChannel->setData(str); + itemChannel->setData(strStaticData); } } } diff --git a/DataWatch3500_GUI.pro b/DataWatch3500_GUI.pro index d5d11fc..26c89ed 100644 --- a/DataWatch3500_GUI.pro +++ b/DataWatch3500_GUI.pro @@ -38,6 +38,7 @@ SOURCES += \ FileServerConfig.cpp \ HistoryAlarm.cpp \ Mqttclient.cpp \ + MyTreeView.cpp \ NTPServerConfig.cpp \ NetMgr.cpp \ OtherConfig.cpp \ @@ -87,6 +88,7 @@ HEADERS += \ FileServerConfig.h \ HistoryAlarm.h \ Mqttclient.h \ + MyTreeView.h \ NTPServerConfig.h \ NetMgr.h \ OtherConfig.h \ diff --git a/MyTreeView.cpp b/MyTreeView.cpp new file mode 100644 index 0000000..d15e4b0 --- /dev/null +++ b/MyTreeView.cpp @@ -0,0 +1,72 @@ +#include "MyTreeView.h" +#include +#include + +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"; +} diff --git a/MyTreeView.h b/MyTreeView.h new file mode 100644 index 0000000..cf676e8 --- /dev/null +++ b/MyTreeView.h @@ -0,0 +1,28 @@ +#ifndef MYTREEVIEW_H +#define MYTREEVIEW_H + +#include +#include //数据模型类 + +//继承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 diff --git a/RealTimeAlarm.cpp b/RealTimeAlarm.cpp index 3bc2b2f..c537771 100644 --- a/RealTimeAlarm.cpp +++ b/RealTimeAlarm.cpp @@ -4,7 +4,7 @@ #include "QMyTableViewBtnDelegate.h" #include "AlarmDetails.h" #include "sqlitedb.h" - +#include #include "ftpclient.h" @@ -71,7 +71,10 @@ void CRealTimeAlarm::initTable() if(m_vecTriggerAlarmStatusInfo.size() > 0){ for (int i = 0; i < m_vecTriggerAlarmStatusInfo.size(); i++) { 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 = ""; if(m_vecTriggerAlarmStatusInfo[i].triggerLevel == "1"){ triggerLevel = "警报"; diff --git a/TerminalInfo.ui b/TerminalInfo.ui index 92b48b5..ed5fa58 100644 --- a/TerminalInfo.ui +++ b/TerminalInfo.ui @@ -103,185 +103,217 @@ 终端信息 - - - 1 - + - + - - - - 80 - 0 - - - - - 80 - 16777215 - - - - 在线状态: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 在线状态: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + color: rgb(0, 170, 0); + + + 在线 + + + + - - - color: rgb(0, 170, 0); - - - 在线 - - - - - - - - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - 终端号: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 终端号: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + - - + + + + - - - - - - - - - - - - - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - 终端名称: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 终端名称: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + - - + + + + - - - - - - - - - - - - - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - 版本: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 版本: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + - - + + + + - - - - - - - - - - - - - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - 固件升级: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + GUI版本: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + - - + + + + - - - - 96 - 28 - - - - - 96 - 28 - - - - #pushButton_Update { border-image: url(:/image/Btn/normal_Btn.png); + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 固件升级: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 96 + 28 + + + + + 96 + 28 + + + + #pushButton_Update { border-image: url(:/image/Btn/normal_Btn.png); color:#1f5188 } #pushButton_Update:hover { border-image: url(:/image/Btn/normal_Btn_p.png); color:#ffffff} @@ -289,265 +321,265 @@ color:#ffffff} #pushButton_Update:checked { border-image: url(:/image/Btn/normal_Btn_p.png); color:#ffffff} - - - 升级 - - + + + 升级 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - 城市: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 城市: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + - - + + + + - - - - - - - - - - - - - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - 安装时间: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 安装时间: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + - - + + + + - - - - - - - - - - - - - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - 添加人: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 添加人: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + - - + + + + - - - - - - - - - - - - - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - 终端类型: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 终端类型: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + - - + + + + - - - - - - - - - - - - - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - 序列号: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 序列号: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + - - + + + + - - - - - - - - - - - - - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - 终端地址: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 终端地址: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + - - + + + + - - - - - - - - - - - - - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - 数据拷贝: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 96 - 28 - - - - - 96 - 28 - - - - #pushButtonCopy { border-image: url(:/image/Btn/normal_Btn.png); + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 数据拷贝: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 96 + 28 + + + + + 96 + 28 + + + + #pushButtonCopy { border-image: url(:/image/Btn/normal_Btn.png); color:#1f5188 } #pushButtonCopy:hover { border-image: url(:/image/Btn/normal_Btn_p.png); color:#ffffff} @@ -555,24 +587,26 @@ color:#ffffff} #pushButtonCopy:checked { border-image: url(:/image/Btn/normal_Btn_p.png); color:#ffffff} - - - 拷贝 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - + + + 拷贝 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + diff --git a/channellist.ui b/channellist.ui index d2f9e74..72da1eb 100644 --- a/channellist.ui +++ b/channellist.ui @@ -178,7 +178,7 @@ QTableView::item { - + 96 @@ -192,17 +192,17 @@ QTableView::item { - #pushButton_line { border-image: url(:/image/Btn/normal_Btn.png); + #pushButton_restart { border-image: url(:/image/Btn/normal_Btn.png); 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} -#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} -#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} - 查看线路图 + 重启服务 diff --git a/channelsetting.ui b/channelsetting.ui index aa60047..ffbed75 100644 --- a/channelsetting.ui +++ b/channelsetting.ui @@ -635,7 +635,7 @@ color: rgb(27, 30, 35); - 0 + 1 @@ -844,6 +844,9 @@ color: rgb(27, 30, 35); + + false + 0 @@ -1808,6 +1811,9 @@ color: rgb(27, 30, 35); + + false + 0 diff --git a/mainwindow.cpp b/mainwindow.cpp index b0733f8..6ef89d9 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -188,6 +188,15 @@ void MainWindow::initWindow() g_MapChannelType.insert("DI","开入"); g_MapChannelType.insert("DO","开出"); g_MapChannelType.insert("AIRGAP","气隙"); + + + //返回与应用程序所连接的窗口系统相关联的所有屏幕的列表。 + QList screen_list= QGuiApplication::screens(); + for(int i=0;isize(); //此属性保存屏幕的像素分辨率 + } + } void MainWindow::initStyle() diff --git a/qss/blacksoft.css b/qss/blacksoft.css index 5649df8..c8cf672 100644 --- a/qss/blacksoft.css +++ b/qss/blacksoft.css @@ -762,11 +762,11 @@ QMessageBox { } QMessageBox QLabel#qt_msgbox_label { /* textLabel */ - color: #298DFF; + color: #245d9b; background-color: transparent; min-width: 340px; /* textLabel设置最小宽度可以相应的改变QMessageBox的最小宽度 */ min-height: 40px; /* textLabel和iconLabel高度保持一致 */ - font-size: 24pt; + font-size: 18pt; } QMessageBox QLabel#qt_msgboxex_icon_label { /* iconLabel */ diff --git a/realtimeform.cpp b/realtimeform.cpp index 9202a3f..5aed8f0 100644 --- a/realtimeform.cpp +++ b/realtimeform.cpp @@ -425,7 +425,7 @@ void CRealTimeForm::on_addchannel(channelBaseInfo channelbaseInfo,QString str) pTextUnits->setDefaultTextColor(QColor(27, 30, 35)); pTextChannel->setFont(font); pTextValue->setFont(font2); - pTextValue->setPos(150,0); + pTextValue->setPos(160,-2); pTextValue->setDefaultTextColor(QColor(31, 81, 136)); pTextChannel->setPos(0,2); pTextChannel->setDefaultTextColor(QColor(27, 30, 35));