OpenHantek
Loading...
Searching...
No Matches
SpectrumDock.h
1// SPDX-License-Identifier: GPL-2.0+
2
3#pragma once
4
5#include <QDockWidget>
6#include <QGridLayout>
7
8#include "scopesettings.h"
9
10class QLabel;
11class QCheckBox;
12class QComboBox;
13
14class SiSpinBox;
15
19class SpectrumDock : public QDockWidget {
20 Q_OBJECT
21
22 public:
27 SpectrumDock(DsoSettingsScope *scope, QWidget *parent, Qt::WindowFlags flags = 0);
28
33 int setMagnitude(ChannelID channel, double magnitude);
34
39 unsigned setUsed(ChannelID channel, bool used);
40
41 protected:
42 void closeEvent(QCloseEvent *event);
43
44 QGridLayout *dockLayout;
45 QWidget *dockWidget;
46
47 struct ChannelBlock {
48 QCheckBox * usedCheckBox;
49 QComboBox * magnitudeComboBox;
50 };
51
52 std::vector<ChannelBlock> channelBlocks;
53
55
56 std::vector<double> magnitudeSteps;
57 QStringList magnitudeStrings;
58
59 signals:
60 void magnitudeChanged(ChannelID channel, double magnitude);
61 void usedChanged(ChannelID channel, bool used);
62};
A spin box with SI prefix support. This spin box supports the SI prefixes (k/M/G/T) after its value a...
Definition sispinbox.h:14
Dock window for the spectrum view. It contains the magnitude for all channels and allows to enable/di...
Definition SpectrumDock.h:19
std::vector< double > magnitudeSteps
The selectable magnitude steps in dB/div.
Definition SpectrumDock.h:56
void usedChanged(ChannelID channel, bool used)
A spectrum has been enabled/disabled.
QWidget * dockWidget
The main widget for the dock window.
Definition SpectrumDock.h:45
QGridLayout * dockLayout
The main layout for the dock window.
Definition SpectrumDock.h:44
QStringList magnitudeStrings
String representations for the magnitude steps.
Definition SpectrumDock.h:57
unsigned setUsed(ChannelID channel, bool used)
Enables/disables a channel.
Definition SpectrumDock.cpp:94
SpectrumDock(DsoSettingsScope *scope, QWidget *parent, Qt::WindowFlags flags=0)
Initializes the spectrum view docking window.
Definition SpectrumDock.cpp:26
void magnitudeChanged(ChannelID channel, double magnitude)
A magnitude has been selected.
int setMagnitude(ChannelID channel, double magnitude)
Sets the magnitude for a channel.
Definition SpectrumDock.cpp:83
void closeEvent(QCloseEvent *event)
Don't close the dock, just hide it.
Definition SpectrumDock.cpp:77
DsoSettingsScope * scope
The settings provided by the parent class.
Definition SpectrumDock.h:54
Holds the settings for the oscilloscope.
Definition scopesettings.h:77
Definition SpectrumDock.h:47
QCheckBox * usedCheckBox
Enable/disable a specific channel.
Definition SpectrumDock.h:48
QComboBox * magnitudeComboBox
Select the vertical magnitude for the spectrums.
Definition SpectrumDock.h:49