OpenHantek
dsosettings.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0+
2 
3 // increment this value after incompatible config changes
4 const unsigned CONFIG_VERSION = 2;
5 
6 #pragma once
7 
8 #include <QCoreApplication>
9 #include <QSettings>
10 #include <QSize>
11 #include <QString>
12 #include <memory>
13 
14 //#include "exporting/exportsettings.h"
16 #include "scopesettings.h"
17 #include "usb/scopedevice.h"
18 #include "viewsettings.h"
19 
21 class DsoSettings {
22  Q_DECLARE_TR_FUNCTIONS( DsoSettings )
23 
24  public:
25  explicit DsoSettings( const ScopeDevice *scopeDevice, bool resetSettings = false );
26  bool setFilename( const QString &filename );
27 
31  bool exportProcessedSamples = true;
32  bool alwaysSave = true;
34  const QString deviceName;
35  const QString deviceID;
36  const unsigned deviceFW;
37 
38  QByteArray mainWindowGeometry;
39  QByteArray mainWindowState;
40 
42  void load();
43 
45  void save();
46 
47  private:
48  std::unique_ptr< QSettings > storeSettings;
50  void setDefaultConfig();
51  bool resetSettings = false;
52 };
DsoSettings(const ScopeDevice *scopeDevice, bool resetSettings=false)
Set the number of channels.
Definition: dsosettings.cpp:12
const unsigned CONFIG_VERSION
Definition: dsosettings.h:4
void save()
Save the settings to the harddisk.
Definition: dsosettings.cpp:289
Definition: postprocessingsettings.h:46
bool alwaysSave
Always save the settings on exit.
Definition: dsosettings.h:32
bool exportProcessedSamples
General options of the program.
Definition: dsosettings.h:31
DsoSettingsView view
All view related settings.
Definition: dsosettings.h:29
QByteArray mainWindowGeometry
Geometry of the main window.
Definition: dsosettings.h:38
const QString deviceID
Definition: dsosettings.h:35
const Dso::ControlSpecification * deviceSpecification
Definition: dsosettings.h:49
Holds the settings of the program.
Definition: dsosettings.h:21
bool resetSettings
Definition: dsosettings.h:51
DsoSettingsPostProcessing post
All post processing related settings.
Definition: dsosettings.h:30
const unsigned deviceFW
Definition: dsosettings.h:36
This class handles the USB communication with an usb device that has one in and one out endpoint...
Definition: scopedevice.h:33
DsoSettingsScope scope
All oscilloscope related settings.
Definition: dsosettings.h:28
Stores the specifications of the currently connected device.
Definition: controlspecification.h:42
const QString deviceName
Definition: dsosettings.h:34
Holds all view settings.
Definition: viewsettings.h:35
std::unique_ptr< QSettings > storeSettings
Definition: dsosettings.h:48
void setDefaultConfig()
Definition: dsosettings.cpp:439
Holds the settings for the oscilloscope.
Definition: scopesettings.h:82
void load()
Read the settings from the last session or another file.
Definition: dsosettings.cpp:79
QByteArray mainWindowState
State of docking windows and toolbars.
Definition: dsosettings.h:39
unsigned configVersion
Handle incompatible changes.
Definition: dsosettings.h:33
bool setFilename(const QString &filename)
Definition: dsosettings.cpp:66