CEBL  2.1
TabMonitor.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 TABMONITOR_H
27 #define TABMONITOR_H
28 
29 #include "Tab.hpp"
30 #include "../model/EEGData.hpp"
31 #include "StatusBar.hpp"
32 
33 //forward declaratiosn
34 class EEGMonitor;
35 class EEGDataSource;
36 
37 class TabMonitor : public Tab
38 {
39 private:
40  GtkWidget *btn_start,
41  *btn_stop,
42  *btn_start_collecting,
43  *label_collected_seconds,
44  *label_collected_samples,
45  *progress_bar,
46  *check_filter;
47 
48  EEGMonitor * plot;
49 
50  // CALLBACKS
51  static void CB_StartMonitor(GtkWidget *, gpointer);
52  static void CB_StopMonitor(GtkWidget *, gpointer);
53  static void CB_StartCollect(GtkWidget *, gpointer);
54  static void CB_StopCollect(GtkWidget *, gpointer);
55  static void CB_toggleFilter(GtkWidget *, gpointer);
56 
57  //PLOTTING
58  static gint timedPlot(gpointer);
59 
64  bool startDataSource();
65  void stopDataSource();
66 
67  void startPlotting();
68  void stopPlotting();
69  void createPlot();
70 
71  bool continue_plotting;
72  bool collecting_data;
73  bool continuePlotting() { return continue_plotting; }
74  //passive plot indicates that we are plotting but not controlling the mindset
75  bool passive_plot;
76  StatusID status_id;
77  bool updating_view;
78 
79 protected:
81  void CreateGUI();
82 
83 public:
84 
85  //Constructors / Destructors
86  TabMonitor(string title, GtkWidget* notebook, CEBLViewGTK * view) : Tab(title,notebook,view) { CreateGUI(); }
87  ~TabMonitor();
88 
89  //update the view
90  void updateView();
91  //update model
92  void updateModel();
93  void onHide();
94 };
95 
96 #endif
97 
98 
99