优化了界面功能
This commit is contained in:
parent
4ceee47797
commit
783efb76fd
@ -31,6 +31,8 @@ CConfiguration::CConfiguration(QWidget *parent) :
|
||||
pHeader2->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
pHeader2->setStretchLastSection(false);
|
||||
|
||||
ui->treeView_Available->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
ui->treeView_Relay->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
connect(ui->comboBox_WC,SIGNAL(currentTextChanged(const QString &)),this,SLOT(on_comboBox_WC_currentTextChanged2(const QString&)));
|
||||
|
||||
}
|
||||
|
||||
@ -119,8 +119,8 @@ void CCopyDatFile::on_pushButton_refresh_clicked()
|
||||
ui -> treeWidget_dist ->clear();
|
||||
ftp -> cd("/run/media/");
|
||||
ui->label_path->setText("/run/media/");
|
||||
m_strDistPwd = "";
|
||||
m_strDistPwd = "/run/media/";
|
||||
m_strDistPath = "";
|
||||
m_strDistPath = "/run/media/";
|
||||
ftp->list();
|
||||
}
|
||||
|
||||
@ -133,10 +133,10 @@ void CCopyDatFile::processItem(QTreeWidgetItem *item, int /*column*/)
|
||||
currentPath += '/';
|
||||
currentPath += name;
|
||||
ftp->cd(name);
|
||||
m_strDistPwd = "";
|
||||
m_strDistPath = "";
|
||||
|
||||
m_strDistPwd = "/run/media" + currentPath;
|
||||
ui->label_path->setText(m_strDistPwd);
|
||||
m_strDistPath = "/run/media" + currentPath;
|
||||
ui->label_path->setText(m_strDistPath);
|
||||
currentPath = "";
|
||||
ftp->list();
|
||||
return;
|
||||
@ -153,7 +153,7 @@ void CCopyDatFile::slotCopyItem()
|
||||
allObj.insert("cmd", "100");
|
||||
cmdBody.insert("subcmd",1);
|
||||
cmdBody.insert("srcfile",str);
|
||||
cmdBody.insert("dstdirectory",m_strDistPwd);
|
||||
cmdBody.insert("dstdirectory",m_strDistPath);
|
||||
allObj["cmdBody"] = cmdBody;
|
||||
QNetworkRequest req;
|
||||
QString sUrl = QString("http://%1/cgi-bin/General.cgi/").arg(IP);
|
||||
@ -179,7 +179,7 @@ void CCopyDatFile::on_pushButton_exit_clicked()
|
||||
QJsonObject allObj,cmdBody;
|
||||
allObj.insert("cmd", "100");
|
||||
cmdBody.insert("subcmd",3);
|
||||
cmdBody.insert("dstdirectory",m_strDistPwd);
|
||||
cmdBody.insert("dstdirectory",m_strDistPath);
|
||||
allObj["cmdBody"] = cmdBody;
|
||||
QNetworkRequest req;
|
||||
QString sUrl = QString("http://%1/cgi-bin/General.cgi/").arg(IP);
|
||||
|
||||
@ -42,7 +42,7 @@ private:
|
||||
QFtp *ftp = nullptr;
|
||||
QStandardItemModel *model;
|
||||
QString currentPath;
|
||||
QString m_strDistPwd;
|
||||
QString m_strDistPath;
|
||||
QAction *copyAction;
|
||||
};
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
#include "AlarmDetails.h"
|
||||
#include "ftpclient.h"
|
||||
#include "global.h"
|
||||
|
||||
#include "NetMgr.h"
|
||||
|
||||
CHistoryAlarm::CHistoryAlarm(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
@ -618,12 +618,15 @@ void CHistoryAlarm::on_pushButton_delete_clicked()
|
||||
default:
|
||||
break;
|
||||
}
|
||||
QStringList strListFileName;
|
||||
QString strChannelName;
|
||||
QVector<TriggerEvent_t> vecTriggerEvent;
|
||||
for (int i = 0; i < model->rowCount(); i++) {
|
||||
QModelIndex indexCheck = model->index(i,0);
|
||||
bool check = model->data(indexCheck, Qt::UserRole).toBool();
|
||||
if(check){
|
||||
QString strDate = model->data(model->index(i,4)).toString();
|
||||
QString strChannelName = model->data(model->index(i,3)).toString();
|
||||
strChannelName = model->data(model->index(i,3)).toString();
|
||||
QStringList channellist = strChannelName.split("-");
|
||||
QDateTime dateTime = QDateTime::fromString(strDate, "yyyy-MM-dd hh:mm:ss");
|
||||
|
||||
@ -632,10 +635,33 @@ void CHistoryAlarm::on_pushButton_delete_clicked()
|
||||
qint64 timestamp = dateTime.toSecsSinceEpoch();
|
||||
QString strWhere1 = QString("timestamp = '%1' and channelName = '%2'").arg(timestamp).arg(channellist[0]);
|
||||
QString strWhere2 = QString("triggeredTime = %1 and triggeredChannelName = '%2'").arg(timestamp).arg(channellist[0]);
|
||||
QString strCol = "triggeredFileName";
|
||||
QString strTableName = QString("t_TriggerEvent ORDER BY ABS(triggeredTime - %1) LIMIT 1").arg(timestamp);
|
||||
QString strFileName = g_SqliteDB->GetSingelLine(strTableName,strCol);
|
||||
strFileName = strFileName.left(strFileName.size()-1);
|
||||
strListFileName = strFileName.split("/");
|
||||
g_SqliteDB->DeleteDataW(strTableNameAlarm,strWhere1);
|
||||
g_SqliteDB->DeleteDataW(strTableNameTriger,strWhere2);
|
||||
}
|
||||
}
|
||||
|
||||
QJsonObject allObj,cmdBody;
|
||||
QJsonArray arrayFileName;
|
||||
allObj.insert("cmd", "40");
|
||||
cmdBody.insert("type","ARRAY");
|
||||
arrayFileName.append(strChannelName);
|
||||
cmdBody.insert("fileName",strListFileName[5]);
|
||||
allObj["cmdBody"] = cmdBody;
|
||||
QNetworkRequest req;
|
||||
QString sUrl = QString("http://%1/cgi-bin/General.cgi/").arg(IP);
|
||||
req.setUrl(sUrl);
|
||||
g_NetMgr->PostJson(req,allObj);
|
||||
|
||||
QString dat_path = QCoreApplication::applicationDirPath() + "\\dat\\" + strListFileName[5];
|
||||
QDir datDir(dat_path);
|
||||
if (datDir.exists()) {
|
||||
datDir.removeRecursively();
|
||||
}
|
||||
on_pushButton_search_clicked();
|
||||
}
|
||||
|
||||
|
||||
@ -294,8 +294,6 @@ void CTerminalInfo::on_pushButton_Update_clicked()
|
||||
curIndex = 0;
|
||||
else if(text == "后端主程序")
|
||||
curIndex = 1;
|
||||
else if(text == "后端辅助程序")
|
||||
curIndex = 2;
|
||||
g_FtpClient->UpLoadFile(filepath,FileName,curIndex);
|
||||
}
|
||||
|
||||
|
||||
@ -28,6 +28,7 @@ CWokingConditionConfig::CWokingConditionConfig(QWidget *parent) :
|
||||
|
||||
ui->treeView->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
ui->treeView->setStyle(QStyleFactory::create("windows"));
|
||||
|
||||
treeModel = new QStandardItemModel(ui->treeView); //创建模型指定父类
|
||||
ui->treeView->setModel(treeModel);
|
||||
ui->treeView->setHeaderHidden(true);
|
||||
@ -38,7 +39,7 @@ CWokingConditionConfig::CWokingConditionConfig(QWidget *parent) :
|
||||
QRegExp exp("[0-9\\.-]+$");
|
||||
QValidator *Validator = new QRegExpValidator(exp);
|
||||
ui->lineEdit_Interval->setValidator(Validator);
|
||||
|
||||
ui->treeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
}
|
||||
|
||||
CWokingConditionConfig::~CWokingConditionConfig()
|
||||
|
||||
2
global.h
2
global.h
@ -247,6 +247,8 @@ typedef struct _TriggerEvent{
|
||||
int triggeredEquipmentID;
|
||||
QString triggeredEventName;
|
||||
QString triggeredFeatureName;
|
||||
QString triggeredFileName;
|
||||
QString triggereValue;
|
||||
}TriggerEvent_t ;
|
||||
|
||||
typedef struct _TriggerAlarmStatusInfo{
|
||||
|
||||
@ -27,7 +27,11 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
#ifdef Q_OS_LINUX
|
||||
QSettings settingsread(QCoreApplication::applicationDirPath() + "/config/config.ini",QSettings::IniFormat);
|
||||
#endif
|
||||
g_strVersion = "SJ90C V1.1_20241009";
|
||||
QDate buildDate = QLocale( QLocale::English ).toDate( QString(__DATE__).replace(" ", " 0"), "MMM dd yyyy");
|
||||
QTime buildTime = QTime::fromString(__TIME__, "hh:mm:ss");
|
||||
|
||||
g_strVersion = "SJ90C V1.1_" + buildDate.toString("yyyyMMdd");
|
||||
customLogMessageHandler(QtDebugMsg,g_strVersion + " " + buildTime.toString());
|
||||
g_strProject = settingsread.value("main/Project").toString();
|
||||
g_strFre = settingsread.value("main/Fre").toString();
|
||||
|
||||
|
||||
@ -488,7 +488,8 @@ SqliteDB::GetTriggerEvent(QString tablename,QString whereCon)
|
||||
tempTriggerEvent.triggeredEquipmentID = sql_query.value(8).toInt();
|
||||
tempTriggerEvent.triggeredEventName = sql_query.value(9).toString();
|
||||
tempTriggerEvent.triggeredFeatureName = sql_query.value(10).toString();
|
||||
|
||||
tempTriggerEvent.triggeredFileName = sql_query.value(11).toString();
|
||||
tempTriggerEvent.triggereValue = sql_query.value(12).toString();
|
||||
vecResult.append(tempTriggerEvent);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user