qmca  0.0.20
mcaplotcurve.cpp
Go to the documentation of this file.
1 #include "mcaplotcurve.h"
2 #include "mcacontroller.h"
3 #include "epicsmca.h"
4 #include <QObject>
5 #include <qwt_plot_curve.h>
6 
7 MCAPlotCurve::MCAPlotCurve(QObject *parent, const QString &title, MCAController *ctrl, QwtPlot *plot, EpicsMCA* mca)
8  : QObject(parent),
9  QwtPlotCurve(title),
10  m_Controller(ctrl),
11  m_Plot(plot),
12  m_MCA(mca)
13 {
14  connect(m_MCA, SIGNAL(valueChanged()), this, SLOT(arrayValueChanged()));
15 }
16 
18 {
19 }
20 
22 {
23  int sz = m_MCA->count();
24  QVector<double> xv(sz);
25 
26  for (int i=0; i<sz; i++) {
27  xv[i]=i;
28  }
29 
30  setSamples(xv.data(), m_MCA->value().data(), m_MCA->count());
31 
33 }
MCAController * m_Controller
Definition: mcaplotcurve.h:23
EpicsMCA * m_MCA
Definition: mcaplotcurve.h:25
virtual ~MCAPlotCurve()
QVector< double > value()
Definition: epicsarray.cpp:90
MCAPlotCurve(QObject *parent, const QString &title, MCAController *ctrl, QwtPlot *plot, EpicsMCA *mca)
Definition: mcaplotcurve.cpp:7
void arrayValueChanged()