-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmainwindow.h
98 lines (82 loc) · 2.15 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtWidgets/QMainWindow>
#include <QtGui/QCloseEvent>
#include <QtWidgets/QFileDialog>
#include <QtWidgets/QMessageBox>
#include <thread>
#include <string>
#include <vector>
// LSL API
//#define LSL_DEBUG_BINDINGS
#include "lsl_cpp.h"
// BrainAmp API
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <WinIoCtl.h>
#include "LibTalker.h"
struct t_AppVersion
{
int32_t Major;
int32_t Minor;
int32_t Bugfix;
};
struct t_AmpConfiguration
{
std::string m_sSerialNumber;
bool m_bUseActiveShield;
bool m_bFDA;
bool m_bUseSampleCtr;
int m_nBaseSamplingRate;
int m_nSubSampleDivisor;
int m_nChunkSize;
std::vector<std::string> m_psEegChannelLabels;
std::vector<std::string> m_psAuxChannelLabels;
bool m_bUnsampledMarkers;
bool m_bSampledMarkersEEG;
bool m_bUseSim;
};
namespace Ui
{
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget* parent, const char* config_file);
~MainWindow();
private slots:
QString find_config_file(const char* filename);
void LoadConfigDialog();
void SaveConfigDialog();
void Link();
void closeEvent(QCloseEvent *ev);
void SetSamplingRate();
//void SetMinChunk();
void VersionsDialog();
void UpdateChannelLabels();
void RefreshDevices();
void UpdateChannelLabelsEEG(int);
void UpdateChannelLabelsGUI(int);
void ChooseDevice(int which);
void RadioButtonBehavior(bool b);
private:
void ReadThread(t_AmpConfiguration ampConfiguration);
void AmpSetup(t_AmpConfiguration ampConfiguration);
void LoadConfig(const QString &filename);
void SaveConfig(const QString &filename);
void ToggleGUIEnabled(bool bEnabled);
t_AppVersion m_AppVersion;
LibTalker m_LibTalker;
std::vector<std::string> m_psAmpSns;
std::vector<int> m_pnUsableChannelsByDevice;
bool m_bUseActiveShield;
int m_nSamplingRate;
bool m_bOverrideAutoUpdate;
bool m_bStop;
t_TriggerOutputMode m_TriggerOutputMode;
std::unique_ptr<std::thread> m_ptReadThread;
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H