-
Notifications
You must be signed in to change notification settings - Fork 159
/
Copy pathviewsettings.h
63 lines (56 loc) · 3.52 KB
/
viewsettings.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <QColor>
#include <QObject>
#include <QPoint>
#include <QString>
#include <QVector>
#include "hantekdso/enums.h"
// These values allow a quite narrow but readable display
const QString defaultFont = "Arial";
const int defaultFontSize = 10;
const int defaultCondensed = 87; // SemiCondensed = 87%
////////////////////////////////////////////////////////////////////////////////
/// \struct DsoSettingsColorValues
/// \brief Holds the color values for the oscilloscope screen.
struct DsoSettingsColorValues {
QColor axes; ///< X- and Y-axis and subdiv lines on them
QColor background; ///< The scope background
QColor border; ///< The border of the scope screen
QColor grid; ///< The color of the grid
QColor markers; ///< The color of the markers
QColor text; ///< The default text color
std::vector< QColor > spectrum; ///< The colors of the spectrum graphs
std::vector< QColor > voltage; ///< The colors of the voltage graphs
};
////////////////////////////////////////////////////////////////////////////////
/// \struct DsoSettingsView
/// \brief Holds all view settings.
struct DsoSettingsView {
DsoSettingsColorValues screen = { QColor( 0x7f, 0x7f, 0x7f, 0xff ), QColor( 0x00, 0x00, 0x00, 0xff ), // axes, background
QColor( 0xff, 0xff, 0xff, 0xff ), QColor( 0xc0, 0xc0, 0xc0, 0xff ), // border, grid
QColor( 0xc0, 0xc0, 0xc0, 0xff ), QColor( 0xff, 0xff, 0xff, 0xff ), // markers, text
std::vector< QColor >(), std::vector< QColor >() }; // spectrum, voltage
DsoSettingsColorValues print = { QColor( 0x40, 0x40, 0x40, 0xff ), QColor( 0xff, 0xff, 0xff, 0xff ), // axes, background
QColor( 0x00, 0x00, 0x00, 0xff ), QColor( 0x40, 0x40, 0x40, 0xff ), // border, grid
QColor( 0x40, 0x40, 0x40, 0xff ), QColor( 0x00, 0x00, 0x00, 0xff ), // markers, text
std::vector< QColor >(), std::vector< QColor >() }; // spectrum, voltage
bool antialiasing = true; ///< Antialiasing for the graphs
bool digitalPhosphor = false; ///< true slowly fades out the previous graphs
unsigned digitalPhosphorDepth = 8; ///< Number of channels shown at one time
Dso::InterpolationMode interpolation = Dso::INTERPOLATION_LINEAR; ///< Interpolation mode for the graph
bool printerColorImages = true; ///< Exports images with screen colors
int zoomHeightIndex = 2; ///< Zoom scope window height
bool zoomImage = true; ///< Export zoomed images with double height
bool zoom = false; ///< true if the magnified scope is enabled
int exportScaleValue = 1;
Qt::ToolBarArea cursorGridPosition = Qt::RightToolBarArea;
bool cursorsVisible = false;
DsoSettingsColorValues *colors = &screen;
int fontSize = defaultFontSize;
bool styleFusion = false;
int theme = 0;
unsigned screenHeight = 0;
unsigned screenWidth = 0;
unsigned digitalPhosphorDraws() const { return digitalPhosphor ? digitalPhosphorDepth : 1; }
};