RescaleAxeOperation.cpp
79 lines
| 2.4 KiB
| text/x-c
|
CppLexer
r435 | #include "Visualization/operations/RescaleAxeOperation.h" | |||
#include "Visualization/VisualizationGraphWidget.h" | ||||
Q_LOGGING_CATEGORY(LOG_RescaleAxeOperation, "RescaleAxeOperation") | ||||
r1420 | struct RescaleAxeOperation::RescaleAxeOperationPrivate | |||
{ | ||||
explicit RescaleAxeOperationPrivate( | ||||
std::shared_ptr<Variable2> variable, const DateTimeRange& range) | ||||
: m_Variable { variable }, m_Range { range } | ||||
r435 | { | |||
} | ||||
r1420 | std::shared_ptr<Variable2> m_Variable; | |||
r1346 | DateTimeRange m_Range; | |||
r435 | }; | |||
r1420 | RescaleAxeOperation::RescaleAxeOperation( | |||
std::shared_ptr<Variable2> variable, const DateTimeRange& range) | ||||
: impl { spimpl::make_unique_impl<RescaleAxeOperationPrivate>(variable, range) } | ||||
r435 | { | |||
} | ||||
r1420 | void RescaleAxeOperation::visitEnter(VisualizationWidget* widget) | |||
r435 | { | |||
// VisualizationWidget is not intended to contain a variable | ||||
Q_UNUSED(widget) | ||||
} | ||||
r1420 | void RescaleAxeOperation::visitLeave(VisualizationWidget* widget) | |||
r435 | { | |||
// VisualizationWidget is not intended to contain a variable | ||||
Q_UNUSED(widget) | ||||
} | ||||
r1420 | void RescaleAxeOperation::visitEnter(VisualizationTabWidget* tabWidget) | |||
r435 | { | |||
// VisualizationTabWidget is not intended to contain a variable | ||||
Q_UNUSED(tabWidget) | ||||
} | ||||
r1420 | void RescaleAxeOperation::visitLeave(VisualizationTabWidget* tabWidget) | |||
r435 | { | |||
// VisualizationTabWidget is not intended to contain a variable | ||||
Q_UNUSED(tabWidget) | ||||
} | ||||
r1420 | void RescaleAxeOperation::visitEnter(VisualizationZoneWidget* zoneWidget) | |||
r435 | { | |||
// VisualizationZoneWidget is not intended to contain a variable | ||||
Q_UNUSED(zoneWidget) | ||||
} | ||||
r1420 | void RescaleAxeOperation::visitLeave(VisualizationZoneWidget* zoneWidget) | |||
r435 | { | |||
// VisualizationZoneWidget is not intended to contain a variable | ||||
Q_UNUSED(zoneWidget) | ||||
} | ||||
r1420 | void RescaleAxeOperation::visit(VisualizationGraphWidget* graphWidget) | |||
r435 | { | |||
r1420 | if (graphWidget) | |||
{ | ||||
r447 | // If the widget contains the variable, rescale it | |||
r1420 | if (impl->m_Variable && graphWidget->contains(*impl->m_Variable)) | |||
{ | ||||
Alexandre Leroux
|
r1272 | // During rescale, acquisition for the graph is disabled but synchronization is still | ||
// enabled | ||||
graphWidget->setFlags(GraphFlag::EnableSynchronization); | ||||
r1377 | graphWidget->setGraphRange(impl->m_Range, true); | |||
Alexandre Leroux
|
r1271 | graphWidget->setFlags(GraphFlag::EnableAll); | ||
r435 | } | |||
} | ||||
r1420 | else | |||
{ | ||||
qCCritical( | ||||
LOG_RescaleAxeOperation(), "Can't visit VisualizationGraphWidget : the widget is null"); | ||||
r435 | } | |||
} | ||||