v2.0.0
Loading...
Searching...
No Matches
scalingview.h
Go to the documentation of this file.
1//=============================================================================================================
22
23#ifndef SCALINGVIEW_H
24#define SCALINGVIEW_H
25
26//=============================================================================================================
27// INCLUDES
28//=============================================================================================================
29
30#include "../disp_global.h"
31#include "abstractview.h"
32
33//=============================================================================================================
34// QT INCLUDES
35//=============================================================================================================
36
37#include <QMap>
38#include <QPointer>
39
40//=============================================================================================================
41// EIGEN INCLUDES
42//=============================================================================================================
43
44//=============================================================================================================
45// FORWARD DECLARATIONS
46//=============================================================================================================
47
48class QCheckBox;
49namespace Ui {
50 class ScalingViewWidget;
51}
52
53//=============================================================================================================
54// DEFINE NAMESPACE DISPLIB
55//=============================================================================================================
56
57namespace DISPLIB
58{
59
60//=============================================================================================================
61// DISPLIB FORWARD DECLARATIONS
62//=============================================================================================================
63class ScaleControl;
64
65//=========================================================================================================
76DISPSHARED_EXPORT float getDefaultScalingValue(int iChannelKind,
77 int iChannelUnit);
78
79//=========================================================================================================
92DISPSHARED_EXPORT float getScalingValue(const QMap<qint32, float>& qMapChScaling,
93 int iChannelKind,
94 int iChannelUnit);
95
96//=============================================================================================================
106{
107 Q_OBJECT
108
109public:
110 typedef QSharedPointer<ScalingView> SPtr;
111 typedef QSharedPointer<const ScalingView> ConstSPtr;
112
113 //=========================================================================================================
119 ScalingView(const QString& sSettingsPath = "",
120 QWidget *parent = 0,
121 Qt::WindowFlags f = Qt::Widget,
122 const QStringList& lChannelsToShow = QStringList() << "all");
123
124 //=========================================================================================================
128 ~ScalingView();
129
130 //=========================================================================================================
136 QMap<qint32,float> getScaleMap() const;
137
138 //=========================================================================================================
142 void setScaleMap(const QMap<qint32, float> &qMapChScaling);
143
144 //=========================================================================================================
148 void saveSettings() override;
149
150 //=========================================================================================================
154 void loadSettings() override;
155
156 //=========================================================================================================
160 void clearView() override;
161
162 //=========================================================================================================
168 void setMagGradLink(Qt::CheckState l);
169
170signals:
171 //=========================================================================================================
178 void scalingChanged(const QMap<qint32, float>& scalingMap);
179
180private:
181
182 //=============================================================================================================
186 void processScalingChange();
187
188 //=============================================================================================================
192 void showLinkControl();
193
194 //=============================================================================================================
200 void updateMAGScale(double dScale);
201
202 //=========================================================================================================
208 void updateGRADScale(double dScale);
209
210 //=========================================================================================================
216 void updateMAGtoGRADlink(double dScale);
217
218 //=========================================================================================================
224 void updateEEGScale(double dScale);
225
226 //=========================================================================================================
232 void updateEOGScale(double dScale);
233
234 //=========================================================================================================
240 void updateEMGScale(double dScale);
241
242 //=========================================================================================================
248 void updateECGScale(double dScale);
249
250 //=========================================================================================================
256 void updateMISCScale(double dScale);
257
258 //=========================================================================================================
264 void updateSTIMScale(double dScale);
265
266 //=========================================================================================================
272 void updateGuiMode(GuiMode mode) override;
273
274 //=========================================================================================================
280 void updateProcessingMode(ProcessingMode mode) override;
281
282 //=========================================================================================================
286 void createScaleControls();
287
288 //=========================================================================================================
292 void drawScalingGUI();
293
294 //=========================================================================================================
298 void linkMagToGrad();
299
300 //=========================================================================================================
304 void linkGradToMag();
305
306 //=========================================================================================================
310 void createLinkMagGradCheckBox();
311
312 //=========================================================================================================
318 void keyReleaseEvent(QKeyEvent* event) override;
319
320 //=========================================================================================================
326 void keyPressEvent(QKeyEvent* event) override;
327
328 QMap<qint32, float> m_qMapChScaling;
329 QMap<qint32, QPointer<ScaleControl> > m_qMapScaleControls;
330
331 QString m_sSettingsPath;
332
333 QStringList m_lChannelTypesToShow;
334
335 Ui::ScalingViewWidget* m_pUi;
336 bool m_bLinkMAGtoGRAD;
337 bool m_bIsShiftKeyPressed;
338 bool m_bManagingSpinBoxChange;
339 bool m_bManagingSliderChange;
340 bool m_bManagingLinkMagToGrad;
341 QPointer<QCheckBox> m_pCheckBox;
342};
343
344} // NAMESPACE
345
346#endif // SCALINGVIEW_H
Common base widget for every dockable Quick-Control settings panel in DISPLIB.
Export macros and build-info hooks for the DISPLIB shared library.
#define DISPSHARED_EXPORT
Definition disp_global.h:38
2-D display widgets and visualisation helpers (charts, topography, colour maps).
float getScalingValue(const QMap< qint32, float > &qMapChScaling, int iChannelKind, int iChannelUnit)
float getDefaultScalingValue(int iChannelKind, int iChannelUnit)
AbstractView(QWidget *parent=0, Qt::WindowFlags f=Qt::Widget)
Composite slider + spinbox widget for picking a (possibly logarithmic) scale value.
void scalingChanged(const QMap< qint32, float > &scalingMap)
void saveSettings() override
void setMagGradLink(Qt::CheckState l)
void loadSettings() override
QSharedPointer< const ScalingView > ConstSPtr
void clearView() override
QSharedPointer< ScalingView > SPtr
ScalingView(const QString &sSettingsPath="", QWidget *parent=0, Qt::WindowFlags f=Qt::Widget, const QStringList &lChannelsToShow=QStringList()<< "all")
void setScaleMap(const QMap< qint32, float > &qMapChScaling)
QMap< qint32, float > getScaleMap() const