MNE-CPP  beta 0.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
realtimemultisamplearray.cpp
Go to the documentation of this file.
1 //=============================================================================================================
36 //*************************************************************************************************************
37 //=============================================================================================================
38 // INCLUDES
39 //=============================================================================================================
40 
42 
43 
44 //*************************************************************************************************************
45 //=============================================================================================================
46 // QT INCLUDES
47 //=============================================================================================================
48 
49 #include <QDebug>
50 
51 
52 //*************************************************************************************************************
53 //=============================================================================================================
54 // USED NAMESPACES
55 //=============================================================================================================
56 
57 using namespace XMEASLIB;
58 //using namespace IOBuffer;
59 
60 
61 //*************************************************************************************************************
62 //=============================================================================================================
63 // DEFINE MEMBER METHODS
64 //=============================================================================================================
65 
68 , m_dMinValue(0)
69 , m_dMaxValue(65535)
70 , m_dSamplingRate(0)
71 , m_qString_Unit("")
72 , m_uiNumChannels(uiNumChannels)
73 , m_ucMultiArraySize(10)
74 
75 {
76 
77 }
78 
79 
80 //*************************************************************************************************************
81 
83 {
84 
85 }
86 
87 
88 //*************************************************************************************************************
89 
90 QVector<double> RealTimeMultiSampleArray::getVector() const
91 {
92  return m_vecValue;
93 }
94 
95 
96 //*************************************************************************************************************
97 
98 void RealTimeMultiSampleArray::setVector(QVector<double> v)
99 {
100  if(v.size() != int(m_uiNumChannels))
101  qDebug() << "Error Occured in RealTimeMultiSampleArray::setVector: Vector size does not matche the number of channels! ";
102 
103  for(QVector<double>::iterator it = v.begin(); it != v.end(); ++it)
104  {
105  if(*it < m_dMinValue) *it = m_dMinValue;
106  else if(*it > m_dMaxValue) *it = m_dMaxValue;
107  }
108 
109  m_vecValue = v;
110  m_matSamples.push_back(m_vecValue);
111  if(m_matSamples.size() >= m_ucMultiArraySize && notifyEnabled)
112  {
113  notify();
114  m_matSamples.clear();
115  }
116 }
static bool notifyEnabled
RealTimeMultiSampleArray(unsigned int uiNumChannels)
Contains the declaration of the RealTimeMultiSampleArray class.
virtual QVector< double > getVector() const
virtual void setVector(QVector< double > v)
The SngChnMeasurement class is the base class of every SngChnMeasurement.
void notify()