CEBL  2.1
TabFeatures.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 TABFEATURES_H
27 #define TABFEATURES_H
28 
29 #include "Tab.hpp"
30 #include "WidgetPanel.hpp"
31 #include "../model/EEGData.hpp"
32 
33 //forward declarations
34 class EEGMonitor;
35 
36 class TabFeatures : public Tab
37 {
38 private:
39 
40  private:
41  GtkWidget *btn_start,
42  *btn_stop,
43  *btn_train,
44  *combo_features,
45  *panel_container,
46  *panel_box,
47  *check_feature_trained,
48  *hbox_features;
49 
50 
51  //features
52  WidgetPanel *panel;
53  int sample_rate;
54  std::vector<string> feature_names;
55  string selected_feature;
56  bool updating_view;
57  int num_features;
58  int plot_size;
59 
60  //CALLBACKS
61  static void CB_changeFeature(GtkWidget *, gpointer);
62  static void CB_trainFeature(GtkWidget *, gpointer);
63  static void CB_startPlot(GtkWidget *, gpointer);
64  static void CB_stopPlot(GtkWidget *, gpointer);
65  static gint timedPlot(gpointer);
66 
67  //PLOTTING
68  EEGMonitor *plot;
69  bool continue_plotting;
70 
71  void createPlot();
72  void startPlotting();
73  void stopPlotting();
74  bool continuePlotting() { return continue_plotting; }
75 
76 protected:
78  void CreateGUI();
79 
80 public:
81 
82  //Constructors / Destructors
83  TabFeatures(string title, GtkWidget* notebook, CEBLViewGTK * view) : Tab(title,notebook,view) { CreateGUI(); }
84  ~TabFeatures();
85 
86  //update the view
87  void updateView();
88 
89  //update model
90  void updateModel();
91 
92  //update features when hidden
93  void onHide();
94 };
95 
96 
97 #endif
98 
99 
100