-
Notifications
You must be signed in to change notification settings - Fork 0
/
fsGUI.h
executable file
·194 lines (137 loc) · 4.52 KB
/
fsGUI.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#ifndef __SPIKE_FS_GUI_H__
#define __SPIKE_FS_GUI_H__
#include <QtGui>
#include <QtWidgets>
#include <QtXml>
#include <QMainWindow>
#include <inttypes.h>
#include <configuration.h>
#include <trodesSocket.h>
#include "fsSharedStimControlDefines.h"
#include "fsConfigureStimulators.h"
#include "fsConfigureAOut.h"
#include "fsPulseTrainTab.h"
#include "fsFeedbackTab.h"
#include "fsLatencyTab.h"
#include "fsStimForm.h"
#define PI 3.1415
#define TWOPI 6.2830
#define MAX_WELLS 64
#define MAX_REST 90000
#define MAX_REWARD_BITS 32
#define DEFAULT_TMP_PULSE_COMMANDS_FILE "/tmp/tmp_pulse_commands"
#define CONFIG_STIMULATORS_TAB 1
#define CONFIG_ANALOG_OUT_TAB 2
#define OUTPUT_ONLY_TAB 3
#define REALTIME_FEEDBACK_TAB 4
#define SAMP_TO_TIMESTAMP 3
class PythonConfig {
public:
bool pythonFSData = false;
int loadFromXML(QDomNode &pythonNode);
void saveToXML(QDomDocument &doc, QDomElement &rootNode);
};
class HPCConfig {
public:
bool hpcEnabled = false;
qint16 dataType; // the datatypes to send to the HPC framework
int loadFromXML(QDomNode &hpcConfNode);
void saveToXML(QDomDocument &doc, QDomElement &rootNode);
};
class FSGui : public QMainWindow {
Q_OBJECT
public:
FSGui(QStringList arguments, QWidget *parent = 0);
~FSGui();
int loadFromXML(QDomNode &fsConfNode);
void saveToXML(QDomDocument &doc, QDomElement &rootNode);
private slots:
void about();
int readConfigFile(QString);
int sendConfigFile(QString);
bool writeConfigFile(QString);
void enableTabs(bool);
void loadSettings(void);
void saveSettings(void);
void setupFile(QString filename);
void startRecording();
void stopRecording();
void closeFile();
void triggerSingleStim(void);
void startOutputOnlyStim(void);
void abortOutputOnlyStim(void);
void resetRealtimeStim(void);
void startRealtimeStim(void);
void stopRealtimeStim(void);
void startTrodesClient(void);
void startDataSocket(DataClientInfo *dc);
void startDataSockets(DataTypeSpec *dataTypeSpec, int dataType);
void updateContNTrodeSelection(qint16 nTrodeIndex, bool selected);
void updateSpikeNTrodeSelection(qint16 nTrodeIndex, bool selected);
void startFSData(void);
void startData(void);
void stopData(void);
void SendFSDataMessage(int message, char *data, int size);
void setupFSDataMessageHandler();
void processFSDataMessage(quint8 messageType, QByteArray message);
void setStateScriptFunctionRange(int start, int end);
void setStateScriptFunctionValid(uint16_t fNum, bool valid);
void openLatencyDataFile();
void closeLatencyDataFile();
void updateAutoSettleSetting(bool autoSettle, int originID);
private:
QString configFileName;
QString fsDataPath;
QGridLayout *mainLayout;
QMenu *fileMenu;
QAction *loadFileAction;
QAction *saveFileAction;
QAction *openLatencyFileAction;
QAction *closeLatencyFileAction;
QAction *exitAction;
QMenu *menuHelp;
QAction *actionAbout;
QFile latencyFile;
QTextStream latencyStream;
bool trodes;
bool trodesClientStarted;
bool fsDataRestarted;
bool dataStreaming;
TrodesModuleNetwork *moduleNet;
TrodesServer *fsDataServer;
/** Disabling data menu selection of channels to stream to FSData.
* Instead each realtime module should configure it's own channel settings.
*/
QMenu *dataMenu;
QAction *restartFSDataAction;
QAction *selectContinuousDataAction;
QAction *selectSpikeDataAction;
QAction *startDataAction;
QAction *stopDataAction;
QProcess *fsDataProcess;
NTrodeSelectDialog *contDataDialog;
NTrodeSelectDialog *spikeDataDialog;
PythonConfig pythonConfig;
HPCConfig hpcConfig; // configuration information for real-time high performance computing
//int getStateScriptFnNum(void);
qint8 dataTypesConnected;
int numContNTrodesConnected;
int numSpikeNTrodesConnected;
//int directDIOFuncNum;
// Setup default FSGui state script providing
// direct control of DIO ports.
//void generateDirectDIOScript(int, QString *);
protected:
int ntabs;
QTabWidget *qtab;
StimConfigTab *stimConfigTab;
AOutConfigTab *aOutConfigTab;
//PulseFileTab *pulseFileTabWidget;
StimPulseTrainTab *stimPulseTrainTab;
FeedbackTab *feedbackTab;
LatencyTab *latencyTab;
signals:
void contDataStarted();
void sig_fsDataRestarted();
};
#endif