Auto status change to "Under Review"
@@ -73,6 +73,9 signals: | |||
|
73 | 73 | /// Signal emitted when a data acquisition is requested on a range for a variable |
|
74 | 74 | void rangeChanged(std::shared_ptr<Variable> variable, const SqpRange &range); |
|
75 | 75 | |
|
76 | /// Signal emitted when a sub range of the cacheRange of the variable can be displayed | |
|
77 | void updateVarDisplaying(std::shared_ptr<Variable> variable, const SqpRange &range); | |
|
78 | ||
|
76 | 79 | public slots: |
|
77 | 80 | /// Request the data loading of the variable whithin range |
|
78 | 81 | void onRequestDataLoading(QVector<std::shared_ptr<Variable> > variables, const SqpRange &range, |
@@ -80,7 +80,8 struct VariableController::VariableControllerPrivate { | |||
|
80 | 80 | m_VariableSelectionModel{new QItemSelectionModel{m_VariableModel, parent}}, |
|
81 | 81 | m_VariableCacheController{std::make_unique<VariableCacheController>()}, |
|
82 | 82 | m_VariableCacheStrategy{std::make_unique<VariableCacheStrategy>()}, |
|
83 | m_VariableAcquisitionWorker{std::make_unique<VariableAcquisitionWorker>()} | |
|
83 | m_VariableAcquisitionWorker{std::make_unique<VariableAcquisitionWorker>()}, | |
|
84 | q{parent} | |
|
84 | 85 | { |
|
85 | 86 | |
|
86 | 87 | m_VariableAcquisitionWorker->moveToThread(&m_VariableAcquisitionWorkerThread); |
@@ -126,6 +127,9 struct VariableController::VariableControllerPrivate { | |||
|
126 | 127 | m_GroupIdToVariableSynchronizationGroupMap; |
|
127 | 128 | std::map<QUuid, QUuid> m_VariableIdGroupIdMap; |
|
128 | 129 | std::set<std::shared_ptr<IDataProvider> > m_ProviderSet; |
|
130 | ||
|
131 | ||
|
132 | VariableController *q; | |
|
129 | 133 | }; |
|
130 | 134 | |
|
131 | 135 | |
@@ -463,6 +467,7 void VariableController::VariableControllerPrivate::processRequest(std::shared_p | |||
|
463 | 467 | auto varRangesRequested |
|
464 | 468 | = m_VariableCacheStrategy->computeCacheRange(var->range(), rangeRequested); |
|
465 | 469 | auto notInCacheRangeList = var->provideNotInCacheRangeList(varRangesRequested.second); |
|
470 | auto inCacheRangeList = var->provideInCacheRangeList(varRangesRequested.second); | |
|
466 | 471 | |
|
467 | 472 | if (!notInCacheRangeList.empty()) { |
|
468 | 473 | auto identifier = m_VariableToIdentifierMap.at(var); |
@@ -477,6 +482,10 void VariableController::VariableControllerPrivate::processRequest(std::shared_p | |||
|
477 | 482 | qCCritical(LOG_VariableController()) |
|
478 | 483 | << "Impossible to provide data with a null provider"; |
|
479 | 484 | } |
|
485 | ||
|
486 | if (!inCacheRangeList.empty()) { | |
|
487 | emit q->updateVarDisplaying(var, inCacheRangeList.first()); | |
|
488 | } | |
|
480 | 489 | } |
|
481 | 490 | else { |
|
482 | 491 | var->setRange(rangeRequested); |
@@ -79,6 +79,8 private slots: | |||
|
79 | 79 | void onMouseRelease(QMouseEvent *event) noexcept; |
|
80 | 80 | |
|
81 | 81 | void onDataCacheVariableUpdated(); |
|
82 | ||
|
83 | void onUpdateVarDisplaying(std::shared_ptr<Variable> variable, const SqpRange &range); | |
|
82 | 84 | }; |
|
83 | 85 | |
|
84 | 86 | #endif // SCIQLOP_VISUALIZATIONGRAPHWIDGET_H |
@@ -43,27 +43,28 void updateScalarData(QCPAbstractPlottable *component, std::shared_ptr<ScalarSer | |||
|
43 | 43 | if (auto qcpGraph = dynamic_cast<QCPGraph *>(component)) { |
|
44 | 44 | scalarSeries->lockRead(); |
|
45 | 45 | { |
|
46 |
|
|
|
47 |
const auto & |
|
|
46 | // auto bounds = scalarSeries->subData(rang | |
|
47 | // const auto &xData = scalarSeries->xAxisData()->cdata(); | |
|
48 | // const auto &valuesData = scalarSeries->valuesData()->cdata(); | |
|
48 | 49 | |
|
49 | auto xDataBegin = xData.cbegin(); | |
|
50 | auto xDataEnd = xData.cend(); | |
|
50 | // auto xDataBegin = xData.cbegin(); | |
|
51 | // auto xDataEnd = xData.cend(); | |
|
51 | 52 | |
|
52 | qCInfo(LOG_VisualizationGraphHelper()) << "TODEBUG: Current points in cache" | |
|
53 | << xData.count(); | |
|
53 | // qCInfo(LOG_VisualizationGraphHelper()) << "TODEBUG: Current points in cache" | |
|
54 | // << xData.count(); | |
|
54 | 55 | |
|
55 | auto sqpDataContainer = QSharedPointer<SqpDataContainer>::create(); | |
|
56 | qcpGraph->setData(sqpDataContainer); | |
|
56 | // auto sqpDataContainer = QSharedPointer<SqpDataContainer>::create(); | |
|
57 | // qcpGraph->setData(sqpDataContainer); | |
|
57 | 58 | |
|
58 | auto lowerIt = std::lower_bound(xDataBegin, xDataEnd, dateTime.m_TStart); | |
|
59 | auto upperIt = std::upper_bound(xDataBegin, xDataEnd, dateTime.m_TEnd); | |
|
60 | auto distance = std::distance(xDataBegin, lowerIt); | |
|
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); | |
|
61 | 62 | |
|
62 | auto valuesDataIt = valuesData.cbegin() + distance; | |
|
63 | for (auto xAxisDataIt = lowerIt; xAxisDataIt != upperIt; | |
|
64 | ++xAxisDataIt, ++valuesDataIt) { | |
|
65 | sqpDataContainer->appendGraphData(QCPGraphData(*xAxisDataIt, *valuesDataIt)); | |
|
66 | } | |
|
63 | // auto valuesDataIt = valuesData.cbegin() + distance; | |
|
64 | // for (auto xAxisDataIt = lowerIt; xAxisDataIt != upperIt; | |
|
65 | // ++xAxisDataIt, ++valuesDataIt) { | |
|
66 | // sqpDataContainer->appendGraphData(QCPGraphData(*xAxisDataIt, *valuesDataIt)); | |
|
67 | // } | |
|
67 | 68 | |
|
68 | 69 | qCInfo(LOG_VisualizationGraphHelper()) << "TODEBUG: Current points displayed" |
|
69 | 70 | << sqpDataContainer->size(); |
@@ -80,6 +80,9 VisualizationGraphWidget::VisualizationGraphWidget(const QString &name, QWidget | |||
|
80 | 80 | |
|
81 | 81 | connect(this, &VisualizationGraphWidget::requestDataLoading, &sqpApp->variableController(), |
|
82 | 82 | &VariableController::onRequestDataLoading); |
|
83 | ||
|
84 | connect(&sqpApp->variableController(), &VariableController::updateVarDisplaying, this, | |
|
85 | &VisualizationGraphWidget::onUpdateVarDisplaying); | |
|
83 | 86 | } |
|
84 | 87 | |
|
85 | 88 | |
@@ -305,3 +308,13 void VisualizationGraphWidget::onDataCacheVariableUpdated() | |||
|
305 | 308 | } |
|
306 | 309 | } |
|
307 | 310 | } |
|
311 | ||
|
312 | void VisualizationGraphWidget::onUpdateVarDisplaying(std::shared_ptr<Variable> variable, | |
|
313 | const SqpRange &range) | |
|
314 | { | |
|
315 | auto componentsIt = impl->m_VariableToPlotMultiMap.equal_range(variable); | |
|
316 | for (auto it = componentsIt.first; it != componentsIt.second;) { | |
|
317 | VisualizationGraphHelper::updateData(QVector<QCPAbstractPlottable *>{} << it->second, | |
|
318 | variable->dataSeries(), range); | |
|
319 | } | |
|
320 | } |
General Comments 1
You need to be logged in to leave comments.
Login now