OpenHantek
TriggerDock.h
Go to the documentation of this file.
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 {
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 = nullptr);
31 
34  void setMode(Dso::TriggerMode mode);
35 
38  void setSource(int id);
39 
42  void setSlope(Dso::Slope slope);
43 
44  public slots:
48 
49  protected:
50  void closeEvent(QCloseEvent *event);
51 
52  QGridLayout *dockLayout;
53  QWidget *dockWidget;
54  QLabel *modeLabel;
55  QLabel *sourceLabel;
56  QLabel *slopeLabel;
57  QComboBox *modeComboBox;
58  QComboBox *sourceComboBox;
59  QComboBox *slopeComboBox;
60 
63 
64  QStringList sourceStandardStrings;
65 
66 signals:
68  void sourceChanged(unsigned int id, bool smooth);
69  void slopeChanged(Dso::Slope);
70 };
void setMode(Dso::TriggerMode mode)
Changes the trigger mode if the new mode is supported.
Definition: TriggerDock.cpp:96
Slope
The slope that causes a trigger.
Definition: enums.h:44
void loadSettings(DsoSettingsScope *scope)
Loads settings into GUI.
Definition: TriggerDock.cpp:81
QStringList sourceStandardStrings
Strings for the standard trigger sources.
Definition: TriggerDock.h:64
QLabel * sourceLabel
The label for the trigger source combobox.
Definition: TriggerDock.h:55
QLabel * modeLabel
The label for the trigger mode combobox.
Definition: TriggerDock.h:54
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:52
void sourceChanged(unsigned int id, bool smooth)
The trigger source has been changed.
QComboBox * modeComboBox
Select the triggering mode.
Definition: TriggerDock.h:57
const Dso::ControlSpecification * mSpec
Definition: TriggerDock.h:62
void slopeChanged(Dso::Slope)
The trigger slope has been changed.
TriggerMode
The different triggering modes.
Definition: enums.h:35
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:42
DsoSettingsScope * scope
The settings provided by the parent class.
Definition: TriggerDock.h:61
TriggerDock(DsoSettingsScope *scope, const Dso::ControlSpecification *mSpec, QWidget *parent, Qt::WindowFlags flags=nullptr)
Initializes the trigger settings docking window.
Definition: TriggerDock.cpp:21
QWidget * dockWidget
The main widget for the dock window.
Definition: TriggerDock.h:53
void closeEvent(QCloseEvent *event)
Don&#39;t close the dock, just hide it.
Definition: TriggerDock.cpp:90
void setSource(int id)
Changes the trigger source if the new source is supported.
Definition: TriggerDock.cpp:107
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:58
QLabel * slopeLabel
The label for the trigger slope combobox.
Definition: TriggerDock.h:56
QComboBox * slopeComboBox
Select the slope that causes triggering.
Definition: TriggerDock.h:59
Holds the settings for the oscilloscope.
Definition: scopesettings.h:75
void modeChanged(Dso::TriggerMode)
The trigger mode has been changed.
Definition: TriggerDock.h:15