forked from SpineML/SpineCreator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SC_viewGVpropertieslayout.h
239 lines (200 loc) · 7.25 KB
/
SC_viewGVpropertieslayout.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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
/***************************************************************************
** **
** This file is part of SpineCreator, an easy to use GUI for **
** describing spiking neural network models. **
** Copyright (C) 2013-2014 Alex Cope, Paul Richmond, Seb James **
** **
** This program is free software: you can redistribute it and/or modify **
** it under the terms of the GNU General Public License as published by **
** the Free Software Foundation, either version 3 of the License, or **
** (at your option) any later version. **
** **
** This program is distributed in the hope that it will be useful, **
** but WITHOUT ANY WARRANTY; without even the implied warranty of **
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
** GNU General Public License for more details. **
** **
** You should have received a copy of the GNU General Public License **
** along with this program. If not, see http://www.gnu.org/licenses/. **
** **
****************************************************************************
** Author: Alex Cope **
** Website/Contact: http://bimpa.group.shef.ac.uk/ **
****************************************************************************/
#ifndef VIEWGVPROPERTIESLAYOUT_H
#define VIEWGVPROPERTIESLAYOUT_H
#include <QtGui>
#include "SC_logged_data.h"
#include "EL_experiment.h"
struct viewGVstruct; // Defined in mainwindow.h
class viewGVpropertieslayout : public QWidget
{
Q_OBJECT
public:
explicit viewGVpropertieslayout(viewGVstruct* viewGVin, QWidget* parent = 0);
~viewGVpropertieslayout();
/*!
* \brief configure a new QCustomPlot for use.
*/
void setupPlot (QCustomPlot* plot);
/*!
* \brief populateVLogData Populate @see vLogData from the given list of files.
* \param filelist The list of log file names or absolute file paths.
* \param path A directory whose path is prepended to the members of filelist.
*/
void populateVLogData (QStringList filelist, QDir* path = 0);
/*!
* Clears out this->vLogData
*/
void clearVLogData (void);
/*!
* \brief Close visible QCustomPlots, without trying to store them
* away (used if the project for which the plots are being viewed
* was closed).
*/
void clearPlots (void);
/*!
* Add an empty plot and tile it.
*/
void addEmptyPlot (void);
/*!
* \brief viewGV - a structure defined in mainwindow.h holding
* information about the graphing interface of SpineCreator.
*/
viewGVstruct* viewGV;
/*!
* Called when the user presses a button to create a new, empty
* graph window.
*/
QAction* actionAddGraphSubWin;
/*!
* \brief actionToGrid Tile all the subwindows.
*/
QAction* actionToGrid;
/*!
* \brief actionLoadData Open a dialog to load some log data
*/
QAction* actionLoadLogData;
QAction* actionRefreshLogData;
QAction* actionSavePdf;
QAction* actionSavePng;
/*!
* \brief vLogData A vector of pointers to the logData objects
* which are being shown for the current experiment.
*/
QVector<logData*> vLogData;
/*!
* The currently selected graph sub-window.
*/
QMdiSubWindow* currentSubWindow;
/*!
* The experiment which is currently "in view"
*/
experiment* currentExperiment;
/*!
* The list widgets which appear on the right hand side of the graph view.
*/
QListWidget* logList;
/*!
* \brief dataIndexList is a list of the individual data sets within each
* log file. Corresponds to the elements in a population.
*/
QListWidget* dataIndexList;
/*!
* \brief A list of the plot types for a given logData. Currently there's
* only one option, depending on the data type; line graphs or raster plots.
*/
QListWidget* typeList;
/*!
* This is "add a graph of the data to the current, existent plot
* window". In this class, we'll use "graph" to mean the graph of
* a single set of data, which may be one of many existing in the
* file backend of a given logData object
*/
QPushButton* addGraphButton;
/*!
* The log directory which is currently being viewed.
*/
QString currentLogDataDir;
private:
/*!
* \brief Create the tool bar that sits above the graphing area. Called once.
*/
void createToolbar (void);
/*!
* \brief Update @see logList
*/
void updateLogList (void);
/*!
* \brief refreshLog
* \param log
*/
void refreshLog (logData* log);
/*!
* Run through the logData object and graph all data on @see subWin.
*/
void addLinesRasters (logData* log, QMdiSubWindow* subWin);
/*!
* If true, the x axes of all the visible plots should be kept to
* the same range - editing the range in one plot should lead to
* the range changing in all the others.
*/
bool unifyTime;
signals:
public slots:
// property slots
/*!
* \brief Actions to carry out when a sub window is selected by the user.
*/
void windowSelected (QMdiSubWindow* window);
/*!
* \brief Called when the list of selected logs is changed by the user.
*/
void logListSelectionChanged (int);
/*!
* \brief Add a graph to the current sub window.
*/
void addGraphsToCurrent();
/*!
* Set the range r on the x axis for all plots other than the
* current one. This is a "unify time" option for multiple
* graphs. Cool.
*/
void unifyRangeForAllPlots (const QCPRange& r);
/*!
* \brief Delete the currently selected log file.
*
* This looks at the currently selected log in @see logList, deletes
* the log files behind it (the .xml and .bin files) and then removes
* the corresponding entry from @see vLogData and @see logList
*/
void deleteCurrentLog();
/*!
* Toggle the feature which keeps the x axis (time) ranges the
* same on all graphs.
*/
void toggleUnifyTime (void);
// graph slots
/*!
* \brief Remove the selected graph from the currently selected subwindow.
*/
void removeSelectedGraph();
/*!
* \brief Remove all graphs from the currently selected subwindow.
*/
void removeAllGraphs();
void toggleHorizontalZoom();
void toggleHorizontalDrag();
void toggleVerticalZoom();
void toggleVerticalDrag();
void rescaleAxes();
void contextMenuRequest (QPoint pos);
// toolbar slots
void actionAddGraphSubWin_triggered();
void actionToGrid_triggered();
void actionLoadLogData_triggered();
void actionRefreshLogData_triggered();
void actionSavePdf_triggered();
void actionSavePng_triggered();
};
#endif // VIEWGVPROPERTIESLAYOUT_H