diff --git a/plugins/datalogger/include/datalogger/menus/plottimeaxiscontroller.hpp b/plugins/datalogger/include/datalogger/menus/plottimeaxiscontroller.hpp index 4487c0fa7a..27c363224d 100644 --- a/plugins/datalogger/include/datalogger/menus/plottimeaxiscontroller.hpp +++ b/plugins/datalogger/include/datalogger/menus/plottimeaxiscontroller.hpp @@ -25,8 +25,8 @@ #include #include #include +#include #include -#include #include "scopy-datalogger_export.h" namespace scopy { @@ -45,7 +45,7 @@ class SCOPY_DATALOGGER_EXPORT PlotTimeAxisController : public QWidget private: MonitorPlot *m_plot; - PositionSpinButton *m_xdelta; + gui::MenuSpinbox *m_xdelta; QDateEdit *dateEdit; QTimeEdit *timeEdit; MenuOnOffSwitch *realTimeToggle; diff --git a/plugins/datalogger/src/menus/plottimeaxiscontroller.cpp b/plugins/datalogger/src/menus/plottimeaxiscontroller.cpp index a58aa66dd2..cf7e4ee1a4 100644 --- a/plugins/datalogger/src/menus/plottimeaxiscontroller.cpp +++ b/plugins/datalogger/src/menus/plottimeaxiscontroller.cpp @@ -59,13 +59,10 @@ PlotTimeAxisController::PlotTimeAxisController(MonitorPlot *m_plot, QWidget *par timeEdit->setDisplayFormat("hh:mm:ss"); timeEdit->setVisible(false); - m_xdelta = new PositionSpinButton( - { - {"s", 1}, - {"min", 60}, - {"hour", 3600}, - }, - "Delta", -DBL_MAX, DBL_MAX, false, false, xAxisContainer); + m_xdelta = new gui::MenuSpinbox("Delta", DataMonitorUtils::getAxisDefaultMaxValue(), "s", 0, DBL_MAX, false, + false, xAxisContainer); + m_xdelta->setScaleRange(1, 1); + m_xdelta->setIncrementMode(gui::MenuSpinbox::IS_FIXED); m_xdelta->setValue(DataMonitorUtils::getAxisDefaultMaxValue()); auto &&timeTracker = TimeManager::GetInstance(); @@ -89,7 +86,7 @@ PlotTimeAxisController::PlotTimeAxisController(MonitorPlot *m_plot, QWidget *par connect(dateEdit, &QDateEdit::dateChanged, this, &PlotTimeAxisController::updatePlotStartPoint); connect(timeEdit, &QTimeEdit::timeChanged, this, &PlotTimeAxisController::updatePlotStartPoint); - connect(m_xdelta, &PositionSpinButton::valueChanged, this, + connect(m_xdelta, &gui::MenuSpinbox::valueChanged, this, [=, this](double value) { m_plot->updateXAxisIntervalMax(value); }); xAxisSection->contentLayout()->addWidget(realTimeToggle);