V1.2.0
This commit is contained in:
@ -11,4 +11,4 @@ QFile Gloab::file;
|
||||
qint64 Gloab::fileSize;
|
||||
qint64 Gloab::bytesRead;
|
||||
QCompleter *Gloab::completer;
|
||||
QVector<double> Gloab::xData,Gloab::yData;
|
||||
QVector<double> Gloab::xData[4],Gloab::yData[4];
|
||||
|
2
gloab.h
2
gloab.h
@ -29,7 +29,7 @@ public:
|
||||
static qint64 fileSize;
|
||||
static qint64 bytesRead;
|
||||
static QCompleter *completer;
|
||||
static QVector<double> xData,yData;
|
||||
static QVector<double> xData[4],yData[4];
|
||||
};
|
||||
|
||||
|
||||
|
35529
lib/qcustomplot.cpp
Normal file
35529
lib/qcustomplot.cpp
Normal file
File diff suppressed because it is too large
Load Diff
7774
lib/qcustomplot.h
Normal file
7774
lib/qcustomplot.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 12.0.2, 2024-09-13T11:44:52. -->
|
||||
<!-- Written by QtCreator 12.0.2, 2024-09-13T21:26:35. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
@ -99,7 +99,7 @@
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 5.12.0 (mingw73_64)</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Qt 5.12.0 (mingw73_64)</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{edc54fcd-f681-4a0a-ba77-11a1a5c94a66}</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
@ -255,7 +255,7 @@
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default">C:/Work/CQT/Test_01/build-log7-Qt_5_12_0_mingw73_64-Debug</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default">C:/Work/CQT/Test_01/build-log7-Qt_5_12_0_mingw73_64-Release</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
|
@ -11,7 +11,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
ui->setupUi(this);
|
||||
this->setWindowTitle("日志查询工具");
|
||||
// 创建版本号标签
|
||||
m_versionLabel = new QLabel(tr("v1.1.0"), this);
|
||||
m_versionLabel = new QLabel(tr("v1.2.0"), this);
|
||||
// 将标签添加到状态栏的右端
|
||||
ui->statusbar->addPermanentWidget(m_versionLabel);
|
||||
|
||||
@ -102,7 +102,7 @@ void MainWindow::closeProg() {
|
||||
|
||||
void MainWindow::setChartView(int jd, bool isEnum) {
|
||||
// 设置图表标题
|
||||
QCustPlot *qCustPlot = new QCustPlot(Gloab::xData, Gloab::yData, jd, isEnum, true);
|
||||
QCustPlot *qCustPlot = new QCustPlot(Gloab::xData[jd], Gloab::yData[jd], jd, isEnum, true);
|
||||
// 将qCustPlot添加到容器中
|
||||
Gloab::m_QCView.append(qCustPlot);
|
||||
}
|
||||
@ -135,7 +135,7 @@ void MainWindow::setWidget() {
|
||||
|
||||
void MainWindow::setPlotChartView(int jd, bool isEnum) {
|
||||
// 设置图表标题
|
||||
QCustPlot *qCustPlot = new QCustPlot(Gloab::xData, Gloab::yData, jd, isEnum, false);
|
||||
QCustPlot *qCustPlot = new QCustPlot(Gloab::xData[jd], Gloab::yData[jd], jd, isEnum, false);
|
||||
// 将qCustPlot添加到容器中
|
||||
Gloab::m_QCView.append(qCustPlot);
|
||||
}
|
||||
|
@ -17,12 +17,14 @@ void ThreadChart::run() {
|
||||
Gloab::m_QCView.clear();
|
||||
Gloab::rule.clear();
|
||||
Gloab::rule.append("状态");
|
||||
|
||||
for (int var = 0; var < 4; ++var) {
|
||||
Gloab::xData[var].clear();
|
||||
Gloab::yData[var].clear();
|
||||
}
|
||||
//判断右侧数据是否为数字型
|
||||
bool isEnum = Gloab::namelist[dataName];
|
||||
for (int i = 0; i < jd.size(); ++i) {
|
||||
// emit newCandS();
|
||||
Gloab::xData.clear();
|
||||
Gloab::yData.clear();
|
||||
qreal y = 114.514;
|
||||
QString tem1 = "无数据";
|
||||
// 为每个图表添加数据
|
||||
@ -37,13 +39,13 @@ void ThreadChart::run() {
|
||||
if (temTime >= beginTime && temTime < endTime) {
|
||||
if (!Gloab::g_param[jd[i]][j].contains(dataName)) {
|
||||
if (y != 114.514) {
|
||||
Gloab::xData.append(temTime.toMSecsSinceEpoch()/1000.0);
|
||||
Gloab::yData.append(y);
|
||||
Gloab::xData[jd[i]].append(temTime.toMSecsSinceEpoch()/1000.0);
|
||||
Gloab::yData[jd[i]].append(y);
|
||||
}
|
||||
} else {
|
||||
y = Gloab::g_param[jd[i]][j][dataName].toDouble();
|
||||
Gloab::xData.append(temTime.toMSecsSinceEpoch()/1000.0);
|
||||
Gloab::yData.append(y);
|
||||
Gloab::xData[jd[i]].append(temTime.toMSecsSinceEpoch()/1000.0);
|
||||
Gloab::yData[jd[i]].append(y);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -61,16 +63,16 @@ void ThreadChart::run() {
|
||||
if (!Gloab::rule.contains(tem1)) {
|
||||
Gloab::rule.append(tem1);
|
||||
}
|
||||
Gloab::xData.append(temTime.toMSecsSinceEpoch()/1000.0);
|
||||
Gloab::yData.append(Gloab::rule.indexOf(tem1));
|
||||
Gloab::xData[jd[i]].append(temTime.toMSecsSinceEpoch()/1000.0);
|
||||
Gloab::yData[jd[i]].append(Gloab::rule.indexOf(tem1));
|
||||
}
|
||||
} else {
|
||||
tem1 = Gloab::g_param[jd[i]][j][dataName];
|
||||
if (!Gloab::rule.contains(tem1)) {
|
||||
Gloab::rule.append(tem1);
|
||||
}
|
||||
Gloab::xData.append(temTime.toMSecsSinceEpoch()/1000.0);
|
||||
Gloab::yData.append(Gloab::rule.indexOf(tem1));
|
||||
Gloab::xData[jd[i]].append(temTime.toMSecsSinceEpoch()/1000.0);
|
||||
Gloab::yData[jd[i]].append(Gloab::rule.indexOf(tem1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,13 +17,15 @@ void threadPoltChart::run() {
|
||||
Gloab::m_QCView.clear();
|
||||
Gloab::rule.clear();
|
||||
Gloab::rule.append("状态");
|
||||
|
||||
for (int var = 0; var < 4; ++var) {
|
||||
Gloab::xData[var].clear();
|
||||
Gloab::yData[var].clear();
|
||||
}
|
||||
//判断右侧数据是否为数字型
|
||||
bool isEnum = Gloab::namelist[dataName];
|
||||
for (int i = 0; i < jd.size(); ++i) {
|
||||
int X = 1;
|
||||
Gloab::xData.clear();
|
||||
Gloab::yData.clear();
|
||||
|
||||
// 为每个图表添加数据
|
||||
if (isEnum) {
|
||||
for (int j = 0; j < Gloab::g_param[jd[i]].size(); j++) {
|
||||
@ -49,8 +51,8 @@ void threadPoltChart::run() {
|
||||
QDateTime temTime = QDateTime::fromString(Gloab::g_param[jd[i]][j]["时间"], "yyyy-MM-dd hh:mm:ss:zzz");
|
||||
if (temTime >= beginTime && temTime < endTime) {
|
||||
if (Gloab::g_param[jd[i]][j].contains(dataName)) {
|
||||
Gloab::xData.append(X++);
|
||||
Gloab::yData.append(Gloab::g_param[jd[i]][j][dataName].toDouble());
|
||||
Gloab::xData[jd[i]].append(X++);
|
||||
Gloab::yData[jd[i]].append(Gloab::g_param[jd[i]][j][dataName].toDouble());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -68,8 +70,8 @@ void threadPoltChart::run() {
|
||||
if (!Gloab::rule.contains(tem1)) {
|
||||
Gloab::rule.append(tem1);
|
||||
}
|
||||
Gloab::xData.append(X++);
|
||||
Gloab::yData.append(Gloab::rule.indexOf(tem1));
|
||||
Gloab::xData[jd[i]].append(X++);
|
||||
Gloab::yData[jd[i]].append(Gloab::rule.indexOf(tem1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user