##// END OF EJS Templates
Merge pull request 193 from SCIQLOP-Initialisation develop...
Merge pull request 193 from SCIQLOP-Initialisation develop Develop

File last commit:

r471:9ca55d63290e
r474:9eb803f3f9ab merge
Show More
VisualizationGraphWidget.cpp
412 lines | 17.0 KiB | text/x-c | CppLexer
/ gui / src / Visualization / VisualizationGraphWidget.cpp
mv visualization -> Visualization...
r95 #include "Visualization/VisualizationGraphWidget.h"
Alexandre Leroux
Updates visitor interface...
r207 #include "Visualization/IVisualizationWidgetVisitor.h"
Correction for pull request
r243 #include "Visualization/VisualizationGraphHelper.h"
Creation of VisualizationWidget, VizualizationTabWidget, VisualizationZoneWidget, VisualizationGraphWidget
r58 #include "ui_VisualizationGraphWidget.h"
The mock plugin can now create data with view operation
r235 #include <Data/ArrayData.h>
#include <Data/IDataSeries.h>
Alexandre Leroux
Settings binding (5)...
r470 #include <Settings/SqpSettingsDefs.h>
The mock plugin can now create data with view operation
r235 #include <SqpApplication.h>
Add the visualization gui classes
r118 #include <Variable/Variable.h>
The mock plugin can now create data with view operation
r235 #include <Variable/VariableController.h>
Add the visualization gui classes
r118 #include <unordered_map>
Alexandre Leroux
Adds logs for null visitors
r219 Q_LOGGING_CATEGORY(LOG_VisualizationGraphWidget, "VisualizationGraphWidget")
Alexandre Leroux
Handles key modifiers for zoom...
r179 namespace {
/// Key pressed to enable zoom on horizontal axis
const auto HORIZONTAL_ZOOM_MODIFIER = Qt::NoModifier;
/// Key pressed to enable zoom on vertical axis
const auto VERTICAL_ZOOM_MODIFIER = Qt::ControlModifier;
Alexandre Leroux
Settings binding (5)...
r470 /// Gets a tolerance value from application settings. If the setting can't be found, the default
/// value passed in parameter is returned
double toleranceValue(const QString &key, double defaultValue) noexcept
{
return QSettings{}.value(key, defaultValue).toDouble();
}
Alexandre Leroux
Handles key modifiers for zoom...
r179 } // namespace
Add the visualization gui classes
r118 struct VisualizationGraphWidget::VisualizationGraphWidgetPrivate {
Correction for MR
r447 explicit VisualizationGraphWidgetPrivate() : m_DoSynchronize{true}, m_IsCalibration{false} {}
Implementation of the calibration for the synchronization...
r445
// Return the operation when range changed
VisualizationGraphWidgetZoomType getZoomType(const QCPRange &t1, const QCPRange &t2);
Add synchronization that keep delta
r444
Add the visualization gui classes
r118 // 1 variable -> n qcpplot
Alexandre Leroux
Remove variable from graph (2)...
r270 std::multimap<std::shared_ptr<Variable>, QCPAbstractPlottable *> m_VariableToPlotMultiMap;
Add synchronization that keep delta
r444
bool m_DoSynchronize;
Implementation of the calibration for the synchronization...
r445 bool m_IsCalibration;
Add the visualization gui classes
r118 };
Alexandre Leroux
Fixes reference
r205 VisualizationGraphWidget::VisualizationGraphWidget(const QString &name, QWidget *parent)
add {} missing
r120 : QWidget{parent},
ui{new Ui::VisualizationGraphWidget},
Add the visualization gui classes
r118 impl{spimpl::make_unique_impl<VisualizationGraphWidgetPrivate>()}
Creation of VisualizationWidget, VizualizationTabWidget, VisualizationZoneWidget, VisualizationGraphWidget
r58 {
ui->setupUi(this);
Alexandre Leroux
Sets plot properties in a graph
r178
Alexandre Leroux
Adds a close button to a graph widget + calls close() method when clicked...
r266 ui->graphNameLabel->setText(name);
// 'Close' options : widget is deleted when closed
setAttribute(Qt::WA_DeleteOnClose);
connect(ui->closeButton, &QToolButton::clicked, this, &VisualizationGraphWidget::close);
ui->closeButton->setIcon(sqpApp->style()->standardIcon(QStyle::SP_TitleBarCloseButton));
Alexandre Leroux
Adds name to a graph...
r196
Alexandre Leroux
Sets plot properties in a graph
r178 // Set qcpplot properties :
Alexandre Leroux
Enables drag only for x-axis
r180 // - Drag (on x-axis) and zoom are enabled
Alexandre Leroux
Handles key modifiers for zoom...
r179 // - Mouse wheel on qcpplot is intercepted to determine the zoom orientation
Alexandre Leroux
Sets plot properties in a graph
r178 ui->widget->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);
Alexandre Leroux
Enables drag only for x-axis
r180 ui->widget->axisRect()->setRangeDrag(Qt::Horizontal);
Implementation of the calibration for the synchronization...
r445 connect(ui->widget, &QCustomPlot::mousePress, this, &VisualizationGraphWidget::onMousePress);
connect(ui->widget, &QCustomPlot::mouseRelease, this,
&VisualizationGraphWidget::onMouseRelease);
Alexandre Leroux
Handles key modifiers for zoom...
r179 connect(ui->widget, &QCustomPlot::mouseWheel, this, &VisualizationGraphWidget::onMouseWheel);
Add synchronization that keep delta
r444 connect(ui->widget->xAxis, static_cast<void (QCPAxis::*)(const QCPRange &, const QCPRange &)>(
&QCPAxis::rangeChanged),
Implementation of the calibration for the synchronization...
r445 this, &VisualizationGraphWidget::onRangeChanged, Qt::DirectConnection);
Alexandre Leroux
Remove variable from graph (1)...
r269
// Activates menu when right clicking on the graph
ui->widget->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui->widget, &QCustomPlot::customContextMenuRequested, this,
&VisualizationGraphWidget::onGraphMenuRequested);
Fix the cosinus bug....
r298
connect(this, &VisualizationGraphWidget::requestDataLoading, &sqpApp->variableController(),
&VariableController::onRequestDataLoading);
Creation of VisualizationWidget, VizualizationTabWidget, VisualizationZoneWidget, VisualizationGraphWidget
r58 }
Alexandre Leroux
QCustomPlot notify the graph widget when the xRange changed
r227
Creation of VisualizationWidget, VizualizationTabWidget, VisualizationZoneWidget, VisualizationGraphWidget
r58 VisualizationGraphWidget::~VisualizationGraphWidget()
{
delete ui;
}
Add the visualization gui classes
r118
Add synchronization that keep delta
r444 void VisualizationGraphWidget::enableSynchronize(bool enable)
{
impl->m_DoSynchronize = enable;
}
Add the visualization gui classes
r118 void VisualizationGraphWidget::addVariable(std::shared_ptr<Variable> variable)
{
Alexandre Leroux
Uses factory in the VariableGraphWidget
r184 // Uses delegate to create the qcpplot components according to the variable
Correction for pull request
r243 auto createdPlottables = VisualizationGraphHelper::create(variable, *ui->widget);
Alexandre Leroux
Uses factory in the VariableGraphWidget
r184
for (auto createdPlottable : qAsConst(createdPlottables)) {
The mock plugin can now create data with view operation
r235 impl->m_VariableToPlotMultiMap.insert({variable, createdPlottable});
Alexandre Leroux
Uses factory in the VariableGraphWidget
r184 }
The mock plugin can now create data with view operation
r235
Fix the cosinus bug....
r298 connect(variable.get(), SIGNAL(updated()), this, SLOT(onDataCacheVariableUpdated()));
Add the visualization gui classes
r118 }
variable time is now set to range graphe displayed when it is displayed...
r314 void VisualizationGraphWidget::addVariableUsingGraph(std::shared_ptr<Variable> variable)
{
// when adding a variable, we need to set its time range to the current graph range
auto grapheRange = ui->widget->xAxis->range();
auto dateTime = SqpDateTime{grapheRange.lower, grapheRange.upper};
variable->setDateTime(dateTime);
auto variableDateTimeWithTolerance = dateTime;
Alexandre Leroux
Settings binding (5)...
r470 // add tolerance for each side
auto toleranceFactor
= toleranceValue(GENERAL_TOLERANCE_AT_INIT_KEY, GENERAL_TOLERANCE_AT_INIT_DEFAULT_VALUE);
auto tolerance = toleranceFactor * (dateTime.m_TEnd - dateTime.m_TStart);
variable time is now set to range graphe displayed when it is displayed...
r314 variableDateTimeWithTolerance.m_TStart -= tolerance;
variableDateTimeWithTolerance.m_TEnd += tolerance;
// Uses delegate to create the qcpplot components according to the variable
auto createdPlottables = VisualizationGraphHelper::create(variable, *ui->widget);
for (auto createdPlottable : qAsConst(createdPlottables)) {
impl->m_VariableToPlotMultiMap.insert({variable, createdPlottable});
}
connect(variable.get(), SIGNAL(updated()), this, SLOT(onDataCacheVariableUpdated()));
// CHangement detected, we need to ask controller to request data loading
emit requestDataLoading(variable, variableDateTimeWithTolerance);
}
Alexandre Leroux
Remove variable from graph (2)...
r270 void VisualizationGraphWidget::removeVariable(std::shared_ptr<Variable> variable) noexcept
{
Alexandre Leroux
Remove variable from graph (3)...
r271 // Each component associated to the variable :
// - is removed from qcpplot (which deletes it)
// - is no longer referenced in the map
auto componentsIt = impl->m_VariableToPlotMultiMap.equal_range(variable);
for (auto it = componentsIt.first; it != componentsIt.second;) {
ui->widget->removePlottable(it->second);
it = impl->m_VariableToPlotMultiMap.erase(it);
}
// Updates graph
ui->widget->replot();
Alexandre Leroux
Remove variable from graph (2)...
r270 }
Add implementation for the range rescale. Variable is ignored here...
r438 void VisualizationGraphWidget::setRange(std::shared_ptr<Variable> variable,
const SqpDateTime &range)
{
Correction for MR
r447 // Note: in case of different axes that depends on variable, we could start with a code like
// that:
Add implementation for the range rescale. Variable is ignored here...
r438 // auto componentsIt = impl->m_VariableToPlotMultiMap.equal_range(variable);
// for (auto it = componentsIt.first; it != componentsIt.second;) {
// }
ui->widget->xAxis->setRange(range.m_TStart, range.m_TEnd);
Add synchronization that keep delta
r444 ui->widget->replot();
}
Correction for MR
r447 SqpDateTime VisualizationGraphWidget::graphRange() const noexcept
Add synchronization that keep delta
r444 {
auto grapheRange = ui->widget->xAxis->range();
return SqpDateTime{grapheRange.lower, grapheRange.upper};
}
void VisualizationGraphWidget::setGraphRange(const SqpDateTime &range)
{
Implementation of the calibration for the synchronization...
r445 qCDebug(LOG_VisualizationGraphWidget()) << tr("VisualizationGraphWidget::setGraphRange START");
Add synchronization that keep delta
r444 ui->widget->xAxis->setRange(range.m_TStart, range.m_TEnd);
ui->widget->replot();
qCDebug(LOG_VisualizationGraphWidget()) << tr("VisualizationGraphWidget::setGraphRange END");
Add implementation for the range rescale. Variable is ignored here...
r438 }
Alexandre Leroux
Updates visitor interface...
r207 void VisualizationGraphWidget::accept(IVisualizationWidgetVisitor *visitor)
Add the visualization gui classes
r118 {
Alexandre Leroux
Implements accept() method of visualization widgets
r208 if (visitor) {
visitor->visit(this);
}
Alexandre Leroux
Adds logs for null visitors
r219 else {
qCCritical(LOG_VisualizationGraphWidget())
<< tr("Can't visit widget : the visitor is null");
}
Add the visualization gui classes
r118 }
Alexandre Leroux
Creates a interface that defines a variable container...
r209 bool VisualizationGraphWidget::canDrop(const Variable &variable) const
{
/// @todo : for the moment, a graph can always accomodate a variable
Q_UNUSED(variable);
return true;
}
Alexandre Leroux
Unplot menu (5): adds contains() method to an IVariableContainer...
r327 bool VisualizationGraphWidget::contains(const Variable &variable) const
{
// Finds the variable among the keys of the map
auto variablePtr = &variable;
auto findVariable
= [variablePtr](const auto &entry) { return variablePtr == entry.first.get(); };
auto end = impl->m_VariableToPlotMultiMap.cend();
auto it = std::find_if(impl->m_VariableToPlotMultiMap.cbegin(), end, findVariable);
return it != end;
}
Add const and override
r119 QString VisualizationGraphWidget::name() const
Add the visualization gui classes
r118 {
Alexandre Leroux
Adds a close button to a graph widget + calls close() method when clicked...
r266 return ui->graphNameLabel->text();
Add the visualization gui classes
r118 }
Alexandre Leroux
Remove variable from graph (1)...
r269 void VisualizationGraphWidget::onGraphMenuRequested(const QPoint &pos) noexcept
Add the visualization gui classes
r118 {
Alexandre Leroux
Remove variable from graph (1)...
r269 QMenu graphMenu{};
Alexandre Leroux
Remove variable from graph (2)...
r270 // Iterates on variables (unique keys)
for (auto it = impl->m_VariableToPlotMultiMap.cbegin(),
end = impl->m_VariableToPlotMultiMap.cend();
it != end; it = impl->m_VariableToPlotMultiMap.upper_bound(it->first)) {
// 'Remove variable' action
graphMenu.addAction(tr("Remove variable %1").arg(it->first->name()),
[ this, var = it->first ]() { removeVariable(var); });
Alexandre Leroux
Adds name to a graph...
r196 }
Alexandre Leroux
Remove variable from graph (1)...
r269
if (!graphMenu.isEmpty()) {
graphMenu.exec(mapToGlobal(pos));
Alexandre Leroux
Adds name to a graph...
r196 }
Add the visualization gui classes
r118 }
Alexandre Leroux
Handles key modifiers for zoom...
r179
Add synchronization that keep delta
r444 void VisualizationGraphWidget::onRangeChanged(const QCPRange &t1, const QCPRange &t2)
Alexandre Leroux
QCustomPlot notify the graph widget when the xRange changed
r227 {
Add clang format for linux
r471 qCInfo(LOG_VisualizationGraphWidget()) << tr("VisualizationGraphWidget::onRangeChanged")
<< QThread::currentThread()->objectName();
Add synchronization that keep delta
r444
auto dateTimeRange = SqpDateTime{t1.lower, t1.upper};
The mock plugin can now create data with view operation
r235
Implementation of the calibration for the synchronization...
r445 auto zoomType = impl->getZoomType(t1, t2);
The mock plugin can now create data with view operation
r235 for (auto it = impl->m_VariableToPlotMultiMap.cbegin();
it != impl->m_VariableToPlotMultiMap.cend(); ++it) {
Add intersect méthode on variable and sqpDateTime...
r258
The mock plugin can now create data with view operation
r235 auto variable = it->first;
Add synchronization that keep delta
r444 auto currentDateTime = dateTimeRange;
The mock plugin can now create data with view operation
r235
Alexandre Leroux
Settings binding (5)...
r470 auto toleranceFactor = toleranceValue(GENERAL_TOLERANCE_AT_UPDATE_KEY,
GENERAL_TOLERANCE_AT_UPDATE_DEFAULT_VALUE);
Add synchronization that keep delta
r444 auto tolerance = toleranceFactor * (currentDateTime.m_TEnd - currentDateTime.m_TStart);
auto variableDateTimeWithTolerance = currentDateTime;
Implementation of the cache feature : download before display needs
r433 variableDateTimeWithTolerance.m_TStart -= tolerance;
variableDateTimeWithTolerance.m_TEnd += tolerance;
Add synchronization that keep delta
r444 qCDebug(LOG_VisualizationGraphWidget()) << "r" << currentDateTime;
qCDebug(LOG_VisualizationGraphWidget()) << "t" << variableDateTimeWithTolerance;
qCDebug(LOG_VisualizationGraphWidget()) << "v" << variable->dateTime();
Implementation of the cache feature : download before display needs
r433 // If new range with tol is upper than variable datetime parameters. we need to request new
// data
if (!variable->contains(variableDateTimeWithTolerance)) {
Add intersect méthode on variable and sqpDateTime...
r258
Add synchronization that keep delta
r444 auto variableDateTimeWithTolerance = currentDateTime;
if (!variable->isInside(currentDateTime)) {
Add intersect méthode on variable and sqpDateTime...
r258 auto variableDateTime = variable->dateTime();
Add synchronization that keep delta
r444 if (variable->contains(variableDateTimeWithTolerance)) {
Implementation of the calibration for the synchronization...
r445 qCDebug(LOG_VisualizationGraphWidget())
Add synchronization that keep delta
r444 << tr("TORM: Detection zoom in that need request:");
Alexandre Leroux
Minor refactoring...
r460 // add tolerance for each side
Add synchronization that keep delta
r444 tolerance
= toleranceFactor * (currentDateTime.m_TEnd - currentDateTime.m_TStart);
variableDateTimeWithTolerance.m_TStart -= tolerance;
variableDateTimeWithTolerance.m_TEnd += tolerance;
}
else if (variableDateTime.m_TStart < currentDateTime.m_TStart) {
qCInfo(LOG_VisualizationGraphWidget()) << tr("TORM: Detection pan to right:");
Add correction for delta T
r263
Add synchronization that keep delta
r444 auto diffEndToKeepDelta = currentDateTime.m_TEnd - variableDateTime.m_TEnd;
currentDateTime.m_TStart = variableDateTime.m_TStart + diffEndToKeepDelta;
Add correction for delta T
r263 // Tolerance have to be added to the right
Add implementation for the range rescale. Variable is ignored here...
r438 // add tolerance for right (end) side
Add synchronization that keep delta
r444 tolerance
= toleranceFactor * (currentDateTime.m_TEnd - currentDateTime.m_TStart);
Implementation of the new Dela T computation strategy
r260 variableDateTimeWithTolerance.m_TEnd += tolerance;
Add intersect méthode on variable and sqpDateTime...
r258 }
Add synchronization that keep delta
r444 else if (variableDateTime.m_TEnd > currentDateTime.m_TEnd) {
Implementation of the calibration for the synchronization...
r445 qCDebug(LOG_VisualizationGraphWidget()) << tr("TORM: Detection pan to left: ");
Add synchronization that keep delta
r444 auto diffStartToKeepDelta
= variableDateTime.m_TStart - currentDateTime.m_TStart;
currentDateTime.m_TEnd = variableDateTime.m_TEnd - diffStartToKeepDelta;
Add correction for delta T
r263 // Tolerance have to be added to the left
Add implementation for the range rescale. Variable is ignored here...
r438 // add tolerance for left (start) side
Add synchronization that keep delta
r444 tolerance
= toleranceFactor * (currentDateTime.m_TEnd - currentDateTime.m_TStart);
Implementation of the new Dela T computation strategy
r260 variableDateTimeWithTolerance.m_TStart -= tolerance;
Add intersect méthode on variable and sqpDateTime...
r258 }
The cache is now updated only if date requested has been successfully...
r318 else {
Implementation of the calibration for the synchronization...
r445 qCCritical(LOG_VisualizationGraphWidget())
The cache is now updated only if date requested has been successfully...
r318 << tr("Detection anormal zoom detection: ");
}
Add intersect méthode on variable and sqpDateTime...
r258 }
else {
Implementation of the calibration for the synchronization...
r445 qCDebug(LOG_VisualizationGraphWidget()) << tr("TORM: Detection zoom out: ");
Alexandre Leroux
Minor refactoring...
r460 // add tolerance for each side
Add synchronization that keep delta
r444 tolerance = toleranceFactor * (currentDateTime.m_TEnd - currentDateTime.m_TStart);
Implementation of the new Dela T computation strategy
r260 variableDateTimeWithTolerance.m_TStart -= tolerance;
variableDateTimeWithTolerance.m_TEnd += tolerance;
Add synchronization that keep delta
r444 zoomType = VisualizationGraphWidgetZoomType::ZoomOut;
Add intersect méthode on variable and sqpDateTime...
r258 }
Implementation of the cache feature : download before display needs
r433 if (!variable->contains(dateTimeRange)) {
Implementation of the calibration for the synchronization...
r445 qCDebug(LOG_VisualizationGraphWidget())
Add synchronization that keep delta
r444 << "TORM: Modif on variable datetime detected" << currentDateTime;
variable->setDateTime(currentDateTime);
Implementation of the cache feature : download before display needs
r433 }
Implementation of the new Dela T computation strategy
r260
Implementation of the calibration for the synchronization...
r445 qCDebug(LOG_VisualizationGraphWidget()) << tr("TORM: Request data detection: ");
Implementation of the new Dela T computation strategy
r260 // CHangement detected, we need to ask controller to request data loading
Fix the cosinus bug....
r298 emit requestDataLoading(variable, variableDateTimeWithTolerance);
The mock plugin can now create data with view operation
r235 }
The cache is now updated only if date requested has been successfully...
r318 else {
Add synchronization that keep delta
r444 qCInfo(LOG_VisualizationGraphWidget())
<< tr("TORM: Detection zoom in that doesn't need request: ");
zoomType = VisualizationGraphWidgetZoomType::ZoomIn;
The cache is now updated only if date requested has been successfully...
r318 }
Alexandre Leroux
QCustomPlot notify the graph widget when the xRange changed
r227 }
Add synchronization that keep delta
r444
Implementation of the calibration for the synchronization...
r445 if (impl->m_DoSynchronize && !impl->m_IsCalibration) {
Add synchronization that keep delta
r444 auto oldDateTime = SqpDateTime{t2.lower, t2.upper};
qCDebug(LOG_VisualizationGraphWidget())
<< tr("TORM: VisualizationGraphWidget::Synchronize notify !!")
<< QThread::currentThread()->objectName();
emit synchronize(dateTimeRange, oldDateTime, zoomType);
}
Alexandre Leroux
QCustomPlot notify the graph widget when the xRange changed
r227 }
Alexandre Leroux
Handles key modifiers for zoom...
r179 void VisualizationGraphWidget::onMouseWheel(QWheelEvent *event) noexcept
{
auto zoomOrientations = QFlags<Qt::Orientation>{};
Implementation of the new Dela T computation strategy
r260 // Lambda that enables a zoom orientation if the key modifier related to this orientation
// has
Alexandre Leroux
Handles key modifiers for zoom...
r179 // been pressed
auto enableOrientation
= [&zoomOrientations, event](const auto &orientation, const auto &modifier) {
auto orientationEnabled = event->modifiers().testFlag(modifier);
zoomOrientations.setFlag(orientation, orientationEnabled);
};
enableOrientation(Qt::Vertical, VERTICAL_ZOOM_MODIFIER);
enableOrientation(Qt::Horizontal, HORIZONTAL_ZOOM_MODIFIER);
ui->widget->axisRect()->setRangeZoom(zoomOrientations);
}
The mock plugin can now create data with view operation
r235
Implementation of the calibration for the synchronization...
r445 void VisualizationGraphWidget::onMousePress(QMouseEvent *event) noexcept
{
impl->m_IsCalibration = event->modifiers().testFlag(Qt::ControlModifier);
}
void VisualizationGraphWidget::onMouseRelease(QMouseEvent *event) noexcept
{
impl->m_IsCalibration = false;
}
The mock plugin can now create data with view operation
r235 void VisualizationGraphWidget::onDataCacheVariableUpdated()
{
Correction for pull request
r243 // NOTE:
Implementation of the new Dela T computation strategy
r260 // We don't want to call the method for each component of a variable unitarily, but for
// all
Correction for pull request
r243 // its components at once (eg its three components in the case of a vector).
// The unordered_multimap does not do this easily, so the question is whether to:
// - use an ordered_multimap and the algos of std to group the values by key
// - use a map (unique keys) and store as values directly the list of components
Implementation of the cache feature : download before display needs
r433 auto grapheRange = ui->widget->xAxis->range();
auto dateTime = SqpDateTime{grapheRange.lower, grapheRange.upper};
The mock plugin can now create data with view operation
r235 for (auto it = impl->m_VariableToPlotMultiMap.cbegin();
it != impl->m_VariableToPlotMultiMap.cend(); ++it) {
auto variable = it->first;
Downgrade dev log from info to debug
r441 qCDebug(LOG_VisualizationGraphWidget())
Implementation of the cache feature : download before display needs
r433 << "TORM: VisualizationGraphWidget::onDataCacheVariableUpdated S"
<< variable->dateTime();
Downgrade dev log from info to debug
r441 qCDebug(LOG_VisualizationGraphWidget())
Implementation of the cache feature : download before display needs
r433 << "TORM: VisualizationGraphWidget::onDataCacheVariableUpdated E" << dateTime;
if (dateTime.contains(variable->dateTime()) || dateTime.intersect(variable->dateTime())) {
VisualizationGraphHelper::updateData(QVector<QCPAbstractPlottable *>{} << it->second,
variable->dataSeries(), variable->dateTime());
}
The mock plugin can now create data with view operation
r235 }
}
Implementation of the calibration for the synchronization...
r445
VisualizationGraphWidgetZoomType
VisualizationGraphWidget::VisualizationGraphWidgetPrivate::getZoomType(const QCPRange &t1,
const QCPRange &t2)
{
// t1.lower <= t2.lower && t2.upper <= t1.upper
auto zoomType = VisualizationGraphWidgetZoomType::Unknown;
if (t1.lower <= t2.lower && t2.upper <= t1.upper) {
zoomType = VisualizationGraphWidgetZoomType::ZoomOut;
}
else if (t1.lower > t2.lower && t1.upper > t2.upper) {
zoomType = VisualizationGraphWidgetZoomType::PanRight;
}
else if (t1.lower < t2.lower && t1.upper < t2.upper) {
zoomType = VisualizationGraphWidgetZoomType::PanLeft;
}
else if (t1.lower > t2.lower && t2.upper > t1.upper) {
zoomType = VisualizationGraphWidgetZoomType::ZoomIn;
}
else {
qCCritical(LOG_VisualizationGraphWidget()) << "getZoomType: Unknown type detected";
}
return zoomType;
}