CEBL  2.1
TabFilter.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 
26 #ifndef TABFILTER_H
27 #define TABFILTER_H
28 
29 #include "Tab.hpp"
30 #include "../model/EEGData.hpp"
31 #include "../model/Timer.hpp"
32 
33 //forward declarations
34 class EEGMonitor;
35 
36 class TabFilter : public Tab
37 {
38 private:
39  GtkWidget * btn_show,
40  *btn_create_filter,
41  *entry_components,
42  *label_selected,
43  *btn_box1,
44  *btn_box2,
45  *btn_box3,
46  *check_filter_made,
47  *combo_filters,
48  *btn_collect,
49  *spin_lags,
50  *spin_seconds;
51 
52  //EEGDataSource * data_source;
53  EEGMonitor * plot;
54  EEGData training_data;
55  void createPlot(int);
56 
57  // CALLBACKS
58  static void CB_selectComponents(GtkWidget *, gpointer);
59  static void CB_showComponents(GtkWidget *, gpointer);
60  static void CB_createFilter(GtkWidget *, gpointer);
61  static void CB_changeFilter(GtkWidget *, gpointer);
62  static void CB_changeNumLags(GtkWidget *, gpointer);
63  static void CB_collectData(GtkWidget *, gpointer);
64  static void CB_changeNumSeconds(GtkWidget *, gpointer);
65 
66  void startCollect();
67  void stopCollect();
68  bool is_collecting;
69  bool training_collected;
70  int num_seconds;
71  Timer collect_timer;
72 
73  //changing filter and updating view
74  std::vector<string> filter_names;
75  string selected_filter;
76  bool updating_view;
77  int num_filters;
78 
79 protected:
81  void CreateGUI();
82 
83 
84 
85 public:
86 
87  //Constructors / Destructors
88  TabFilter(string title, GtkWidget* notebook, CEBLViewGTK * view) : Tab(title,notebook,view) { CreateGUI(); }
89  ~TabFilter();
90 
91  //update the view
92  void updateView();
93  //update model
94  void updateModel();
95 };
96 
97 
98 #endif
99 
100 
101