OpenHantek
VoltageDock.h
1 // SPDX-License-Identifier: GPL-2.0+
2 
3 #pragma once
4 
5 #include <QDockWidget>
6 #include <QGridLayout>
7 #include <QCheckBox>
8 #include <QComboBox>
9 #include <QLabel>
10 
11 #include "scopesettings.h"
12 #include "hantekdso/controlspecification.h"
13 #include "post/postprocessingsettings.h"
14 
15 class SiSpinBox;
16 
20 class VoltageDock : public QDockWidget {
21  Q_OBJECT
22 
23  public:
28  VoltageDock(DsoSettingsScope *scope, const Dso::ControlSpecification* spec, QWidget *parent, Qt::WindowFlags flags = 0);
29 
33  void setCoupling(ChannelID channel, unsigned couplingIndex);
34 
38  void setGain(ChannelID channel, unsigned gainStepIndex);
39 
42  void setMode(unsigned mathModeIndex);
43 
47  void setUsed(ChannelID channel, bool used);
48 
49  protected:
50  void closeEvent(QCloseEvent *event);
51 
52  QGridLayout *dockLayout;
53  QWidget *dockWidget;
54 
55  struct ChannelBlock {
56  QCheckBox * usedCheckBox;
57  QComboBox * gainComboBox;
58  QComboBox * miscComboBox;
59  QCheckBox * invertCheckBox;
60  };
61 
62  std::vector<ChannelBlock> channelBlocks;
63 
65  const Dso::ControlSpecification *spec;
66 
67  QStringList couplingStrings;
68  QStringList modeStrings;
69  QStringList gainStrings;
70 
71  signals:
72  void couplingChanged(ChannelID channel, Dso::Coupling coupling);
73  void gainChanged(ChannelID channel, double gain);
74  void modeChanged(Dso::MathMode mode);
75  void usedChanged(ChannelID channel, bool used);
76 };
void setMode(unsigned mathModeIndex)
Sets the mode for the math channel.
Definition: VoltageDock.cpp:120
QStringList couplingStrings
The strings for the couplings.
Definition: VoltageDock.h:67
QWidget * dockWidget
The main widget for the dock window.
Definition: VoltageDock.h:53
QCheckBox * invertCheckBox
Select if the channels should be displayed inverted.
Definition: VoltageDock.h:59
VoltageDock(DsoSettingsScope *scope, const Dso::ControlSpecification *spec, QWidget *parent, Qt::WindowFlags flags=0)
Initializes the vertical axis docking window.
Definition: VoltageDock.cpp:26
void couplingChanged(ChannelID channel, Dso::Coupling coupling)
A coupling has been selected.
void setUsed(ChannelID channel, bool used)
Enables/disables a channel.
Definition: VoltageDock.cpp:125
QCheckBox * usedCheckBox
Enable/disable a specific channel.
Definition: VoltageDock.h:56
QStringList gainStrings
String representations for the gain steps.
Definition: VoltageDock.h:69
void setCoupling(ChannelID channel, unsigned couplingIndex)
Sets the coupling for a channel.
Definition: VoltageDock.cpp:106
void usedChanged(ChannelID channel, bool used)
A channel has been enabled/disabled.
void gainChanged(ChannelID channel, double gain)
A gain has been selected.
Definition: VoltageDock.h:55
QStringList modeStrings
The strings for the math mode.
Definition: VoltageDock.h:68
QGridLayout * dockLayout
The main layout for the dock window.
Definition: VoltageDock.h:52
void modeChanged(Dso::MathMode mode)
The mode for the math channels has been changed.
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
Stores the specifications of the currently connected device.
Definition: controlspecification.h:47
void closeEvent(QCloseEvent *event)
Don&#39;t close the dock, just hide it.
Definition: VoltageDock.cpp:101
DsoSettingsScope * scope
The settings provided by the parent class.
Definition: VoltageDock.h:64
Dock window for the voltage channel settings. It contains the settings for gain and coupling for both...
Definition: VoltageDock.h:20
QComboBox * miscComboBox
Select coupling for real and mode for math channels.
Definition: VoltageDock.h:58
Holds the settings for the oscilloscope.
Definition: scopesettings.h:77
void setGain(ChannelID channel, unsigned gainStepIndex)
Sets the gain for a channel.
Definition: VoltageDock.cpp:113
QComboBox * gainComboBox
Select the vertical gain for the channels.
Definition: VoltageDock.h:57