-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscopeplotcurve.cpp
More file actions
37 lines (31 loc) · 861 Bytes
/
scopeplotcurve.cpp
File metadata and controls
37 lines (31 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "scopeplotcurve.h"
#include "AnalogSignal.h"
#include <qwt_plot_curve.h>
#include <qwt_symbol.h>
#include <qwt_curve_fitter.h>
#include <qwt_text.h>
ScopePlotCurve::ScopePlotCurve( const QString& name, AnalogSignal* pAnalogSignal, QwtPlot* pPlot, const QColor& color )
: m_strName( name )
, m_pAnalogSignal( pAnalogSignal )
{
m_pPlotCurve = new QwtPlotCurve( name );
m_pPlotCurve->attach( pPlot );
m_pPlotCurve->setPen(color);
m_pPlotCurve->setStyle(QwtPlotCurve::Lines);
}
ScopePlotCurve::~ScopePlotCurve(void)
{
delete m_pPlotCurve;
}
void ScopePlotCurve::setColor( const QColor& color )
{
m_pPlotCurve->setPen(color);
}
void ScopePlotCurve::Plot()
{
m_pPlotCurve->setSamples( m_pAnalogSignal->GetXValues(), m_pAnalogSignal->GetValues() );
}
QwtPlotCurve* ScopePlotCurve::GetPlotCurve()
{
return m_pPlotCurve;
}