OpenHantek
mainwindow.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0+
2 
3 #pragma once
4 #include "post/ppresult.h"
5 #include <QElapsedTimer>
6 #include <QLineEdit>
7 #include <QMainWindow>
8 #include <memory>
9 
10 #include "scopesettings.h"
11 
12 class SpectrumGenerator;
13 class HantekDsoControl;
14 class DsoSettings;
15 class ExporterRegistry;
16 class DsoWidget;
17 class HorizontalDock;
18 class TriggerDock;
19 class SpectrumDock;
20 class VoltageDock;
21 
22 namespace Ui {
23 class MainWindow;
24 }
25 
29 class MainWindow : public QMainWindow {
30  Q_OBJECT
31 
32  public:
34  QWidget *parent = nullptr );
35  ~MainWindow() override;
36  QElapsedTimer elapsedTime;
37 
38  public slots:
39  void showNewData( std::shared_ptr< PPresult > newData );
40  void exporterStatusChanged( const QString &exporterName, const QString &status );
42 
43  protected:
44  void closeEvent( QCloseEvent *event ) override;
45 
46  private:
47  Ui::MainWindow *ui;
48  QIcon iconPause;
49  QIcon iconPlay;
50  QLineEdit *commandEdit;
51 
52  // Central widgets
54 
55  // Settings used for the whole program
58 
59  // Taking screenshots
62  void screenShot( screenshotType_t screenshotType = SCREENSHOT, bool autoSave = false );
63 
64  signals:
65  void settingsLoaded( DsoSettingsScope *scope, const Dso::ControlSpecification *spec );
66 };
Definition: mainwindow.h:60
QElapsedTimer elapsedTime
Definition: mainwindow.h:36
void closeEvent(QCloseEvent *event) override
Save the settings before exiting.
Definition: mainwindow.cpp:586
Ui::MainWindow * ui
Definition: mainwindow.h:47
Definition: mainwindow.h:60
Definition: exporterregistry.h:23
void showNewData(std::shared_ptr< PPresult > newData)
Definition: mainwindow.cpp:460
Definition: mainwindow.h:22
The widget for the oszilloscope-screen This widget contains the scopes and all level sliders...
Definition: dsowidget.h:23
void screenShot(screenshotType_t screenshotType=SCREENSHOT, bool autoSave=false)
Definition: mainwindow.cpp:486
Holds the settings of the program.
Definition: dsosettings.h:21
QLineEdit * commandEdit
Definition: mainwindow.h:50
void settingsLoaded(DsoSettingsScope *scope, const Dso::ControlSpecification *spec)
Stores the specifications of the currently connected device.
Definition: controlspecification.h:42
QIcon iconPlay
Definition: mainwindow.h:49
~MainWindow() override
Definition: mainwindow.cpp:453
void exporterProgressChanged()
Definition: mainwindow.cpp:474
QIcon iconPause
Definition: mainwindow.h:48
Dock window for the trigger settings. It contains the settings for the trigger mode, source and slope.
Definition: TriggerDock.h:21
DsoWidget * dsoWidget
Definition: mainwindow.h:53
Dock window for the voltage channel settings. It contains the settings for gain and coupling for both...
Definition: VoltageDock.h:24
Definition: mainwindow.h:60
screenshotType_t screenshotType
Definition: mainwindow.h:61
DsoSettings * dsoSettings
Definition: mainwindow.h:56
MainWindow(HantekDsoControl *dsoControl, DsoSettings *dsoSettings, ExporterRegistry *exporterRegistry, QWidget *parent=nullptr)
Definition: mainwindow.cpp:35
Holds the settings for the oscilloscope.
Definition: scopesettings.h:82
screenshotType_t
Definition: mainwindow.h:60
Dock window for the spectrum view. It contains the magnitude for all channels and allows to enable/di...
Definition: SpectrumDock.h:19
Dock window for the horizontal axis. It contains the settings for the timebase and the display format...
Definition: HorizontalDock.h:27
void exporterStatusChanged(const QString &exporterName, const QString &status)
Definition: mainwindow.cpp:467
Analyzes the data from the dso. Calculates the spectrum and various data about the signal and saves t...
Definition: spectrumgenerator.h:24
The main window of the application. The main window contains the classic oszilloscope-screen and the ...
Definition: mainwindow.h:29
The DsoControl abstraction layer for Hantek USB DSOs. TODO Please anyone, refactor this class into sm...
Definition: hantekdsocontrol.h:53
ExporterRegistry * exporterRegistry
Definition: mainwindow.h:57