更改为QCustplot
This commit is contained in:
@ -14,13 +14,15 @@ void ThreadChart::setValue(QVector<int> jd, QString dataName, QDateTime beginTim
|
||||
|
||||
|
||||
void ThreadChart::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) {
|
||||
emit newCandS();
|
||||
// emit newCandS();
|
||||
Gloab::xData.clear();
|
||||
Gloab::yData.clear();
|
||||
qreal y = 114.514;
|
||||
QString tem1 = "无数据";
|
||||
// 为每个图表添加数据
|
||||
@ -35,16 +37,13 @@ void ThreadChart::run() {
|
||||
if (temTime >= beginTime && temTime < endTime) {
|
||||
if (!Gloab::g_param[jd[i]][j].contains(dataName)) {
|
||||
if (y != 114.514) {
|
||||
emit appSeries(temTime.toMSecsSinceEpoch(), y);
|
||||
Gloab::xData.append(temTime.toMSecsSinceEpoch()/1000.0);
|
||||
Gloab::yData.append(y);
|
||||
}
|
||||
} else {
|
||||
if (Gloab::g_param[jd[i]][j][dataName].contains(".")) {
|
||||
y = Gloab::g_param[jd[i]][j][dataName].toDouble();
|
||||
emit appSeries(temTime.toMSecsSinceEpoch(), y);
|
||||
} else {
|
||||
y = Gloab::g_param[jd[i]][j][dataName].toLongLong();
|
||||
emit appSeries(temTime.toMSecsSinceEpoch(), y);
|
||||
}
|
||||
y = Gloab::g_param[jd[i]][j][dataName].toDouble();
|
||||
Gloab::xData.append(temTime.toMSecsSinceEpoch()/1000.0);
|
||||
Gloab::yData.append(y);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -62,14 +61,16 @@ void ThreadChart::run() {
|
||||
if (!Gloab::rule.contains(tem1)) {
|
||||
Gloab::rule.append(tem1);
|
||||
}
|
||||
emit appSeries(temTime.toMSecsSinceEpoch(), Gloab::rule.indexOf(tem1));
|
||||
Gloab::xData.append(temTime.toMSecsSinceEpoch()/1000.0);
|
||||
Gloab::yData.append(Gloab::rule.indexOf(tem1));
|
||||
}
|
||||
} else {
|
||||
tem1 = Gloab::g_param[jd[i]][j][dataName];
|
||||
if (!Gloab::rule.contains(tem1)) {
|
||||
Gloab::rule.append(tem1);
|
||||
}
|
||||
emit appSeries(temTime.toMSecsSinceEpoch(), Gloab::rule.indexOf(tem1));
|
||||
Gloab::xData.append(temTime.toMSecsSinceEpoch()/1000.0);
|
||||
Gloab::yData.append(Gloab::rule.indexOf(tem1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user