Skip to content

Commit

Permalink
datamonitor: update functionality based on dev changes
Browse files Browse the repository at this point in the history
Signed-off-by: Ionut Muthi <[email protected]>
  • Loading branch information
IonutMuthi committed Apr 19, 2024
1 parent 2c4e542 commit 8052074
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <QwtDateScaleEngine>
#include <QTimer>
#include <QLabel>
#include <plotbufferpreviewer.h>
#include "scopy-datamonitorplugin_export.h"

namespace scopy {
Expand Down Expand Up @@ -54,7 +55,7 @@ class SCOPY_DATAMONITORPLUGIN_EXPORT MonitorPlot : public QWidget
private:
QString dateTimeFormat;
PlotWidget *m_plot;
TimePlotInfo *m_plotInfo;
PlotBufferPreviewer *m_bufferPreviewer;
QMap<QString, MonitorPlotCurve *> *m_monitorCurves;
bool m_firstMonitor = true;

Expand Down
13 changes: 7 additions & 6 deletions plugins/datamonitorPlugin/src/datamonitor/monitorplot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ MonitorPlot::MonitorPlot(QWidget *parent)

setupXAxis();

m_plotInfo = new TimePlotInfo(m_plot, this);
AnalogBufferPreviewer *bufferPreviewer = new AnalogBufferPreviewer(this);
m_bufferPreviewer = new PlotBufferPreviewer(m_plot, bufferPreviewer, this);

layout->addWidget(m_plotInfo);
layout->addWidget(m_bufferPreviewer);
layout->addWidget(m_plot);

m_monitorCurves = new QMap<QString, MonitorPlotCurve *>();
Expand Down Expand Up @@ -105,15 +106,15 @@ void MonitorPlot::updateXAxisIntervalMin(double min)
{
m_xAxisIntervalMax = min;
refreshXAxisInterval();
m_plotInfo->updateBufferPreviewer();
m_bufferPreviewer->updateBufferPreviewer();
m_plot->replot();
}

void MonitorPlot::updateXAxisIntervalMax(double max)
{
m_xAxisIntervalMin = max;
refreshXAxisInterval();
m_plotInfo->updateBufferPreviewer();
m_bufferPreviewer->updateBufferPreviewer();
m_plot->replot();
}

Expand Down Expand Up @@ -219,8 +220,8 @@ void MonitorPlot::updatePlotStartingPoint(double time, double delta)
m_plot->xAxis()->setInterval(time - (delta * 1000), time);
}

m_plotInfo->updateBufferPreviewer();
m_bufferPreviewer->updateBufferPreviewer();
m_plot->replot();
}

void MonitorPlot::toggleBufferPreview(bool toggled) { m_plotInfo->setVisible(toggled); }
void MonitorPlot::toggleBufferPreview(bool toggled) { m_bufferPreviewer->setVisible(toggled); }
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ MonitorPlotCurve::MonitorPlotCurve(DataMonitorModel *dataMonitorModel, PlotWidge
{
QPen chpen = QPen(dataMonitorModel->getColor(), 1);

m_plotch = new PlotChannel(dataMonitorModel->getName(), chpen, plot, plot->xAxis(), plot->yAxis(), this);
m_plotch = new PlotChannel(dataMonitorModel->getName(), chpen, plot->xAxis(), plot->yAxis(), this);
plot->addPlotChannel(m_plotch);
m_plotch->setEnabled(true);

m_plotch->curve()->setRawSamples(m_dataMonitorModel->getXdata()->data(), m_dataMonitorModel->getYdata()->data(),
Expand Down

0 comments on commit 8052074

Please sign in to comment.