@@ -53,7 +53,7 private slots: | |||
|
53 | 53 | /// Slot called when right clicking on the graph (displays a menu) |
|
54 | 54 | void onGraphMenuRequested(const QPoint &pos) noexcept; |
|
55 | 55 | |
|
56 |
void onRangeChanged(const QCPRange &t1 |
|
|
56 | void onRangeChanged(const QCPRange &t1); | |
|
57 | 57 | |
|
58 | 58 | /// Slot called when a mouse wheel was made, to perform some processing before the zoom is done |
|
59 | 59 | void onMouseWheel(QWheelEvent *event) noexcept; |
@@ -59,10 +59,15 void updateScalarData(QCPAbstractPlottable *component, ScalarSeries &scalarSerie | |||
|
59 | 59 | xValue.resize(n); |
|
60 | 60 | vValue.resize(n); |
|
61 | 61 | |
|
62 | qCInfo(LOG_VisualizationGraphHelper()) << "TORM: Current points displayed" | |
|
63 |
<< |
|
|
62 | qCInfo(LOG_VisualizationGraphHelper()) << "TORM: Current points displayed" << xValue.count() | |
|
63 | << dateTime; | |
|
64 | 64 | |
|
65 | 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 | 72 | else { |
|
68 | 73 | /// @todo DEBUG |
@@ -97,7 +102,6 QCPAbstractPlottable *createScalarSeriesComponent(ScalarSeries &scalarSeries, QC | |||
|
97 | 102 | |
|
98 | 103 | // Display all data |
|
99 | 104 | component->rescaleAxes(); |
|
100 | ||
|
101 | 105 | plot.replot(); |
|
102 | 106 | } |
|
103 | 107 | else { |
@@ -49,9 +49,9 VisualizationGraphWidget::VisualizationGraphWidget(const QString &name, QWidget | |||
|
49 | 49 | ui->widget->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom); |
|
50 | 50 | ui->widget->axisRect()->setRangeDrag(Qt::Horizontal); |
|
51 | 51 | connect(ui->widget, &QCustomPlot::mouseWheel, this, &VisualizationGraphWidget::onMouseWheel); |
|
52 | connect(ui->widget->xAxis, static_cast<void (QCPAxis::*)(const QCPRange &, const QCPRange &)>( | |
|
53 | &QCPAxis::rangeChanged), | |
|
54 |
|
|
|
52 | connect(ui->widget->xAxis, | |
|
53 | static_cast<void (QCPAxis::*)(const QCPRange &)>(&QCPAxis::rangeChanged), this, | |
|
54 | &VisualizationGraphWidget::onRangeChanged); | |
|
55 | 55 | |
|
56 | 56 | // Activates menu when right clicking on the graph |
|
57 | 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 |
|
|
171 | void VisualizationGraphWidget::onRangeChanged(const QCPRange &t1) | |
|
172 | 172 | { |
|
173 | 173 | |
|
174 |
qC |
|
|
174 | qCInfo(LOG_VisualizationGraphWidget()) << tr("VisualizationGraphWidget::onRangeChanged"); | |
|
175 | 175 | |
|
176 | 176 | for (auto it = impl->m_VariableToPlotMultiMap.cbegin(); |
|
177 | 177 | it != impl->m_VariableToPlotMultiMap.cend(); ++it) { |
|
178 | 178 | |
|
179 | 179 | auto variable = it->first; |
|
180 |
auto dateTime = SqpDateTime{t |
|
|
180 | auto dateTime = SqpDateTime{t1.lower, t1.upper}; | |
|
181 | 181 | |
|
182 | 182 | if (!variable->contains(dateTime)) { |
|
183 | qCInfo(LOG_VisualizationGraphWidget()) << dateTime << variable->dateTime(); | |
|
183 | 184 | |
|
184 | 185 | auto variableDateTimeWithTolerance = dateTime; |
|
185 | 186 | if (variable->intersect(dateTime)) { |
General Comments 0
You need to be logged in to leave comments.
Login now