@@ -20,6 +20,8 public: | |||
|
20 | 20 | |
|
21 | 21 | void onMouseDoubleClick(QMouseEvent *event) noexcept; |
|
22 | 22 | void onMouseMove(QMouseEvent *event) noexcept; |
|
23 | /// Updates rendering when data of plot changed | |
|
24 | void onPlotUpdated() noexcept; | |
|
23 | 25 | |
|
24 | 26 | /// Sets properties of the plot's axes from the data series passed as parameter |
|
25 | 27 | void setAxesProperties(std::shared_ptr<IDataSeries> dataSeries) noexcept; |
@@ -165,8 +165,6 struct PlottablesUpdater<T, | |||
|
165 | 165 | if (rescaleAxes) { |
|
166 | 166 | plot->rescaleAxes(); |
|
167 | 167 | } |
|
168 | ||
|
169 | plot->replot(); | |
|
170 | 168 | } |
|
171 | 169 | } |
|
172 | 170 | }; |
@@ -246,8 +244,6 struct PlottablesUpdater<T, | |||
|
246 | 244 | if (rescaleAxes) { |
|
247 | 245 | plot->rescaleAxes(); |
|
248 | 246 | } |
|
249 | ||
|
250 | plot->replot(); | |
|
251 | 247 | } |
|
252 | 248 | }; |
|
253 | 249 |
@@ -228,6 +228,13 void VisualizationGraphRenderingDelegate::onMouseMove(QMouseEvent *event) noexce | |||
|
228 | 228 | } |
|
229 | 229 | } |
|
230 | 230 | |
|
231 | void VisualizationGraphRenderingDelegate::onPlotUpdated() noexcept | |
|
232 | { | |
|
233 | // Updates color scale bounds | |
|
234 | impl->m_ColorScale.updateDataRange(); | |
|
235 | impl->m_Plot.replot(); | |
|
236 | } | |
|
237 | ||
|
231 | 238 | void VisualizationGraphRenderingDelegate::setAxesProperties( |
|
232 | 239 | std::shared_ptr<IDataSeries> dataSeries) noexcept |
|
233 | 240 | { |
@@ -53,6 +53,15 struct VisualizationGraphWidget::VisualizationGraphWidgetPrivate { | |||
|
53 | 53 | { |
|
54 | 54 | } |
|
55 | 55 | |
|
56 | void updateData(PlottablesMap &plottables, std::shared_ptr<IDataSeries> dataSeries, | |
|
57 | const SqpRange &range) | |
|
58 | { | |
|
59 | VisualizationGraphHelper::updateData(plottables, dataSeries, range); | |
|
60 | ||
|
61 | // Prevents that data has changed to update rendering | |
|
62 | m_RenderingDelegate->onPlotUpdated(); | |
|
63 | } | |
|
64 | ||
|
56 | 65 | QString m_Name; |
|
57 | 66 | // 1 variable -> n qcpplot |
|
58 | 67 | std::map<std::shared_ptr<Variable>, PlottablesMap> m_VariableToPlotMultiMap; |
@@ -588,8 +597,7 void VisualizationGraphWidget::onDataCacheVariableUpdated() | |||
|
588 | 597 | qCDebug(LOG_VisualizationGraphWidget()) |
|
589 | 598 | << "TORM: VisualizationGraphWidget::onDataCacheVariableUpdated E" << dateTime; |
|
590 | 599 | if (dateTime.contains(variable->range()) || dateTime.intersect(variable->range())) { |
|
591 |
|
|
|
592 | variable->range()); | |
|
600 | impl->updateData(variableEntry.second, variable->dataSeries(), variable->range()); | |
|
593 | 601 | } |
|
594 | 602 | } |
|
595 | 603 | } |
@@ -599,6 +607,6 void VisualizationGraphWidget::onUpdateVarDisplaying(std::shared_ptr<Variable> v | |||
|
599 | 607 | { |
|
600 | 608 | auto it = impl->m_VariableToPlotMultiMap.find(variable); |
|
601 | 609 | if (it != impl->m_VariableToPlotMultiMap.end()) { |
|
602 |
|
|
|
610 | impl->updateData(it->second, variable->dataSeries(), range); | |
|
603 | 611 | } |
|
604 | 612 | } |
General Comments 0
You need to be logged in to leave comments.
Login now