OpenHantek
SpectrumDock Class Reference

Dock window for the spectrum view. It contains the magnitude for all channels and allows to enable/disable the channels. More...

#include <SpectrumDock.h>

Inheritance diagram for SpectrumDock:

Data Structures

struct  ChannelBlock
 

Public Slots

void loadSettings (DsoSettingsScope *scope)
 Loads settings into GUI. More...
 

Signals

void magnitudeChanged (ChannelID channel, double magnitude)
 A magnitude has been selected. More...
 
void usedChanged (ChannelID channel, bool used)
 A spectrum has been enabled/disabled. More...
 

Public Member Functions

 SpectrumDock (DsoSettingsScope *scope, QWidget *parent, Qt::WindowFlags flags=nullptr)
 Initializes the spectrum view docking window. More...
 
int setMagnitude (ChannelID channel, double magnitude)
 Sets the magnitude for a channel. More...
 
unsigned setUsed (ChannelID channel, bool used)
 Enables/disables a channel. More...
 

Protected Member Functions

void closeEvent (QCloseEvent *event)
 Don't close the dock, just hide it. More...
 

Protected Attributes

QGridLayout * dockLayout
 The main layout for the dock window. More...
 
QWidget * dockWidget
 The main widget for the dock window. More...
 
std::vector< ChannelBlockchannelBlocks
 
DsoSettingsScopescope
 The settings provided by the parent class. More...
 
std::vector< double > magnitudeSteps
 The selectable magnitude steps in dB/div. More...
 
QStringList magnitudeStrings
 String representations for the magnitude steps. More...
 

Detailed Description

Dock window for the spectrum view. It contains the magnitude for all channels and allows to enable/disable the channels.

Constructor & Destructor Documentation

◆ SpectrumDock()

SpectrumDock::SpectrumDock ( DsoSettingsScope scope,
QWidget *  parent,
Qt::WindowFlags  flags = nullptr 
)

Initializes the spectrum view docking window.

Parameters
settingsThe target settings object.
parentThe parent widget.
flagsFlags for the window manager.

Member Function Documentation

◆ closeEvent()

void SpectrumDock::closeEvent ( QCloseEvent *  event)
protected

Don't close the dock, just hide it.

Parameters
eventThe close event that should be handled.

◆ loadSettings

void SpectrumDock::loadSettings ( DsoSettingsScope scope)
slot

Loads settings into GUI.

Parameters
scopeSettings to load

◆ magnitudeChanged

void SpectrumDock::magnitudeChanged ( ChannelID  channel,
double  magnitude 
)
signal

A magnitude has been selected.

◆ setMagnitude()

int SpectrumDock::setMagnitude ( ChannelID  channel,
double  magnitude 
)

Sets the magnitude for a channel.

Parameters
channelThe channel, whose magnitude should be set.
magnitudeThe magnitude in dB.
Returns
Index of magnitude-value, -1 on error.

◆ setUsed()

unsigned SpectrumDock::setUsed ( ChannelID  channel,
bool  used 
)

Enables/disables a channel.

Parameters
channelThe channel, that should be enabled/disabled.
usedTrue if the channel should be enabled, false otherwise.
Returns
Index of channel, INT_MAX on error.

◆ usedChanged

void SpectrumDock::usedChanged ( ChannelID  channel,
bool  used 
)
signal

A spectrum has been enabled/disabled.

Field Documentation

◆ channelBlocks

std::vector<ChannelBlock> SpectrumDock::channelBlocks
protected

◆ dockLayout

QGridLayout* SpectrumDock::dockLayout
protected

The main layout for the dock window.

◆ dockWidget

QWidget* SpectrumDock::dockWidget
protected

The main widget for the dock window.

◆ magnitudeSteps

std::vector<double> SpectrumDock::magnitudeSteps
protected

The selectable magnitude steps in dB/div.

◆ magnitudeStrings

QStringList SpectrumDock::magnitudeStrings
protected

String representations for the magnitude steps.

◆ scope

DsoSettingsScope* SpectrumDock::scope
protected

The settings provided by the parent class.


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