##// END OF EJS Templates
onRangeChanged is now based on the good range (the new one)...
perrinel -
r290:076efd0d6728
parent child
Show More
@@ -53,7 +53,7 private slots:
53 /// Slot called when right clicking on the graph (displays a menu)
53 /// Slot called when right clicking on the graph (displays a menu)
54 void onGraphMenuRequested(const QPoint &pos) noexcept;
54 void onGraphMenuRequested(const QPoint &pos) noexcept;
55
55
56 void onRangeChanged(const QCPRange &t1, const QCPRange &t2);
56 void onRangeChanged(const QCPRange &t1);
57
57
58 /// Slot called when a mouse wheel was made, to perform some processing before the zoom is done
58 /// Slot called when a mouse wheel was made, to perform some processing before the zoom is done
59 void onMouseWheel(QWheelEvent *event) noexcept;
59 void onMouseWheel(QWheelEvent *event) noexcept;
@@ -59,10 +59,15 void updateScalarData(QCPAbstractPlottable *component, ScalarSeries &scalarSerie
59 xValue.resize(n);
59 xValue.resize(n);
60 vValue.resize(n);
60 vValue.resize(n);
61
61
62 qCInfo(LOG_VisualizationGraphHelper()) << "TORM: Current points displayed"
62 qCInfo(LOG_VisualizationGraphHelper()) << "TORM: Current points displayed" << xValue.count()
63 << xValue.count();
63 << dateTime;
64
64
65 qcpGraph->setData(xValue, vValue);
65 qcpGraph->setData(xValue, vValue);
66
67 // Display all data
68 // component->parentPlot()->xAxis->setRange(dateTime.m_TStart, dateTime.m_TEnd);
69 component->rescaleAxes();
70 component->parentPlot()->replot();
66 }
71 }
67 else {
72 else {
68 /// @todo DEBUG
73 /// @todo DEBUG
@@ -97,7 +102,6 QCPAbstractPlottable *createScalarSeriesComponent(ScalarSeries &scalarSeries, QC
97
102
98 // Display all data
103 // Display all data
99 component->rescaleAxes();
104 component->rescaleAxes();
100
101 plot.replot();
105 plot.replot();
102 }
106 }
103 else {
107 else {
@@ -49,9 +49,9 VisualizationGraphWidget::VisualizationGraphWidget(const QString &name, QWidget
49 ui->widget->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);
49 ui->widget->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);
50 ui->widget->axisRect()->setRangeDrag(Qt::Horizontal);
50 ui->widget->axisRect()->setRangeDrag(Qt::Horizontal);
51 connect(ui->widget, &QCustomPlot::mouseWheel, this, &VisualizationGraphWidget::onMouseWheel);
51 connect(ui->widget, &QCustomPlot::mouseWheel, this, &VisualizationGraphWidget::onMouseWheel);
52 connect(ui->widget->xAxis, static_cast<void (QCPAxis::*)(const QCPRange &, const QCPRange &)>(
52 connect(ui->widget->xAxis,
53 &QCPAxis::rangeChanged),
53 static_cast<void (QCPAxis::*)(const QCPRange &)>(&QCPAxis::rangeChanged), this,
54 this, &VisualizationGraphWidget::onRangeChanged);
54 &VisualizationGraphWidget::onRangeChanged);
55
55
56 // Activates menu when right clicking on the graph
56 // Activates menu when right clicking on the graph
57 ui->widget->setContextMenuPolicy(Qt::CustomContextMenu);
57 ui->widget->setContextMenuPolicy(Qt::CustomContextMenu);
@@ -168,18 +168,19 void VisualizationGraphWidget::onGraphMenuRequested(const QPoint &pos) noexcept
168 }
168 }
169 }
169 }
170
170
171 void VisualizationGraphWidget::onRangeChanged(const QCPRange &t1, const QCPRange &t2)
171 void VisualizationGraphWidget::onRangeChanged(const QCPRange &t1)
172 {
172 {
173
173
174 qCDebug(LOG_VisualizationGraphWidget()) << tr("VisualizationGraphWidget::onRangeChanged");
174 qCInfo(LOG_VisualizationGraphWidget()) << tr("VisualizationGraphWidget::onRangeChanged");
175
175
176 for (auto it = impl->m_VariableToPlotMultiMap.cbegin();
176 for (auto it = impl->m_VariableToPlotMultiMap.cbegin();
177 it != impl->m_VariableToPlotMultiMap.cend(); ++it) {
177 it != impl->m_VariableToPlotMultiMap.cend(); ++it) {
178
178
179 auto variable = it->first;
179 auto variable = it->first;
180 auto dateTime = SqpDateTime{t2.lower, t2.upper};
180 auto dateTime = SqpDateTime{t1.lower, t1.upper};
181
181
182 if (!variable->contains(dateTime)) {
182 if (!variable->contains(dateTime)) {
183 qCInfo(LOG_VisualizationGraphWidget()) << dateTime << variable->dateTime();
183
184
184 auto variableDateTimeWithTolerance = dateTime;
185 auto variableDateTimeWithTolerance = dateTime;
185 if (variable->intersect(dateTime)) {
186 if (variable->intersect(dateTime)) {
General Comments 2
Under Review
author

Pull request updated. Auto status change to "Under Review"

Changed commits:
  * 3 added
  * 0 removed

Changed files:
  * M core/include/Data/SqpDateTime.h
  * M core/include/Variable/Variable.h
  * M core/include/Variable/VariableModel.h
  * M core/src/Variable/Variable.cpp
  * M core/src/Variable/VariableCacheController.cpp
  * M core/src/Variable/VariableController.cpp
  * M core/src/Variable/VariableModel.cpp
  * M gui/include/Visualization/VisualizationGraphWidget.h
  * M gui/src/Visualization/VisualizationGraphHelper.cpp
  * M gui/src/Visualization/VisualizationGraphWidget.cpp
  * M gui/src/Visualization/operations/GenerateVariableMenuOperation.cpp
  * R COPYING
  * R app/src/MainWindow.cpp
  * R app/ui/MainWindow.ui
  * R cmake/sciqlop_package_qt.cmake
  * R core/include/Common/MetaTypes.h
  * R core/include/Data/ArrayData.h
  * R core/include/Data/DataProviderParameters.h
  * R core/include/Data/DataSeries.h
  * R core/include/Data/IDataProvider.h
  * R core/include/Data/IDataSeries.h
  * R core/include/Data/ScalarSeries.h
  * R core/include/DataSource/DataSourceItemAction.h
  * R core/include/Plugin/PluginManager.h
  * R core/include/Time/TimeController.h
  * R core/include/Variable/VariableCacheController.h
  * R core/include/Variable/VariableController.h
  * R core/include/Visualization/VisualizationController.h
  * R core/src/Data/ScalarSeries.cpp
  * R core/src/DataSource/DataSourceItemAction.cpp
  * R core/src/Plugin/PluginManager.cpp
  * R core/src/Time/TimeController.cpp
  * R core/src/Visualization/VisualizationController.cpp
  * R core/tests/Variable/TestVariableCacheController.cpp
  * R gui/include/DataSource/DataSourceTreeWidgetItem.h
  * R gui/include/DataSource/DataSourceWidget.h
  * R gui/include/SidePane/SqpSidePane.h
  * R gui/include/TimeWidget/TimeWidget.h
  * R gui/include/Variable/VariableInspectorWidget.h
  * R gui/include/Variable/VariableMenuHeaderWidget.h
  * R gui/include/Visualization/IVariableContainer.h
  * R gui/include/Visualization/IVisualizationWidget.h
  * R gui/include/Visualization/IVisualizationWidgetVisitor.h
  * R gui/include/Visualization/VisualizationGraphHelper.h
  * R gui/include/Visualization/VisualizationTabWidget.h
  * R gui/include/Visualization/VisualizationWidget.h
  * R gui/include/Visualization/VisualizationZoneWidget.h
  * R gui/include/Visualization/operations/GenerateVariableMenuOperation.h
  * R gui/include/Visualization/operations/MenuBuilder.h
  * R gui/include/Visualization/qcustomplot.h
  * R gui/resources/icones/delete.png
  * R gui/resources/icones/next.png
  * R gui/resources/icones/openInspector.png
  * R gui/resources/icones/previous.png
  * R gui/resources/icones/sciqlop2PNG_1024.png
  * R gui/resources/sqpguiresources.qrc
  * R gui/src/DataSource/DataSourceTreeWidgetItem.cpp
  * R gui/src/DataSource/DataSourceWidget.cpp
  * R gui/src/SidePane/SqpSidePane.cpp
  * R gui/src/TimeWidget/TimeWidget.cpp
  * R gui/src/Variable/VariableInspectorWidget.cpp
  * R gui/src/Variable/VariableMenuHeaderWidget.cpp
  * R gui/src/Visualization/VisualizationTabWidget.cpp
  * R gui/src/Visualization/VisualizationWidget.cpp
  * R gui/src/Visualization/VisualizationZoneWidget.cpp
  * R gui/src/Visualization/operations/MenuBuilder.cpp
  * R gui/src/Visualization/qcustomplot.cpp
  * R gui/ui/DataSource/DataSourceWidget.ui
  * R gui/ui/SidePane/SqpSidePane.ui
  * R gui/ui/TimeWidget/TimeWidget.ui
  * R gui/ui/Variable/VariableInspectorWidget.ui
  * R gui/ui/Variable/VariableMenuHeaderWidget.ui
  * R gui/ui/Visualization/VisualizationGraphWidget.ui
  * R gui/ui/Visualization/VisualizationTabWidget.ui
  * R gui/ui/Visualization/VisualizationWidget.ui
  * R gui/ui/Visualization/VisualizationZoneWidget.ui
  * R gui/vera-exclusions/exclusions.txt
  * R plugin/CMakeLists.txt
  * R plugin/cmake/Findsciqlop-plugin.cmake
  * R plugin/include/Plugin/IPlugin.h
  * R plugins/mockplugin/CMakeLists.txt
  * R plugins/mockplugin/cmake/Findsciqlop-mockplugin.cmake
  * R plugins/mockplugin/include/CosinusProvider.h
  * R plugins/mockplugin/include/MockPlugin.h
  * R plugins/mockplugin/resources/mockplugin.json
  * R plugins/mockplugin/src/CosinusProvider.cpp
  * R plugins/mockplugin/src/MockPlugin.cpp
  * R README.md
  * R app/CMakeLists.txt
  * R app/include/MainWindow.h
  * R app/src/Main.cpp
  * R app/vera-exclusions/exclusions.txt
  * R cmake/sciqlop.cmake
  * R cmake/sciqlop_applications.cmake
  * R cmake/sciqlop_package.cmake
  * R cmake/sciqlop_params.cmake
  * R core/CMakeLists.txt
  * R core/include/Common/spimpl.h
  * R core/include/DataSource/DataSourceController.h
  * R core/include/DataSource/DataSourceItem.h
  * R core/src/DataSource/DataSourceController.cpp
  * R core/src/DataSource/DataSourceItem.cpp
  * R core/tests/DataSource/TestDataSourceController.cpp
  * R core/vera-exclusions/exclusions.txt
  * R formatting/cmake/use_clangformat.cmake
  * R formatting/vera-exclusions/exclusions.txt
  * R gui/CMakeLists.txt
  * R gui/include/SqpApplication.h
  * R gui/src/SqpApplication.cpp
  * R LICENSE
  * R app/src/mainwindow.cpp
  * R app/src/mainwindow.ui
You need to be logged in to leave comments. Login now