优化mqtt重连,开入开出界面
This commit is contained in:
parent
332756c8eb
commit
d32e5bfb55
1
.gitignore
vendored
1
.gitignore
vendored
@ -54,3 +54,4 @@ deploy/
|
|||||||
*.pb.cc
|
*.pb.cc
|
||||||
|
|
||||||
|
|
||||||
|
realtimeform - 副本.cpp
|
||||||
|
|||||||
10
Backup.cpp
10
Backup.cpp
@ -34,8 +34,14 @@ void CBackup::on_pushButton_confirm_clicked()
|
|||||||
QMessageBox::information(this,tr("提示"),tr("请选择导出文件路径!"));
|
QMessageBox::information(this,tr("提示"),tr("请选择导出文件路径!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
backup_path = backup_path + "\\config\\";
|
#ifdef Q_OS_WIN32
|
||||||
copyDirectory(QCoreApplication::applicationDirPath() + "\\config\\", backup_path);
|
backup_path = backup_path + "\\config\\";
|
||||||
|
copyDirectory(QCoreApplication::applicationDirPath() + "\\config\\", backup_path);
|
||||||
|
#endif
|
||||||
|
#ifdef Q_OS_LINUX
|
||||||
|
backup_path = backup_path + "/config/";
|
||||||
|
copyDirectory(QCoreApplication::applicationDirPath() + "/config/", backup_path);
|
||||||
|
#endif
|
||||||
QFile file(backup_path+"macbackup");
|
QFile file(backup_path+"macbackup");
|
||||||
if (!file.open(QIODevice::ReadWrite)) {
|
if (!file.open(QIODevice::ReadWrite)) {
|
||||||
qWarning("Couldn't open file for writing.");
|
qWarning("Couldn't open file for writing.");
|
||||||
|
|||||||
@ -1016,22 +1016,14 @@ void CBoardSetting::on_pushButton_Init_clicked()
|
|||||||
// g_FtpClient->SetUserInfo("root","@#cidw!@123456");
|
// g_FtpClient->SetUserInfo("root","@#cidw!@123456");
|
||||||
// g_FtpClient->UpLoadFile(name,"UnitBoardsInfo.json");
|
// g_FtpClient->UpLoadFile(name,"UnitBoardsInfo.json");
|
||||||
customLogMessageHandler(QtDebugMsg,"初始化机组板卡配置信息推送完成!");
|
customLogMessageHandler(QtDebugMsg,"初始化机组板卡配置信息推送完成!");
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
=======
|
|
||||||
#ifndef NO_FILTER
|
#ifndef NO_FILTER
|
||||||
>>>>>>> font
|
|
||||||
QJsonObject sendData;
|
QJsonObject sendData;
|
||||||
sendData["cmd"] = "111";
|
sendData["cmd"] = "111";
|
||||||
QNetworkRequest req;
|
QNetworkRequest req;
|
||||||
QString sUrl = QString("http://%1/cgi-bin/General.cgi/").arg(IP);
|
QString sUrl = QString("http://%1/cgi-bin/General.cgi/").arg(IP);
|
||||||
req.setUrl(sUrl);
|
req.setUrl(sUrl);
|
||||||
g_NetMgr->PostJson(req,sendData);
|
g_NetMgr->PostJson(req,sendData);
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
=======
|
|
||||||
#endif
|
#endif
|
||||||
>>>>>>> font
|
|
||||||
putJson();
|
putJson();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -68,9 +68,6 @@ CChannelList::CChannelList(QWidget *parent) :
|
|||||||
ui->comboBox_operate->addItem("通道");
|
ui->comboBox_operate->addItem("通道");
|
||||||
ui->comboBox_operate->addItem("带通滤波");
|
ui->comboBox_operate->addItem("带通滤波");
|
||||||
|
|
||||||
|
|
||||||
ui->comboBox_operate->addItem("带通滤波");
|
|
||||||
ui->comboBox_operate->addItem("通道");
|
|
||||||
//--2 创建表格项
|
//--2 创建表格项
|
||||||
// QStringList workingConditionName;
|
// QStringList workingConditionName;
|
||||||
// workingConditionName<<tr("工况1")<<tr("工况2")<<tr("工况3");
|
// workingConditionName<<tr("工况1")<<tr("工况2")<<tr("工况3");
|
||||||
@ -79,12 +76,9 @@ CChannelList::CChannelList(QWidget *parent) :
|
|||||||
#ifdef QT_DEBUG
|
#ifdef QT_DEBUG
|
||||||
initReadConfig();
|
initReadConfig();
|
||||||
#endif
|
#endif
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
#ifdef NO_FILTER
|
#ifdef NO_FILTER
|
||||||
initReadConfig();
|
initReadConfig();
|
||||||
#endif
|
#endif
|
||||||
>>>>>>> font
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,10 +174,7 @@ void CChannelList::iniConnect()
|
|||||||
connect(model, SIGNAL(itemChanged(QStandardItem*)), this, SLOT(itemChangedSlot(QStandardItem*)));
|
connect(model, SIGNAL(itemChanged(QStandardItem*)), this, SLOT(itemChangedSlot(QStandardItem*)));
|
||||||
|
|
||||||
connect(g_NetMgr,SIGNAL(sigNetMgr(QString, const QVariant&)), this, SLOT(slotNetMgr(QString,const QVariant&)));
|
connect(g_NetMgr,SIGNAL(sigNetMgr(QString, const QVariant&)), this, SLOT(slotNetMgr(QString,const QVariant&)));
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
#ifndef NO_FILTER
|
#ifndef NO_FILTER
|
||||||
>>>>>>> font
|
|
||||||
QJsonObject sendData;
|
QJsonObject sendData;
|
||||||
sendData["cmd"] = "97";
|
sendData["cmd"] = "97";
|
||||||
QJsonArray chan_list;
|
QJsonArray chan_list;
|
||||||
@ -196,10 +187,7 @@ void CChannelList::iniConnect()
|
|||||||
QString sUrl = QString("http://%1/cgi-bin/General.cgi/").arg(IP);
|
QString sUrl = QString("http://%1/cgi-bin/General.cgi/").arg(IP);
|
||||||
req.setUrl(sUrl);
|
req.setUrl(sUrl);
|
||||||
g_NetMgr->PostJson(req,sendData);
|
g_NetMgr->PostJson(req,sendData);
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
#endif
|
#endif
|
||||||
>>>>>>> font
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChannelList::createItem(QStringList filename)
|
void CChannelList::createItem(QStringList filename)
|
||||||
@ -659,12 +647,8 @@ void CChannelList::on_pushButton_open_clicked()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
putJson();
|
putJson();
|
||||||
<<<<<<< HEAD
|
|
||||||
}else if(ui->comboBox_operate->currentText() == "带通滤波"){
|
|
||||||
=======
|
|
||||||
}else if(ui->comboBox_operate->currentText() == "带通滤波")
|
}else if(ui->comboBox_operate->currentText() == "带通滤波")
|
||||||
{
|
{
|
||||||
>>>>>>> font
|
|
||||||
QJsonArray channleList;
|
QJsonArray channleList;
|
||||||
for (int i = 0; i < model->rowCount(); i++) {
|
for (int i = 0; i < model->rowCount(); i++) {
|
||||||
QModelIndex indexCheck = model->index(i,0);
|
QModelIndex indexCheck = model->index(i,0);
|
||||||
@ -728,10 +712,7 @@ void CChannelList::on_pushButton_refresh_clicked()
|
|||||||
model->removeRows(0, model->rowCount());
|
model->removeRows(0, model->rowCount());
|
||||||
g_channelSetting = g_SqliteDB->GetDataMultiLine("t_ChannelSetting");
|
g_channelSetting = g_SqliteDB->GetDataMultiLine("t_ChannelSetting");
|
||||||
connect(g_NetMgr,SIGNAL(sigNetMgr(QString, const QVariant&)), this, SLOT(slotNetMgr(QString,const QVariant&)));
|
connect(g_NetMgr,SIGNAL(sigNetMgr(QString, const QVariant&)), this, SLOT(slotNetMgr(QString,const QVariant&)));
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
#ifndef NO_FILTER
|
#ifndef NO_FILTER
|
||||||
>>>>>>> font
|
|
||||||
QJsonObject sendData;
|
QJsonObject sendData;
|
||||||
sendData["cmd"] = "97";
|
sendData["cmd"] = "97";
|
||||||
QJsonArray chan_list;
|
QJsonArray chan_list;
|
||||||
@ -743,15 +724,12 @@ void CChannelList::on_pushButton_refresh_clicked()
|
|||||||
QString sUrl = QString("http://%1/cgi-bin/General.cgi/").arg(IP);
|
QString sUrl = QString("http://%1/cgi-bin/General.cgi/").arg(IP);
|
||||||
req.setUrl(sUrl);
|
req.setUrl(sUrl);
|
||||||
g_NetMgr->PostJson(req,sendData);
|
g_NetMgr->PostJson(req,sendData);
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
#else
|
#else
|
||||||
initReadConfig();
|
initReadConfig();
|
||||||
#endif
|
#endif
|
||||||
#ifdef QT_DEBUG
|
#ifdef QT_DEBUG
|
||||||
initReadConfig();
|
initReadConfig();
|
||||||
#endif
|
#endif
|
||||||
>>>>>>> font
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChannelList::slotNetMgr(QString sAddr, const QVariant &msg)
|
void CChannelList::slotNetMgr(QString sAddr, const QVariant &msg)
|
||||||
@ -779,13 +757,9 @@ void CChannelList::slotNetMgr(QString sAddr, const QVariant &msg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
|
||||||
initReadConfig();
|
|
||||||
=======
|
|
||||||
#ifndef NO_FILTER
|
#ifndef NO_FILTER
|
||||||
initReadConfig();
|
initReadConfig();
|
||||||
#endif
|
#endif
|
||||||
>>>>>>> font
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
disconnect(g_NetMgr,SIGNAL(sigNetMgr(QString, const QVariant&)), this, SLOT(slotNetMgr(QString,const QVariant&)));
|
disconnect(g_NetMgr,SIGNAL(sigNetMgr(QString, const QVariant&)), this, SLOT(slotNetMgr(QString,const QVariant&)));
|
||||||
|
|||||||
@ -850,14 +850,7 @@ void CChannelSetting::on_pushButton_CustomFilter_clicked()
|
|||||||
|
|
||||||
CustomFilter *pCustomFilter = new CustomFilter();
|
CustomFilter *pCustomFilter = new CustomFilter();
|
||||||
pCustomFilter->channel_ID = channelSetting.channelId;
|
pCustomFilter->channel_ID = channelSetting.channelId;
|
||||||
<<<<<<< HEAD
|
|
||||||
if(ui->channelTypeCombox->currentText()=="径向振动位移" && ui->comboBox_sensorType->currentText() =="低频位移")
|
|
||||||
pCustomFilter->vibrate_channel = 1;
|
|
||||||
else
|
|
||||||
pCustomFilter->vibrate_channel = 0;
|
|
||||||
=======
|
|
||||||
pCustomFilter->vibrate_channel = 1;
|
pCustomFilter->vibrate_channel = 1;
|
||||||
>>>>>>> font
|
|
||||||
pCustomFilter->setWindowModality(Qt::ApplicationModal);
|
pCustomFilter->setWindowModality(Qt::ApplicationModal);
|
||||||
pCustomFilter->show();
|
pCustomFilter->show();
|
||||||
pCustomFilter->getfilterInfo();
|
pCustomFilter->getfilterInfo();
|
||||||
|
|||||||
@ -418,6 +418,7 @@ QJsonArray CConfiguration::GetItem(QStandardItem *item,int MinimumNumber)
|
|||||||
QJsonArray ret;
|
QJsonArray ret;
|
||||||
ret.append(jsonObjLogic);
|
ret.append(jsonObjLogic);
|
||||||
m_deleteInputArray.append(jsonObjLogic2);
|
m_deleteInputArray.append(jsonObjLogic2);
|
||||||
|
qDebug() << "m_array" << ret << endl;
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|
||||||
@ -501,6 +502,9 @@ void CConfiguration::slotNetMgr(QString sAddr, const QVariant &msg)
|
|||||||
|
|
||||||
void CConfiguration::on_pushButton_save_clicked()
|
void CConfiguration::on_pushButton_save_clicked()
|
||||||
{
|
{
|
||||||
|
#ifdef QT_DEBUG
|
||||||
|
PushData();
|
||||||
|
#endif
|
||||||
connect(g_NetMgr,SIGNAL(sigNetMgr(QString, const QVariant&)), this, SLOT(slotNetMgr(QString,const QVariant&)));
|
connect(g_NetMgr,SIGNAL(sigNetMgr(QString, const QVariant&)), this, SLOT(slotNetMgr(QString,const QVariant&)));
|
||||||
g_NetMgr->DetectNet();
|
g_NetMgr->DetectNet();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QStandardItemModel> //数据模型类
|
#include <QStandardItemModel> //数据模型类
|
||||||
|
#include <QTreeView>
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "sqlitedb.h"
|
#include "sqlitedb.h"
|
||||||
#include "ftpclient.h"
|
#include "ftpclient.h"
|
||||||
@ -79,6 +80,7 @@ private:
|
|||||||
QVector<QJsonObject> m_vecWorkConditionObj;
|
QVector<QJsonObject> m_vecWorkConditionObj;
|
||||||
QVector<QJsonObject> m_vecWorkConditionObj2;
|
QVector<QJsonObject> m_vecWorkConditionObj2;
|
||||||
|
|
||||||
|
|
||||||
void LoadConfiguration();
|
void LoadConfiguration();
|
||||||
QJsonObject SelectChannel(int channelNo);
|
QJsonObject SelectChannel(int channelNo);
|
||||||
void ViewRelay(int ChannelNoInBoard);
|
void ViewRelay(int ChannelNoInBoard);
|
||||||
|
|||||||
@ -92,11 +92,7 @@ void CustomFilter::on_pushButton_Submit_clicked()
|
|||||||
type = false;
|
type = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if(ui->spinBox_start->text().toInt() >= ui->spinBox_stop->text().toInt()){
|
|
||||||
=======
|
|
||||||
if(ui->doubleSpinBox_start->text().toDouble() >= ui->doubleSpinBox_stop->text().toDouble()){
|
if(ui->doubleSpinBox_start->text().toDouble() >= ui->doubleSpinBox_stop->text().toDouble()){
|
||||||
>>>>>>> font
|
|
||||||
QMessageBox::warning(this, QStringLiteral("提示"), QStringLiteral("频率下限设置错误!"));
|
QMessageBox::warning(this, QStringLiteral("提示"), QStringLiteral("频率下限设置错误!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -104,18 +100,11 @@ void CustomFilter::on_pushButton_Submit_clicked()
|
|||||||
sendData2["cmd"] = "95";
|
sendData2["cmd"] = "95";
|
||||||
sendData2["chan_id"] = channel_ID;
|
sendData2["chan_id"] = channel_ID;
|
||||||
sendData2["open"] = type;
|
sendData2["open"] = type;
|
||||||
<<<<<<< HEAD
|
|
||||||
sendData2["start"] = ui->spinBox_start->text().toInt();
|
|
||||||
sendData2["stop"] = ui->spinBox_stop->text().toInt();
|
|
||||||
req.setUrl(sUrl);
|
|
||||||
g_NetMgr->PostJson(req,sendData2);
|
|
||||||
=======
|
|
||||||
sendData2["start"] = ui->doubleSpinBox_start->text().toDouble();
|
sendData2["start"] = ui->doubleSpinBox_start->text().toDouble();
|
||||||
sendData2["stop"] = ui->doubleSpinBox_stop->text().toDouble();
|
sendData2["stop"] = ui->doubleSpinBox_stop->text().toDouble();
|
||||||
req.setUrl(sUrl);
|
req.setUrl(sUrl);
|
||||||
g_NetMgr->PostJson(req,sendData2);
|
g_NetMgr->PostJson(req,sendData2);
|
||||||
this->close();
|
this->close();
|
||||||
>>>>>>> font
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomFilter::slotNetMgr(QString sAddr, const QVariant &msg)
|
void CustomFilter::slotNetMgr(QString sAddr, const QVariant &msg)
|
||||||
@ -134,23 +123,15 @@ void CustomFilter::slotNetMgr(QString sAddr, const QVariant &msg)
|
|||||||
if(arrays_value.toString() == "94"){
|
if(arrays_value.toString() == "94"){
|
||||||
|
|
||||||
int Statusfilter = objec.take("status").toInt();
|
int Statusfilter = objec.take("status").toInt();
|
||||||
<<<<<<< HEAD
|
|
||||||
ui->spinBox_start->setValue(objec.take("start").toInt());
|
|
||||||
ui->spinBox_stop->setValue(objec.take("stop").toInt());
|
|
||||||
=======
|
|
||||||
ui->doubleSpinBox_start->setValue(objec.take("start").toDouble());
|
ui->doubleSpinBox_start->setValue(objec.take("start").toDouble());
|
||||||
ui->doubleSpinBox_stop->setValue(objec.take("stop").toDouble());
|
ui->doubleSpinBox_stop->setValue(objec.take("stop").toDouble());
|
||||||
>>>>>>> font
|
|
||||||
|
|
||||||
if(Statusfilter){
|
if(Statusfilter){
|
||||||
ui->comboBox_open->setCurrentText("是");
|
ui->comboBox_open->setCurrentText("是");
|
||||||
}else if(!Statusfilter){
|
}else if(!Statusfilter){
|
||||||
ui->comboBox_open->setCurrentText("否");
|
ui->comboBox_open->setCurrentText("否");
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
ui->doubleSpinBox_start->setEnabled(false);
|
ui->doubleSpinBox_start->setEnabled(false);
|
||||||
ui->doubleSpinBox_stop->setEnabled(false);
|
ui->doubleSpinBox_stop->setEnabled(false);
|
||||||
>>>>>>> font
|
|
||||||
}
|
}
|
||||||
QMessageBox::information(this, QStringLiteral("提示"), QStringLiteral("获取成功!"));
|
QMessageBox::information(this, QStringLiteral("提示"), QStringLiteral("获取成功!"));
|
||||||
}else if(arrays_value.toString() == "98"){
|
}else if(arrays_value.toString() == "98"){
|
||||||
@ -167,23 +148,15 @@ void CustomFilter::slotNetMgr(QString sAddr, const QVariant &msg)
|
|||||||
QMessageBox::information(this, QStringLiteral("提示"), QStringLiteral("获取成功!"));
|
QMessageBox::information(this, QStringLiteral("提示"), QStringLiteral("获取成功!"));
|
||||||
}else if(arrays_value.toString() == "112"){
|
}else if(arrays_value.toString() == "112"){
|
||||||
int Statusfilter = objec.take("status").toInt();
|
int Statusfilter = objec.take("status").toInt();
|
||||||
<<<<<<< HEAD
|
|
||||||
ui->spinBox_start->setValue(objec.take("start").toInt());
|
|
||||||
ui->spinBox_stop->setValue(objec.take("stop").toInt());
|
|
||||||
=======
|
|
||||||
ui->doubleSpinBox_start->setValue(objec.take("start").toDouble());
|
ui->doubleSpinBox_start->setValue(objec.take("start").toDouble());
|
||||||
ui->doubleSpinBox_stop->setValue(objec.take("stop").toDouble());
|
ui->doubleSpinBox_stop->setValue(objec.take("stop").toDouble());
|
||||||
>>>>>>> font
|
|
||||||
|
|
||||||
if(Statusfilter){
|
if(Statusfilter){
|
||||||
ui->comboBox_open->setCurrentText("是");
|
ui->comboBox_open->setCurrentText("是");
|
||||||
}else if(!Statusfilter){
|
}else if(!Statusfilter){
|
||||||
ui->comboBox_open->setCurrentText("否");
|
ui->comboBox_open->setCurrentText("否");
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
ui->doubleSpinBox_start->setEnabled(false);
|
ui->doubleSpinBox_start->setEnabled(false);
|
||||||
ui->doubleSpinBox_stop->setEnabled(false);
|
ui->doubleSpinBox_stop->setEnabled(false);
|
||||||
>>>>>>> font
|
|
||||||
}
|
}
|
||||||
int num = objec["num"].toInt();
|
int num = objec["num"].toInt();
|
||||||
int j = 0;
|
int j = 0;
|
||||||
@ -202,13 +175,8 @@ void CustomFilter::slotNetMgr(QString sAddr, const QVariant &msg)
|
|||||||
}
|
}
|
||||||
if(!vibrate_channel){
|
if(!vibrate_channel){
|
||||||
ui->comboBox_open->setEnabled(false);
|
ui->comboBox_open->setEnabled(false);
|
||||||
<<<<<<< HEAD
|
|
||||||
ui->spinBox_start->setEnabled(false);
|
|
||||||
ui->spinBox_stop->setEnabled(false);
|
|
||||||
=======
|
|
||||||
ui->doubleSpinBox_start->setEnabled(false);
|
ui->doubleSpinBox_start->setEnabled(false);
|
||||||
ui->doubleSpinBox_stop->setEnabled(false);
|
ui->doubleSpinBox_stop->setEnabled(false);
|
||||||
>>>>>>> font
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -226,11 +194,6 @@ void CustomFilter::getfilterInfo()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
void CustomFilter::comboBox_open_currentTextChanged(const QString &)
|
|
||||||
{
|
|
||||||
qDebug() << "" << endl;
|
|
||||||
=======
|
|
||||||
void CustomFilter::comboBox_open_currentTextChanged(const QString &str)
|
void CustomFilter::comboBox_open_currentTextChanged(const QString &str)
|
||||||
{
|
{
|
||||||
if(str == "否"){
|
if(str == "否"){
|
||||||
@ -240,5 +203,4 @@ void CustomFilter::comboBox_open_currentTextChanged(const QString &str)
|
|||||||
ui->doubleSpinBox_start->setEnabled(true);
|
ui->doubleSpinBox_start->setEnabled(true);
|
||||||
ui->doubleSpinBox_stop->setEnabled(true);
|
ui->doubleSpinBox_stop->setEnabled(true);
|
||||||
}
|
}
|
||||||
>>>>>>> font
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,11 +28,7 @@ private slots:
|
|||||||
|
|
||||||
void on_pushButton_Submit_clicked();
|
void on_pushButton_Submit_clicked();
|
||||||
void slotNetMgr(QString sAddr,const QVariant& msg);
|
void slotNetMgr(QString sAddr,const QVariant& msg);
|
||||||
<<<<<<< HEAD
|
|
||||||
void comboBox_open_currentTextChanged(const QString &);
|
|
||||||
=======
|
|
||||||
void comboBox_open_currentTextChanged(const QString &str);
|
void comboBox_open_currentTextChanged(const QString &str);
|
||||||
>>>>>>> font
|
|
||||||
private:
|
private:
|
||||||
Ui::CustomFilter *ui;
|
Ui::CustomFilter *ui;
|
||||||
TableHeaderView *myHeader;
|
TableHeaderView *myHeader;
|
||||||
|
|||||||
@ -94,21 +94,9 @@ color: rgb(27, 30, 35);</string>
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<<<<<<< HEAD
|
|
||||||
<widget class="QSpinBox" name="spinBox_start">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>80</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>9999</number>
|
|
||||||
=======
|
|
||||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_start">
|
<widget class="QDoubleSpinBox" name="doubleSpinBox_start">
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<double>999999.989999999990687</double>
|
<double>999999.989999999990687</double>
|
||||||
>>>>>>> font
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -144,20 +132,6 @@ color: rgb(27, 30, 35);</string>
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<<<<<<< HEAD
|
|
||||||
<widget class="QSpinBox" name="spinBox_stop">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>80</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>9999</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>200</number>
|
|
||||||
=======
|
|
||||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_stop">
|
<widget class="QDoubleSpinBox" name="doubleSpinBox_stop">
|
||||||
<property name="decimals">
|
<property name="decimals">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
@ -167,7 +141,6 @@ color: rgb(27, 30, 35);</string>
|
|||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<double>999999.989999999990687</double>
|
<double>999999.989999999990687</double>
|
||||||
>>>>>>> font
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -214,15 +187,11 @@ color: rgb(27, 30, 35);</string>
|
|||||||
<widget class="QWidget" name="widget_3" native="true">
|
<widget class="QWidget" name="widget_3" native="true">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
<item>
|
<item>
|
||||||
<<<<<<< HEAD
|
|
||||||
<widget class="QTableView" name="tableView"/>
|
|
||||||
=======
|
|
||||||
<widget class="QTableView" name="tableView">
|
<widget class="QTableView" name="tableView">
|
||||||
<attribute name="verticalHeaderVisible">
|
<attribute name="verticalHeaderVisible">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</attribute>
|
</attribute>
|
||||||
</widget>
|
</widget>
|
||||||
>>>>>>> font
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
@ -139,7 +139,7 @@ void CDIO_Board::Init()
|
|||||||
void CDIO_Board::on_pushButton_Close_clicked()
|
void CDIO_Board::on_pushButton_Close_clicked()
|
||||||
{
|
{
|
||||||
QMessageBox:: StandardButton iResult = QMessageBox::question(this, QStringLiteral("提示"),
|
QMessageBox:: StandardButton iResult = QMessageBox::question(this, QStringLiteral("提示"),
|
||||||
QStringLiteral("确认后将关闭选择的开出通道!"),
|
QStringLiteral("确认后继电器闭合!"),
|
||||||
QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes);
|
QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes);
|
||||||
switch (iResult) {
|
switch (iResult) {
|
||||||
case QMessageBox::Yes:
|
case QMessageBox::Yes:
|
||||||
@ -254,7 +254,7 @@ void CDIO_Board::on_pushButton_Open_clicked()
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
QMessageBox:: StandardButton iResult = QMessageBox::question(this, QStringLiteral("提示"),
|
QMessageBox:: StandardButton iResult = QMessageBox::question(this, QStringLiteral("提示"),
|
||||||
QStringLiteral("确认后将打开选择的开出通道!"),
|
QStringLiteral("确认后继电器断开!"),
|
||||||
QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes);
|
QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes);
|
||||||
switch (iResult) {
|
switch (iResult) {
|
||||||
case QMessageBox::Yes:
|
case QMessageBox::Yes:
|
||||||
|
|||||||
@ -118,14 +118,15 @@ void CHistoryAlarm::on_pushButton_search_clicked()
|
|||||||
|
|
||||||
QString strTableName = "t_AlarmStatusInfo",strSql;
|
QString strTableName = "t_AlarmStatusInfo",strSql;
|
||||||
if(ui->comboBox_channel->currentText() == "请选择通道..."){
|
if(ui->comboBox_channel->currentText() == "请选择通道..."){
|
||||||
strSql = QString(" timestamp > %1 and timestamp < %2 order by timestamp ").arg(timestampStart).arg(timestampEnd);
|
strSql = QString(" timestamp > %1 and timestamp < %2 order by timestamp desc").arg(timestampStart).arg(timestampEnd);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
strSql = QString(" channelId = '%1' and timestamp > %2 and timestamp < %3 order by timestamp desc").arg(m_strChannelID).arg(timestampStart).arg(timestampEnd);
|
strSql = QString(" channelId = '%1' and timestamp > %2 and timestamp < %3 order by timestamp desc").arg(m_strChannelID).arg(timestampStart).arg(timestampEnd);
|
||||||
}
|
}
|
||||||
|
QVector<TriggerAlarmStatusInfo_t>().swap(m_vecTriggerAlarmStatusInfo);
|
||||||
m_vecTriggerAlarmStatusInfo = g_SqliteDB->GetTriggerAlarmStatusInfo(strTableName,strSql);
|
m_vecTriggerAlarmStatusInfo = g_SqliteDB->GetTriggerAlarmStatusInfo(strTableName,strSql);
|
||||||
|
QString strSize = QString(" 事件个数 : %1").arg(m_vecTriggerAlarmStatusInfo.size());
|
||||||
|
customLogMessageHandler(QtInfoMsg,strSize);
|
||||||
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 ;
|
||||||
|
|||||||
@ -252,6 +252,19 @@ void CImportConfig::on_pushButton_confirm_clicked()
|
|||||||
// g_FtpClient->SetUserInfo("root","@#cidw!@123456");
|
// g_FtpClient->SetUserInfo("root","@#cidw!@123456");
|
||||||
// g_FtpClient->UpLoadFile(name,"UnitBoardsInfo.json");
|
// g_FtpClient->UpLoadFile(name,"UnitBoardsInfo.json");
|
||||||
g_FtpClient->uploadFile(str,name,"UnitBoardsInfo.json");
|
g_FtpClient->uploadFile(str,name,"UnitBoardsInfo.json");
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN32
|
||||||
|
QString fileNameChannel = QCoreApplication::applicationDirPath() + "\\config\\ChannelSettings.json";
|
||||||
|
#endif
|
||||||
|
#ifdef Q_OS_LINUX
|
||||||
|
QString fileNameChannel = QCoreApplication::applicationDirPath() + "/config/ChannelSettings.json";
|
||||||
|
#endif
|
||||||
|
QString strChannelSettings = QString("ftp://%1/CIDW/qtconfig/%2").arg(IP).arg("ChannelSettings.json");
|
||||||
|
// g_FtpClient->SetServerInfo(str);
|
||||||
|
// g_FtpClient->SetUserInfo("root","@#cidw!@123456");
|
||||||
|
// g_FtpClient->UpLoadFile(name,"UnitBoardsInfo.json");
|
||||||
|
g_FtpClient->uploadFile(strChannelSettings,fileNameChannel,"UnitBoardsInfo.json");
|
||||||
|
|
||||||
qApp->exit(0);
|
qApp->exit(0);
|
||||||
QProcess::startDetached(qApp->applicationFilePath(), QStringList());
|
QProcess::startDetached(qApp->applicationFilePath(), QStringList());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,7 @@ MqttClient::MqttClient(QObject *parent) : QObject(parent)
|
|||||||
void MqttClient::onMQTT_Connected()
|
void MqttClient::onMQTT_Connected()
|
||||||
{
|
{
|
||||||
qDebug()<< "doConnected" <<endl;
|
qDebug()<< "doConnected" <<endl;
|
||||||
|
emit DoConnect_sig();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MqttClient::onMQTT_disconnected()
|
void MqttClient::onMQTT_disconnected()
|
||||||
@ -48,37 +49,44 @@ void MqttClient::onMQTT_Connected()
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MqttClient::onMQTT_error(QMQTT::ClientError err)
|
void MqttClient::onMQTT_error(QMQTT::ClientError err)
|
||||||
{
|
{
|
||||||
//todo: should emit on server suback
|
//todo: should emit on server suback
|
||||||
|
|
||||||
QString errInfo;
|
QString errInfo;
|
||||||
|
QTimer *timer;
|
||||||
|
|
||||||
switch(err) {
|
switch(err) {
|
||||||
// 0 The connection was refused by the peer (or timed out).
|
// 0 The connection was refused by the peer (or timed out).
|
||||||
case QAbstractSocket::ConnectionRefusedError:
|
case QAbstractSocket::ConnectionRefusedError:
|
||||||
errInfo = tr("Connection Refused");
|
errInfo = tr("Connection Refused");
|
||||||
|
break;
|
||||||
// 1 The remote host closed the connection. Note that the client socket (i.e., this socket) will be closed after the remote close notification has been sent.
|
// 1 The remote host closed the connection. Note that the client socket (i.e., this socket) will be closed after the remote close notification has been sent.
|
||||||
case QAbstractSocket::RemoteHostClosedError:
|
case QAbstractSocket::RemoteHostClosedError:
|
||||||
errInfo = tr("Remote Host Closed");
|
errInfo = tr("Remote Host Closed");
|
||||||
|
break;
|
||||||
// 2 The host address was not found.
|
// 2 The host address was not found.
|
||||||
case QAbstractSocket::HostNotFoundError:
|
case QAbstractSocket::HostNotFoundError:
|
||||||
errInfo = tr("Host Not Found Error");
|
errInfo = tr("Host Not Found Error");
|
||||||
|
break;
|
||||||
// 3 The socket operation failed because the application lacked the required privileges.
|
// 3 The socket operation failed because the application lacked the required privileges.
|
||||||
case QAbstractSocket::SocketAccessError:
|
case QAbstractSocket::SocketAccessError:
|
||||||
errInfo = tr("Socket Access Error");
|
errInfo = tr("Socket Access Error");
|
||||||
|
break;
|
||||||
// 4 The local system ran out of resources (e.g., too many sockets).
|
// 4 The local system ran out of resources (e.g., too many sockets).
|
||||||
case QAbstractSocket::SocketResourceError:
|
case QAbstractSocket::SocketResourceError:
|
||||||
errInfo = tr("Socket Resource Error");
|
errInfo = tr("Socket Resource Error");
|
||||||
|
break;
|
||||||
// 5 The socket operation timed out.
|
// 5 The socket operation timed out.
|
||||||
case QAbstractSocket::SocketTimeoutError:
|
case QAbstractSocket::SocketTimeoutError:
|
||||||
errInfo = tr("Socket Timeout Error");
|
errInfo = tr("Socket Timeout Error");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
errInfo = tr("Socket Error");
|
errInfo = tr("Socket Error");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug()<< errInfo <<endl;;
|
qDebug()<< errInfo <<endl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,7 +120,7 @@ void MqttClient::onMQTT_Connected()
|
|||||||
|
|
||||||
void MqttClient::onMQTT_unsubscribed(const QString &topic)
|
void MqttClient::onMQTT_unsubscribed(const QString &topic)
|
||||||
{
|
{
|
||||||
|
m_client->unsubscribe(topic);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MqttClient::onMQTT_unsubacked(quint16 msgid)
|
void MqttClient::onMQTT_unsubacked(quint16 msgid)
|
||||||
@ -134,13 +142,11 @@ void MqttClient::subscribed(QString strTopic)
|
|||||||
void MqttClient::ConnectMQTT(QString strIP)
|
void MqttClient::ConnectMQTT(QString strIP)
|
||||||
{
|
{
|
||||||
m_client = new QMQTT::Client(QHostAddress(strIP),1883);
|
m_client = new QMQTT::Client(QHostAddress(strIP),1883);
|
||||||
|
|
||||||
//m_client->setHost(QHostAddress("192.168.1.156"));
|
|
||||||
//m_client->setPort(51613);
|
|
||||||
m_client->setUsername("chaos");
|
m_client->setUsername("chaos");
|
||||||
m_client->setPassword("HSD272*#xkd");
|
m_client->setPassword("HSD272*#xkd");
|
||||||
m_client->connectToHost();
|
m_client->connectToHost();
|
||||||
|
m_client->setAutoReconnect(true);
|
||||||
|
m_client->setAutoReconnectInterval(60);
|
||||||
connect(m_client, SIGNAL(connected()), this, SLOT(onMQTT_Connected()));
|
connect(m_client, SIGNAL(connected()), this, SLOT(onMQTT_Connected()));
|
||||||
//todo: should emit on server suback
|
//todo: should emit on server suback
|
||||||
//connect(_client, SIGNAL(connacked(quint8)), this, SLOT(onMQTT_Connacked(quint8)));
|
//connect(_client, SIGNAL(connacked(quint8)), this, SLOT(onMQTT_Connacked(quint8)));
|
||||||
|
|||||||
@ -28,6 +28,7 @@ public slots:
|
|||||||
void onMQTT_disconnected();
|
void onMQTT_disconnected();
|
||||||
signals:
|
signals:
|
||||||
void Recevive_sig(QString,QByteArray);
|
void Recevive_sig(QString,QByteArray);
|
||||||
|
void DoConnect_sig();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MQTTCLIENT_H
|
#endif // MQTTCLIENT_H
|
||||||
|
|||||||
@ -20,10 +20,6 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
g_FtpClient = new FtpClient();
|
g_FtpClient = new FtpClient();
|
||||||
|
|
||||||
//读取ini
|
//读取ini
|
||||||
<<<<<<< HEAD
|
|
||||||
QSettings settingsread(QCoreApplication::applicationDirPath() + "\\config\\config.ini",QSettings::IniFormat);
|
|
||||||
g_strVersion = "SJ90C V1.1";
|
|
||||||
=======
|
|
||||||
|
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
QSettings settingsread(QCoreApplication::applicationDirPath() + "\\config\\config.ini",QSettings::IniFormat);
|
QSettings settingsread(QCoreApplication::applicationDirPath() + "\\config\\config.ini",QSettings::IniFormat);
|
||||||
@ -34,9 +30,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
QDate buildDate = QLocale( QLocale::English ).toDate( QString(__DATE__).replace(" ", " 0"), "MMM dd yyyy");
|
QDate buildDate = QLocale( QLocale::English ).toDate( QString(__DATE__).replace(" ", " 0"), "MMM dd yyyy");
|
||||||
QTime buildTime = QTime::fromString(__TIME__, "hh:mm:ss");
|
QTime buildTime = QTime::fromString(__TIME__, "hh:mm:ss");
|
||||||
|
|
||||||
g_strVersion = "SJ90C V1.1_" + buildDate.toString("yyyyMMdd");
|
g_strVersion = "SJ90C V1.1.0_" + buildDate.toString("yyyyMMdd");
|
||||||
customLogMessageHandler(QtDebugMsg,g_strVersion + " " + buildTime.toString());
|
customLogMessageHandler(QtDebugMsg,g_strVersion + " " + buildTime.toString());
|
||||||
>>>>>>> font
|
|
||||||
g_strProject = settingsread.value("main/Project").toString();
|
g_strProject = settingsread.value("main/Project").toString();
|
||||||
g_strFre = settingsread.value("main/Fre").toString();
|
g_strFre = settingsread.value("main/Fre").toString();
|
||||||
|
|
||||||
@ -91,13 +86,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
mqttclient = new MqttClient(this);
|
mqttclient = new MqttClient(this);
|
||||||
mqttclient->ConnectMQTT(IP);
|
mqttclient->ConnectMQTT(IP);
|
||||||
|
|
||||||
|
connect(mqttclient, SIGNAL(DoConnect_sig()), this, SLOT(mqttDoConnect_slot()));
|
||||||
id1 = startTimer(5000); //参数1 间隔 单位 毫秒
|
connect(mqttclient, SIGNAL(Recevive_sig(QString,QByteArray)), this, SLOT(mqttReceive_slot(QString,QByteArray)));
|
||||||
//定时器第二种方式
|
|
||||||
QTimer * timer = new QTimer(this);
|
|
||||||
//启动定时器
|
|
||||||
timer->start(500);
|
|
||||||
|
|
||||||
LoadTrigerConfig();
|
LoadTrigerConfig();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -106,19 +96,15 @@ void MainWindow::LoadTrigerConfig()
|
|||||||
g_SqliteDB->GetTriggerConfig("t_TriggerConfig","");
|
g_SqliteDB->GetTriggerConfig("t_TriggerConfig","");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::mqttDoConnect_slot(){
|
||||||
|
|
||||||
|
m_strTriggerEnevtTopic = QString("up/%1/trigger").arg(MAC);//订阅
|
||||||
|
m_triggerAlarmSatusTopic = QString("up/%1/triggerAlarmStatus").arg(MAC);
|
||||||
|
//m_strTriggerEnevtTopic = QString("up/%1/characteristic").arg(MAC);//订阅
|
||||||
|
mqttclient->subscribed(m_strTriggerEnevtTopic);
|
||||||
|
mqttclient->subscribed(m_triggerAlarmSatusTopic);
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::timerEvent(QTimerEvent *ev)
|
|
||||||
{
|
|
||||||
if(ev->timerId() == id1)
|
|
||||||
{
|
|
||||||
m_strTriggerEnevtTopic = QString("up/%1/trigger").arg(MAC);//订阅
|
|
||||||
m_triggerAlarmSatusTopic = QString("up/%1/triggerAlarmStatus").arg(MAC);
|
|
||||||
//m_strTriggerEnevtTopic = QString("up/%1/characteristic").arg(MAC);//订阅
|
|
||||||
mqttclient->subscribed(m_strTriggerEnevtTopic);
|
|
||||||
mqttclient->subscribed(m_triggerAlarmSatusTopic);
|
|
||||||
connect(mqttclient, SIGNAL(Recevive_sig(QString,QByteArray)), this, SLOT(mqttReceive_slot(QString,QByteArray)));
|
|
||||||
killTimer(id1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
@ -178,8 +164,6 @@ void MainWindow::initWindow()
|
|||||||
//设置顶部导航按钮
|
//设置顶部导航按钮
|
||||||
QList<QAbstractButton *> tbtns = ui->widgetTop->findChildren<QAbstractButton *>();
|
QList<QAbstractButton *> tbtns = ui->widgetTop->findChildren<QAbstractButton *>();
|
||||||
foreach (QAbstractButton *btn, tbtns) {
|
foreach (QAbstractButton *btn, tbtns) {
|
||||||
//btn->setIconSize(icoSize);
|
|
||||||
//btn->setMinimumWidth(icoWidth);
|
|
||||||
btn->setCheckable(true);
|
btn->setCheckable(true);
|
||||||
connect(btn, SIGNAL(clicked()), this, SLOT(buttonClick()));
|
connect(btn, SIGNAL(clicked()), this, SLOT(buttonClick()));
|
||||||
}
|
}
|
||||||
@ -286,9 +270,6 @@ void MainWindow::leftConfigClick()
|
|||||||
ui->tabWidget_main->setCurrentWidget(pWaveDisPlay);
|
ui->tabWidget_main->setCurrentWidget(pWaveDisPlay);
|
||||||
|
|
||||||
}else if(name == "开入开出"){
|
}else if(name == "开入开出"){
|
||||||
// Form *dlg = new Form();
|
|
||||||
// dlg->setWindowModality(Qt::ApplicationModal);
|
|
||||||
// dlg->show();
|
|
||||||
if(pDIOBoard == NULL)
|
if(pDIOBoard == NULL)
|
||||||
pDIOBoard = new CDIO_Board(this);
|
pDIOBoard = new CDIO_Board(this);
|
||||||
ui->tabWidget_main->addTab(pDIOBoard,"");
|
ui->tabWidget_main->addTab(pDIOBoard,"");
|
||||||
@ -587,6 +568,12 @@ void MainWindow::leftConfigClick4()
|
|||||||
QProcess process(this);
|
QProcess process(this);
|
||||||
process.startDetached(".\\Calibration\\NARI3500Calibration.exe");
|
process.startDetached(".\\Calibration\\NARI3500Calibration.exe");
|
||||||
}else if(name == "其他配置"){
|
}else if(name == "其他配置"){
|
||||||
|
|
||||||
|
if(pDIOBoard){
|
||||||
|
delete pDIOBoard;
|
||||||
|
pDIOBoard = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if(pOtherConfig == NULL)
|
if(pOtherConfig == NULL)
|
||||||
pOtherConfig = new COtherConfig (this);
|
pOtherConfig = new COtherConfig (this);
|
||||||
ui->tabWidget_sysConfig->addTab(pOtherConfig,"");
|
ui->tabWidget_sysConfig->addTab(pOtherConfig,"");
|
||||||
@ -684,6 +671,7 @@ void MainWindow::slotRPM(QString& str)
|
|||||||
|
|
||||||
void MainWindow::mqttReceive_slot(QString strTopic,QByteArray payload)
|
void MainWindow::mqttReceive_slot(QString strTopic,QByteArray payload)
|
||||||
{
|
{
|
||||||
|
qDebug() << payload << strTopic << endl;
|
||||||
if(strTopic == m_strTriggerEnevtTopic){
|
if(strTopic == m_strTriggerEnevtTopic){
|
||||||
QString strReceive = QString(payload);
|
QString strReceive = QString(payload);
|
||||||
qDebug() << strReceive.size() << endl;
|
qDebug() << strReceive.size() << endl;
|
||||||
|
|||||||
@ -61,6 +61,7 @@ private slots:
|
|||||||
void slotWCStatus(QString&);
|
void slotWCStatus(QString&);
|
||||||
void slotRPM(QString&);
|
void slotRPM(QString&);
|
||||||
void mqttReceive_slot(QString,QByteArray);
|
void mqttReceive_slot(QString,QByteArray);
|
||||||
|
void mqttDoConnect_slot();
|
||||||
|
|
||||||
void on_pushButton_detail_clicked();
|
void on_pushButton_detail_clicked();
|
||||||
void slotNetMgr(QString sAddr,const QVariant& msg);
|
void slotNetMgr(QString sAddr,const QVariant& msg);
|
||||||
@ -92,9 +93,6 @@ private:
|
|||||||
COtherConfig *pOtherConfig;
|
COtherConfig *pOtherConfig;
|
||||||
MqttClient *mqttclient;
|
MqttClient *mqttclient;
|
||||||
QString m_strTriggerEnevtTopic,m_triggerAlarmSatusTopic;
|
QString m_strTriggerEnevtTopic,m_triggerAlarmSatusTopic;
|
||||||
|
|
||||||
virtual void timerEvent(QTimerEvent *);
|
|
||||||
int id1; //定时器1的唯一标示
|
|
||||||
void LoadTrigerConfig();
|
void LoadTrigerConfig();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
11
sqlitedb.cpp
11
sqlitedb.cpp
@ -81,17 +81,6 @@ int SqliteDB::initTable()
|
|||||||
iRet = ExeSqlData(strSql);
|
iRet = ExeSqlData(strSql);
|
||||||
if(iRet == 0){
|
if(iRet == 0){
|
||||||
strSql = "ALTER TABLE t_TriggerConfig ADD COLUMN 'operate' integer DEFAULT 1";
|
strSql = "ALTER TABLE t_TriggerConfig ADD COLUMN 'operate' integer DEFAULT 1";
|
||||||
<<<<<<< HEAD
|
|
||||||
ExeSqlData(strSql);
|
|
||||||
}
|
|
||||||
|
|
||||||
strSql = QString("select count(*) from %1 where name = '%2' and sql LIKE '%%3%' ")\
|
|
||||||
.arg("sqlite_master").arg("t_ChannelSetting").arg("filterStatus");
|
|
||||||
iRet = ExeSqlData(strSql);
|
|
||||||
if(iRet == 0){
|
|
||||||
strSql = "ALTER TABLE t_ChannelSetting ADD COLUMN 'filterStatus' integer";
|
|
||||||
=======
|
|
||||||
>>>>>>> font
|
|
||||||
ExeSqlData(strSql);
|
ExeSqlData(strSql);
|
||||||
}
|
}
|
||||||
//#ifndef NO_FILTER
|
//#ifndef NO_FILTER
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user