更改为QCustplot
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
#include <QDebug>
|
||||
|
||||
threadPoltChart::threadPoltChart(QObject *parent)
|
||||
: QThread{parent} {
|
||||
: QThread{parent} {
|
||||
}
|
||||
|
||||
void threadPoltChart::setValue(QVector<int> jd, QString dataName, QDateTime beginTime, QDateTime endTime) {
|
||||
@ -13,21 +13,18 @@ void threadPoltChart::setValue(QVector<int> jd, QString dataName, QDateTime begi
|
||||
}
|
||||
|
||||
|
||||
|
||||
void threadPoltChart::run() {
|
||||
Gloab::m_chartViews.clear();
|
||||
Gloab::m_QCView.clear();
|
||||
Gloab::rule.clear();
|
||||
Gloab::rule.append("状态");
|
||||
//判断右侧数据是否为数字型
|
||||
bool isEnum = Gloab::namelist[dataName];
|
||||
for (int i = 0; i < jd.size(); ++i) {
|
||||
int X = 1;
|
||||
emit newCandS();
|
||||
Gloab::xData.clear();
|
||||
Gloab::yData.clear();
|
||||
|
||||
// 为每个图表添加数据
|
||||
//判断右侧数据是否为数字型
|
||||
bool isEnum = Gloab::namelist[dataName];
|
||||
if (dataName.contains("版本号")) {
|
||||
isEnum = false;
|
||||
}
|
||||
if (isEnum) {
|
||||
for (int j = 0; j < Gloab::g_param[jd[i]].size(); j++) {
|
||||
//更新进度条
|
||||
@ -35,11 +32,11 @@ void threadPoltChart::run() {
|
||||
int percent = Gloab::bytesRead * 100 / Gloab::fileSize;
|
||||
emit setProgressBar(percent);
|
||||
|
||||
if (Gloab::g_param[jd[i]][j].keys().size()<=deleteName.size()) {
|
||||
bool f=true;
|
||||
for(auto key : Gloab::g_param[jd[i]][j].keys()) {
|
||||
if (Gloab::g_param[jd[i]][j].keys().size() <= deleteName.size()) {
|
||||
bool f = true;
|
||||
for (auto key: Gloab::g_param[jd[i]][j].keys()) {
|
||||
if (!deleteName.contains(key)) {
|
||||
f=false;
|
||||
f = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -52,11 +49,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)) {
|
||||
if (Gloab::g_param[jd[i]][j][dataName].contains(".")) {
|
||||
emit appSeries(X++, Gloab::g_param[jd[i]][j][dataName].toDouble());
|
||||
} else {
|
||||
emit appSeries(X++, Gloab::g_param[jd[i]][j][dataName].toLongLong());
|
||||
}
|
||||
Gloab::xData.append(X++);
|
||||
Gloab::yData.append(Gloab::g_param[jd[i]][j][dataName].toDouble());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -74,7 +68,8 @@ void threadPoltChart::run() {
|
||||
if (!Gloab::rule.contains(tem1)) {
|
||||
Gloab::rule.append(tem1);
|
||||
}
|
||||
emit appSeries(X++, Gloab::rule.indexOf(tem1));
|
||||
Gloab::xData.append(X++);
|
||||
Gloab::yData.append(Gloab::rule.indexOf(tem1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user