CEBL  2.1
ChannelsConfig.hpp
Go to the documentation of this file.
1 /*
2 * CEBL : CSU EEG Brain-Computer Interface Lab
3 *
4 * Author: Jeshua Bratman - jeshuabratman@gmail.com
5 *
6 * This file is part of CEBL.
7 *
8 * CEBL is free software; you can redistribute it and/or modify it.
9 * We only ask that if you use our code that you cite the source in
10 * your project or publication.
11 *
12 * EEG Group (www.cs.colostate.edu/eeg)
13 * Department of Computer Science
14 * Colorado State University
15 *
16 */
17 
25 #ifndef CHANNELSCONFIG_H
26 #define CHANNELSCONFIG_H
27 
28 //forward declarations
29 class CEBLModel;
30 using std::string;
31 
33 {
34 private:
35  CEBLModel * model;
36 
37  string config_filename;
38  int max_num_channels;
39 
40  vector<string> channels_names;
41  vector<bool> channels_enabled;
42  vector<bool> channels_reference;
43 
44 
50  bool parseConfigFromStream(std::istream &ifs);
51 
57  bool saveConfigToStream(std::ostream &ofs);
58 
59 public:
60  ChannelsConfig(CEBLModel *model);
62 
63 
64  // getters used by model
65  string getCurrentFilename();
66  string getElectrodeName(int);
67  bool getElectrodeReference(int);
68  bool getElectrodeEnabled(int);
69  int getMaxNumChannels();
70  std::vector<string> getEnabledNames();
71  int getNumEnabled();
72  string getConfigurationString();
73 
74  // setters used by model
75  void loadFile(string filename);
76  void saveFile(string filename);
77  void setElectrodeName(int electrode, string name);
78  void setElectrodeReference(int electrode, bool enabled);
79  void setElectrodeEnabled(int electrode, bool enabled);
80  void setConfigurationFromString(string config);
81 
82 
83  //other getters
89  vector<bool> getEnabledMask() { return channels_enabled; }
90 
91 };
92 
93 
94 #endif