|
@@
-186,8
+186,8
void VisualizationGraphWidget::onGraphMenuRequested(const QPoint &pos) noexcept
|
|
186
|
|
|
186
|
|
|
187
|
void VisualizationGraphWidget::onRangeChanged(const QCPRange &t1)
|
|
187
|
void VisualizationGraphWidget::onRangeChanged(const QCPRange &t1)
|
|
188
|
{
|
|
188
|
{
|
|
189
|
qCInfo(LOG_VisualizationGraphWidget()) << tr("VisualizationGraphWidget::onRangeChanged")
|
|
189
|
qCDebug(LOG_VisualizationGraphWidget()) << tr("VisualizationGraphWidget::onRangeChanged")
|
|
190
|
<< QThread::currentThread()->objectName();
|
|
190
|
<< QThread::currentThread()->objectName();
|
|
191
|
|
|
191
|
|
|
192
|
for (auto it = impl->m_VariableToPlotMultiMap.cbegin();
|
|
192
|
for (auto it = impl->m_VariableToPlotMultiMap.cbegin();
|
|
193
|
it != impl->m_VariableToPlotMultiMap.cend(); ++it) {
|
|
193
|
it != impl->m_VariableToPlotMultiMap.cend(); ++it) {
|
|
@@
-202,8
+202,8
void VisualizationGraphWidget::onRangeChanged(const QCPRange &t1)
|
|
202
|
variableDateTimeWithTolerance.m_TStart -= tolerance;
|
|
202
|
variableDateTimeWithTolerance.m_TStart -= tolerance;
|
|
203
|
variableDateTimeWithTolerance.m_TEnd += tolerance;
|
|
203
|
variableDateTimeWithTolerance.m_TEnd += tolerance;
|
|
204
|
|
|
204
|
|
|
205
|
qCInfo(LOG_VisualizationGraphWidget()) << "v" << dateTime;
|
|
205
|
qCDebug(LOG_VisualizationGraphWidget()) << "v" << dateTime;
|
|
206
|
qCInfo(LOG_VisualizationGraphWidget()) << "vtol" << variableDateTimeWithTolerance;
|
|
206
|
qCDebug(LOG_VisualizationGraphWidget()) << "vtol" << variableDateTimeWithTolerance;
|
|
207
|
// If new range with tol is upper than variable datetime parameters. we need to request new
|
|
207
|
// If new range with tol is upper than variable datetime parameters. we need to request new
|
|
208
|
// data
|
|
208
|
// data
|
|
209
|
if (!variable->contains(variableDateTimeWithTolerance)) {
|
|
209
|
if (!variable->contains(variableDateTimeWithTolerance)) {
|
|
@@
-212,7
+212,7
void VisualizationGraphWidget::onRangeChanged(const QCPRange &t1)
|
|
212
|
if (!variable->isInside(dateTime)) {
|
|
212
|
if (!variable->isInside(dateTime)) {
|
|
213
|
auto variableDateTime = variable->dateTime();
|
|
213
|
auto variableDateTime = variable->dateTime();
|
|
214
|
if (variableDateTime.m_TStart < dateTime.m_TStart) {
|
|
214
|
if (variableDateTime.m_TStart < dateTime.m_TStart) {
|
|
215
|
qCInfo(LOG_VisualizationGraphWidget()) << tr("TORM: Detection pan to right:");
|
|
215
|
qCDebug(LOG_VisualizationGraphWidget()) << tr("TORM: Detection pan to right:");
|
|
216
|
|
|
216
|
|
|
217
|
auto diffEndToKeepDelta = dateTime.m_TEnd - variableDateTime.m_TEnd;
|
|
217
|
auto diffEndToKeepDelta = dateTime.m_TEnd - variableDateTime.m_TEnd;
|
|
218
|
dateTime.m_TStart = variableDateTime.m_TStart + diffEndToKeepDelta;
|
|
218
|
dateTime.m_TStart = variableDateTime.m_TStart + diffEndToKeepDelta;
|
|
@@
-222,7
+222,7
void VisualizationGraphWidget::onRangeChanged(const QCPRange &t1)
|
|
222
|
variableDateTimeWithTolerance.m_TEnd += tolerance;
|
|
222
|
variableDateTimeWithTolerance.m_TEnd += tolerance;
|
|
223
|
}
|
|
223
|
}
|
|
224
|
else if (variableDateTime.m_TEnd > dateTime.m_TEnd) {
|
|
224
|
else if (variableDateTime.m_TEnd > dateTime.m_TEnd) {
|
|
225
|
qCInfo(LOG_VisualizationGraphWidget()) << tr("TORM: Detection pan to left: ");
|
|
225
|
qCDebug(LOG_VisualizationGraphWidget()) << tr("TORM: Detection pan to left: ");
|
|
226
|
auto diffStartToKeepDelta = variableDateTime.m_TStart - dateTime.m_TStart;
|
|
226
|
auto diffStartToKeepDelta = variableDateTime.m_TStart - dateTime.m_TStart;
|
|
227
|
dateTime.m_TEnd = variableDateTime.m_TEnd - diffStartToKeepDelta;
|
|
227
|
dateTime.m_TEnd = variableDateTime.m_TEnd - diffStartToKeepDelta;
|
|
228
|
// Tolerance have to be added to the left
|
|
228
|
// Tolerance have to be added to the left
|
|
@@
-231,29
+231,29
void VisualizationGraphWidget::onRangeChanged(const QCPRange &t1)
|
|
231
|
variableDateTimeWithTolerance.m_TStart -= tolerance;
|
|
231
|
variableDateTimeWithTolerance.m_TStart -= tolerance;
|
|
232
|
}
|
|
232
|
}
|
|
233
|
else {
|
|
233
|
else {
|
|
234
|
qCWarning(LOG_VisualizationGraphWidget())
|
|
234
|
qCDebug(LOG_VisualizationGraphWidget())
|
|
235
|
<< tr("Detection anormal zoom detection: ");
|
|
235
|
<< tr("Detection anormal zoom detection: ");
|
|
236
|
}
|
|
236
|
}
|
|
237
|
}
|
|
237
|
}
|
|
238
|
else {
|
|
238
|
else {
|
|
239
|
qCInfo(LOG_VisualizationGraphWidget()) << tr("Detection zoom out: ");
|
|
239
|
qCDebug(LOG_VisualizationGraphWidget()) << tr("Detection zoom out: ");
|
|
240
|
// add 10% tolerance for each side
|
|
240
|
// add 10% tolerance for each side
|
|
241
|
tolerance = 0.2 * (dateTime.m_TEnd - dateTime.m_TStart);
|
|
241
|
tolerance = 0.2 * (dateTime.m_TEnd - dateTime.m_TStart);
|
|
242
|
variableDateTimeWithTolerance.m_TStart -= tolerance;
|
|
242
|
variableDateTimeWithTolerance.m_TStart -= tolerance;
|
|
243
|
variableDateTimeWithTolerance.m_TEnd += tolerance;
|
|
243
|
variableDateTimeWithTolerance.m_TEnd += tolerance;
|
|
244
|
}
|
|
244
|
}
|
|
245
|
if (!variable->contains(dateTimeRange)) {
|
|
245
|
if (!variable->contains(dateTimeRange)) {
|
|
246
|
qCInfo(LOG_VisualizationGraphWidget())
|
|
246
|
qCDebug(LOG_VisualizationGraphWidget())
|
|
247
|
<< "TORM: Modif on variable datetime detected" << dateTime;
|
|
247
|
<< "TORM: Modif on variable datetime detected" << dateTime;
|
|
248
|
variable->setDateTime(dateTime);
|
|
248
|
variable->setDateTime(dateTime);
|
|
249
|
}
|
|
249
|
}
|
|
250
|
|
|
250
|
|
|
251
|
qCInfo(LOG_VisualizationGraphWidget()) << tr("Request data detection: ");
|
|
251
|
qCDebug(LOG_VisualizationGraphWidget()) << tr("Request data detection: ");
|
|
252
|
// CHangement detected, we need to ask controller to request data loading
|
|
252
|
// CHangement detected, we need to ask controller to request data loading
|
|
253
|
emit requestDataLoading(variable, variableDateTimeWithTolerance);
|
|
253
|
emit requestDataLoading(variable, variableDateTimeWithTolerance);
|
|
254
|
}
|
|
254
|
}
|
|
255
|
else {
|
|
255
|
else {
|
|
256
|
qCInfo(LOG_VisualizationGraphWidget()) << tr("Detection zoom in: ");
|
|
256
|
qCDebug(LOG_VisualizationGraphWidget()) << tr("Detection zoom in: ");
|
|
257
|
}
|
|
257
|
}
|
|
258
|
}
|
|
258
|
}
|
|
259
|
}
|
|
259
|
}
|
|
@@
-293,10
+293,10
void VisualizationGraphWidget::onDataCacheVariableUpdated()
|
|
293
|
for (auto it = impl->m_VariableToPlotMultiMap.cbegin();
|
|
293
|
for (auto it = impl->m_VariableToPlotMultiMap.cbegin();
|
|
294
|
it != impl->m_VariableToPlotMultiMap.cend(); ++it) {
|
|
294
|
it != impl->m_VariableToPlotMultiMap.cend(); ++it) {
|
|
295
|
auto variable = it->first;
|
|
295
|
auto variable = it->first;
|
|
296
|
qCInfo(LOG_VisualizationGraphWidget())
|
|
296
|
qCDebug(LOG_VisualizationGraphWidget())
|
|
297
|
<< "TORM: VisualizationGraphWidget::onDataCacheVariableUpdated S"
|
|
297
|
<< "TORM: VisualizationGraphWidget::onDataCacheVariableUpdated S"
|
|
298
|
<< variable->dateTime();
|
|
298
|
<< variable->dateTime();
|
|
299
|
qCInfo(LOG_VisualizationGraphWidget())
|
|
299
|
qCDebug(LOG_VisualizationGraphWidget())
|
|
300
|
<< "TORM: VisualizationGraphWidget::onDataCacheVariableUpdated E" << dateTime;
|
|
300
|
<< "TORM: VisualizationGraphWidget::onDataCacheVariableUpdated E" << dateTime;
|
|
301
|
if (dateTime.contains(variable->dateTime()) || dateTime.intersect(variable->dateTime())) {
|
|
301
|
if (dateTime.contains(variable->dateTime()) || dateTime.intersect(variable->dateTime())) {
|
|
302
|
|
|
302
|
|