v2.0.0
Loading...
Searching...
No Matches
filterdesignview.h
Go to the documentation of this file.
1//=============================================================================================================
25
26#ifndef FILTERDESIGNVIEW_H
27#define FILTERDESIGNVIEW_H
28
29//=============================================================================================================
30// INCLUDES
31//=============================================================================================================
32
33#include "../disp_global.h"
34#include "abstractview.h"
35
36#include <dsp/filterkernel.h>
37
38//=============================================================================================================
39// QT INCLUDES
40//=============================================================================================================
41
42#include <QPointer>
43
44#include <memory>
45
46//=============================================================================================================
47// EIGEN INCLUDES
48//=============================================================================================================
49
50//=============================================================================================================
51// FORWARD DECLARATIONS
52//=============================================================================================================
53
54class QCheckBox;
55
56namespace Ui
57{
58class FilterDesignViewWidget;
59}
60
61//=============================================================================================================
62// DEFINE NAMESPACE DISPLIB
63//=============================================================================================================
64
65namespace DISPLIB
66{
67
68//=============================================================================================================
69// DISPLIB FORWARD DECLARATIONS
70//=============================================================================================================
71
72class FilterPlotScene;
73
74//=============================================================================================================
85{
86 Q_OBJECT
87
88public:
89 typedef QSharedPointer<FilterDesignView> SPtr;
90 typedef QSharedPointer<const FilterDesignView> ConstSPtr;
91
92 //=========================================================================================================
102 FilterDesignView(const QString& sSettingsPath,
103 QWidget* parent = 0,
104 Qt::WindowFlags f = Qt::Widget);
105
106 //=========================================================================================================
112
113 //=========================================================================================================
119 void setMaxAllowedFilterTaps(int iMaxNumberFilterTaps);
120
121 //=========================================================================================================
127 int getFilterTaps();
128
129 //=========================================================================================================
135 void setSamplingRate(double dSamplingRate);
136
137 //=========================================================================================================
143 void setFrom(double dFrom);
144
145 //=========================================================================================================
151 void setTo(double dTo);
152
153 //=========================================================================================================
159 double getFrom();
160
161 //=========================================================================================================
167 double getTo();
168
169 //=========================================================================================================
176
177 //=========================================================================================================
183 QString getChannelType();
184
185 //=========================================================================================================
191 void setChannelType(const QString& sType);
192
193 //=========================================================================================================
197 void saveSettings();
198
199 //=========================================================================================================
203 void loadSettings();
204
205 //=========================================================================================================
209 void clearView();
210
211 //=========================================================================================================
215 void updateFilterPlot();
216
217 //=========================================================================================================
224
225protected:
226 //=========================================================================================================
232 void updateGuiMode(GuiMode mode);
233
234 //=========================================================================================================
241
242 //=========================================================================================================
246 void initSpinBoxes();
247
248 //=========================================================================================================
252 void initButtons();
253
254 //=========================================================================================================
258 void initComboBoxes();
259
260 //=========================================================================================================
264 void initFilterPlot();
265
266 //=========================================================================================================
272 void resizeEvent(QResizeEvent* event);
273
274 //=========================================================================================================
280 virtual void keyPressEvent(QKeyEvent* event);
281
282 //=========================================================================================================
288 void changeStateSpinBoxes(int currentIndex);
289
290 //=========================================================================================================
295
296 //=========================================================================================================
302 void onSpinBoxFilterChannelType(const QString& channelType);
303
304 //=========================================================================================================
309
310 //=========================================================================================================
315
316 //=========================================================================================================
320 void onBtnLoadFilter();
321
322 //=========================================================================================================
329
330 std::unique_ptr<Ui::FilterDesignViewWidget> m_pUi;
331
332 QPointer<FilterPlotScene> m_pFilterPlotScene;
333
335
337
339 double m_dSFreq;
340
341signals:
342 //=========================================================================================================
348 void filterChanged(const UTILSLIB::FilterKernel& activeFilter);
349
350 //=========================================================================================================
356 void filterChannelTypeChanged(const QString& channelType);
357
358 //=========================================================================================================
364 void updateFilterFrom(double dFrom);
365
366 //=========================================================================================================
372 void updateFilterTo(double dTo);
373};
374} // NAMESPACE DISPLIB
375
376#endif // FILTERDESIGNVIEW_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.
Linear-phase FIR filter kernel with overlap-add FFT convolution back-end.
2-D display widgets and visualisation helpers (charts, topography, colour maps).
AbstractView(QWidget *parent=0, Qt::WindowFlags f=Qt::Widget)
void setMaxAllowedFilterTaps(int iMaxNumberFilterTaps)
void changeStateSpinBoxes(int currentIndex)
void updateFilterFrom(double dFrom)
void updateGuiMode(GuiMode mode)
void setSamplingRate(double dSamplingRate)
void updateFilterTo(double dTo)
std::unique_ptr< Ui::FilterDesignViewWidget > m_pUi
QPointer< FilterPlotScene > m_pFilterPlotScene
QSharedPointer< const FilterDesignView > ConstSPtr
void resizeEvent(QResizeEvent *event)
virtual void keyPressEvent(QKeyEvent *event)
UTILSLIB::FilterKernel m_filterKernel
void guiStyleChanged(DISPLIB::AbstractView::StyleMode style)
QSharedPointer< FilterDesignView > SPtr
UTILSLIB::FilterKernel getCurrentFilter()
void setChannelType(const QString &sType)
void updateProcessingMode(ProcessingMode mode)
void onSpinBoxFilterChannelType(const QString &channelType)
void filterChannelTypeChanged(const QString &channelType)
void updateGuiFromFilter(const UTILSLIB::FilterKernel &filter)
FilterDesignView(const QString &sSettingsPath, QWidget *parent=0, Qt::WindowFlags f=Qt::Widget)
void filterChanged(const UTILSLIB::FilterKernel &activeFilter)
QGraphicsScene rendering the magnitude (and optional phase) response of a designed FIR / IIR filter.
The FilterKernel class provides methods to create/design a FIR filter kernel.