##// END OF EJS Templates
Add impletation for displaying data that are already in cache when...
perrinel -
r573:575eda7156d0
parent child
Show More
@@ -36,35 +36,19 QSharedPointer<QCPAxisTicker> axisTicker(bool isTimeAxis)
36 }
36 }
37
37
38 void updateScalarData(QCPAbstractPlottable *component, std::shared_ptr<ScalarSeries> scalarSeries,
38 void updateScalarData(QCPAbstractPlottable *component, std::shared_ptr<ScalarSeries> scalarSeries,
39 const SqpRange &dateTime)
39 const SqpRange &range)
40 {
40 {
41 qCDebug(LOG_VisualizationGraphHelper()) << "TORM: updateScalarData"
41 qCDebug(LOG_VisualizationGraphHelper()) << "TORM: updateScalarData"
42 << QThread::currentThread()->objectName();
42 << QThread::currentThread()->objectName();
43 if (auto qcpGraph = dynamic_cast<QCPGraph *>(component)) {
43 if (auto qcpGraph = dynamic_cast<QCPGraph *>(component)) {
44 scalarSeries->lockRead();
44 scalarSeries->lockRead();
45 {
45 {
46 // auto bounds = scalarSeries->subData(rang
46 auto sqpDataContainer = QSharedPointer<SqpDataContainer>::create();
47 // const auto &xData = scalarSeries->xAxisData()->cdata();
47 qcpGraph->setData(sqpDataContainer);
48 // const auto &valuesData = scalarSeries->valuesData()->cdata();
48 auto bounds = scalarSeries->subData(range.m_TStart, range.m_TEnd);
49
49 for (auto it = bounds.first; it != bounds.second; ++it) {
50 // auto xDataBegin = xData.cbegin();
50 sqpDataContainer->appendGraphData(QCPGraphData(it->x(), it->value()));
51 // auto xDataEnd = xData.cend();
51 }
52
53 // qCInfo(LOG_VisualizationGraphHelper()) << "TODEBUG: Current points in cache"
54 // << xData.count();
55
56 // auto sqpDataContainer = QSharedPointer<SqpDataContainer>::create();
57 // qcpGraph->setData(sqpDataContainer);
58
59 // auto lowerIt = std::lower_bound(xDataBegin, xDataEnd, dateTime.m_TStart);
60 // auto upperIt = std::upper_bound(xDataBegin, xDataEnd, dateTime.m_TEnd);
61 // auto distance = std::distance(xDataBegin, lowerIt);
62
63 // auto valuesDataIt = valuesData.cbegin() + distance;
64 // for (auto xAxisDataIt = lowerIt; xAxisDataIt != upperIt;
65 // ++xAxisDataIt, ++valuesDataIt) {
66 // sqpDataContainer->appendGraphData(QCPGraphData(*xAxisDataIt, *valuesDataIt));
67 // }
68
52
69 qCInfo(LOG_VisualizationGraphHelper()) << "TODEBUG: Current points displayed"
53 qCInfo(LOG_VisualizationGraphHelper()) << "TODEBUG: Current points displayed"
70 << sqpDataContainer->size();
54 << sqpDataContainer->size();
@@ -258,11 +258,11 void TestAmdaResultParser::testReadScalarTxt_data()
258 QVector<QDateTime>{}, QVector<double>{}};
258 QVector<QDateTime>{}, QVector<double>{}};
259
259
260 // Invalid files
260 // Invalid files
261 QTest::newRow("Invalid file (unexisting file)")
261 QTest::newRow("Invalid file (unexisting file)") << QStringLiteral("UnexistingFile.txt")
262 << QStringLiteral("UnexistingFile.txt") << ExpectedResults<ScalarSeries>{};
262 << ExpectedResults<ScalarSeries>{};
263
263
264 QTest::newRow("Invalid file (file not found on server)")
264 QTest::newRow("Invalid file (file not found on server)") << QStringLiteral("FileNotFound.txt")
265 << QStringLiteral("FileNotFound.txt") << ExpectedResults<ScalarSeries>{};
265 << ExpectedResults<ScalarSeries>{};
266 }
266 }
267
267
268 void TestAmdaResultParser::testReadScalarTxt()
268 void TestAmdaResultParser::testReadScalarTxt()
General Comments 0
You need to be logged in to leave comments. Login now