OpenHantek
TriggerDock.h
1 // SPDX-License-Identifier: GPL-2.0+
2 
3 #pragma once
4 
5 #include <QDockWidget>
6 #include <QGridLayout>
7 #include <QLabel>
8 #include <QCheckBox>
9 #include <QComboBox>
10 
11 #include "hantekdso/enums.h"
12 
13 class SiSpinBox;
14 struct DsoSettingsScope;
15 namespace Dso {
16 struct ControlSpecification;
17 }
18 
21 class TriggerDock : public QDockWidget {
22  Q_OBJECT
23 
24  public:
30  TriggerDock(DsoSettingsScope *scope, const Dso::ControlSpecification* mSpec, QWidget *parent, Qt::WindowFlags flags = 0);
31 
34  void setMode(Dso::TriggerMode mode);
35 
39  void setSource(bool special, unsigned int id);
40 
43  void setSlope(Dso::Slope slope);
44 
45  protected:
46  void closeEvent(QCloseEvent *event);
47 
48  QGridLayout *dockLayout;
49  QWidget *dockWidget;
50  QLabel *modeLabel;
51  QLabel *sourceLabel;
52  QLabel *slopeLabel;
53  QComboBox *modeComboBox;
54  QComboBox *sourceComboBox;
55  QComboBox *slopeComboBox;
56 
58  const Dso::ControlSpecification* mSpec;
59 
60  QStringList sourceStandardStrings;
61  QStringList sourceSpecialStrings;
62  signals:
63  void modeChanged(Dso::TriggerMode);
64  void sourceChanged(bool special, unsigned int id);
65  void slopeChanged(Dso::Slope);
66 };
void setSource(bool special, unsigned int id)
Changes the trigger source if the new source is supported.
Definition: TriggerDock.cpp:107
void setMode(Dso::TriggerMode mode)
Changes the trigger mode if the new mode is supported.
Definition: TriggerDock.cpp:96
TriggerDock(DsoSettingsScope *scope, const Dso::ControlSpecification *mSpec, QWidget *parent, Qt::WindowFlags flags=0)
Initializes the trigger settings docking window.
Definition: TriggerDock.cpp:20
QStringList sourceStandardStrings
Strings for the standard trigger sources.
Definition: TriggerDock.h:60
QLabel * sourceLabel
The label for the trigger source combobox.
Definition: TriggerDock.h:51
QLabel * modeLabel
The label for the trigger mode combobox.
Definition: TriggerDock.h:50
void sourceChanged(bool special, unsigned int id)
The trigger source has been changed.
void setSlope(Dso::Slope slope)
Changes the trigger slope if the new slope is supported.
Definition: TriggerDock.cpp:102
QGridLayout * dockLayout
The main layout for the dock window.
Definition: TriggerDock.h:48
QComboBox * modeComboBox
Select the triggering mode.
Definition: TriggerDock.h:53
void slopeChanged(Dso::Slope)
The trigger slope has been changed.
QStringList sourceSpecialStrings
Strings for the special trigger sources.
Definition: TriggerDock.h:61
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
DsoSettingsScope * scope
The settings provided by the parent class.
Definition: TriggerDock.h:57
QWidget * dockWidget
The main widget for the dock window.
Definition: TriggerDock.h:49
void closeEvent(QCloseEvent *event)
Don&#39;t close the dock, just hide it.
Definition: TriggerDock.cpp:90
Dock window for the trigger settings. It contains the settings for the trigger mode, source and slope.
Definition: TriggerDock.h:21
QComboBox * sourceComboBox
Select the source for triggering.
Definition: TriggerDock.h:54
QLabel * slopeLabel
The label for the trigger slope combobox.
Definition: TriggerDock.h:52
QComboBox * slopeComboBox
Select the slope that causes triggering.
Definition: TriggerDock.h:55
Holds the settings for the oscilloscope.
Definition: scopesettings.h:77
void modeChanged(Dso::TriggerMode)
The trigger mode has been changed.
Definition: TriggerDock.h:15