v2.0.0
Loading...
Searching...
No Matches
DISPLIB::FilterDesignView Class Reference

Interactive FIR / IIR filter design GUI with a live magnitude / phase preview. More...

#include <filterdesignview.h>

Public Types

typedef QSharedPointer< FilterDesignViewSPtr
typedef QSharedPointer< const FilterDesignViewConstSPtr
Public Types inherited from DISPLIB::AbstractView
enum  StyleMode { Default , Dark }
enum  GuiMode { Clinical , Research }
enum  ProcessingMode { RealTime , Offline }
typedef QSharedPointer< AbstractViewSPtr
typedef QSharedPointer< const AbstractViewConstSPtr

Signals

void filterChanged (const UTILSLIB::FilterKernel &activeFilter)
void filterChannelTypeChanged (const QString &channelType)
void updateFilterFrom (double dFrom)
void updateFilterTo (double dTo)
Signals inherited from DISPLIB::AbstractView
void guiStyleChanged (DISPLIB::AbstractView::StyleMode style)

Public Member Functions

 FilterDesignView (const QString &sSettingsPath, QWidget *parent=0, Qt::WindowFlags f=Qt::Widget)
 ~FilterDesignView ()
void setMaxAllowedFilterTaps (int iMaxNumberFilterTaps)
int getFilterTaps ()
void setSamplingRate (double dSamplingRate)
void setFrom (double dFrom)
void setTo (double dTo)
double getFrom ()
double getTo ()
UTILSLIB::FilterKernel getCurrentFilter ()
QString getChannelType ()
void setChannelType (const QString &sType)
void saveSettings ()
void loadSettings ()
void clearView ()
void updateFilterPlot ()
void guiStyleChanged (DISPLIB::AbstractView::StyleMode style)
Public Member Functions inherited from DISPLIB::AbstractView
 AbstractView (QWidget *parent=0, Qt::WindowFlags f=Qt::Widget)
virtual void setGuiMode (GuiMode mode)
virtual void setProcessingMode (ProcessingMode mode)

Protected Member Functions

void updateGuiMode (GuiMode mode)
void updateProcessingMode (ProcessingMode mode)
void initSpinBoxes ()
void initButtons ()
void initComboBoxes ()
void initFilterPlot ()
void resizeEvent (QResizeEvent *event)
virtual void keyPressEvent (QKeyEvent *event)
void changeStateSpinBoxes (int currentIndex)
void filterParametersChanged ()
void onSpinBoxFilterChannelType (const QString &channelType)
void onBtnExportFilterPlot ()
void onBtnExportFilterCoefficients ()
void onBtnLoadFilter ()
void updateGuiFromFilter (const UTILSLIB::FilterKernel &filter)

Protected Attributes

Ui::FilterDesignViewWidget * m_pUi
QPointer< FilterPlotScenem_pFilterPlotScene
UTILSLIB::FilterKernel m_filterKernel
QString m_sSettingsPath
int m_iFilterTaps
double m_dSFreq
Protected Attributes inherited from DISPLIB::AbstractView
bool m_bResearchModeIsActive
bool m_bOfflineModeIsActive
QString m_sSettingsPath

Detailed Description

Interactive FIR / IIR filter design GUI with a live magnitude / phase preview.

Lets the user pick filter type, design family (cosine, Hamming, Blackman, …), cutoff frequencies, transition bandwidth and tap count, then renders the resulting frequency response in an embedded FilterPlotScene and emits the FilterKernel as a filterChanged signal consumed by the rtprocessing chain.

Definition at line 81 of file filterdesignview.h.

Inheritance diagram for DISPLIB::FilterDesignView:
Inheritance graph

Member Typedef Documentation

◆ ConstSPtr

Const shared pointer type for FilterDesignView.

Definition at line 87 of file filterdesignview.h.

◆ SPtr

Shared pointer type for FilterDesignView.

Definition at line 86 of file filterdesignview.h.

Constructor & Destructor Documentation

◆ FilterDesignView()

FilterDesignView::FilterDesignView ( const QString & sSettingsPath,
QWidget * parent = 0,
Qt::WindowFlags f = Qt::Widget )

Constructs a FilterDesignView dialog which is a child of parent.

Parameters
[in]parentpointer to parent widget; If parent is 0, the new FilterDesignView becomes a window. If parent is another widget, FilterDesignView becomes a child window inside parent. FilterDesignView is deleted when its parent is deleted.

Definition at line 60 of file filterdesignview.cpp.

◆ ~FilterDesignView()

FilterDesignView::~FilterDesignView ( )

Destroys the FilterDesignView. All FilterDesignView's children are deleted first. The application exits if FilterDesignView is the main widget.

