CEBL  2.1
TabTraining.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 TABTRAINING_H
27 #define TABTRAINING_H
28 
29 #include "Tab.hpp"
31 #include "../model/EEGData.hpp"
32 #include "StatusBar.hpp"
33 
34 //forward declarations
36 
37 class TabTraining : public Tab
38 {
39 private:
40  bool updating_view;
41 
42  //WIDGETS
43  GtkWidget *interface_combo,
44  *source_combo,
45  *interface_box,
46  *controls_box,
47  *btn_start,
48  *btn_stop,
49  *btn_load,
50  *btn_save,
51  *btn_interface_cfg,
52  *check_classification_feedback,
53  *spin_classes,
54  *spin_sequences,
55  *spin_sequence_length,
56  *spin_pause_length,
57  *label_info,
58  *label_data,
59  *info_frame1,
60  *info_frame2,
61  *controls_hbox1,
62  *controls_hbox2,
63  *controls_hbox3,
64  *controls_hbox4;
65 
66  EEGInterface *interface;
67  bool training_stopped_manually;
68  InterfaceConfigurationWindow * interface_config;
69  void disableControls();
70  void enableControls();
71  static void CB_startTraining(GtkWidget *, gpointer);
72  static void CB_stopTraining(GtkWidget *, gpointer);
73  static void CB_changeNumClasses(GtkWidget *, gpointer);
74  static void CB_changeNumSequences(GtkWidget *, gpointer);
75  static void CB_changeSequenceLength(GtkWidget *, gpointer);
76  static void CB_changePauseLength(GtkWidget *, gpointer);
77  static void CB_loadData(GtkWidget *, gpointer);
78  static void CB_saveData(GtkWidget *, gpointer);
79  static void CB_toggleClassificationFeedback(GtkWidget *, gpointer);
80 
81  //update interface based on num classes, and class labels
82  void updateInterface();
83  //update text info to user
84  void updateTextInfo();
85  //update the interface during training process
86  static gint timedUpdateInterface(gpointer);
87 
88  //status id
89  StatusID status_id;
90 
91 protected:
93  void CreateGUI();
94 
95 public:
96 
97  //Constructors / Destructors
98  TabTraining(string title, GtkWidget* notebook, CEBLViewGTK * view) : Tab(title,notebook,view) { CreateGUI(); }
99  ~TabTraining();
100 
101  //update the view
102  void updateView();
103  //update model
104  void updateModel();
105  void onHide();
106 };
107 
108 #endif
109 
110 
111