qavrg 0.0.28
|
#include <qavrgspecserver.h>
Public Slots | |
void | debug_print (QString msg) |
Public Member Functions | |
QavrgSpecServer (QavrgAcquisition *acq, QObject *parent=0) | |
Protected Member Functions | |
QVariant | readProperty (QString name) |
Private Attributes | |
QavrgAcquisition * | m_Acquisition |
Definition at line 8 of file qavrgspecserver.h.
QavrgSpecServer::QavrgSpecServer | ( | QavrgAcquisition * | acq, |
QObject * | parent = 0 |
||
) |
Definition at line 8 of file qavrgspecserver.cpp.
: QSpecServer(QcepExperimentWPtr(), "qavrg"), m_Acquisition(acq) { }
void QavrgSpecServer::debug_print | ( | QString | msg | ) | [slot] |
Definition at line 14 of file qavrgspecserver.cpp.
{
printf("QavrgSpecServer:: %s\n", qPrintable(msg));
}
QVariant QavrgSpecServer::readProperty | ( | QString | name | ) | [protected] |
Definition at line 19 of file qavrgspecserver.cpp.
References m_Acquisition.
{ QVariant res; int chan, bin, nbins; if (name=="var/channel(0)") { res.setValue< QVector<double> >(m_Acquisition -> readResult(0,2)); return res; } if (name=="var/channel(1)") { res.setValue< QVector<double> >(m_Acquisition -> readResult(1,2)); return res; } if (name=="var/channel(2)") { res.setValue< QVector<double> >(m_Acquisition -> readResult(2,2)); return res; } if (name=="var/channel(3)") { res.setValue< QVector<double> >(m_Acquisition -> readResult(3,2)); return res; } if (sscanf(qPrintable(name),"var/data(%d,%d,%d)", &chan, &bin, &nbins) == 3) { res.setValue< QVector<double> > (m_Acquisition -> get_RawData(chan,bin,nbins)); return res; } if (sscanf(qPrintable(name),"var/dark(%d,%d,%d)", &chan, &bin, &nbins) == 3) { res.setValue< QVector<double> > (m_Acquisition -> get_DarkData(chan,bin,nbins)); return res; } if (sscanf(qPrintable(name),"var/ref(%d,%d,%d)", &chan, &bin, &nbins) == 3) { res.setValue< QVector<double> > (m_Acquisition -> get_ReferenceData(chan,bin,nbins)); return res; } if (sscanf(qPrintable(name),"var/data(%d,%d)", &chan, &bin) == 2) { res.setValue< double > (m_Acquisition -> get_RawData(chan,bin)); return res; } if (sscanf(qPrintable(name),"var/dark(%d,%d)", &chan, &bin) == 2) { res.setValue< double > (m_Acquisition -> get_DarkData(chan,bin)); return res; } if (sscanf(qPrintable(name),"var/ref(%d,%d)", &chan, &bin) == 2) { res.setValue< double > (m_Acquisition -> get_ReferenceData(chan,bin)); return res; } if (sscanf(qPrintable(name),"var/data(%d)", &chan) == 1) { res.setValue< QVector<double> >(m_Acquisition -> get_RawData(chan)); return res; } if (sscanf(qPrintable(name),"var/dark(%d)", &chan) == 1) { res.setValue< QVector<double> >(m_Acquisition -> get_DarkData(chan)); return res; } if (sscanf(qPrintable(name),"var/ref(%d)", &chan) == 1) { res.setValue< QVector<double> >(m_Acquisition -> get_ReferenceData(chan)); return res; } return QSpecServer::readProperty(name); }
QavrgAcquisition* QavrgSpecServer::m_Acquisition [private] |
Definition at line 22 of file qavrgspecserver.h.
Referenced by readProperty().