##// END OF EJS Templates
Updates sqp color scale thresholds (2)...
Alexandre Leroux -
r1061:edadf7db2f1e
parent child
Show More
@@ -20,6 +20,8 public:
20
20
21 void onMouseDoubleClick(QMouseEvent *event) noexcept;
21 void onMouseDoubleClick(QMouseEvent *event) noexcept;
22 void onMouseMove(QMouseEvent *event) noexcept;
22 void onMouseMove(QMouseEvent *event) noexcept;
23 /// Updates rendering when data of plot changed
24 void onPlotUpdated() noexcept;
23
25
24 /// Sets properties of the plot's axes from the data series passed as parameter
26 /// Sets properties of the plot's axes from the data series passed as parameter
25 void setAxesProperties(std::shared_ptr<IDataSeries> dataSeries) noexcept;
27 void setAxesProperties(std::shared_ptr<IDataSeries> dataSeries) noexcept;
@@ -165,8 +165,6 struct PlottablesUpdater<T,
165 if (rescaleAxes) {
165 if (rescaleAxes) {
166 plot->rescaleAxes();
166 plot->rescaleAxes();
167 }
167 }
168
169 plot->replot();
170 }
168 }
171 }
169 }
172 };
170 };
@@ -246,8 +244,6 struct PlottablesUpdater<T,
246 if (rescaleAxes) {
244 if (rescaleAxes) {
247 plot->rescaleAxes();
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 void VisualizationGraphRenderingDelegate::setAxesProperties(
238 void VisualizationGraphRenderingDelegate::setAxesProperties(
232 std::shared_ptr<IDataSeries> dataSeries) noexcept
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 QString m_Name;
65 QString m_Name;
57 // 1 variable -> n qcpplot
66 // 1 variable -> n qcpplot
58 std::map<std::shared_ptr<Variable>, PlottablesMap> m_VariableToPlotMultiMap;
67 std::map<std::shared_ptr<Variable>, PlottablesMap> m_VariableToPlotMultiMap;
@@ -588,8 +597,7 void VisualizationGraphWidget::onDataCacheVariableUpdated()
588 qCDebug(LOG_VisualizationGraphWidget())
597 qCDebug(LOG_VisualizationGraphWidget())
589 << "TORM: VisualizationGraphWidget::onDataCacheVariableUpdated E" << dateTime;
598 << "TORM: VisualizationGraphWidget::onDataCacheVariableUpdated E" << dateTime;
590 if (dateTime.contains(variable->range()) || dateTime.intersect(variable->range())) {
599 if (dateTime.contains(variable->range()) || dateTime.intersect(variable->range())) {
591 VisualizationGraphHelper::updateData(variableEntry.second, variable->dataSeries(),
600 impl->updateData(variableEntry.second, variable->dataSeries(), variable->range());
592 variable->range());
593 }
601 }
594 }
602 }
595 }
603 }
@@ -599,6 +607,6 void VisualizationGraphWidget::onUpdateVarDisplaying(std::shared_ptr<Variable> v
599 {
607 {
600 auto it = impl->m_VariableToPlotMultiMap.find(variable);
608 auto it = impl->m_VariableToPlotMultiMap.find(variable);
601 if (it != impl->m_VariableToPlotMultiMap.end()) {
609 if (it != impl->m_VariableToPlotMultiMap.end()) {
602 VisualizationGraphHelper::updateData(it->second, variable->dataSeries(), range);
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