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#include <memory>
41
42//=============================================================================================================
43// EIGEN INCLUDES
44//=============================================================================================================
45
46//=============================================================================================================
47// FORWARD DECLARATIONS
48//=============================================================================================================
49
50class QCheckBox;
51namespace Ui
52{
53class ScalingViewWidget;
54}
55
56//=============================================================================================================
57// DEFINE NAMESPACE DISPLIB
58//=============================================================================================================
59
60namespace DISPLIB
61{
62
63//=============================================================================================================
64// DISPLIB FORWARD DECLARATIONS
65//=============================================================================================================
66class ScaleControl;
67
68//=========================================================================================================
79DISPSHARED_EXPORT float getDefaultScalingValue(int iChannelKind,
80 int iChannelUnit);
81
82//=========================================================================================================
95DISPSHARED_EXPORT float getScalingValue(const QMap<qint32, float>& qMapChScaling,
96 int iChannelKind,
97 int iChannelUnit);
98
99//=============================================================================================================
109{
110 Q_OBJECT
111
112public:
113 typedef QSharedPointer<ScalingView> SPtr;
114 typedef QSharedPointer<const ScalingView> ConstSPtr;
115
116 //=========================================================================================================
125 ScalingView(const QString& sSettingsPath = "",
126 QWidget* parent = 0,
127 Qt::WindowFlags f = Qt::Widget,
128 const QStringList& lChannelsToShow = QStringList() << "all");
129
130 //=========================================================================================================
134 ~ScalingView();
135
136 //=========================================================================================================
142 QMap<qint32, float> getScaleMap() const;
143
144 //=========================================================================================================
150 void setScaleMap(const QMap<qint32, float>& qMapChScaling);
151
152 //=========================================================================================================
156 void saveSettings() override;
157
158 //=========================================================================================================
162 void loadSettings() override;
163
164 //=========================================================================================================
168 void clearView() override;
169
170 //=========================================================================================================
176 void setMagGradLink(Qt::CheckState l);
177
178signals:
179 //=========================================================================================================
186 void scalingChanged(const QMap<qint32, float>& scalingMap);
187
188private:
189 //=============================================================================================================
193 void processScalingChange();
194
195 //=============================================================================================================
199 void showLinkControl();
200
201 //=============================================================================================================
207 void updateMAGScale(double dScale);
208
209 //=========================================================================================================
215 void updateGRADScale(double dScale);
216
217 //=========================================================================================================
223 void updateMAGtoGRADlink(double dScale);
224
225 //=========================================================================================================
231 void updateEEGScale(double dScale);
232
233 //=========================================================================================================
239 void updateEOGScale(double dScale);
240
241 //=========================================================================================================
247 void updateEMGScale(double dScale);
248
249 //=========================================================================================================
255 void updateECGScale(double dScale);
256
257 //=========================================================================================================
263 void updateMISCScale(double dScale);
264
265 //=========================================================================================================
271 void updateSTIMScale(double dScale);
272
273 //=========================================================================================================
279 void updateGuiMode(GuiMode mode) override;
280
281 //=========================================================================================================
287 void updateProcessingMode(ProcessingMode mode) override;
288
289 //=========================================================================================================
293 void createScaleControls();
294
295 //=========================================================================================================
299 void drawScalingGUI();
300
301 //=========================================================================================================
305 void linkMagToGrad();
306
307 //=========================================================================================================
311 void linkGradToMag();
312
313 //=========================================================================================================
317 void createLinkMagGradCheckBox();
318
319 //=========================================================================================================
325 void keyReleaseEvent(QKeyEvent* event) override;
326
327 //=========================================================================================================
333 void keyPressEvent(QKeyEvent* event) override;
334
335 QMap<qint32, float> m_qMapChScaling;
336 QMap<qint32, QPointer<ScaleControl>> m_qMapScaleControls;
337
338 QString m_sSettingsPath;
339
340 QStringList m_lChannelTypesToShow;
341
342 std::unique_ptr<Ui::ScalingViewWidget> m_pUi;
343 bool m_bLinkMAGtoGRAD;
344 bool m_bIsShiftKeyPressed;
345 bool m_bManagingSpinBoxChange;
346 bool m_bManagingSliderChange;
347 bool m_bManagingLinkMagToGrad;
348 QPointer<QCheckBox> m_pCheckBox;
349};
350
351} // NAMESPACE
352
353#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