Definition at line 82 of file filterdesignview.cpp.

Member Function Documentation

◆ changeStateSpinBoxes()

void FilterDesignView::changeStateSpinBoxes ( int currentIndex)
protected

This function gets called whenever the combo box is altered by the user via the gui.

Parameters
[in]currentIndexholds the current index of the combo box.

Definition at line 359 of file filterdesignview.cpp.

◆ clearView()

void FilterDesignView::clearView ( )
virtual

Clears the view

Implements DISPLIB::AbstractView.

Definition at line 532 of file filterdesignview.cpp.

◆ filterChanged

void DISPLIB::FilterDesignView::filterChanged ( const UTILSLIB::FilterKernel & activeFilter)
signal

Emitted when the filter changes.

Parameters
[in]activeFilterThe currently active filters.

◆ filterChannelTypeChanged

void DISPLIB::FilterDesignView::filterChannelTypeChanged ( const QString & channelType)
signal

Emitted when the filter channel type changed.

Parameters
[in]channelTypeThe channel type on which the filter should be performed on.

◆ filterParametersChanged()

void FilterDesignView::filterParametersChanged ( )
protected

This function gets called whenever the filter parameters are altered by the user via the gui.

Definition at line 383 of file filterdesignview.cpp.

◆ getChannelType()

QString FilterDesignView::getChannelType ( )

Returns the current channel type which is to be filtered.

Returns
returns the channel type.

Definition at line 165 of file filterdesignview.cpp.

◆ getCurrentFilter()

FilterKernel FilterDesignView::getCurrentFilter ( )

Returns the current filter.

Returns
returns the current filter.

Definition at line 158 of file filterdesignview.cpp.

◆ getFilterTaps()

int FilterDesignView::getFilterTaps ( )

Returns the currently set number of filter taps.

Returns
returns the currently set number of filter taps.

Definition at line 106 of file filterdesignview.cpp.

◆ getFrom()

double FilterDesignView::getFrom ( )

Get filter 'From' value

Returns
filter 'From' value.

Definition at line 539 of file filterdesignview.cpp.

◆ getTo()

double FilterDesignView::getTo ( )

Get filter 'To' value

Returns
filter 'To' value.

Definition at line 546 of file filterdesignview.cpp.

◆ guiStyleChanged()

void FilterDesignView::guiStyleChanged ( DISPLIB::AbstractView::StyleMode style)

Process the event of style mode change in an upper class.

Definition at line 565 of file filterdesignview.cpp.

◆ initButtons()

void FilterDesignView::initButtons ( )
protected

inits all buttons.

Definition at line 273 of file filterdesignview.cpp.

◆ initComboBoxes()

void FilterDesignView::initComboBoxes ( )
protected

inits the QComboBoxes.

Definition at line 287 of file filterdesignview.cpp.

◆ initFilterPlot()

void FilterDesignView::initFilterPlot ( )
protected

inits the filter plot.

Definition at line 312 of file filterdesignview.cpp.

◆ initSpinBoxes()

void FilterDesignView::initSpinBoxes ( )
protected

inits all spin boxes.

Definition at line 251 of file filterdesignview.cpp.

◆ keyPressEvent()

void FilterDesignView::keyPressEvent ( QKeyEvent * event)
protectedvirtual

keyPressEvent reimplemented virtual function to handle key events

Definition at line 333 of file filterdesignview.cpp.

◆ loadSettings()

void FilterDesignView::loadSettings ( )
virtual

Loads and inits all important settings of this view via QSettings.

Implements DISPLIB::AbstractView.

Definition at line 199 of file filterdesignview.cpp.

◆ onBtnExportFilterCoefficients()

void FilterDesignView::onBtnExportFilterCoefficients ( )
protected

This function exports the filter coefficients to a txt file.

Definition at line 484 of file filterdesignview.cpp.

◆ onBtnExportFilterPlot()

void FilterDesignView::onBtnExportFilterPlot ( )
protected

Saves an svg graphic of the scene if wanted by the user.

Definition at line 447 of file filterdesignview.cpp.

◆ onBtnLoadFilter()

void FilterDesignView::onBtnLoadFilter ( )
protected

This function loads a filter from a txt file.

Definition at line 505 of file filterdesignview.cpp.

◆ onSpinBoxFilterChannelType()

void FilterDesignView::onSpinBoxFilterChannelType ( const QString & channelType)
protected

This function applies the user defined filter to all channels.

Parameters
[in]channelTypeholds the current text of the connected spin box.

Definition at line 440 of file filterdesignview.cpp.

◆ resizeEvent()

