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{
51class ScalingViewWidget;
52}
53
54//=============================================================================================================
55// DEFINE NAMESPACE DISPLIB
56//=============================================================================================================
57
58namespace DISPLIB
59{
60
61//=============================================================================================================
62// DISPLIB FORWARD DECLARATIONS
63//=============================================================================================================
64class ScaleControl;
65
66//=========================================================================================================
77DISPSHARED_EXPORT float getDefaultScalingValue(int iChannelKind,
78 int iChannelUnit);
79
80//=========================================================================================================
93DISPSHARED_EXPORT float getScalingValue(const QMap<qint32, float>& qMapChScaling,
94 int iChannelKind,
95 int iChannelUnit);
96
97//=============================================================================================================
107{
108 Q_OBJECT
109
110public:
111 typedef QSharedPointer<ScalingView> SPtr;
112 typedef QSharedPointer<const ScalingView> ConstSPtr;
113
114 //=========================================================================================================
123 ScalingView(const QString& sSettingsPath = "",
124 QWidget* parent = 0,
125 Qt::WindowFlags f = Qt::Widget,
126 const QStringList& lChannelsToShow = QStringList() << "all");
127
128 //=========================================================================================================
132 ~ScalingView();
133
134 //=========================================================================================================
140 QMap<qint32, float> getScaleMap() const;
141
142 //=========================================================================================================
148 void setScaleMap(const QMap<qint32, float>& qMapChScaling);
149
150 //=========================================================================================================
154 void saveSettings() override;
155
156 //=========================================================================================================
160 void loadSettings() override;
161
162 //=========================================================================================================
166 void clearView() override;
167
168 //=========================================================================================================
174 void setMagGradLink(Qt::CheckState l);
175
176signals:
177 //=========================================================================================================
184 void scalingChanged(const QMap<qint32, float>& scalingMap);
185
186private:
187 //=============================================================================================================
191 void processScalingChange();
192
193 //=============================================================================================================
197 void showLinkControl();
198
199 //=============================================================================================================
205 void updateMAGScale(double dScale);
206
207 //=========================================================================================================
213 void updateGRADScale(double dScale);
214
215 //=========================================================================================================
221 void updateMAGtoGRADlink(double dScale);
222
223 //=========================================================================================================
229 void updateEEGScale(double dScale);
230
231 //=========================================================================================================
237 void updateEOGScale(double dScale);
238
239 //=========================================================================================================
245 void updateEMGScale(double dScale);
246
247 //=========================================================================================================
253 void updateECGScale(double dScale);
254
255 //=========================================================================================================
261 void updateMISCScale(double dScale);
262
263 //=========================================================================================================
269 void updateSTIMScale(double dScale);
270
271 //=========================================================================================================
277 void updateGuiMode(GuiMode mode) override;
278
279 //=========================================================================================================
285 void updateProcessingMode(ProcessingMode mode) override;
286
287 //=========================================================================================================
291 void createScaleControls();
292
293 //=========================================================================================================
297 void drawScalingGUI();
298
299 //=========================================================================================================
303 void linkMagToGrad();
304
305 //=========================================================================================================
309 void linkGradToMag();
310
311 //=========================================================================================================
315 void createLinkMagGradCheckBox();
316
317 //=========================================================================================================
323 void keyReleaseEvent(QKeyEvent* event) override;
324
325 //=========================================================================================================
331 void keyPressEvent(QKeyEvent* event) override;
332
333 QMap<qint32, float> m_qMapChScaling;
334 QMap<qint32, QPointer<ScaleControl>> m_qMapScaleControls;
335
336 QString m_sSettingsPath;
337
338 QStringList m_lChannelTypesToShow;
339
340 Ui::ScalingViewWidget* m_pUi;
341 bool m_bLinkMAGtoGRAD;
342 bool m_bIsShiftKeyPressed;
343 bool m_bManagingSpinBoxChange;
344 bool m_bManagingSliderChange;
345 bool m_bManagingLinkMagToGrad;
346 QPointer<QCheckBox> m_pCheckBox;
347};
348
349} // NAMESPACE
350
351#endif // SCALINGVIEW_H
Export macros and build-info hooks for the DISPLIB shared library.
#define DISPSHARED_EXPORT
Definition disp_global.h:38
Common base widget for every dockable Quick-Control settings panel in DISPLIB.
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