/
NoEEGDevice.h
62 lines (47 loc) · 1.36 KB
/
NoEEGDevice.h
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* NoEEGDevice.h
*
* Created on: 2.7.2015
* Author: Tomas
*/
#ifndef NOEEGDEVICE_H_
#define NOEEGDEVICE_H_
#include "DataSource.h"
namespace whiteice {
namespace resonanz {
/**
* Placeholder for empty EEG device producing no outputs.
*/
class NoEEGDevice: public DataSource {
public:
NoEEGDevice(const unsigned int channels = 7);
virtual ~NoEEGDevice();
virtual std::string getDataSourceName() const { return "No EEG device"; };
/**
* Returns true if connection and data collection to device is currently working.
*/
virtual bool connectionOk() const { return true; }
/**
* returns current value
*/
virtual bool data(std::vector<float>& x) const {
x.resize(CHANNELS);
for(unsigned int i=0;i<x.size();i++)
x[i] = 0.5f;
return true;
}
virtual bool getSignalNames(std::vector<std::string>& names) const {
names.resize(CHANNELS);
for(unsigned int i=0;i<names.size();i++)
names[i] = "Empty signal";
return true;
}
virtual unsigned int getNumberOfSignals() const { return CHANNELS; }
virtual bool extradata(std::vector<float>& x) const;
virtual unsigned int getExtraNumberOfSignals() const;
private:
const unsigned int CHANNELS;
};
} /* namespace resonanz */
} /* namespace whiteice */
#endif /* NOEEGDEVICE_H_ */