void FilterDesignView::resizeEvent ( QResizeEvent * event)
protected

resizeEvent reimplemented virtual function to handle resize events of the filter window

Definition at line 325 of file filterdesignview.cpp.

◆ saveSettings()

void FilterDesignView::saveSettings ( )
virtual

Saves all important settings of this view via QSettings.

Implements DISPLIB::AbstractView.

Definition at line 180 of file filterdesignview.cpp.

◆ setChannelType()

void FilterDesignView::setChannelType ( const QString & sType)

Sets the current channel type which is to be filtered.

Parameters
[in]sTypeThe new channel type to be filtered.

Definition at line 172 of file filterdesignview.cpp.

◆ setFrom()

void FilterDesignView::setFrom ( double dFrom)

Sets filter 'From' value

Parameters
[in]dFromset filter 'From' value.

Definition at line 142 of file filterdesignview.cpp.

◆ setMaxAllowedFilterTaps()

void FilterDesignView::setMaxAllowedFilterTaps ( int iMaxNumberFilterTaps)

Sets the max number of allowed filter taps.

Parameters
[in]iMaxNumberFilterTapsnumber of max allowed filter taps.

Definition at line 91 of file filterdesignview.cpp.

◆ setSamplingRate()

void FilterDesignView::setSamplingRate ( double dSamplingRate)

Sets the new samplingRate.

Parameters
[in]dSamplingRatethe new sampling rate.

Definition at line 113 of file filterdesignview.cpp.

◆ setTo()

void FilterDesignView::setTo ( double dTo)

Sets filter 'To' value

Parameters
[in]dToset filter 'To' value.

Definition at line 150 of file filterdesignview.cpp.

◆ updateFilterFrom

void DISPLIB::FilterDesignView::updateFilterFrom ( double dFrom)
signal

Update to simple filter control 'From'

Parameters
[in]dFromchange in filter 'From' value.

◆ updateFilterPlot()

void FilterDesignView::updateFilterPlot ( )

updates the filter plot scene with the newly generated filter

Definition at line 346 of file filterdesignview.cpp.

◆ updateFilterTo

void DISPLIB::FilterDesignView::updateFilterTo ( double dTo)
signal

Update to simple filter control 'To'

Parameters
[in]dTochange in filter 'To' value.

◆ updateGuiFromFilter()

void FilterDesignView::updateGuiFromFilter ( const UTILSLIB::FilterKernel & filter)
protected

Update Gui and filter based on an input filter parameters

Parameters
[in]filterfilter which parameters will be used to update gui and stored filter.

Definition at line 553 of file filterdesignview.cpp.

◆ updateGuiMode()

void FilterDesignView::updateGuiMode ( GuiMode mode)
protectedvirtual

Update the views GUI based on the set GuiMode (Clinical=0, Research=1).

Parameters
[in]modeThe new mode (Clinical=0, Research=1).

Implements DISPLIB::AbstractView.

Definition at line 227 of file filterdesignview.cpp.

◆ updateProcessingMode()

void FilterDesignView::updateProcessingMode ( ProcessingMode mode)
protectedvirtual

Update the views GUI based on the set ProcessingMode (RealTime=0, Offline=1).

Parameters
[in]modeThe new mode (RealTime=0, Offline=1).

Implements DISPLIB::AbstractView.

Definition at line 239 of file filterdesignview.cpp.

Member Data Documentation

◆ m_dSFreq

double DISPLIB::FilterDesignView::m_dSFreq
protected

The current sampling frequency.

Definition at line 328 of file filterdesignview.h.

◆ m_filterKernel

UTILSLIB::FilterKernel DISPLIB::FilterDesignView::m_filterKernel
protected

The current filter operator.

Definition at line 323 of file filterdesignview.h.

◆ m_iFilterTaps

int DISPLIB::FilterDesignView::m_iFilterTaps
protected

The current number of filter taps.

Definition at line 327 of file filterdesignview.h.

◆ m_pFilterPlotScene

QPointer<FilterPlotScene> DISPLIB::FilterDesignView::m_pFilterPlotScene
protected

Pointer to the QGraphicsScene which holds the filter plotting.

Definition at line 321 of file filterdesignview.h.

◆ m_pUi

Ui::FilterDesignViewWidget* DISPLIB::FilterDesignView::m_pUi
protected

Pointer to the qt designer generated ui class.

Definition at line 319 of file filterdesignview.h.

◆ m_sSettingsPath

QString DISPLIB::FilterDesignView::m_sSettingsPath
protected

The settings path to store the GUI settings to.

Definition at line 325 of file filterdesignview.h.


The documentation for this class was generated from the following files: