CEBL  2.1
EEGMonitor.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 
27 #ifndef EEGMONITOR_H
28 #define EEGMONITOR_H
29 
30 
31 //include ublas
32 #include <boost/numeric/ublas/matrix.hpp>
33 #include <boost/numeric/ublas/vector.hpp>
34 namespace ublas = boost::numeric::ublas;
35 
36 
38 #include "EEGPlot.hpp"
39 
40 //forward declarations
41 class EEGDataSource;
42 class Tab;
43 
45 {
46  private:
47  //all the widgets used in the monitor
48  GtkWidget *scroll_window,
49  *plot_box,
50  *box_controls,
51  *box_controls2,
52  *spin_samples,
53  *spin_zoom;
54 
55  //actual plotting widget
56  EEGPlot *plot;
57 
58  //parent tab
59  Tab * parent_tab;
60 
61  //max number of samples to display
62  int num_display_samples;
63  int num_channels;
64  double zoom;
65 
66  //plotting
67  bool continue_plotting;
68  bool plot_wait;
69  bool initialized;
70 
71  //channel configuration
72  std::vector<std::string> labels;
73  std::vector<bool> enabled;
74 
75  //CALLBACKS
76  static void CB_ChangeNumSamples(GtkWidget *, gpointer);
77  static void CB_ChangeZoom(GtkWidget *, gpointer);
78 
79  public:
80  //constructors
81  EEGMonitor(Tab *parent_tab, int nchannels = -1);
82  ~EEGMonitor();
83 
84  //initialization
85  void init();
86  //call to create plot
87  void initPlot();
88  //remove old plot and create new ones
89  void reInitPlot(int nchannels = -1);
90  //setters/getters for various options
92  void setControlsVisible(bool);
94  void setLabels(std::vector<std::string> labels);
96  void setNumDisplaySamples(int);
98  void setZoom(double);
99 
100 
101  //plotting
103  void Plot(ublas::matrix<double> data);
104 
106  Tab * getParentTab() { return parent_tab;}
107 };
108 
109 #endif
110