1
- // //////////////////////////////////////////////////////////////////////////////
2
- //
3
- // OpenHantek
4
- // / \file settings.h
5
- // / \brief Declares the DsoSettings class.
6
- //
7
- // Copyright (C) 2010, 2011 Oliver Haag
8
- // oliver.haag@gmail.com
9
- //
10
- // This program is free software: you can redistribute it and/or modify it
11
- // under the terms of the GNU General Public License as published by the Free
12
- // Software Foundation, either version 3 of the License, or (at your option)
13
- // any later version.
14
- //
15
- // This program is distributed in the hope that it will be useful, but WITHOUT
16
- // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17
- // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18
- // more details.
19
- //
20
- // You should have received a copy of the GNU General Public License along with
21
- // this program. If not, see <http://www.gnu.org/licenses/>.
22
- //
23
- // //////////////////////////////////////////////////////////////////////////////
1
+ // SPDX-License-Identifier: GPL-2.0+
24
2
25
- #ifndef SETTINGS_H
26
- #define SETTINGS_H
3
+ #pragma once
27
4
28
- #include < QColor>
29
- #include < QList>
30
- #include < QObject>
31
- #include < QPoint>
32
5
#include < QSize>
33
6
#include < QString>
34
7
35
- #include " definitions.h"
8
+ #include " scopesettings.h"
9
+ #include " viewsettings.h"
36
10
37
11
// //////////////////////////////////////////////////////////////////////////////
38
12
// / \struct DsoSettingsOptions settings.h
@@ -42,104 +16,6 @@ struct DsoSettingsOptions {
42
16
QSize imageSize; // /< Size of exported images in pixels
43
17
};
44
18
45
- // //////////////////////////////////////////////////////////////////////////////
46
- // / \struct DsoSettingsScopeHorizontal settings.h
47
- // / \brief Holds the settings for the horizontal axis.
48
- struct DsoSettingsScopeHorizontal {
49
- Dso::GraphFormat format; // /< Graph drawing mode of the scope
50
- double frequencybase; // /< Frequencybase in Hz/div
51
- double marker[MARKER_COUNT]; // /< Marker positions in div
52
- bool marker_visible[MARKER_COUNT];
53
- double timebase; // /< Timebase in s/div
54
- unsigned int recordLength; // /< Sample count
55
- double samplerate; // /< The samplerate of the oscilloscope in S
56
- bool samplerateSet; // /< The samplerate was set by the user, not the timebase
57
- };
58
-
59
- // //////////////////////////////////////////////////////////////////////////////
60
- // / \struct DsoSettingsScopeTrigger settings.h
61
- // / \brief Holds the settings for the trigger.
62
- struct DsoSettingsScopeTrigger {
63
- bool filter; // /< Not sure what this is good for...
64
- Dso::TriggerMode mode; // /< Automatic, normal or single trigger
65
- double position; // /< Horizontal position for pretrigger
66
- Dso::Slope slope; // /< Rising or falling edge causes trigger
67
- unsigned int source; // /< Channel that is used as trigger source
68
- bool special; // /< true if the trigger source is not a standard channel
69
- };
70
-
71
- // //////////////////////////////////////////////////////////////////////////////
72
- // / \struct DsoSettingsScopeSpectrum settings.h
73
- // / \brief Holds the settings for the spectrum analysis.
74
- struct DsoSettingsScopeSpectrum {
75
- double magnitude; // /< The vertical resolution in dB/div
76
- QString name; // /< Name of this channel
77
- double offset; // /< Vertical offset in divs
78
- bool used; // /< true if the spectrum is turned on
79
- };
80
-
81
- // //////////////////////////////////////////////////////////////////////////////
82
- // / \struct DsoSettingsScopeVoltage settings.h
83
- // / \brief Holds the settings for the normal voltage graphs.
84
- struct DsoSettingsScopeVoltage {
85
- double gain; // /< The vertical resolution in V/div
86
- int misc; // /< Different enums, coupling for real- and mode for math-channels
87
- QString name; // /< Name of this channel
88
- double offset; // /< Vertical offset in divs
89
- double trigger; // /< Trigger level in V
90
- bool used; // /< true if this channel is enabled
91
- };
92
-
93
- // //////////////////////////////////////////////////////////////////////////////
94
- // / \struct DsoSettingsScope settings.h
95
- // / \brief Holds the settings for the oscilloscope.
96
- struct DsoSettingsScope {
97
- DsoSettingsScopeHorizontal horizontal; // /< Settings for the horizontal axis
98
- DsoSettingsScopeTrigger trigger; // /< Settings for the trigger
99
- QList<DsoSettingsScopeSpectrum> spectrum; // /< Spectrum analysis settings
100
- QList<DsoSettingsScopeVoltage> voltage; // /< Settings for the normal graphs
101
-
102
- unsigned int physicalChannels; // /< Number of real channels (No math etc.)
103
- Dso::WindowFunction spectrumWindow; // /< Window function for DFT
104
- double spectrumReference; // /< Reference level for spectrum in dBm
105
- double spectrumLimit; // /< Minimum magnitude of the spectrum (Avoids peaks)
106
- };
107
-
108
- // //////////////////////////////////////////////////////////////////////////////
109
- // / \struct DsoSettingsColorValues settings.h
110
- // / \brief Holds the color values for the oscilloscope screen.
111
- struct DsoSettingsColorValues {
112
- QColor axes; // /< X- and Y-axis and subdiv lines on them
113
- QColor background; // /< The scope background
114
- QColor border; // /< The border of the scope screen
115
- QColor grid; // /< The color of the grid
116
- QColor markers; // /< The color of the markers
117
- QList<QColor> spectrum; // /< The colors of the spectrum graphs
118
- QColor text; // /< The default text color
119
- QList<QColor> voltage; // /< The colors of the voltage graphs
120
- };
121
-
122
- // //////////////////////////////////////////////////////////////////////////////
123
- // / \struct DsoSettingsViewColor settings.h
124
- // / \brief Holds the settings for the used colors on the screen and on paper.
125
- struct DsoSettingsViewColor {
126
- DsoSettingsColorValues screen; // /< Colors for the screen
127
- DsoSettingsColorValues print; // /< Colors for printout
128
- };
129
-
130
- // //////////////////////////////////////////////////////////////////////////////
131
- // / \struct DsoSettingsView settings.h
132
- // / \brief Holds all view settings.
133
- struct DsoSettingsView {
134
- DsoSettingsViewColor color; // /< Used colors
135
- bool antialiasing; // /< Antialiasing for the graphs
136
- bool digitalPhosphor; // /< true slowly fades out the previous graphs
137
- int digitalPhosphorDepth; // /< Number of channels shown at one time
138
- Dso::InterpolationMode interpolation; // /< Interpolation mode for the graph
139
- bool screenColorImages; // /< true exports images with screen colors
140
- bool zoom; // /< true if the magnified scope is enabled
141
- };
142
-
143
19
// //////////////////////////////////////////////////////////////////////////////
144
20
// / \class DsoSettings settings.h
145
21
// / \brief Holds the settings of the program.
@@ -148,7 +24,6 @@ class DsoSettings : public QObject {
148
24
149
25
public:
150
26
DsoSettings (QWidget *parent = 0 );
151
- ~DsoSettings ();
152
27
153
28
void setChannelCount (unsigned int channels);
154
29
@@ -164,5 +39,3 @@ public slots:
164
39
int load (const QString &fileName = QString());
165
40
int save (const QString &fileName = QString());
166
41
};
167
-
168
- #endif
0 commit comments